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

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

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

 

 

  

  

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

上一篇:springboot log4j2


下一篇:C++类的构造和析构顺序