ubuntu server 22 设置静态ip
进入root用户如何切换root用户请看 https://foxwho.blog.csdn.net/article/details/125423062ubuntu22 查看ip配置进入查看 ip配置文件, 这个文件是我这的ip配置文件,每个版本的可能定义不一样输出ubuntu22 设置静态ip内容修改如下......
·
进入root用户
如何切换root用户请看 https://foxwho.blog.csdn.net/article/details/125423062
安装必备软件
apt install vim curl wget -y
ubuntu 22 查看ip配置
进入 /etc/netplan/
查看 ip配置文件,00-installer-config.yaml
这个文件是我这的ip配置文件,每个版本的可能定义不一样
cat /etc/netplan/00-installer-config.yaml
输出
# This is the network config written by 'subiquity'
network:
ethernets:
eth0:
dhcp4: true
version: 2
ubuntu 22 设置静态ip
vim /etc/netplan/00-installer-config.yaml
内容修改如下
network:
ethernets:
eth0:
dhcp4: false
dhcp6: false
addresses:
- 192.168.10.120/24
optional: true
routes:
- to: default
via: 192.168.10.1
set-name: eth0
nameservers:
addresses:
- 223.5.5.5
- 223.6.6.6
search:
- localhost
- local
version: 2
应用并生效
netplan apply
更多推荐
所有评论(0)