Skip to main content


Does anyone happen to know if there's a way to configure a #WireGuard #VPN to only handle #UDP traffic, leaving #TCP traffic to run over the regular network?
#AskFedi
in reply to Jonathan Lamothe

I don't think Wireguard per se handles this.

One way to handle this is to use 'ip rule' to mark the traffic to belong to a specific table (called a vrf), and then set up 'ip route' commands to send that traffic to your wireguard interface.

You need to be careful with asymmetric routing. If you are using NAT outbound anyway (because you run RFC 1918 networks inside your network) then it gets easier as you apply source NAT on the correct interface.

See also: https://serverfault.com/questions/345111/iptables-target-to-route-packet-to-specific-interface

in reply to Jonathan Lamothe

Most probably, that won't work, because wireguard does routing, and routing is IP, layer 3, while TCP/UDP is on layer 4.
You may have a look at policy based routing, though.
in reply to Rainer "diasp​.org" Sokoll ✅

@Rainer "diasp​.org" Sokoll ✅ Yeah, that's the conclusion I later came to unfortunately. There will be a more detailed blog post detailing the problem coming soon (along with any solution I may find).
in reply to Jonathan Lamothe

Hello there,

There will be a more detailed blog post detailing the problem coming soon (along with any solution I may find).


If you already blog post, could you share a link ?
Thank you !

in reply to ♻ Citoyen Candide ☮

@♻ Citoyen Candide ☮ Yeah, I wasn't able to find a solution to this particular problem. I solved it in a completely different way that didn't require the port forwarding at all.

This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.