Friday, September 11, 2020

IPTables VPN Redirect Setup

So here's what's going on and I cannot get it to work although in the past I had something very much alike working fine using two iptables rules.

I am connecting to OpenVPN server from windows machine. Lets say that VPN server is: 10.0.8.1 and the windows machine VPN address is 10.0.8.5.

There's another machine I'm trying to forward VPN traffic too on specific port 7575 with WAN IP 216.178.188.258 and end up using 8001 on openvpn connected client (10.0.8.5:8001)

So far I have setup masquerade so tun0 and eth0 can communicate well

my iptable rules would be:

iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 7575 -j DNAT --to-destination 10.0.0.5:8001

This does not work and i get a lot of [TCP Retransmissions] via TShark

Basically I want to forward a vpn connected clients port 8001 to an external WAN ip "216.178..." using different port 7575.

It seems that it can forward to it, but i cannot get any packets in return. Please help!!



No comments:

Post a Comment