1.确保vmware的Nat服务开启
2.虚拟机网络编辑器
3.虚拟机默认路由
sudo ip route add default via 192.168.202.2
sudo vim /etc/netplan/00-installer-config.yaml
network:
ethernets:
ens33:
addresses: [192.168.202.133/24]
dhcp4: false
routes:
- to: 0.0.0.0/0
via: 192.168.202.2
version: 2
sudo netplan apply
4.配置DNS
sudo vim /etc/resolv.conf
nameserver 8.8.8.8