Ubuntu 修改静态ip地址

 

打开文件地址:sudo vim /etc/netplan/01-network-manager-all.yaml

 

 

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    eno1:
      dhcp4: false
      addresses: [192.168.0.112/24]
      optional: true
      routes:
        - to: default
          via: 192.168.0.1
      nameservers:
        addresses: [192.168.0.1]

 

将静态ip地址修改为: 192.168.0.112

 

重启网卡

sudo netplan apply

或重启机器

sudo reboot

 

posted on 2024-03-14 11:57  星河赵  阅读(26)  评论(0编辑  收藏  举报

导航