multiple docker run pptp client on same host

2.4k views Asked by At

I setup docker with pptp client to connect to pptp server followed by http://cyan.ly/blog/multiple-vpn-docker-2015

However, when I try to run more than one docker container, I got pptp failed. Only one docker container can connect to pptp server. It seems they cannot share the same device ?

Any help would be appreciated.

1

There are 1 answers

2
Saad On

Point-to-Point Tunneling Protocol (PPTP) traffic is uniquely identified by a source IP address and a Call ID field in the GRE header. When multiple clients connect to the same VPN endpoint behind a common Network Address Translation (NAT), they all have the same source IP address. Because the different VPN clients are unaware of each other, they might choose the same Call ID field, which prohibits multiple connections because the VPN endpoint has no way to differentiate between the various connections.

When i was running my Docker Container using the parameter --net=host, only one container was getting connected

docker run -it --net=bridge --cap-add=NET_ADMIN --device=/dev/ppp --privileged -v /dev:/dev -v /lib/modules:/lib/modules 1368917489 /bin/bash

But after seeing it closely, i came to a conclusion that one should run the container with paramter --net=bridge

Basically, when we are running the containers with network settings bridge, then it will get IP Address directly from DHCP, which will resolve our issue. Try this and you can make hundreds of connection using Docker containers !