2

The router is forwarding all traffic from an IP range, that goes towards outside the local network, to this host (that is intended to be a VPN concentrator). Using tcpdump on the host verifies this.

The host has an OpenVPN VPN tunnel established, named tun0. We can access the Internet through it, so the default route is properly working.

Now, we've enabled both net.ipv4.ip_forward and net.ipv4.conf.all.forwarding using sysctl, and added the corresponding iptables rules to allow traffic to be forwarded and NAT'd:

iptables -A POSTROUTING -o tun0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o tun0 -m conntrack --ctstate NEW -j ACCEPT

But traffic is still not being forwarded to tun0 (as checked with tcpdump).

Any idea as to what could be going wrong, or what could we be missing?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.