1.vmware配置网络为桥接模式

 

2.先查看宿主网络配置  ipconfig

3.虚拟机中网络配置

cd /etc/netplan/
sudo vi 01-network-manager-all.yaml

network:
  version:2
  renderer: NetworkManager
  ethernets:
    ens33:
      addresses:
      - 192.168.41.199/24
      gateway4: 192.168.41.1
      nameservers:
        addresses:
       - 192.168.41.1
       search: []

 

 

4.sudo netplan apply 启用配置