Login
You're viewing the ruby.social public feed.
  • Nov 25, 2026, 11:08 PM

    Ok, upon testing, my overcomplicated dynamic backup routing construct totally doesn't work in practice.

    Should kind of have expected that, as I know that stateful firewalling and dynamic routing don't mix well.

    Need to rethink this setup from scratch....

    💬 1🔄 0⭐ 0

Replies

  • Nov 26, 2026, 11:35 PM

    Ok, ditched all the dynamic routing and switched to a more classic setup with gateway monitoring and policy routing with gateway groups as destination.

    This almost worked, except return traffic for connections coming in via the wireguard tunnel on my inner firewall went back out to the wrong interface, instead of sticking to the stateful rule that passed it in.

    Turns out OPNsense has a default advanced setting that disables the reply-to flag for rules on WAN interfaces ("Disable reply-to", apparently including tunnels). There's an override in individual rules, but it doesn' allow selecting a gateway group, so I guess my only choice is changing the global setting...

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 11:39 PM

    ...my first workaround was to just stick a stateless outbound rule on the WAN interface that forces any relevant packets trying to go into that direction back into the wireguard tunnel.

    Did the job too, but I really expected any stateful rule to also fetch return traffic until I found that option in the firewall advanced settings.

    💬 1🔄 0⭐ 0
  • Nov 26, 2026, 11:45 PM

    Now to remove all the disabled BGP configuration and test if failover is actually working with this setup... That's a job for a different night though.

    💬 1🔄 0⭐ 0
  • Nov 27, 2026, 12:18 AM

    Uh. Looking at the pf rules that have been generated, OPNsense does not set a reply-to in general when the source is an interface group 🙄 Shouldn't come as much of a surprise as the UI doesn't have that option either.

    So next try: Split off the current rule that passes traffic in from the tunnels into two new rules that are explicitly bound to one of the wireguard interfaces and have a reply-to accordingly.

    💬 1🔄 0⭐ 0
  • Nov 27, 2026, 11:03 AM

    Excellent. Missed one overlapping rule last night and everything was broken, dropping incoming TCP sessions after 20 seconds or so. Didn't affect ICMP...

    This still needs some more work apparently.

    💬 1🔄 0⭐ 0
  • Nov 27, 2026, 11:14 AM

    Been pondering if it is possible to go in a different direction and rework this particular part of the ruleset with fully stateless rules that just push individual packets towards the tunnel gateway group, so I have the state table out of play for policy routing.

    Need to look at how exactly the packet flow through pf looks like, again...

    💬 0🔄 0⭐ 0