設定檔案
/etc/netplan/xxx.yml檔案
範例檔案
network:
  ethernets:
    enp4s0:
      addresses: [192.168.0.99/24] // 設定固定內部固定ip
      gateway4: 192.168.0.254 // 設定gateway
      dhcp4: no //設定不用dhcp
      nameservers: //設定使用的dns
        addresses:
          - 8.8.8.8
          - 8.8.4.4
          - 168.95.1.1
  version: 2
不知道gateway在哪裡 可以用ip r | grep ^def
設定完用
sudo netplan try
測試 如果ok 使用sudo netplan apply
寫入如果try之後 在2分鐘內沒有apply
設定值會恢復原來的
沒有留言:
張貼留言