1.需要编辑/etc/netplan/**.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
eno1:
addresses:
- 192.168.1.22/24
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
2.sudo netplan apply