sudo vim /etc/netplan/00-installer-config.yaml # 若是 wifi 则是 00-installer-config-wifi.yaml
默认配置为:
1 2 3 4 5 6
# This is the network config written by 'subiquity' network: ethernets: enp2s0: dhcp4:true version:2
修改后的配置为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# This is the network config written by 'subiquity' network: ethernets: enp2s0: dhcp4:false addresses: -192.168.23.20/24# 设置静态 IP 地址和掩码 routes: -to:default via:192.168.23.254# 设置网关地址 nameservers: addresses: -192.168.23.11# 设置主、备 DNS -119.29.29.29 version:2