ubuntu16.04和18.04的桥接模式和.NAT模式配置
ubuntu16.04和18.04的桥接模式和.NAT模式配置
桥接模式
第一步
vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.18.208
netmask 255.255.255.0
gateway 192.168.18.1
dns-nameserver 114.114.114.114
注意桥接时网段需要与外网一致,改完以后重启虚拟机,ifconfig查看是否修改ok。
.NAT配置
第一步
vi /etc/network/interfacesauto lo
iface lo inet loopback
auto ens33
iface ens33 inet static
address 192.168.148.128
netmask 255.255.255.0
gateway 192.168.148.2
dns-nameserver 114.114.114.114VMware的编辑选项下可找到虚拟网络设置,子网ip网段需要和静态ip统一网段。