this post was submitted on 20 Jun 2024
25 points (87.9% liked)

Programming

17424 readers
24 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

I'd basically like to run some containers within a VPN and some outside of it. The containers running within the VPN should not be able to send or receive any traffic from outside the VPN (except localhost maybe).

The container could be docker, podman, or even a qemu VM or some other solution if need be.

Is that possible? Dunno if this is the right place to ask.

---Resolution-------

Use https://github.com/qdm12/gluetun folks.

Anti Commercial-AI license

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 16 points 4 months ago (1 children)

Easily doable in docker using the network_mode: "service:VPN_CONTAINER" configuration (assuming your VPN is running as a container)

[โ€“] [email protected] 1 points 4 months ago

That works but sucks when you redeploy the Vpn container iirc. I don't do this anymore.

(Now I just use lxc containers with docker inside, and I'll set the default gateway of the lxc to another lxc that is a gateway for a VPN network)