I installed Ubuntu 22.03.4 LTS on a computer and everything was fine. I use it from SSH and I installed on it NextCloud. After some time I got some strange errors : too many requests error, then infinite redirects error. I finally restarted the computer, and I was unable to connect to SSH anymore.
During a cold start, I see the network led blinking: cable connected and trafic incoming. But as Ubuntu displays starting message, the interface's led suddenly turn off. Then the start procedure remains blocked for 2 minutes on a job trying to set up the network.
When I ran the first time systemctl status NetworkManager it told me it was unable to read the /etc/network/interfaces file. It also told me I have to adapter: lo and enp2s0
I created the file /etc/network/interfaces with this content:
auto lo
iface lo inet loopback
auto enp2s0
iface enp2s0 inet dhcp
After reboot, I still have the same problem.
I can start manualy the network interface with these commands:
ip link set enp2s0 up
sudo dhclient -4 enp2s0
=> it remains up until I reboot and it actually works well
systemctl status NetworkManager still says the file /run/network/ifstate doesn't exists but I can't figure out how to create it not what to put inside.
I tried to set the ip link and dhclient commands in the /etc/rc.local file but it doesn't do anything.
I tried an update/upgrade but everything is up to date. I tried also a --reinstall network-manager with no success.
Why has it stopped to work suddenly like this? And how to fix it?