ubuntu18.04 使用netplan配置静态IP

1.cd /etc/netplan

2.sudo vim /etc/netplan/*.yaml

network:
  ethernets:
    enp0s3:
      dhcp4: false
      addresses: [192.168.10.45/24]  #静态IPv4
      gateway4: 192.168.10.255        #网关
      nameservers:
              addresses: [119.29.29.29] #DNS地址
  version: 2

3.sudo netplan try

4.sudo netplan apple

5.sudo reboot

posted @ 2023-08-08 10:37  烧刘病  阅读(272)  评论(0编辑  收藏  举报
回到页首