Ubuntu fix network stopped working after resume from sleep

I'm currently using Ubuntu Lucid on my HP Compaq CQ56 laptop. It is really Linux friendly laptop, but like every other configuration it needs some tweaking to really shine. 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:

sudo lsmod

The result of that command would be the list like this one:

...
r8169                  34108  0 
mii                     4381  1 r8169
binfmt_misc             6587  1 
videodev               34361  1 uvcvideo
v4l1_compat            13251  2 uvcvideo,videodev
rt3090sta             905769  0 
vboxdrv               230432  2 vboxnetadp,vboxnetflt
joydev                  8740  0 
...

Problem on my laptop is with Realtek 8169 ethernet device whose network connection is lost after returning from sleep. So name I was looking for is the name of "r8169" kernel module from the list above. Next thing is to add this kernel module to the list of kernel modules to unload before going to sleep and reload after returning from sleep. We do this by editing (creating it if it doesn't exist) /etc/pm/config.d/unload_modules file like this:

sudo gedit /etc/pm/config.d/unload_modules

Now we add following to that file (you should replace "r1869" with the name of kernel module that is making problems for your configuration):

SUSPEND_MODULES="$SUSPEND_MODULES r8169"

That is it. Now put your PC to sleep and test is your troublesome hardware working after resume. If you feel kind you can also report here if it works or not. Cheers!

DevGenii

A quality focused Magento specialized web development agency. Get in touch!

71 thoughts on “Ubuntu fix network stopped working after resume from sleep

  1. keanne

    I have a Toshiba Satellite Pro L450 and this did not work. Neither the wired or wireless is working after suspend or reboot. Help!

    Reply
  2. Sean

    Works perfectly on a Lenovo Thinkpad X61 with a USB wireless adapter. Going into and out of sleep or hibernate mode on Debian Wheezy.

    Reply
  3. Pete

    After the change, the Suspend does not work at all … hmmm… the computer is running and I can see the wireless reconnecting OK , which is great :-), but I need this after coming back from ‘sleep’ … any thoughts. I am using Ubuntu 14.04 LTS 64 bits.

    Reply
  4. David

    This saved the day for me — Ubuntu-MATE 14.04 on a Dell Inspiron 1545 (driver is ‘wl0’). I had already used ‘lshw -C network’ to find the wireless driver name, so for me it was just a matter of creating the file in /etc. Thanks for the great info!

    Reply
  5. Flo

    Thanks for this solution!

    For anyone who is suffering from this problem on an iMac 12,2 (mid 2011 model, Atheros wireless card, ath9k driver, Ubuntu 18.04 LTS):
    > sudo gedit /etc/pm/config.d/unload_modules
    SUSPEND_MODULES=”$SUSPEND_MODULES cfg80211 mac80211 ath ath9k ath9k_common ath9k_hw”
    > Save and exit.
    > sudo ls -l /etc/pm/config.d/unload_modules
    If not already executable:
    > sudo chmod 755 /etc/pm/config.d/unload_modules#

    I don’t know if all these modules and commands are necessary, but it works for me, so I give zero f**** why, because it annoyed me for so long already.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *