ubuntu 22 内网静态IP设置

ifconfig
sudo vi /etc/netplan/00-installer-config.yaml
network:
  ethernets:
    eno1:
      dhcp4: no
      dhcp6: no
      addresses: [192.168.1.188/24]
      optional: true
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses:  [8.8.8.8, 114.114.114.114]
    eno2:
      dhcp4: true
    eno3:
      dhcp4: no
    eno4:
      dhcp4: true
  version: 2

sudo netplan apply
posted @ 2023-03-08 14:34  MasonLee  阅读(188)  评论(0编辑  收藏  举报