Setting the default route option (redirect-gateway def1) in client-side to redirect all traffic over the VPN it stays connected but nothing passes through even simple ping request.
And it fixed by adding masquerade rule inside openvpn container
docker exec -it openvpn /bin/bashiptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADEiptables -t nat -A POSTROUTING -s 172.16.0.0/12 -j MASQUERADEiptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j MASQUERADE
Setting the default route option (
redirect-gateway def1
) in client-side to redirect all traffic over the VPN it stays connected but nothing passes through even simple ping request.And it fixed by adding masquerade rule inside openvpn container
docker exec -it openvpn /bin/bash
iptables -t nat -A POSTROUTING -s 10.0.0.0/8 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 172.16.0.0/12 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -j MASQUERADE