1

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.

xren
  • 1,381
  • 5
  • 14
  • 29

1 Answers1

0

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 !

Saad
  • 916
  • 1
  • 15
  • 28
  • I am trying to use your answer to make a connection to PPTP server from my docker container. But, in my case it is a Fortinet firewall I am trying to connect to. However when I call nmcli from the container ``` Error: Could not create NMClient object: Could not connect: No such file or directory. ``` Any clue how we can resolve this? – haxpak Jun 17 '20 at 08:38
  • I don't know much about NMclient, one of my fellow told me that there is something related to dbus. while connecting to docker container. Well I don't have much clue about it – Saad Jun 17 '20 at 20:55