1、 vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x8086:0x100f (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:08:59:ca", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:41:6e:e9", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
#SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8c:71:bb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8c:71:bb", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
注释多余的eth* , 记下mac地址 00:0c:29:8c:71:bb
2、 编辑 /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
#UUID=3222c759-e450-42db-98b1-0b3942f15fb9
ONBOOT=yes
#NM_CONTROLLED=yes
#BOOTPROTO=dhcp
BOOTPROTO=static
#HWADDR=00:0c:29:8c:71:bb
HWADDR=00:0c:29:34:71:a6
#DEFROUTE=yes
#PEERDNS=yes
#PEERROUTES=yes
#IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.64.131
NETMASK=255.255.255.0
GATEWAY=192.168.64.1
修改第一步复制的mac地址;
3、service network restart 重启网卡查看是否配置正确,发现可以正常启动:
如何发现网卡IP地址正常但显示为eth1,建议重启后生效