Skip to content

Instantly share code, notes, and snippets.

@deckerego
Created October 22, 2025 16:14
Show Gist options
  • Save deckerego/48859023b28f7d30aba8df98d7d1965a to your computer and use it in GitHub Desktop.
Save deckerego/48859023b28f7d30aba8df98d7d1965a to your computer and use it in GitHub Desktop.
Monit config to restart NetworkManager if the default gateway is no longer reachable
check host gateway with address 192.168.1.1
restart program = "/usr/bin/systemctl restart NetworkManager.service"
if failed
port 443
protocol https
timeout 10 seconds
retry 3
with ssl options {verify: disable}
then restart
@deckerego
Copy link
Author

The latest Raspian builds include a NetworkManager setup that gets extraordinarily confused by channels being rebalanced on the WAP, causing it to no longer see SSIDs and drop the connection. If that happens, a restart of NetworkManager usually does the trick.

Yes, this is a hack... but also nm should be smarter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment