Based on info found in:
https://wiki.archlinux.org/title/Power_management#Hooks_in_.2Fusr.2Flib.2Fsystemd.2Fsystem-sleep
For Arch, create a script in this folder:
sudo nano /usr/lib/systemd/system-sleep/network_fix.sh
In Ubuntu you should need to place the script in /lib/systemd/system-sleep/ (I didn’t test this).
Place this into the script:
#!/bin/sh
case $1/$2 in
pre/*)
echo "Going to $2... Yolooo"
;;
post/*)
echo "Waking up from $2... Yolooo"
sleep 10 && ip link set dev eno1 down && ip link set dev eno1 up
;;
esac
Adapt the code to your network interface name (in this example it is called eno1).
Make the script executable:
sudo chmod a+x /usr/lib/systemd/system-sleep/network_fix.sh
Reboot then put the system on sleep. After waking it up you can check the log with:
journalctl -b -u systemd-suspend.service