虚拟机下Linux无法上网较少见的解法


今天虚拟机里面的linux上网又遇到了问题,网卡激活时老是提示"Determining IP information for eth0... failed; no link present. Check cable?",终于在网上找到了答案:

我的HOST是winxp2,VM是5.0.0 的

网上的解释是:
VMware4.5以上和RedHat 9以上之间,网卡驱动有些不兼容:

Redhat 9.0作Guest OS时,用"ifconfig eth0 up"是无法激活虚拟网卡的,总是提示
诸如 "Determining IP information for eth0... failed; no link present. Check cable?"

解决方法是:
以root权限,编辑 /etc/sysconfig/network-scripts/ifcfg-eth N和
/etc/sysconfig/networking/devices/ifcfg-ethN
其中N是数字,比如eth0,

在每个文件中添加:
check_link_down () {
return 1;
}

然后重新激活网卡,不需要重启就能上网,要是还不能激活,重新启动虚拟机

虚拟机上的网络设置如下:
首先HOST是自动分配IP的

C:\Documents and Settings\yhl>ipconfig -all
Windows IP Configuration
Host Name . . . . . . . . . . . . : yhl
Primary Dns Suffix . . . . . . . : unimassystem.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : unimassystem.com
unimassystem.com
Ethernet adapter 本地连接:
Connection-specific DNS Suffix . : unimassystem.com
Description . . . . . . . . . . . : Broadcom 440x 10/100 Integrated Con
roller
Physical Address. . . . . . . . . : 00-0F-1F-46-40-52
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.29
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 10.71.0.10
10.71.0.40
Primary WINS Server . . . . . . . : 10.71.0.10
Secondary WINS Server . . . . . . : 10.71.0.40
Lease Obtained. . . . . . . . . . : 2006年7月7日 7:56:00
Lease Expires . . . . . . . . . . : 2006年7月10日 7:56:00
Ethernet adapter VMware Network Adapter VMnet1:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet1
Physical Address. . . . . . . . . : 00-50-56-C0-00-01
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.184.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Ethernet adapter VMware Network Adapter VMnet8:
Connection-specific DNS Suffix . :
Description . . . . . . . . . . . : VMware Virtual Ethernet Adapter for
VMnet8
Physical Address. . . . . . . . . : 00-50-56-C0-00-08
Dhcp Enabled. . . . . . . . . . . : No
IP Address. . . . . . . . . . . . : 192.168.118.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
C:\Documents and Settings\yhl>

相关内容