环境:
Ubuntu 20.04.3-live-server
问题描述:
无法获取ip不能上网,重启网络出现unit not found
ubuntu:~$ service network restart
Failed to restart : Unit not found.
解决方案:
1.查看netplan配置文件
cat /etc/netplan/
#This is the network config written by 'subiquity'
network:
ethernets:
ens33:
dhcp4: true
version: 2
2.检测netplan配置
netplan try
Warning: Stopping , but it can still be activated by:
Do you want to keep these settings?
Press ENTER before the timeout to accept the new configuration
Changes will revert in 97 seconds
Configuration accepted.
按回车
ifconfig看看是否获取到IP,获取到IP网络恢复
3.重启服务器测试,网络正常