Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running multiple transmission containers with different VPNs on same host #538

Closed
Troubadoure opened this issue Jun 20, 2018 · 2 comments
Closed

Comments

@Troubadoure
Copy link
Contributor

Is it possible to run multiple containers using different VPN connections on the same host?

I've tried to do it but had no joy. I think they're using the same tun device and as such the VPN conflicts with each other. Would this be something that is possible or not at all?

@Shinoby1992
Copy link

Shinoby1992 commented Jun 23, 2018

i could without problems run multiple vpn on host, i had to because i can't get it working to use more than 51 containers through one vpn.

just change the port for every vpn you create (example down)
and then run your container with
--net=container:vpn1 and the other one with --net=container:vpn2

sudo docker run --cap-add=NET_ADMIN --device=/dev/net/tun -ti \
              --name vpn1 \
              --sysctl net.ipv6.conf.all.disable_ipv6=0  \
              -e OPENVPN_PROVIDER=yourprovidor \
              -e OPENVPN_CONFIG=country \
              -e OPENVPN_USERNAME=username \
              -e OPENVPN_PASSWORD=password \
              -e OPENVPN_OPTS="--inactive 3600 --ping 10 --ping-exit 60" \
              -e LOCAL_NETWORK=10.0.0.0/24 \
              -e WEBPROXY_ENABLED=true \
              -e ENABLE_UFW=true \
              --log-driver json-file \
              --log-opt max-size=10m \
              -p 9091:9091 \
              -e UFW_EXTRA_PORTS=5800 \
              -p 5800:5800 \
              --restart=always \
              haugene/transmission-openvpn
sudo docker run --cap-add=NET_ADMIN --device=/dev/net/tun -ti \
              --name vpn2 \
              --sysctl net.ipv6.conf.all.disable_ipv6=0  \
              -e OPENVPN_PROVIDER=yourprovidor2 \
              -e OPENVPN_CONFIG=country2 \
              -e OPENVPN_USERNAME=username2 \
              -e OPENVPN_PASSWORD=password2 \
              -e OPENVPN_OPTS="--inactive 3600 --ping 10 --ping-exit 60" \
              -e LOCAL_NETWORK=10.0.0.0/24 \
              -e WEBPROXY_ENABLED=true \
              -e ENABLE_UFW=true \
              --log-driver json-file \
              --log-opt max-size=10m \
              -p 9092:9091 \
              -e UFW_EXTRA_PORTS=5800 \
              -p 5800:5800 \
              --restart=always \
              haugene/transmission-openvpn

@haugene
Copy link
Owner

haugene commented Mar 17, 2019

Merged a feature to the dev branch that creates the TUN device automatically inside the container so it doesn't need to be mounted from the host. Then at least it should be no problem. It seems to be working really well so it will become the new default behaviour and released to master soon.

Closing this.

@haugene haugene closed this as completed Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants