Restore missing network connections in Ubuntu

This could be a FAQ: after an upgrade, my Ubuntu installation is missing all network connections and I’ve to waste half a day trying to restore them…

It’s nothing that I can’t reconstruct, since I keep track of all the network credentials (wi-fi shared keys, VPN passwords…) also in my favourite password manager application, but the whole problem is very disturbing and occurs relatively often. This time was during the update from version 14.04 LTS to version 16.04.1 LTS. 😦

ubuntunetworkconnectionsadd

I’m writing here some info for future reference and to help people who could have the same issue in the future. I can’t say what’s the root cause (I suspect there’re many) and for the same reason I don’t have a silver-bullet solution.

Ubuntu stores network connections the following directory:

/etc/NetworkManager/system-connections/

Each connection has its file, readable only by root (note: the files must be readable only by root – permissions 600, otherwise the Network Manager applet won’t find them).

Network interfaces definitions are stored in this file:

/etc/network/interfaces

Thanks to this article, I found that

“Since Ubuntu uses Network Manager to manage network connections, any definition listed in this file will automatically override it”.

Note that the same hint is written also in the Network Manager official documentation (see the “Issue” section).

So, given that my interfaces file had the following content:

auto lo
iface lo inet loopback

I changed it to:

auto lo

And that’s all. After a reboot the connections were back!

Annunci

Informazioni su fgianneschi

Fabrizio Gianneschi is a computer science engineer with 20+ years of experience in the IT sector. He works both in the private than in the public sector. Since the 2005 he's a member of the "Java Champions", a restricted community of Java technology experts and leaders, now handled by Oracle. Fabrizio is also the founder of the Java User Group Sardegna, a Duke's Choice Award winner and one of the most well known user groups in Italy.
Questa voce è stata pubblicata in tricks e contrassegnata con , , , . Contrassegna il permalink.

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...