centos MAC 地址与报错eth0 unknown interface no such device

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/fz2543122681/article/details/39137565

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)


展开阅读全文

没有更多推荐了,返回首页