歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 虛擬機下Linux無法上網較少見的解法

虛擬機下Linux無法上網較少見的解法

日期:2017/2/28 17:35:52   编辑: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>
Copyright © Linux教程網 All Rights Reserved