Ubuntu20.04虚拟机无法上网
# sudo gedit /etc/netplan/01-network-manager-all.yaml
`
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens33: # 网卡名
dhcp4: no # 设置为静态,如果动态改为yes,下面的参数都不需要设置了
# addresses: [192.168.10.30/24] # 地址和子网掩码,注意地址段应该与宿主机一致
addresses: [10.10.3.201/24]
optional: true
# gateway4: 192.168.10.1 # 默认网关,与宿主机一致
gateway4: 10.10.3.1
nameservers:
addresses: [8.8.8.8,114.114.114.114] # DNS
`
sudo netplan apply
原文地址:https://blog.csdn.net/weixin_36878452/article/details/144364363
免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!