Order of rules when NAT'ing.
Sun, 30 Apr 2000 00:38:58 -0500
> Question following might be considered stupid, but here goes:
> When making up a POSTROUTING NAT table, is the order of the rules vital?
> iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j SNAT --to
> iptables -t nat -A POSTROUTING -s 192.168.2.10 -o eth0 -d 18.104.22.168 -j
> SNAT --to 22.214.171.124
> In the case above, what will packages going from 192.168.2.10 to 126.96.36.199
> end up beeing SNAT'ed to?
> Thanks in advance!
> Sture Lygren
I'm no expert on this, but according to the Linux 2.4 NAT HOWTO
Section 5), "...each rule is examined in order until one matches."
So the order is vital and I would expect your packet to match the
first rule and get SNAT'ed to 188.8.131.52.
Home email: firstname.lastname@example.org
Work email: email@example.com
Home page: www.topher.net/~scottygamm