I would like to redirect all traffic (specifically TCP & UDP) from multiple WAN interfaces (ppp0, ppp1, ppp2) to a single IP from eth0.
When it comes to interface to IP, I can use the PREROUTING and POSTROUTING and change the destination and source IP accordingly.
But in that case (with multiple interfaces), how can I tell which IP to use as source-IP in POSTROUTING?
So IPs of ppp0-ppp3 are changing, and eth0 remains "192.168.1.5".
I would like to forward traffic to IP: "192.168.1.10".
For example (for TCP only), I would direct incoming connections to eth0 using:
iptables -t nat -A PREROUTING -p tcp --dport 5000 -j DNAT --to-destination 192.168.1.10:5000
iptables -t nat -A POSTROUTING -p tcp -d 192.168.1.10 --dport 5000 -j SNAT --to-source 192.168.1.5`
But with multiple interfaces (IPs) I don't know how to set the POSTROUTING rule to the source remains the same?
So question is - am I supposed to use iptables techniques to "save" that IP and than use it as source, or there's another way for doing that?
I found a link that looks like what I need, but I can't figure out how to implement it: http://www.tldp.org/HOWTO/IP-Masquerade-HOWTO/multiple-ips.html.
Bottom line, I need "DMZ" from multiple interfaces to a single IP.