Skip to content

Instantly share code, notes, and snippets.

@kylewlacy
Created September 11, 2017 21:53
Show Gist options
  • Save kylewlacy/2af80d44c0df99528930e72eba81d2a6 to your computer and use it in GitHub Desktop.
Save kylewlacy/2af80d44c0df99528930e72eba81d2a6 to your computer and use it in GitHub Desktop.
Linux Mint - Fixing loopback device not starting at startup

Recently, I had an issue where I had no loopback device in Linux Mint 18.2 MATE, which occurred after upgrading from 18.1 MATE.

Diagnosis

ping localhost fails, nc -v -l -p 1234 followed by nc localhost 1234 does not connect, etc. Running ifconfig does not show a loopback device present.

Running sudo service network-manager restart and sudo service networking restart doesn't fix the issue, nor does restarting.

The only clue shows up when inspecting /var/log/syslog:

$ grep "NetworkManager" /var/log/syslog
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1727] device (enp0s31f6): state change: prepare -> config (reason 'none') [40 50 0]
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1728] device (enp0s31f6): state change: config -> ip-config (reason 'none') [50 70 0]
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1729] device (enp0s31f6): state change: ip-config -> ip-check (reason 'none') [70 80 0]
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1743] ofono is now available
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1744] ModemManager available in the bus
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1745] device (enp0s31f6): state change: ip-check -> secondaries (reason 'none') [80 90 0]
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1747] device (enp0s31f6): state change: secondaries -> activated (reason 'none') [90 100 0]
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1747] manager: NetworkManager state is now CONNECTED_GLOBAL
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1748] manager: NetworkManager state is now CONNECTED_SITE
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1748] manager: NetworkManager state is now CONNECTED_GLOBAL
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.1795] dns-mgr: Writing DNS information to /sbin/resolvconf
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <info>  [1505164271.2218] device (enp0s31f6): Activation: successful, device activated.
Sep 11 14:11:11 kyle-mint NetworkManager[31855]: <warn>  [1505164271.2222] failed to enumerate oFono devices: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
Sep 11 14:11:21 kyle-mint NetworkManager[31855]: <info>  [1505164281.5448] device (lo): link disconnected

Cause: ifupdown2 is installed instead of ifupdown

After some inspection in a VM with a fresh install of Linux Mint 18.2 MATE, the only difference in my /etc/{networking,NetworkManager} directories was the ifupdown2 directory. After some investigation, ifupdown2 turned out to be a package that I had installed, which replaced the system-default ifupdown.

The fix

If the above is what caused this issue, the fix is really easy:

  1. Run apt install ifupdown. Note that this will replace ifupdown2 with ifupdown! Proceed with caution if you depend on features from ifupdown2
  2. (optional) Remove the /etc/network/ifupdown2 directory and its contents
  3. Run sudo service network-manager restart && sudo service networking restart

Now, ping localhost should work again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment