ubuntu22.04修改ip配置

sudo vim /etc/netplan/01-network-manager-all.yaml

修改/etc/netplan/目录下的yaml文件,然后应用

sudo netplan apply

image-20220616112917845

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
posted @ 2023-12-19 17:39  疯子110  阅读(364)  评论(0编辑  收藏  举报