1.删除原来eth0的配置信息,将eth1行的eth1改为eth0
[root@svr5 ~]# vim /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:41:fa:fc", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
2.这个时候重启network服务,显示MAC地址与预想地址不符
[root@svr5 ~]# service network restart
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: eth0 设备的 MAC 地址与预想的不符,忽略。
[失败]
3.最简单的办法直接删除记录的MAC地址(红色一行)
[root@svr5 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.4.205
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=00:11:eg:33:12:df
4.也可以把MAC地址改为和主机实际MAC地址一致
(1)查看主机MAC地址
[root@svr5 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:47:C5:DC
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:19 Base address:0x2024
(2)复制主机实际MAC地址到/etc/sysconfig/network-scripts/ifcfg-eth0
[root@svr5 ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=none
IPADDR=192.168.4.205
PREFIX=24
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=00:0C:29:3C:12:02
~
5.reboot重启
6.再重启network服务查看是否OK
[root@svr5 ~]# service network restart
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: Determining if ip address 192.168.4.15 is already in use for device eth0...
[确定]
本文出自 “12619984” 博客,请务必保留此出处http://12629984.blog.51cto.com/12619984/1902969
原文:http://12629984.blog.51cto.com/12619984/1902969