A workaround for networking not working after suspend (stuck on setting network address)

This problem has been around for a long time and affected me. It seems only a problem with NetworkManager… I never had any problems with wicked.

All the quick fixes I researched had no effect.

Basically, it seems like it is race condition bug on restart from suspend because it happens intermittently only on resume from susped and happens regardless of your device driver (mine was e1000e).

Once you hit the bug, you have to reboot to recover your network. Nothing worked (restart NetworkManager, netconfig -f update, systemctl restart network).

The ONLY thing I tried that worked is removing the driver before suspend and installing it on resume.

So I put this script in /usr/lib/systemd/system-sleep (with chmod a+x):


#!/bin/bash
 "$1" = "pre" ] && exec rmmod e1000e
 "$1" = "post" ] && exec modprobe e1000e
exit 0

You should replace e1000e with your driver which you can get from

ethtool -i enp0s25
driver: e1000e
version: 3.2.6-k
firmware-version: 0.2-4
expansion-rom-version:
bus-info: 0000:00:19.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no

or

/sbin/lspci -nnk