网络管理工具 netplan
- 在 Ubuntu20.04 版本中使用 netplan 管理网络
- 在安装好的 Ubuntu20.04 中没有 networking 和 NetworkManage 服务
- netplan 配置文件:/etc/netplan/*.yaml ,文件名每个不一样
- netplan 的对应的网卡配置文件:/proc/sys/net/dev
- netplan 说明文件: /usr/share/doc/netplan/example/ 目录下,在该目录下有各种样例文件,可以提供帮助
修改网卡配置样例
- 编辑网络配置文件
root@it:~# vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
ens32:
addresses:
- 192.168.*.*/24
gateway4: 192.168.*.1
nameservers:
addresses:
- 8.8.8.8
version: 2
- 加载刚刚修改的配置文件信息
root@it:~# netplan try #测试语法
root@it