vmware中配置host-only 和nat
时间:2006-10-30 来源:mrzcs
一.host-only
1.在windows中,本地连接-属性-tcp/ip protocol-advanced-share connection-choose vnet1 or vnet8-ok
vnet1/vnet8 的ip address 变为192.168.0.1, netmask 255.255.255.0
2.在vmware中
选择网络类型为host-only,将dhcp and nat停掉,
a. vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.0.66
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1 b. vi /etc/resolv.conf
iface eth0 inet static
address 192.168.0.66
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.2 b. vi /etc/resolv.conf
iface eth0 inet static
address 192.168.0.66
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1 b. vi /etc/resolv.conf
nameserver windows下的dns ip addr
#/etc/init.d/network restart二.nat
1.在windows中,本地连接-属性-tcp/ip protocol-advanced-share connection-choose vnet1 or vnet8-ok vnet1/vnet8 的ip address 变为192.168.0.1, netmask 255.255.255.02.在vmware中,选择网络类型为nat,将nat启动,gateway address 192.168.0.2
a. vi /etc/network/interfaces auto eth0iface eth0 inet static
address 192.168.0.66
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.2 b. vi /etc/resolv.conf
nameserver 192.168.0.2
#/etc/init.d/network restart
windows连上网,试用vmware ping host主机,ping 网关,ping dns,如果都能ping 通,则可以上网。
另外,如果在公司内部网使用vmware,若需使用代理服务器上网,不需要修改~/.profile增加代理服务器。
相关阅读 更多 +