码迷,mamicode.com
首页 > 其他好文 > 详细

文章标题

时间:2015-03-09 19:11:33      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

今天把以前硬盘里存的centos放到公司的vmware上运行,发现网络起不来,提示错误是这样的:
device “eth2” does not seem to be present, delaying initialization
然后我看了

[def@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth2 
DEVICE="eth2"
BOOTPROTO=dhcp
#HWADDR="00:0C:29:23:31:C2"
#BROADCAST=192.168.101.255
#IPADDR=192.168.101.31
#NETMASK=255.255.255.0
#GATEWAY=192.168.101.1
ONBOOT=yes

解决方法1:
通过ip add命令查看当前的网卡名

[def@localhost ~]$ ip add
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:29:cb:5b:58 brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.131/24 brd 192.168.11.255 scope global eth4
    inet6 fe80::20c:29ff:fecb:5b58/64 scope link 
       valid_lft forever preferred_lft forever
3: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 52:54:00:65:c3:1e brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 500
    link/ether 52:54:00:65:c3:1e brd ff:ff:ff:ff:ff:ff
[def@localhost ~]$ 

从上面可以看出是eth4,然后修改上面的ifcfg-eth2文件,将eth2修改为eth4即可。

解决方法2:
修改udev记录的mac与网卡名称对应规则:

cat /etc/udev/rules.d/70-persistent-net.rules 
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:cb:5b:58",

文章标题

标签:

原文地址:http://blog.csdn.net/jk110333/article/details/44157835

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!