1、静态ip
/etc/netplan# vi 00-installer-config.yaml
设置ip如下
# This is the network config written by \'subiquity\' network: ethernets: enp0s3: dhcp4: false addresses: [192.168.137.122/24] optional: true gateway4: 192.168.137.1 nameservers: addresses: [114.114.114.114] version: 2
2、动态
把dhcp4改成true即可
3、然后使生效
sudo netplan apply
4、查看网关方法
route -n
5、在TAP网络上,某天突然不能使用netplan设置了,固定ip无法上网,没查出原因。