Ubuntu 20.04+22.04版本设置静态IP和多IP

编辑网卡文件
vim /etc/netplan/00-installer-config.yaml

修改为下面内容

network:
  ethernets:
    ens33:
      dhcp4: false
      dhcp6: false
      addresses:
        - 192.168.0.2/24
        - 192.168.0.3/24
        - 192.168.0.4/24
      nameservers:
        addresses: [8.8.8.8, 119.29.29.29]
      routes:
        - to: default
          via: 192.168.0.1
version: 2
renderer: networkd

重启网卡或者系统

netplan apply
sanradar
sanradar
文章: 103