26

I honestly can't get my head around this. I have a machine with Linux (endeavouros), and docker with a few containers. Since I want all the traffic from this system to go through the VPN, do I need to set up gluetun? I think not, but I am not 100% sure...

you are viewing a single comment's thread
view the rest of the comments
[-] TCB13@lemmy.world 2 points 2 months ago* (last edited 2 months ago)

but without nix it’s a pita to maintain through restores/rebuilds.

No it isn't. You can even define those routing polices in your systemd network unit alongside the network interface config and it will manage it all for you.

If you aren't comfortable with systemd, you can also use simple "ip" and "route" commands to accomplish that, add everything to a startup script and done.

major benefit to using a contained VPN or gluetun is that you can be selective on what apps use the VPN.

Systemd can do that for you as well, you can tell that a certain service only has access to the wg network interface while others can use eth0 or wtv.

More classic ip/route can also be used for that, you can create a routing table for programs that you want to force to be on the VPN and other for the ones you want to use your LAN directly. Set those to bind to the respective interface and the routing tables will take place and send the traffic to the right place.

You're using docker or similar, to make things simpler you can also create a network bridge for containers that you want to restrict to the VPN and another for everything else. Then you set the container to use one or the other bridge.

There are multiple ways to get this done, throwing more containers, like gluetun and dragging xyz dependencies and opinionated configurations from somewhere isn't the only one, nor the most performant for sure. Linux is designed to handle this cases.

[-] Chewy7324@discuss.tchncs.de 1 points 2 months ago* (last edited 2 months ago)

Yes, there's many ways to make programs unable to use other network interfaces. E.g. I'm creating a network namespace with a single wg0 interface, which I make services use through systemd NetworkNamespacePath.

That said, I'd argue gluetun is pretty much foolproof, especially with most people using docker which messes with iptables (edit: although I don't know if this'd be an issue for this use case).

this post was submitted on 20 Sep 2024
26 points (93.3% liked)

Selfhosted

40347 readers
365 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS