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

  • Adam@doomscroll.n8e.dev
    link
    fedilink
    English
    arrow-up
    15
    ·
    5 months ago

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

    • PlexSheep@infosec.pub
      link
      fedilink
      arrow-up
      1
      ·
      5 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)