[ubuntu] 20.04 The network connector icon does not display, the cable is not managed, and there is no "network" option in the setting interface, etc.

question

At work, the Ubuntu 20.04 desktop version accidentally caused the following problems due to hanging up or improper operation

1. Ubuntu network connection icon disappears
insert image description here

2. Wired unmanaged

insert image description here
The above picture shows the wired connection , the fault display is limited unmanaged or other characters

3. The "Network" option is missing in "Settings"

insert image description here
The picture above is the setting interface, which has the "Network" option, which is normal, that is, the network setting can be performed. The "Network" option does not exist in the "Settings" interface of the fault, that is, the network settings cannot be made

4. <warn> [1692771694.0556] Error: failed to open /run/network/ifstateWarning
insert image description here
The above picture is used sudo service network-manager statusto view the information, there is <warn> [1692771694.0556] Error: failed to open /run/network/ifstatea warning in the information

solution

Option One

The new version of Ubuntu uses Netplan to manage network devices and resources, but netplan delegates network management rights to NetworkManager or Systemd-networkd. (For more information, please refer to Ubuntu 20.4 without /etc/network/interfaces, Netplan is required for network configuration )

In most cases, it is delegated to NetworkManager for processing.

Therefore, if you encounter the problem of "the Ubuntu network connection icon disappears, or the network cannot be set", you can execute the following commands in order to solve it

xzbd@ubuntu:~$ sudo service network-manager stop 
xzbd@ubuntu:~$ sudo rm /var/lib/NetworkManager/NetworkManager.state
xzbd@ubuntu:~$ sudo service network-manager start 

Option II

Modify /etc/NetworkManager/conf.d/the xxx.conf configuration file, add it at the end of the file ,except:type:ethernet, and then restart NetworkManager

1. Modify /etc/NetworkManager/conf.d/10-ubuntu-fan.conf, add at the end of the configuration
,except:type:ethernet

For configuration file information, refer to [ubuntu] Network Management: /usr/lib/NetworkManager/conf.d/10-globally-managed-devices.conf What is this file, what is it for, and how to use it?

[keyfile]
unmanaged-devices+=interface-name:fan-*,except:type:ethernet 

2. Restart Network Manager

sudo systemctl restart NetworkManager

insert image description here

Guess you like

Origin blog.csdn.net/m0_47406832/article/details/132453065