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)


版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2021-09-19
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
相关资源
相似解决方案