Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Reset/Invalidate DHCP on interfaces when their gateways go down
« previous
next »
Print
Pages: [
1
]
Author
Topic: Reset/Invalidate DHCP on interfaces when their gateways go down (Read 1935 times)
drivera
Jr. Member
Posts: 80
Karma: 0
Reset/Invalidate DHCP on interfaces when their gateways go down
«
on:
September 01, 2019, 11:59:19 pm »
Hi!
In my multi-WAN setup, I have my gateways configured such that their monitoring IP is a well-known, "always up", pingable IP on the general internet. This is important because occasionally the ISPs will have a link be up, but with no internet connectivity. Thus, monitoring an "internet" address helps me cover for that case and apply failover even though the link appears to be up.
However, I've also found that they have another issue wherein when there's a connectivity hiccup - usually due to a short power outage (< 1 min) - the connection will seem to be up, but connectivity won't be restored. This seems to be an issue with the CableModem/ISP connection itself since OPNSense is correctly detecting the lack of connectivity and refuses to fail-back to the primary.
The scenario is this:
Short power outage (< 1 min), causing connectivity over the primary circuit to disappear
Failover happens correctly to the secondary circuit
Power returns
The IP address/etc is still valid on the primary interface, but connectivity is still borked (OPNSense remains in "failed" state, correctly routing over the secondary circuit)
I manually cause a link restart on the primary circuit by power-cycling the cable modem, and everything returns to normal (fail-back to primary, etc)
The question I have regarding all the above is this: is there a way that I could somehow attach a custom script that is executed when a gateway is marked as "DOWN"? i.e. "when this interface's gateway is marked as down, flush the DHCP lease and leave it unconfigured until it comes back up on its own"
The alternative is for me to buy a USB- or Network-controllable power strip - IOT style - and through that custom script, trigger a power cycle of the Cable Modem, which ideally results in fixing everything up.
So...Thoughts? Ideas?
Logged
drivera
Jr. Member
Posts: 80
Karma: 0
[SOLVED] Reset/Invalidate DHCP on interfaces when their gateways go down
«
Reply #1 on:
September 02, 2019, 02:10:30 am »
Found (I think) my solution via
/usr/local/etc/rc.syshook monitor
.
I'll play around with that and maybe I'll be able to figure out an easy way to fire off a DHCP release/renew for the "failed" interface.
The only question I have is how to preserve it in a backup other than manually. But that's small potatoes by comparison
Cheers!
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Reset/Invalidate DHCP on interfaces when their gateways go down