Docker Community Forums

Share and learn in the Docker community.

Docker and Openvpn client breaking port mapping except to localhost


(Egandt) #1

So basically I have a server running on port 8890, and this works fine I have it mapped to all addresses, using “-p 8890:8890”.
The problem occurs when I run the OpenVPN client since I want all out going connections for this server to use the the VPN. OpenVPN connects fine and operates as expected once I added: --privileged, however once started I can only access the mapped port on 127.0.0.1 and no longer on any of the other addresses.
When I stop OpenVPN it works again, so I’m assuming it is related to routing changes made by OpenVPN, but I’m unsure where to begin, to resolve this.

Without OpenVPN:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
172.17.0.0 * 255.255.0.0 U 0 0 0 eth0

With OpenVPN:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.70.10.5 128.0.0.0 UG 0 0 0 tun0
default 172.17.0.1 0.0.0.0 UG 0 0 0 eth0
10.70.10.1 10.70.10.5 255.255.255.255 UGH 0 0 0 tun0
10.70.10.5 * 255.255.255.255 UH 0 0 0 tun0
XXX.XXX.XXX.XXX 172.17.0.1 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.70.10.5 128.0.0.0 UG 0 0 0 tun0
172.17.0.0 * 255.255.0.0 U 0 0 0 eth0

Any suggestions?

Thanks,
ERIC