-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gateway-group bound state flushing on failback #3516
Comments
|
The problem is that OPN/pf keeps track of SIP and since T2 is still up when moving to T1 again, SIP packets are still sent over T2 while connection-less RTP runs over T1. |
|
Yes, that’s the “problem” exactly.
Is there a way to match the state to the rule that passed it?
Because then the dynamic state reset could be matched to the gateway group.
It would be great if this can somehow be made dependent on a rule, because it’s very intrusive and only appropriate in a select few cases.
I will tinker a bit later with pfctl because I’m not really familiar with it.
As a side note, do you think that a stateless gateway rule would provide an adequate workaround or will there be other unforeseen issues?
|
|
With the new rule logic planned for 19.7 it should be possible to kill on a per rule bases, since we use the label field as a unique rule hash (previously the description was put there). |
|
This issue has been automatically timed-out (after 180 days of inactivity). For more information about the policies for this repository, If someone wants to step up and work on this issue, |
|
Just adding this here, for anyone else that stumbles across it, as the opnsense forum post appears to have been archived - I hacked a script from something I found on the pfsense forum, that does the same. My WAN interface is lagg0_vlan18, the script checks the default route interface, then if it's set to WAN it reset the mobile data states. My Opnsense connects to a 4G/Mobile router over 192.168.54.0/24. Uses 'pfctl -k' to only kill states for 192.168.54.102 (the NAT IP on Opnsense that goes over 4G). Runs from cron every minute, causes my L2TP (UDP) tunnels to then fail back/reconnect on the active connection..... rather than remaining on 4G. As I have gateway monitoring enabled, which causes 1 ICMP session, mobile states have to be greater than 1 (to allow for this) before it does any state flushing.
EDIT: This also requires gateway switching to be enabled, so that the default route/interface changes. |
|
Is it possible to get this added into as a default option for cron with some variable? |
Yeah, but cron is not really suitable for this sort of thing. Better hook into something so what you're doing only gets executed when necessary. I just wrote this because Create This hooks into I would very much like to see a proper version of this implemented in OPNsense at some point :) Cheers! |
|
@haarp What happens if there is not a new WAN IP though? Does the IP have to actually change for this to be executed? For example, the primary link suffers from packet loss, fails over to the secondary, but the IP does not change on the primary - sessions/states could still end up on and remain on the secondary? EDIT: So I disabled my Primary gateway in the opnsense UI as a test, failed over to secondary, all tunnels etc failed over nicely. Re-enable the Primary gateway, traffic fails back - most of it. I can see that /usr/local/etc/rc.newwanip is executed from the logs, but I don't see the 'Primary WAN' log_error so I assume it has not run? ... and I end up with sessions/states still on the secondary. EDIT 2: Ah, I think the 'rc.newwanip' I see in the logs, post failover/failback, relates to my L2TP tunnel, not the Primary/Secondary WAN. EDIT 3: Tried shutting down the switch port to the cable modem for the Primary WAN, all fails over and back. But it does not seem to run when the primary WAN is re-established, if the IP does not/has not changed. I think the trigger needs to be the default route change, as opposed to newwanip - is that possible some how? |
|
@iMiMx |
When using a failover gateway group (Tier1/2) for VoiP,
there is a situation where SIP and RTP can be split across tiers, resulting in
VoiP becoming unavailable.
Scenario:
Tier1 UP; Tier2 UP
SIP and RTP are over Tier1, everything works well
Tier1 DOWN (fails); Tier2 UP
SIP and RTP are over Tier2, everything works well
Tier1 UP; Tier2 UP
SIP remains over Tier2, (new) RTP goes out via Tier1.
VoiP remains broken until manual state flush or forcing manual re-registration
Tier1 UP; Tier2 DOWN (fails)
SIP and RTP are over Tier1, everything works well
Registration now is forced to reoccur via Tier1
Basically, when the registration occurs via tier 2, and tier 1 comes back online, the registration stays on tier 2.
This results in the RTP data going out over tier 1 and hence being in a split state, ruining the system.
The ideal solution would be if the gateway group contained a feature
"Flush states for this GW group on failback"
This would allow for:
on the backup
I'd be willing to poke around for implementation given some pointers.
The text was updated successfully, but these errors were encountered: