中创建虚拟机node1,了最新的centos6,而后采用复制虚拟机文件的方式快速创建了node2,启动node2系统时vmware提示检测到系统变动,选择I copied,以便其能重新配置网卡,之前的诸多rhel4/5系统均如何操作并正常。
复制出的node2启动后,按照之前的经验也是首先去修改网卡的配置,但进入到/etc/sysconfig/network-script目录,看到ifcfg-eth[N]与ifconfig中显示的设备并不匹配。
Ifcfg中配置了eth0,但ifconfig命令显示当前设备的网卡为eth1:
[root@node2 ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:BB:E2:19
inet addr:10.0.14.88 Bcast:10.0.15.255 Mask:255.255.240.0
inet6 addr: fe80::20c:29ff:fedd:f7cf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:59751 errors:0 dropped:0 overruns:0 frame.:0
TX packets:259 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4128373 (3.9 MiB) TX bytes:43361 (42.3 KiB)
初始以为是复制时配置有误,或者系统识别的问题,于是在vmware的界面删除了网卡,而后再重新添加,再次查看ifconfig,这下发现eth1也不见了,网卡设备名变成了eth2:
[root@node2 ~]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:DD:F7:CF
inet addr:10.0.14.88 Bcast:10.0.15.255 Mask:255.255.240.0
inet6 addr: fe80::20c:29ff:fedd:f7cf/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16454 errors:0 dropped:0 overruns:0 frame.:0
TX packets:4159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4128373 (2.1 MiB) TX bytes:43361 (451.3 KiB)
Vmware的虚拟机也配置过很多个,从未遇到过这种问题,怀疑应该是跟centos6的系统有关系,但面对这种无头绪问题真不知道该从何处下手,赶紧向成师傅(http://blog.sina.com.cn/winpub)请教,大师出马果然不同反响,很快就定位到了/etc/udev/rules.d/70-persistent-net.rules:
[root@node2 rules.d]# more /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) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:68:cf:fd", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:bb:e2:19", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x8086:0x100f (e1000)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:dd:f7:cf", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x8086:0x100f (e1000) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:dd:f7:cf", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
经过大师的分析,认为应该是系统启动时对设备名的识别紊乱导致,解决起来也很简单,删除文件中的无用配置,仅保留最后一条eth0的配置即可,而后重启机器,问题解决。
阅读(3172) | 评论(0) | 转发(0) |