1、NAT联网
VMware选择“虚拟机”->“设置”->“网络连接”->“NAT模式”
宿主机中启用vmnet8,并启动与VMware相关的所有服务,特别是NAT Server。
进入ubuntu:
#vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.47.100
netmask 255.255.255.0
gateway 192.168.47.2
#vim /etc/resolv.conf
nameserver 192.168.47.2
#/etc/init.d/networking restart
2、桥接联网
VMware选择“虚拟机”->“设置”->“网络连接”->“桥接模式”
进入ubuntu:
#vim /etc/network/interfaces
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 10.10.20.12
netmask 255.255.0.0
gateway 10.10.0.3
#vim /etc/resolv.conf
nameserver 10.10.0.3
#/etc/init.d/networking restart