歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> VMware克隆後找不到eth0

VMware克隆後找不到eth0

日期:2017/2/28 15:34:04   编辑:Linux教程

用ESX克隆虛擬機的時候,會發現網卡編號變化了,原來的eth0,eth1不見了,而出現了eth2,eth3。我估計可能的原因是ESX在創建虛擬機時,會重新創建網卡,當系統發現網卡和配置不一樣時,就新建了新的網絡接口。

可以用下面的方法把eth0改回來:

修改70-persistent-net.rules文件

  1. [root@RedHat89178 ~]# cat /etc/udev/rules.d/70-persistent-net.rules
  2. # This file was automatically generated by the /lib/udev/write_net_rules
  3. # program, run by the persistent-net-generator.rules rules file.
  4. #
  5. # You can modify it, as long as you keep each rule on a single
  6. # line, and change only the value of the NAME= key.

  7. # PCI device 0x15ad:0x07b0 (vmxnet3)
  8. # 把原來的配置注釋掉
  9. #SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:99", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

  10. # PCI device 0x15ad:0x07b0 (vmxnet3)
  11. # 把新出現的eth2改為eth0
  12. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:9c:00:9a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

更改網卡配置文件

  1. [root@redhat89178 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
  2. DEVICE="eth0"
  3. BOOTPROTO=static
  4. # 把MAC地址改成新的地址
  5. HWADDR="00:50:56:9C:00:3A"
  6. ...

更新主機名

  1. [root@redhat89178 ~]# cat /etc/sysconfig/network
  2. NETWORKING=yes
  3. HOSTNAME=<new_hostname>
  4. GATEWAY=10.10.10.1
Copyright © Linux教程網 All Rights Reserved