[GH-ISSUE #27] Masquerade is required inside openvpn container #23

Open
opened 2026-02-25 20:30:18 +03:00 by kerem · 0 comments
Owner

Originally created by @patachi on GitHub (May 25, 2020).
Original GitHub issue: https://github.com/adamwalach/openvpn-web-ui/issues/27

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

Originally created by @patachi on GitHub (May 25, 2020). Original GitHub issue: https://github.com/adamwalach/openvpn-web-ui/issues/27 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`
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/openvpn-web-ui#23
No description provided.