1网卡地址 /etc/netplan network: ethernets: ens33: dhcp4: no addresses: [192.168.21.204/24] optional: true routes: - to: default via: 192.168.21.2 nameservers: addresses: [192.168.21.2,8.8.8.8] version: 2
配置完成后,netplan apply生效。