Ubuntu20.04设置静态IP(/etc/netplan添加yaml配置)
Posted boonya
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu20.04设置静态IP(/etc/netplan添加yaml配置)相关的知识,希望对你有一定的参考价值。
Ubuntu从18.04开始有了大的版本改动,网络配置有些不一样。
找到网路配置修改的yaml:
cd /etc/netplan
boonya@boonya-VirtualBox:/etc/netplan$ ls
01-network-manager-all.yaml
boonya@boonya-VirtualBox:/etc/netplan$ sudo vi 01-network-manager-all.yaml
添加静态IP:
# Let NetworkManager manage all devices on this system
network:
ethernets:
enp0s3:
dhcp4: no
addresses: [192.168.0.10/24]
gateway4: 192.168.0.1
nameservers:
addresses: [192.168.0.1,61.139.2.69]
version: 2
renderer: NetworkManager
使网路配置生效:
sudo netplan apply
本人博客园地址:Ubuntu20.04设置静态IP - boonya - 博客园
以上是关于Ubuntu20.04设置静态IP(/etc/netplan添加yaml配置)的主要内容,如果未能解决你的问题,请参考以下文章
为Ubuntu 20.04 设置静态IP简明教程(和把大象装冰箱一样简单)
linux ubuntu20.04固定ip设置方法(静态ip)(没有以太网网络设置界面)
linux ubuntu20.04固定ip设置方法(静态ip)(没有以太网网络设置界面)