Ubuntu 20.04.3无法获取ip不能上网,重启网络出现unit NetworkManager.service not found

环境:

Ubuntu 20.04.3-live-server

问题描述:

无法获取ip不能上网,重启网络出现unit NetworkManager.service not found

ubuntu:~$ service network restart
Failed to restart network.service: Unit network.service not found.

解决方案:

1.查看netplan配置文件
cat /etc/netplan/00-installer-config.yaml

#This is the network config written by 'subiquity'
network:
  ethernets:
    ens33:
      dhcp4: true
  version: 2

2.检测netplan配置

netplan try

Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket
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.重启服务器测试,网络正常

你可能感兴趣的:(Ubuntu,网络,ubuntu,tcp/ip)