ubuntu22 修改ip方法
1 安装必备软件
apt install vim curl wget -y
2 查看ip配置
cat /etc/netplan/00-installer-config.yaml
结果
# This is the network config written by 'subiquity'
network:
ethernets:
eth0:
dhcp4: true
version: 2
3 设置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
这是我的配置
# This is the network config written by 'subiquity'
network:
ethernets:
ens160:
addresses:
- 192.168.1.233/24
optional: true
nameservers:
addresses: []
search: []
version: 2
4 执行
netplan apply
参考
https://blog.csdn.net/m0_37052320/article/details/100107557
https://blog.csdn.net/fenglailea/article/details/125426306
https://www.cnblogs.com/xingsiyue/p/16557428.html
https://www.jb51.net/article/187742.htm

浙公网安备 33010602011771号