Ubuntu - restart wifi connection without rebooting
Restarting a wifi connection without rebooting
I have a Mythbuntu box who's only connection to the outside world is through a wi-fi connection. It can be frustrating when the connection drops out at a critical time - during an upgrade to the next LTS release for instance. Here are some things to try to reset the connection.
sudo ifconfig
will tell you whether the adapter has an ip address allocated
dmesg | tail
might shed some light on what caused the connection to drop
sudo dhclient -v wlan0
dhclient will request a new dhcp lease, if your network adapter is configured to use dhcp. This worked for me, although it took some time. AFAIK, dhclient will keep on trying to acquire an ip address until it gets one or Ctrl + C is pressed. It might take a few minutes to succeed!
Other things to try
If the above doesn't work, you could try the following:
nmcli networking off nmcli networking on
restart network-manager:
sudo service network-manager restart
reload the kernel wifi module:
sudo rmmod iwlwifi sudo modprobe iwlwifi
The module name will depend on the wifi hardware installed. To find out the module name try either of these commands:
lspci | grep -i network
or
sudo lshw -C network
and look for a line containing driver=something
*-network description: Wireless interface product: Wireless 7260 configuration: driver=iwlwifi latency=0
Hopefully one of these methods will work. Otherwise check out these resources:
AskUbuntu
- http://askubuntu.com/questions/271387/how-to-restart-wifi-connection
- http://askubuntu.com/questions/54710/how-do-i-reset-the-network-adapter-using-a-terminal-command
Stephen Ostermiller's Blog
Trackbacks
The author does not allow comments to this entry
Comments
Display comments as Linear | Threaded