vi编辑命令
sudo vi /etc/netplan/00-installer-config.yaml
文件内容
—————————————————————-# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
version: 2
renderer: networkd
ethernets:
ens2: #你的网卡名称
dhcp4: no
addresses: [192.168.3.105/24]
gateway4: 192.168.3.1
nameservers:
addresses: [114.114.114.114]———————————————————————-
之后 :wq 保存并退出
启动服务
$ sudo netplan apply
查看网络服务的状态
$ networkctl status