Ubuntu-Server22.04修改IP


sudo vim /etc/netplan/01-network-manager-all.yaml
# 修改/etc/netplan/目录下的yaml文件,
# This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.8.200/24]
      gateway4: 192.168.8.2
      nameservers:
        addresses: [114.114.114.114,8.8.8.8]

# 然后应用 
sudo netplan apply