ubuntu22.04修改ip配置
sudo vim /etc/netplan/01-network-manager-all.yaml
修改/etc/netplan/目录下的yaml文件,然后应用
sudo netplan apply
network:
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses:
- 192.168.0.10/24
routes:
- to: default
via: 192.168.0.1
nameservers:
addresses:
- 114.114.114.114
- 8.8.8.8
version: 2
renderer: networkd