1、编辑网卡
sudo vim /etc/netplan/00-network-manager-all.yaml
network:
version: 2
ethernets:
eth0:
addresses: [***.***.***.***/**]
dhcp4: no
optional: true
gateway4: ***.***.***.***
nameservers:
addresses: [***.***.***.***]
2、配置生效
sudo netplan apply
3、查看ip
ip addr
4、ping baidu