当前位置: > 虚拟化 Virtualization > VMware >

Vmware克隆Centos系统后网卡不能正常使用

时间:2016-05-19 12:44来源:linux.it.net.cn 作者:IT
症状:
在Vmware克隆一个centos系统,称为B系统,各种服务都正常,除了网络之外。
重启 service network restart
报错:
系统启动日志:Bringing up interface eth0: pcnet32 device eth0 does not seem to be present, delaying initialization.

解决:
查看70-persistent-net.rules文件,此文件里面存放着centos系统认到的网卡信息和系统文件eth*的绑定。

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 0x1022:0x2000 (pcnet32) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:c4:79:9b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e7:9d:5e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"记下网卡名称为eth1的mac地址(即:00:0c:29:e7:9d:5e)

修改 ifcfg-eth0 中的 ONBOOT=off

vi /etc/sysconfig/network-scripts/ifcfg-eth0保存退出。

复制ifcfg-etho 为 ifcfg-eth1

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1再修改 ifcfg-eth1 中的 ONBOOT=on 和 HWADDR=刚才记录的mac地址(即:00:0c:29:e7:9d:5e)

vi /etc/sysconfig/network-scripts/ifcfg-eth0保存退出。

最后重启网卡服务

service network restart

(责任编辑:IT)
------分隔线----------------------------