vmware中host-only的设置

2025-02-23 20:06:36
推荐回答(1个)
回答1:

一.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
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.0
2.在vmware中,选择网络类型为nat,将nat启动,gateway address 192.168.0.2

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.2

b. vi /etc/resolv.conf
nameserver 192.168.0.2

#/etc/init.d/network restart

windows连上网,试用vmware ping host主机,ping 网关,ping dns,如果都能ping 通,则可以上网。