
在虚拟机安装了AS3U8,但LINUX系统下系统无法上网,从网上搜索方法。终于解决不能上网的原因。
根据http://blog.csdn.net/fbysss/archive/2008/03/27/2223890.aspx的方法解决虚拟机LINUX上网的原因。
1.选中本地连接高级选项中“允许其他网络用户通过此计算机的Internet连接来连接”,下拉框中选择VMnet1,VMnet1弹出更改为192.168.0.1,确定。VMnet8选DHCP。
2.更改虚拟机中的Network connection为NAT模式。
3.更改虚拟机的分配为DHCP。在命令行中输入route,查看默认网关和DNS
[root@localhost root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.10.2 0.0.0.0 UG 0 0 0 eth0
为了方便使用软件连接虚拟机,设置动态IP。
[root@localhost root]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.10.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default 192.168.10.2 0.0.0.0 UG 0 0 0 eth0
[root@localhost root]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.10.10
NETMASK=255.255.255.0
GATEWAY=192.168.10.2
[root@localhost root]# cat /etc/resolv.conf
nameserver 192.168.10.2
search localdomain
网关和DNS都设置为192.168.10.2