今天做实验需要用到两个Linux系统,于是就把原有的CentOS6.6_64系统克隆了一份,启动克隆的系统配置好IP地址后,重启网络服务(service network restart),提示eth0不存在。而明明eth0文件是有存在滴。
下面来说说解决的方法:
1、修改克隆的CentOS6.6_64系统的网卡配置文件ifcfg-eth0,把HWADDR和UUID的行删除,参考如下:
[root@ilinux Packages]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 TYPE=Ethernet IPADDR=192.168.80.201 NETMASK=255.255.255.0 BROADCAST=192.168.80.255 GATEWAY=192.168.80.254 DNS1=218.85.152.99 DNS2=222.222.222.222 ONBOOT=yes #开机自启动网络,很重要哦; NM_CONTROLLED=yes
2、修改克隆的CentOS6.6_64系统的70-persistent-net.rules配置文件,把文件里面未注释的行都删除或都注释掉(听说也可把此配置文件直接删除,想知道就自己实验下吧!)
[root@ilinux Packages]# vim /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) # PCI device 0x8086:0x100f (e1000) # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8d:3f:84", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
3、重启系统,只要你把网卡配置对了就OK了,ifconfig下吧,eth0出现了。
本文出自 “ilinux” 博客,请务必保留此出处http://shenzhijin.blog.51cto.com/1741240/1859932
原文地址:http://shenzhijin.blog.51cto.com/1741240/1859932