- 修改配置文件
sudo vim /etc/netplan/00-installer-config.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
addresses: [192.168.126.128/24]
gateway4: 192.168.72.2
nameservers:
addresses: [8.8.8.8,8.8.4.4]
sudo netplan apply
使网络配置生效
- 如果此时域名解析还是错误,在
/etc/network
里有个in开头的配置文件,删除即可
然后切换连接为有线连接1