ubuntu20.04设置动态ip,静态Ip

时间:2021-08-21 08:28:28   收藏:0   阅读:27

1、静态ip

/etc/netplan# vi 00-installer-config.yaml

设置ip如下

# This is the network config written by ‘subiquity‘
network:
  ethernets:
    enp0s3:
      dhcp4: false
      addresses: [192.168.137.122/24]
      optional: true
      gateway4: 192.168.137.1
      nameservers:
        addresses: [114.114.114.114]
  version: 2

2、动态

把dhcp4改成true即可 

3、然后使生效

sudo netplan apply

4、查看网关方法

route -n

技术分享图片

 

 

  

  

原文:https://www.cnblogs.com/zhaogaojian/p/15168215.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!