OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: ckishappy on November 27, 2017, 10:54:38 am

Title: Simple ping & reboot if no ping method every 3min?
Post by: ckishappy on November 27, 2017, 10:54:38 am
Hi, what is the most simple script/method with OPNsense to check every 3min if the ping to an IP is possible and if not, that the whole systems gets rebooted? This is for a remote router w/ovpn with not so reliable internet WAN connection.. Please advise.
Title: Re: Simple ping & reboot if no ping method every 3min?
Post by: phoenix on November 27, 2017, 02:01:54 pm
I don't know if this will do what you want but there's a script I posted a while ago that restarts the WAN interface if there's no response, you might need to modify it to your requirements but it's in this thread: https://forum.opnsense.org/index.php?topic=5511.0
Title: Re: Simple ping & reboot if no ping method every 3min?
Post by: Oxygen61 on November 28, 2017, 10:43:43 pm
I may don't see the bigger picture but isn't the "apinger daemon" based on monitoring and checking all the Gateway IP addresses for latency/Packet loss and member down events?
Why do you use a script if apinger is renewing the WAN interface anyway with "rc.newwanip"?
You can change the behaviour of apinger in the GUI by changing the gateway monitoring settings.
Maybe that could help to change the behaviour to check more often and reload the WAN interface whenever "member down" events happen in any case. :)

Indeed this would not reboot the Firewall by any chance, but reloading the WAN interface should be enough anyway.