OpenVPN routing for OpenVZ containers

networkingopenvpnopenvzroutingvirtualization

I am trying to make OpenVPN tunnel accessible for all OVZ CT's running on the host.
I have initialized the tunnel devise on the host server to remote VPN server.
Although I have PING response from the remote tunnel end-point on the host, I do not have it from inside the container.

Can anyone point me on the routing configuration that I need to perform in order to have the remote VPN server accessible from inside the OpenVPN containers ?

Thanks in advance.

Best Answer

Just solved this problem with iptables NAT rule like this:

iptables -t nat -A POSTROUTING -d TARGET_NET/MASK -s CT'S_NET/MASK -j SNAT --to TUN_IP_ADDR
Related Topic