Home Linux Community Forums Linux Distributions Ubuntu Restarting the wireless device

Restarting the wireless device

Link to this post 17 Aug 10

I just started integrating ubuntu throughout my home network. Ubuntu holds up to it's reputation.

On one of the systems, I have a wireless nic that sometimes losses connection to my router. Usually if the router is the cause of the problem, you would fix the router and restart the computer's network controller. You can do the same in ubuntu by clicking on the network controller icon and select auto connect.

Is there a command that you can type in the terminal that will restart the controller, and also configure it?


Link to this post 17 Aug 10

You can restart networking with:

sudo /etc/init.d/networking restart
but that's not an interface specific command, it just restarts the whole thing. If you use the graphical network tool to manage your wireless interface, I know of no way to administer it from the command line. I would suggest migrating to a conf file based set up using /etc/network/interfaces.

Link to this post 18 Aug 10

Thanks for the suggestions and the command.B)

Link to this post 18 Aug 10

It sounds like router is freezing which depending on your security may require multiple steps to reconnect, such as interface authentication, security authentication and dhcp requests. Based upon the multiple steps restarting the networking service as Jinux suggested appears to be the best option. I recommend modifying your sudoers file to allow your normal user access to run the networking script as root without password authentication and creating a shortcut to run the command on your desktop.

Although you may want a script to auto-reconnect that concept can create problems by being stuck in a loop when you are not in range of the said router effectively knocking out any connections that you may have had setup, so based upon that logic I will not just give you a script or guide to accomplish the task, but if you are still interested I may work with you to make it a reality.

Link to this post 20 Aug 10

If you can help me create a script that will automatically run to restart the wireless nic whenever connection is dropped, and terminate the script after a number of failed restarts, then I will oblige your assistance.

Link to this post 21 Aug 10

Before we jump to a script I recommend you lookup instructions for using wicd instead of the ubuntu network manager, wicd has a clean option to automatically reconnect that has worked well for me.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board