I’ve been having this strange issue where my wifi mysteriously drops after exactly 1 hour. When this happens, I have to turn my wifi off and then back on again and let it reconnect. After doing this, I have no further issues until the next reboot.
This has puzzled me for months. I tried disabling powersave. I tried disabling IPv6. I tried several different things to resolve this, but nothing has worked yet.
Originally when I made this post, I thought I had figured out how to fix it. Unfortunately I was wrong, so I removed the original post. But I did find a way to get my connection back up and running when it goes down with a cron job that pings Google every minute. This will also reconnect my wifi if Google goes down, but that doesn’t happen very often.
#!/bin/bash
# This must be added to root's crontab.
# The nmcli command won't work on a normal user's crontab.
# Set it to run once every minute.
ping -c 1 google.com > /dev/null
if [ $? -eq 0 ]
then
exit
else
nmcli radio wifi off; nmcli radio wifi on
fi