Home » Linux » Ubuntu fix network stopped working after resume from sleep

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!

Categories: Linux
Tags:
Comments
  • bubba_jones April 28, 2013 at 00:10:19

    r8127u did not work after suspend.  built this file and it works great now. only line in file is:  I have ubuntu 12.04

    SUSPEND_MODULES=”$SUSPEND_MODULES r8712u”

  • Killerbees19 April 22, 2013 at 20:36:24

    Thanks, this solution finally solved my wifi issues :-)

    Sapphire Edge HD-3 (r8712u module) at Xubuntu 12.04 LTS!

  • Blaine March 13, 2013 at 20:38:08

    That worked perfectly for me. USB wireless (r8712u) would not reload after suspend.

    Ubuntu 12.04LTS, Dell D620 laptop w/ Asus Wireless N USB (r8712u)

  • David March 4, 2013 at 04:49:19

    Thanks mate, you are awesome!

  • LongIslandSteven February 25, 2013 at 01:54:54

    Works for me! I just installed Ubuntu and would not be keeping it if I wasn’t able to get wifi after suspend working.

    You’re a lifesaver!

  • Chuck Finley February 22, 2013 at 22:10:48

    Output of lsmod


    Module Size Used by
    rtl8192ce 53641 0
    rtl8192c_common 48780 1 rtl8192ce
    rtlwifi 74749 1 rtl8192ce

    Added this line tonew file /etc/pm/config.d/unload_modules

    SUSPEND_MODULES="$SUSPEND_MODULES rtl8192ce"

    Seems to have solved my problem of wifi being finicky after resuming from suspend on my Toshiba Satellite C855.

    Thanks

  • Jojo February 16, 2013 at 21:59:39

    You’re awesome!

  • mardocheo February 9, 2013 at 10:08:29

    It works perfectly for me.

    But for my case it slowed also my hibernate wake-up, I mean that before this trick I could hibernate or suspend my 12.10 ubuntu distro and have a fast reboot, but now I must wait a little … anyway it`s perfetc for wifi modules.

    Thank you (I am luky i have the same wifi adapter of you!)

  • Matheus January 22, 2013 at 04:07:40

    Man, you don’t know how much I am happy now!

     

    Thanks!

  • Daniel January 20, 2013 at 12:35:50

    Thank you!
    Worked like a charm.
    In my case i needed to “wake up” more than one NIC,
    If anyone need it, just put a comma between them, like this:

    SUSPEND_MODULES=”$SUSPEND_MODULES module1, module2, module3″

  • David January 11, 2013 at 11:06:16

    Damn, I thought this was the fix Ive been waiting for, but saly it does not seem to have worked. :(

    Mine was iwl3945
    So I put  SUSPEND_MODULES=”$SUSPEND_MODULES iwl3945″

    into the file, and nothing has changed, :(

    Any ideas? thank you.

    • Marko January 11, 2013 at 19:54:26

      Hi. Check dmesg command after returning from suspend was module really unloaded. If it was unloaded then problem is unfortunately elsewhere, most probably inside iw3945 kernel module.

      • David January 12, 2013 at 00:29:43

        ok thank you. I will try to see what’s up. Thanks for the reply. :)

  • harry January 9, 2013 at 16:56:56

    Thanks a lot!!!

  • JimmySavile January 2, 2013 at 14:18:03

    Another victory (and my first delve into the terminal) – How’s about that then!
    via_rhine seems to be a popular LAN module

  • dercorn December 20, 2012 at 11:22:53

    You just saved my day. This has been bugging me for quite some time. Thank you!

  • Dano December 18, 2012 at 01:50:32

    Perfect, it fixed my wired network issue on my laptop, Ubuntu 12.04. Mine was also r8169.

  • raypetter December 1, 2012 at 10:30:52

    Perfect on my debian squeeze@macbook pro. That pesky b43 wireless adapter can be a real pain in the a…

  • Indy May 23, 2012 at 21:18:56

    Thanks, i have problem with Ubuntu 12.04 with r8712u – wifi dos not work after suspend.

    As you wrote, SUSPEND_MODULES=”$SUSPEND_MODULES r8712u” in
    /etc/pm/config.d/unload_modules and it works fine!

  • Frank May 15, 2012 at 14:43:40

    Thanks :)
    it was really annoying that standby didn’t work

  • Terrell Baranski May 7, 2012 at 09:47:27

    Terrell Baranski

  • Davious April 4, 2012 at 23:42:07

    PS – Toshiba Satellite Pro C660 – 2F6
    Ubuntu 11
    Realtek r8169

  • Davious April 4, 2012 at 23:39:35

    Brilliant, I was sick of having to re-boot after suspend to get wlan back online, this did the trick!!

    Many thanks to you sir!! :)

    • warrick April 16, 2012 at 02:21:52

      You are a dipshit if you used to reboot, just turn the adapter off then back on and it’s fine. All laptops have a switch or a button to disable, if it’s a desktop with a dongle just unplug the dongle and plug it back in.

  • Netman April 3, 2012 at 22:23:42

    Whooo Hooo worked for me too. Not being a linux guru (windows me — Boooo) I’m well on my way to liking what I see.
    Compaq 500 nouvo module now tick-a-tee boo

    Thanks Netman

  • Euloiix March 9, 2012 at 01:45:00

    It worked for me also. 

    Lucid 10.04 with ath9k module which prevented me to connect wirelessly after suspend

  • SuaveRico February 11, 2012 at 05:05:48

    It worked for me, with the same kernel module “r8169″
    At first it didn’t work, but after I rebooted Ubuntu I was able get my network working after sleep.
    Ubuntu 11.10
    HPDV51128ca
    Realtek RTL8102E

  • Kovo1533 January 2, 2012 at 11:00:45

    Looks like this solved my problem with wifi on lenovo S12 ion (module wl), now I am able to connect after resume, I use WICD instead NM.

  • pixatintes November 19, 2011 at 23:16:19

    Thanks man, you save me,

    Same hardware, same driver, same problem, same solution xD

  • noah November 18, 2011 at 13:48:15

    Thank you for good information! Work fine!

    My environment >
    ThinkPad X61
    Ubuntu 11.10
    USB Wireless LAN : GW-USHYPER300

  • Ptr August 13, 2011 at 16:39:42

    Hi Marko,

    forget network, i have issues just booting my laptop once it enters sleep mode.
    any fix for this?
    http://ubuntuforums.org/showthread.php?t=1742470

    even this dint work for me.
    http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug

    Thank you

  • Marko June 26, 2011 at 16:06:38

    @Hiren C Bhatt

    Hi! Thanks for reporting your findings. Ubuntu Maverick is the last sane Ubuntu ;)

  • Hiren C Bhatt June 26, 2011 at 15:55:36

    Thank a lot! This worked for me! I have a HP Pavilion Tx 2000 and I am using Ubuntu 10.10.