修改主机名:
vim /etc/hosts
vim /etc/sysconfig/network
修改IP地址与mac地址:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
修改IPADDR值
修改HWADDR值(参考 ifconfig |grep HWadd |awk '{print $NF}' )
修改网卡信息
vim /etc/udev/rules.d/70-persistent-net.rules
如果只有一块网卡,则只保留一行记录,需要修改name与address
如下实例:
将第一行注释,然后将第二行中的name值改为eth0
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:fe:cc:d9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:2d:b8:50", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"