Restore wi-fi after suspend in Ubuntu

  • 8th day of Discord, in the yold 3183
  • 0 Comments

On many laptop models with Ubuntu systems (Kubuntu, Lubuntu, Xubuntu etc.) the wireless network stops working after returning from sleep/standby mode. The problem is quite common and occurs in many versions of the system: 16.04, 14.04 and others. The article will describe a universal solution to this problem.

If your wifi “drops” when you exit suspend/hibernate/hybrid-sleep, don’t despair, just type in the command in the terminal:

sudo systemctl restart network-manager.service

If this command restarts wifi, then create the /etc/systemd/system/wifi-resume.service file under the superuser:

sudo nano /etc/systemd/system/wifi-resume.service

With such content:

#/etc/systemd/system/wifi-resume.service
#sudo systemctl enable wifi-resume.service
[Unit]
Description=Restart networkmanager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
ExecStart=/bin/systemctl restart network-manager.service
[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

Then activate this script:

sudo systemctl enable wifi-resume.service

And you can safely go into standby mode.

If rebooting the network-manager doesn’t help (which is rare in this case), look for a solution at the wifi-adapter driver level.

Leave a Comment

Your email address will not be published. Required fields are marked *