Ubuntu22.04网络配置,静态IP配置文章来源:https://www.toymoban.com/news/detail-557355.html
一、查看默认配置
ms@moshui:~$ cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s5:
dhcp4: true
version: 2
ms@moshui:~$
二、配置静态IP
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s5:
dhcp4: true
enp0s6:
dhcp4: false
addresses:
- 198.168.0.22/24
optional: true
routes:
- to: default
via: 198.168.0.1
nameservers:
addresses: [198.168.0.1,8.8.8.8]
search:
- localhost
- local
version: 2
或文章来源地址https://www.toymoban.com/news/detail-557355.html
# This is the network config written by 'subiquity'
network:
ethernets:
enp0s5:
dhcp4: true
enp0s6:
dhcp4: false
addresses:
- 198.168.0.22/24
optional: true
routes:
- to: default
via: 198.168.0.1
nameservers:
addresses:
- 198.168.0.1
- 8.8.8.8
search:
- localhost
- local
version: 2
三、应用生效
sudo netplan apply
到了这里,关于Ubuntu22.04网络配置,静态IP配置的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!