Ubuntu Server 21.10静态IP地址的设置和以前不同了.
# 此处文件名按照自己的实际情况来 sudo nano /etc/netplan/*.yaml
network: version: 2 renderer: networkd ethernets: eth0: link-local: [] optional: true dhcp4: no addresses: - 192.168.1.2/24 routes: - to: default via: 192.168.1.1 match: macaddress: f4:5b:11:4c:dc:bd set-name: eth0 nameservers: addresses: [192.168.1.1,223.5.5.5,223.6.6.6,8.8.8.8,8.8.4.4] search: []
sudo netplan apply
sudo reboot