Ubuntu18.04 配置静态IP地址
侧边栏壁纸
  • 累计撰写 42 篇文章
  • 累计收到 0 条评论

Ubuntu18.04 配置静态IP地址

HiYae.
2022-04-21 / 0 评论 / 46 阅读 / 正在检测是否收录...
vim /etc/netplan/01-network-manager-all.yaml

静态IP:

# Let NetworkManager manage all devices on this system
#network:
#  version: 2
#  renderer: NetworkManager
#  ethernets:
#      enp6s0:
#          dhcp4: yes 

network:
  version: 2
  ethernets:
      enp6s0:
          dhcp4: no
          addresses: [192.168.1.22/24]
          optional: true
          gateway4: 192.168.1.1
          nameservers:
              addresses: [192.168.1.1]

DHCP:

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
      enp6s0:
          dhcp4: yes 

#network:
#  version: 2
#  ethernets:
#      enp6s0:
#          dhcp4: no
#          addresses: [192.168.1.22/24]
#          optional: true
#          gateway4: 192.168.1.1
#          nameservers:
#              addresses: [192.168.1.1]
sudo netplan apply
0

评论

博主关闭了所有页面的评论