天天看點

克隆虛拟機出現的網卡錯誤

cat /etc/udev/rules.d/70-persistent-net.rules

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x100f (e1000)
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:75:d1:d7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"      

看到這個檔案的name字段後面寫的是什麼你就編輯一下你的網卡   vi /etc/sysconfig/network-scripts/ifcfg-eth0,隻需要把DEVICE=eth0  ,改成/這個檔案/etc/udev/rules.d/70-persistent-net.rules的et後面的name字段就好了,這裡是eth1,是以你的ifcfg-eth0的内容應該是這樣的,編輯完了之後就把/etc/udev/rules.d/70-persistent-net.rules檔案删除,重新開機服務service network restart

[[email protected] ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0      
DEVICE=eth1
TYPE=Ethernet
IPADDR=192.168.0.5
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=static      

轉載于:https://www.cnblogs.com/fyy-hhzzj/p/vmware_.html