|
|
Log in / Subscribe / Register

Identity management for WireGuard

Identity management for WireGuard

Posted Oct 19, 2022 10:43 UTC (Wed) by grawity (subscriber, #80596)
In reply to: Identity management for WireGuard by leromarinvit
Parent article: Identity management for WireGuard

IMO, the big problem with IKE/ESP isn't that it's complex, necessarily (IKEv2 is quite ok), but that its main implementations rely heavily on the kernel's "transform" framework instead of providing a route-based interface (like tun0 or wg0) and that makes everything look so much more complex.

Xfrm makes a lot of sense for *transport* IPsec associations, where no virtual IPs are involved, but instead the traffic between hosts' real IPs gets ~magically~ transformed into encrypted packets (or has an AH header stuck onto it). For example, between a bunch of servers spread around the net.

But once you start building tunnels through xfrm API, things get really weird. You have to assign virtual IPs to the physical eth0, move them as the default gateway changes, etc. IPsec VPN clients like StrongSwan really ought to default to creating an ipsec0 interface for that (which it *can* do now, using xfrmi interfaces).


to post comments

Identity management for WireGuard

Posted Oct 19, 2022 15:29 UTC (Wed) by patrakov (subscriber, #97174) [Link]

Even with the xfrm interfaces (what they call a route-based VPN), there is a gotcha. Let's say that there is a firewall that applies packet marks, and a complex routing setup that uses these firewall marks for routing decisions.

Let's talk about an incoming packet on port 4500/udp. It traverses through the firewall, and gets its packet mark applied. Then the kernel decrypts it. The resulting packet traverses again through the firewall, but it inherits the mark of the original IPSEC packet.

Some firewall rulesets for policy routing (e.g. mwan3) clearly do not expect this, because "non-zero packet mark in the PREROUTING chain on the mangle table at the very beginning" just cannot happen with classical non-VPN interfaces or with userspace solutions like OpenVPN. Already reported as a bug in mwan3, see https://github.com/openwrt/packages/issues/19607.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds