固定ip
/etc/netplan/00-installer-config.yaml
network:
ethernets:
ens33:
dhcp4: no
addresses: [192.168.10.108/24] #设置本机IP及掩码
optional: true
routes:
- to: default
via: 192.168.1.1 #设置网关(ipv4 dns服务器)
nameservers:
addresses: [114.114.114.114, 8.8.8.8] #设置DNS
生效 sudo netplan apply