centos MAC 地址与报错eth0 unknown interface no such device
eth0 unknown interface no such device出现这个原因是由于虚拟机直接COPY过来,
·
eth0 unknown interface no such device
出现这个原因是由于虚拟机直接COPY过来,MAC地址发生了变化,但eth0 里仍然记录着旧的MAC地址。
解决方法:
vim /etc/udev/rules.d/70-persistent-net.rules
# PCI device 0x8086:0x100e (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:25:d3:1c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:37:20:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
eth1记录着新MAC地址,eth0是旧的地址。
操作步骤:
1.
将eth0的ATTR{address}==eht1的MAC地址
2.
删除eth1 的配置,也就以下内容删除:
# PCI device 0x8086:0x100e (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:37:20:1e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
3.
vim /etc/sysconfig/network-scripts/ifcfg-eth0
将MAC地址改为:
HWADDR=08:00:27:25:d3:1c #必须对应etho是的MAC地址(/etc/udev/rules.d/70-persistent-net.rules)
更多推荐
已为社区贡献4条内容
所有评论(0)