Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Monitor WAN connection and recover when defunct (ifup/ifdown - reboot)
« previous
next »
Print
Pages: [
1
]
Author
Topic: Monitor WAN connection and recover when defunct (ifup/ifdown - reboot) (Read 2337 times)
le_top
Newbie
Posts: 10
Karma: 0
Monitor WAN connection and recover when defunct (ifup/ifdown - reboot)
«
on:
October 01, 2023, 01:29:21 pm »
From time to time I lost internet connectivity "from my internal network" - and I found that OPNsense could not connet to the internet either.
The internet box was connected to the internet though and as far as I remember, I could connect to the internet box from my internal network. And connect to the internet through a direct connection through the internet box (without the OPNsense firewall).
It turned out that i was not alone and a script already existed.
I have ajusted that to my needs, made it a bit more self-containing with regards to its installation.
It's available as a gist:
https://gist.github.com/035129a6f90979ba39ec8377e99922f5
.
This script will ping the internally defined servers on every execution. When the ping fails, it will bring the igb0 interface down and up to try to restore the connection and ping again. If that fails, OPNsense is rebooted.
I find that my OPNsense server reboots from time to time and that I not have to intervene unless the internet connection is really down.
Logged
CJ
Hero Member
Posts: 832
Karma: 30
Re: Monitor WAN connection and recover when defunct (ifup/ifdown - reboot)
«
Reply #1 on:
October 01, 2023, 03:31:03 pm »
Have you investigated why your connection appears to have issues? I've never had an issue where I needed to reboot OPNSense or flap WAN so it makes me think something else is the root cause and you're applying a bandaid by having it reboot.
Also, am I understanding correctly that you have OPNSense behind another router?
Logged
Have Answer, Will Blog
le_top
Newbie
Posts: 10
Karma: 0
Re: Monitor WAN connection and recover when defunct (ifup/ifdown - reboot)
«
Reply #2 on:
October 02, 2023, 01:16:27 am »
I've tried to determine why OPNsense stopped connecting and tried to fix it interactively using different methods without success.
When it happened at a bad time (the day after I was on a remote location for a few weeks), I looked into a method to monitor this and reboot if needed - which leaded to the already know solution apparently with a similar undetermined reason for the loss of the network.
Yes, OPNsense is connected to another router which is my internet modem where OPNsense is defined as the DMZ.
OPNsense is on a dedicated machine with two ethernet ports and installed as the native OS (no proxmox nor other virtualisation) on a Core i3-8100 CPU @ 3.60GHz based machine.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
Tutorials and FAQs
»
Monitor WAN connection and recover when defunct (ifup/ifdown - reboot)