So I have a VPN on ppp0 and I setup so I can use either ppp0 or eth1 to connect out with the default route being eth1.
Both reply to "ping google.com" (uses eth1) and "ping -I ppp0 google.com" (uses VPN)
Goal: If I connect to eth1 on port 12345 it will forward out ppp0 to a specific ip address (126.96.36.199).
eth1: local network
ppp0: vpn service
local network: 10.10.1.0/24
forwarding ip: 188.8.131.52
ports can be different the same doesnt matter, if it works :)
iptables -t nat -A PREROUTING -p tcp -i eth1 -d 10.10.1.0/24 --dport 12345 -j DNAT --to-destination 184.108.40.206:12345 iptables -A FORWARD -p tcp -o ppp0 -d 220.127.116.11 --dport 12345 -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
After searching this is what most people say. Use the PREROUTE to set new destination. Then forward out ppp0. But its not working and I don't know how to actually see what its doing.