系统相关
首页 > 系统相关> > Ubuntu Server 21.10设置静态IP

Ubuntu Server 21.10设置静态IP

作者:互联网

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

标签:netplan,1.1,IP,sudo,192.168,Server,21.10,设置,8.8
来源: https://www.cnblogs.com/dygood/p/15835558.html