今天,重启vmware下的Linux突然不能上网了!

 

虚拟机用模板做linux的时候因为网卡配置信息(主要是MAC)也复制过去,但是虚拟服务器会分配另外的一个mac地址,启用的时候会出错,错误信息为:device "eth0" does not seem to be present, delaying initialization

解决方法:

1.打开etc/sysconfig/network-scripts/ ficfg-eth0,确定ONBOOT应该为yes

2.检查ficfg-eth0MACifconfig现实的MAC是否相符,并修改ficfg-eth0MAC

3.重启服务,service NetworkManager restart ,service network restart.

4.然后系统会自动识别到网卡信息,就ok了。

 

系统启动日志:Bringing up interface eth0: pcnet32 device eth0 does not seem to be present, delaying initialization.

ifconfig输出:没有eth0

系统->网络配置:有eth0,处于非激活状态。设法激活时,出错:pcnet32 device eth0 does not seem to be present。

网上有解决方法的。http://blog.csdn.net/ccnp_Server/archive/2008/01/24/2063437.aspx

但太复杂,我没有试,且没有说明问题的原因。后来在communities.vmware.com看到一个老外说,他在遇到这个问题时说:“What I found was that my modules.dep and modules.alias were empty, which live in /lib/modules/`uname -r`/”。这让我想起了,下午我在编一个模块时,执行过depmod,这是会改变modules.dep和modules.alias。到/lib/modules/`uname -r`/一看,果然,里面只有与我的模块有关的依赖信息。看来,这是由于我以错误的方式执行了depmod命令造成的。(具体怎么回事我忘了,好像我在自己工作目录depmod my.ko过)。

看来是系统模块的依赖关系信息丢失了,启动时网卡驱动等模块无法加载。所以,如果想用modprobe向系统加自己的模块时,应将your_module.ko拷入/lib/modules/`uname -r`/,然后depmod -a 。最后,modprob your_module。

解决:在/lib/modules/`uname -r`/下执行,depmod,重新生成modules.dep和modules.alias,重启。

 
 
 
 
 
2011-04-04 15:33

用VMware 安装 linux 6.0 后,网络连接不上 service network restart 出现以下提示

evice eth0 does not seem to be present

使用ifconfig 命令只能看到lo 的状态信息, 使用ifconfig -a 如下

——————————————————————————————————————

eth4 Link encap:Ethernet HWaddr 00:0C:29:75:9D:A8
inet addr:192.168.1.133 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe75:9da8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4377 errors:2 dropped:3 overruns:0 frame:0
TX packets:988 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:451841 (441.2 KiB) TX bytes:78718 (76.8 KiB)
Interrupt:19 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:246 errors:0 dropped:0 overruns:0 frame:0
TX packets:246 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:27552 (26.9 KiB) TX bytes:27552 (26.9 KiB)
——————————————————————————————————————————————————————

eth0变eth4了,晕,想了半天,明白了,是因为我装linux后,把linux虚拟盘复制了4次,以满足我的多系统的测试。 所以复制后的网卡分别变成1-4了。

我是这样解决的,

先把脚本eth0 改成 eth4

[root@linux ~]# mv /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth4


[root@linux ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth4
 

DEVICE="eth4"
HWADDR="00:0C:29:75:9D:A8" #(注意,这是原来eth0的MAC 要改成ifconfig -a 后显示的 eth4的MAC哦)

NM_CONTROLLED="yes"
ONBOOT="yes"
BROADCAST="192.168.1.255"
BOOTPROTO="static"
IPADDR="192.168.1.133"
NETMASK="255.255.255.0"
NETWORK="192.168.1.0"
GATEWAY="192.168.1.1"
 

 

保存后

service network restart 解决问题