Hacker News new | ask | show | jobs
by ikeboy 2383 days ago
Is there a simple way to tunnel specific apps only through wireguard?
4 comments

WG exposes a point to point / l3 network interface like any other to userspace, so an answer would not be specific to wireguard but about networking and routing in general.

Network Namespaces and VRFs are the correct way to approach this I think: https://www.kernel.org/doc/Documentation/networking/vrf.txt

On linux you’d probably want to use network namespaces to accomplish this, there’s an example at https://www.wireguard.com/netns/
You can choose to only have certain IP address ranges accessible through Wireguard, it also creates a wg0 interface that you should be able to bind software to: https://superuser.com/questions/241178/how-to-use-different-...
Should be possible to accomplish something like this using namespaces, under Linux.