Ubuntu – Docker container can not access hosts behind VPN

dockerikev2strongswanUbuntuvpn

I have a VPN gateway which allows remote access to a network with subnet 171.30.0.0/16.

I have a local machine setup with ubuntu 14.04 and strongswan which connects to that VPN server using IKEv2 RSA and while connected, I'm successfully able to ping all the hosts behind my VPN (say for example 171.30.0.200) from my ubuntu machine. VPN server assigns IPs out of virtual IP range 192.168.40.0/24 to clients. Lets say my ubuntu machine receives IP 192.168.41.1 when connected.

http://postimg.org/image/gad07tmez/

on this ubuntu machine I have docker installed and from inside one of docker images I have to access one of the machines behind VPN (171.30.0.200). I can not ping that server from inside docker container, even though pinging is successful from docker host (which is ubuntu machine). It is also interesting to know that pinging 192.168.41.1 is successful from inside docker container.

any idea what cloud the problem be?

Best Answer

so it seemed that the problem was not route tables or so on, but the strongswan configuration on both client and server. I set all the left and right subnets on both client and server config to right values and also the left and right firewalls to true and restarted both side and since then it it working. I can ping from anywhere the other side of network.