vi /etc/netplan/01-network-manager-all.yaml
network:
ethernets:
enp0s3: #配置的网卡的名称
dhcp4: no #dhcp4关闭
addresses: [10.224.0.220/16]
gateway4: 10.224.0.1 #网关IP,设置为和物理机相同
nameservers:
addresses: [10.248.8.19,10.248.8.18] #设置DNS,与物理机相同
version: 2
renderer: NetworkManager
sudo netplan apply