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 (18.104.22.168).
eth1: local network
ppp0: vpn service
local network: 10.10.1.0/24
forwarding ip: 22.214.171.124
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 126.96.36.199:12345 iptables -A FORWARD -p tcp -o ppp0 -d 188.8.131.52 --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.