Welcome to the new Linux Foundation Forum!

Restarting the wireless device

saqman2060saqman2060 Posts: 777

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?

B)

Comments

  • JinuxJinux Posts: 20
    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.
  • saqman2060saqman2060 Posts: 777
    Thanks for the suggestions and the command.B)
  • mfillpotmfillpot Posts: 2,180
    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.
  • saqman2060saqman2060 Posts: 777
    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.
  • mfillpotmfillpot Posts: 2,180
    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.
  • saqman2060saqman2060 Posts: 777
    This is great, thanks!!!
Sign In or Register to comment.