All of lore.kernel.org
 help / color / mirror / Atom feed
* nftables: masquerading not applied consistently
@ 2020-07-07 22:38 Thilo-Alexander Ginkel
  2020-07-07 23:10 ` Florian Westphal
  0 siblings, 1 reply; 5+ messages in thread
From: Thilo-Alexander Ginkel @ 2020-07-07 22:38 UTC (permalink / raw)
  To: netfilter

Hello everyone,

I have a somewhat complex VPN setup involving a Ubuntu-based VPN
gateway ("vpn-gw") that terminates multiple VPNs based on WireGuard
and OpenVPN. Also involved is a core router ("gw01") that performs
routing among different VLANs comprising the LAN. One of the OpenVPN
interfaces ("tun252")  requires masquerading, which I implemented
through the following nftables config snippet:

table ip nat {
    chain postrouting {
        type nat hook postrouting priority 100; policy accept

        [...]
        oifname "tun252" counter masquerade
    }
}

This works fine if traffic originates on the LAN. Things start acting
weird (i.e., no masquerading is applied when the traffic is forwarded
to tun252) when the traffic originates on one of the WireGuard
interfaces. The path of the packets in this case is: vpn-gw[wireguard]
-> vpn-gw[eth0.250] -> gw01[eth0.250] ->  gw01[eth0.252] ->
vpn-gw[eth0.252] -> vpn-gw[tun252]

In contrast, traffic that takes the following course is masqueraded
correctly: gw01[eth0.10] ->  gw01[eth0.252] -> vpn-gw[eth0.252] ->
vpn-gw[tun252]

Any idea what may be causing this and how to fix this?

Thanks,
Thilo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-07-08 11:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-07 22:38 nftables: masquerading not applied consistently Thilo-Alexander Ginkel
2020-07-07 23:10 ` Florian Westphal
2020-07-08  7:28   ` Thilo-Alexander Ginkel
2020-07-08 10:32     ` Reindl Harald
2020-07-08 11:40       ` Thilo-Alexander Ginkel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.