adamwalach / openvpn-web-ui

Web interface (with golang backend) for monitoring and administration of OpenVPN server
MIT License
674 stars 276 forks source link

Masquerade is required inside openvpn container #27

Open patachi opened 4 years ago

patachi commented 4 years ago

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