[Solved] Port forwarding (OpenVPN)

Hello, I can't handle it anymore... after day wasted on trying....
My setup is
VPS with Debian and OpenVPN server (eth0 -, tun0 ----> OpenWRT router which works as OpenVPN client (tun0-00 ----> my local PC (
I need somehow forward and open all route (port 8999) from VPS over OpenWRT router and then into my local pc.
I have no deeper understanding of iptables... but I have to use them... please help me because I'm starting to freaking out :smile:

Although this problem is not exactly connected to OpenWrt, you need to add a static route on VPS for via (if you haven't already)

ip route add via dev tun0

Then add a DNAT rule
iptables -t nat -A PREROUTING -p tcp -d --dport 8999 -j DNAT --to-destination

That will work if you are not doing NAT on the vpn interface on the OpneWrt. If you are, then you don't need the static route, you do the DNAT to and on OpenWrt another DNAT to

1 Like

Thanks you my saviour many many thanks.
I'm doing NAT and thanks to you its all works fine
Thanks thanks thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.