vim etc/netlpan/00-installer-config.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
addresses: [192.168.197.103/24]
gateway4: 192.168.197.2
nameservers:
addresses: [192.168.197.2, 114.114.114.114]
生效 :sudo netplan apply