LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables twice nating (https://www.linuxquestions.org/questions/linux-networking-3/iptables-twice-nating-347193/)

beno123 07-27-2005 02:41 AM

iptables twice nating
 
Hi,
I would really appreciate some advice on the following. Note that ive had a look at lots of tutorials but when it comes to twin-nating none seem to work for my particular case.
Imagine if you will the following situation

Public address Space

xxxx.xxxx.xxxx.xxxx yyyy.yyyy.yyyy.yyyy
ppp0 ppp0
[network device] [linux border router]
eth1: 172.16.0.4 eth1: 172.16.0.5


DMZ Address space

eth1: 172.16.0.51
[linux dmz / internal router]
eth:0 192.168.1.100

Internal address space

The default route on the on the [linux dmz / internal router] is 172.16.0.4.
In the event that the [network device] fails it would be nice to have traffic come over the [linux border router] without having to make change the default route upon the [linux / internal router].

Is it possible to nat mail for example at the [linux border router] so that the [linux dmz / router] routes packets back through 172.16.0.5 instead of trying to use the default route ?

Here is what Ive tried to no avail upon the [linux border router]

iptables -t nat -A PREROUTING -d yyyy.yyyy.yyyy.yyyy -i ppp0 -p tcp -m tcp --dport 25 -j DNAT --to-destination 172.16.0.51:25

iptables -t nat -A POSTROUTING -s 172.16.0.51/32 -j SNAT -o eth1 --to-source yyyy.yyyy.yyyy.yyyy

iptables -A FORWARD -p tcp -i ppp0 -o eth1 -d 172.16.0.51 -m multiport --dport 25 --sport 1024:65535 -m state --state NEW -j ACCEPT

Any ideas corrections etc would be greatly appreciated


All times are GMT -5. The time now is 10:44 AM.