2
I have a OpenVPN server running in a LAN (locally addressable at 192.168.1.12) and I'd like to forward requests to it from other devices on the LAN, over just port 3000, to one of the VPN clients. (10.8.0.6)
My end result is for 192.168.x.x devices to be able to reach a web server via typing 192.168.1.12:3000 into a browser, but actually be communicating with 10.8.0.6:3000.
ip forwarding is enabled on the vpn server.
(these modified attempts from other questions don't seem to work)
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 3000 -j DNAT --to-destination 10.8.0.6:3000
iptables -A FORWARD -p tcp -d 10.8.0.6 --dport 3000 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
Thanks, this is an interesting solution but not the route I'm going for, as it doesn't solve the problem for mobile clients. – Joe – 2016-06-25T21:25:28.430