转载自:http://363340.blog.51cto.com/353340/1213046
问题:用Vmware克隆Centos 6.4后,发现系统内只有eth1,而且/etc/sysconfig/network-scripts/下只有,ifcfg-eth0文件,虽然可以上网,但无法设置静态IP。
ifconfig eth0
eth1: error fetching interface information: Device not found
解决:vi /etc/udev/rules.d/70-persistent-net.rules 显示为:
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:48:85:9c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
将 NAME="eth1" 改成NAME="eth0"
并将 ATTR{address}=="00:0c:29:48:85:9c",中的网卡地址改到
/etc/sysconfig/network-scripts/ifcfg-eth0 文件中,HWADDR="00:0C:29:48:85:9C",使他们对应。
然后reboot
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:48:85:9C
inet addr:192.168.74.148 Bcast:192.168.74.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe48:859c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5032 errors:0 dropped:0 overruns:0 frame:0
TX packets:3674 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5762656 (5.4 MiB) TX bytes:209372 (204.4 KiB)
完成。