If your laptop is not connecting to wireless network after sleep, suspend – this is how you solve it in Ubuntu.
There is an ongoing problem faced my many users in Ubuntu. If your Ubuntu laptop is connected to Wi-Fi and it goes to sleep mode and if you wake your laptop up, then you can see the network manager is unable to connect to the wireless network. The wireless network is still preset and signal is also good but if you open up the network manager, you will see the wireless network status is shown as “Out Of Range” and Connect/Disconnect button is disabled.
Like myself, this issue is faced by many users (see forums links at the end of this article) in Ubuntu 14.04, 14.10, 15.04, 15.10 and surprisingly it is still present in latest Ubuntu 16.04 Xenial Xerus as well.
This is indeed a bug [ bug#1439771 , bug#1270257 ] and it has been reported multiple times. And one of them is still open and hopefully would be fixed in future releases. The main difficulty is to recreate the problem. At least for myself, it is not happening all the time the laptop wakes up from sleep. It seems a very random behavior.
There are lots of forum posts on this issue in ubuntuforums and askubuntu with multiple solutions. After going through all of them and the solutions’ success rate, the below method looks promising.
How to Fix
Once you wake up your laptop from sleep and see the wireless is not connecting automatically, open terminal (CTRL+ALT+T) and run below command:
sudo service network-manager restart
If all goes well, you can see the wireless network is connected again to which it was connected before going to sleep.
While searching for solution to this problem on the web, most of the cases I found above solution worked including myself. If you are facing the same problem and above command is not working, drop a comment.
This solution tested on Ubuntu 16.04 LTS Xenial Xerus, Dell Vostro 3000 Series Laptops.
This article is inspired from below blog/forum posts: