Fix Network after Resume from suspend in Ubuntu or Linux Mint

By Umair Friday, January 18, 2013


In this post I will show you how to fix problem with ethernet network not working after resume from sleep. This procedure works for ethernet or wifi network devices, or any other hardware device that makes problems after resume from sleep.
First thing is to find out the kernel module that makes your network hardware alive (and dead after resume from sleep). It takes some knowledge to determine this name, usually it starts with “r” if you have Realtek NIC or “rt” for Ralink wifi hardware but it could be anything else. It might help to look into your hardware specification. To see the list of loaded kernel modules use this command:

1. To fix the Ethernet / WiFi network not working after resume from suspend, firstly, you must find out the kernel module used by your network hardware. The article where I've found this fix suggests using the following command:
sudo lsmod

and then trying to figure out which module is the one used by your network interface. But that's not so easy to do, so here's an easier way. Firstly, install "lshw", a tool to list your computer hardware - in Ubuntu, install it using the following command:
sudo apt-get install lshw

Then, to list the network interfaces, use the following command:
sudo lshw -C network

The command output should look more or less like this:
       description: Wireless interface
       product: Centrino Wireless-N 1030
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: wlan0
       version: 34
       serial: 4c:85:93:2d:34:61
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=3.5.0-22-generic firmware= latency=0 link=no multicast=yes wireless=IEEE 802.11bgn
       resources: irq:51 memory:f3b00000-f3b01fff
       description: Ethernet interface
       product: RTL8111/8168B PCI Express Gigabit Ethernet controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:0a:00.0
       logical name: eth0
       version: 06
       serial: 00:e0:3c:64:00:08
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl_nic/rtl8168e-2.fw ip= latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:53 ioport:2000(size=256) memory:f3004000-f3004fff memory:f3000000-f3003fff

Depending on the network interface you're having problems with after resuming from suspend, look under "description: Wireless interface" (for WiFi obviously) or "description: Ethernet interface" (for wired network) and under "configuration" you should see the kernel module used by that interface, as "driver=", as you can see in the above example output (in bold). In my case, it's "r8169" (for RTL8111/8168B PCI Express Gigabit Ethernet controller).

2. The next step is to edit the /etc/pm/config.d/unload_modules file as root with a text editor:
gksu gedit /etc/pm/config.d/unload_modules
(the file may not exist in which case, an empty file will come up - that's ok)

And inside this file, paste the following line:

replacing "MODULE_NAME_FOUND_UNDER_STEP_1" with the Kernel module name for your network interface found under step 1, "r8169" in my case.


Then, save the file and that's it. Now even if the wireless / wired network wasn't working, if you set your computer to suspend, after resume the network should work.

Bio: There is a lot information about Linux Geeks on the Internet.

3 comments to ''Fix Network after Resume from suspend in Ubuntu or Linux Mint"

  1. This worked fine in Mint. Like you said it even fixed the broken network after the first sleep broke it. Brilliant - much appreciated.

  2. Thanks! Worked perfectly on my ASUS S200E running Mint with the alx driverversion.

  3. Didn't work for me. Using Samsung NP535U, atheros driver