linux修改ip,mac命令和qt中编程修改
一.修改MAC地址linux修改Mac地址有三种方法:方法一:1.关闭网卡设备ifconfig eth0 down2.修改MAC地址ifconfig eth0 hw ether MAC地址3.重启网卡ifconfig eth0 up方法二:以上方法一修改后linux重启后MAC又恢复为原来的,为了下次启动时修改后的MAC仍有效,我们可以修改文件file:
linux修改Mac地址
有三种方法: 方法一: 1.关闭网卡设备 ifconfig eth0 down 2.修改MAC地址 ifconfig eth0 hw ether MAC地址 3.重启网卡 ifconfig eth0 up 方法二: 以上方法一修改后linux重启后MAC又恢复为原来的,为了下次启动时修改后的MAC仍有效,我们可以修改文件file:/etc/rc.d/rc.sysinit(RedFlag Linux为这个文件,其他版本的linux应该不同)的内容,在该文件末尾加以下内容: ifconfig eth0 down ifconfig eth0 hw ether MAC地址 ifconfig eth0 up 方法三: 很简单的,只是在./etc/sysconfig/network-scripts/ifcfg-eth0中加入下面一句话: MACADDR=00:AA:BB:CC:DD:EE
linux修改IP地址
(1)Ifconfig命令第一种使用ifconfig命令配置网卡的ip地址。此命令通常用来零时的测试用,计算机启动后
ip地址的配置将自动失效。具体用法如下。ifconfig eth0 ipadd netmask x.x.x.x。
子网掩码:ifconfig eth0 netmask x.x.x.x
其中ethx中的x代表第几快以太网卡,默认第一块为0.ipadd代表ip地址。x.x.x..x为子网掩码。例如给网卡eth0配置的ip地址为192.168.1.1 子网掩码为 255.255.255.0 。
(2)vi /etc/sysconfig/network-scripts/ifcfg-eth0
配置完以后重启动服务.,p地址就配置好了。其实前面3个的配置方法最终还是改变了/etc/sysconfig/network-scripts/ifcfg-eth0下的配置文件罢了。
linux修改网关地址
# route add default gw xxx.xxx.xxx.xxx(网关的IP) 如果用户想更改网关,编辑/etc/sysconfig/network-scripts/ifcfg-eth0文件,将对应的网关设置修改之后,执行下面的命令即可: #/etc/init.d/network restart
- QHostInfo
- QHostAddress
- QNetworkInterface
- QNetworkAddressEntry
LocalHostName:"wangl-d-pc"
IPAddress: (QHostAddress("fe80::396e:183d:aac6:f7f2") , QHostAddress("192.168.118.55" ) )
IPv4Address: "192.168.118.55"
Address:QHostAddress( "fe80::396e:183d:aac6:f7f2" )
Address:QHostAddress( "192.168.118.55" )
Address:QHostAddress( "::1" )
Address:QHostAddress( "127.0.0.1" )
Address:QHostAddress( "fe80::5efe:c0a8:7637" )
Address:QHostAddress( "fe80::e0:0:0:0" )
Device:"{4C5C2613-C18F-416A-A21F-47B707C3B935}"
HardwareAddress:"74:D4:35:1B:A6:2F"
IPAddress: "fe80::396e:183d:aac6:f7f2"
Netmask:"ffff:ffff:ffff:ffff::"
Broadcast:""
IPAddress: "192.168.118.55"
Netmask:"255.255.255.0"
Broadcast:"192.168.118.255"
Device:"{846EE342-7039-11DE-9D20-806E6F6E6963}"
HardwareAddress:""
IPAddress: "::1"
Netmask:"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
Broadcast:""
IPAddress: "127.0.0.1"
Netmask:""
Broadcast:""
Device:"{539F3167-F67C-432D-8904-34129F3F5521}"
HardwareAddress:"00:00:00:00:00:00:00:E0"
IPAddress: "fe80::5efe:c0a8:7637"
Netmask:"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"
Broadcast:""
Device:"{5DECB4C5-20AC-4BD6-A685-9FE608ED6EF5}"
HardwareAddress:"00:00:00:00:00:00:00:E0"
IPAddress: "fe80::e0:0:0:0"
Netmask:"ffff:ffff:ffff:ffff::"
Broadcast:""
更多推荐
所有评论(0)