https://netplan.io/examples 参考例子
配置 DHCP
例 11.1. netplan dhcp 例子
neo@netkiller ~ % cat /etc/netplan/interfaces.yaml network: version: 2 renderer: networkd ethernets: enp2s1: dhcp4: true
启用生效
neo@netkiller ~ % sudo netplan apply
sudo vi /etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: ens33: addresses: [192.168.0.102/24] dhcp4: false gateway4: 192.168.0.254