Results 1 to 7 of 7

Thread: A command to restart everything network-related

  1. #1
    Join Date
    Apr 2009
    Location
    Denmark
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    A command to restart everything network-related

    I have a laptop with ubuntu 10.04 that I use in on several wired and wireless networks. I like to use the hibernate function, but more often than not I experience problems connecting to the network when the machine resumes. This happens especially if i resume on another network than the one that was use when the machine hibernated.
    If i reboot the machine, it always connects without problems, but then I lose my hibernated session.

    Since I assume that the problem is due to some setting being out of sync or some process not resuming, I want to run everything related to networking, as it is run during a clean boot-up.
    Is there a command to restart everything network-related?

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: A command to restart everything network-related

    I assume you want to do this from the GUI interface?

    I run KDE whose Network Manager applet has an "enable networking" check box. If I uncheck that, or more often uncheck the "enable wireless" box, then recheck it, that will force the network to restart. I'd be surprised if you don't have the same options in GNOME.

  3. #3
    Join Date
    Apr 2009
    Location
    Denmark
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: A command to restart everything network-related

    Quote Originally Posted by SeijiSensei View Post
    I assume you want to do this from the GUI interface?
    I run KDE whose Network Manager applet has an "enable networking" check box. If I uncheck that, or more often uncheck the "enable wireless" box, then recheck it, that will force the network to restart. I'd be surprised if you don't have the same options in GNOME.
    Actually I do prefer a shell command.
    The equivalent GNOME applet also has "enable networking" and "enable wireless" checkboxes, but using those does not work in the situation i referred to in my initial post. Since rebooting works, I figure there must be a difference between what the network manager does and what is done at bootup.

  4. #4
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: A command to restart everything network-related

    If you prefer using the shell then the following should restart the networking:

    Code:
    sudo /etc/init.d/networking restart

  5. #5
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: A command to restart everything network-related

    reloading your wireless module should work.

    type
    Code:
    sudo lshw -C network
    in the information for you wireless interface it will list the kernel module used under driver=?

    After you resume try

    Code:
    sudo modprobe -r ?
    sudo modprobe ?
    Where ? is the wireless module/driver

  6. #6
    Join Date
    Apr 2009
    Location
    Denmark
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: A command to restart everything network-related

    Thanks for your answers.

    I tried the suggestions by Lars Noodén and nothingspecial, but none of them got the connection up and running.

    Then I realized that I left out some information that might be important.

    I said that rebooting works, but it is a truth with modifications.
    Just rebooting does actually not work. What works is to set the hardware switch for the network adapter to "off", then reboot, and then set the hardware swich back to "on". Then wifi autodetection starts and works.
    Toggling the hardware switch back and forth without rebooting does not help.

    I am going to test your suggestions in combination with use of the hardware switch, but if the commands you provide do the same as using the GUI network manager does, it is not going to work.

  7. #7
    Join Date
    Apr 2009
    Location
    Denmark
    Beans
    58
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: A command to restart everything network-related

    I have now done the test. The result is as foreseen:

    What works:
    1. Setting hardware switch to network adapter to "off".
    2. Reboot.
    3. Setting hardware switch to network adapter to "on".
    4. Laptop autoconnects succesfully to the wireless network.

    What does not work:
    Any combination of commands suggested in this thread, clicking around in the Network Manager GUI and toogling the hardware switch to network adapter, that does _not_ include rebooting.

    Reminds me of my Windows days: Don't try to understand, just reboot

    It simply must be possible to connect to a wireless network without having to reboot. If anyone can give me any pointers to a diagnose or even a solution, I'll be glad.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •