虚拟机linux上网设置
<!-- alimama_pid="mm_10809884_1047205_2744758"; alimama_titlecolor="0000FF"; alimama_descolor ="000000"; alimama_bgcolor="FFFFFF"; alimama_bordercolor="E6E6E6"; alimama_linkcolor="00
DHCP的设置是关键:
1、虚拟机装完后会自动使用DHCP分配IP地址, 在网络邻居中把VMnet1 和VMnet8的ip地址改为动态获得的那些地址范围内的地址,在我的机子上VMnet1是192.168.94.150/24 网关是192.168.94.2,VMnet8是192.168.253.150/24 网关是192.168.253.2,具体的ip地址范围可以到虚拟机的edit-》虚拟机网络设置-》DHCP下可以看到相应的IP地址的范围以及相应的掩码。并且设置相应的dns是的跟window下默认的网络连接一样的。
2、在虚拟机上设置连接方式为NAT方式,我设置的为custom,VMnet8(NAT),在虚拟机的linux上到/etc/network/interfaces修改ip地址,改为192.168.253.150/24,网关改为192.168.253.2,/etc/resolv.conf下修改DNS与windows上上网的一样。然后先ping 192.168.253.2网关看看是否能通。通后,在ping一下外面主机windows的IP地址,如果能通的华就可以上网了。
<script type="text/JavaScript"> </script> <script src="http://a.alimama.cn/inf.js" type="text/javascript"></script>
更多推荐
所有评论(0)