Linux Netfilter discussions
 help / color / mirror / Atom feed
* SNAT matching question
@ 2002-09-29 13:30 Mohan Khurana
  2002-09-30  8:27 ` Nobody can help me ??? :( Hanz F.
  0 siblings, 1 reply; 7+ messages in thread
From: Mohan Khurana @ 2002-09-29 13:30 UTC (permalink / raw)
  To: netfilter

Hi everyone,

I'm trying to make a dual-homed router right now.

I'm wondering, if I add two SNAT entries to the POSTROUTING chain of the
nat table, that are completely identical except the the fact that they
have different values for their specification of --to-source, will both of
them get the opportunity to match?  What decides which one matches them?

I am wondering, if packets come in, and I route them, and ensure that
their next-hop is one of the --to-sources, will the rule check both the
source range, and the value of the --to-source?

Example:

iptables -t nat -A POSTROUTING -s 192.168.2.10 -d \! 192.168.2.0/24 -j
SNAT --to-source 1.2.3.4
iptables -t nat -A POSTROUTING -s 192.168.2.10 -d \! 192.168.2.0/24 -j
SNAT --to-source 5.6.7.8

If in my iproute2 configuration, if I ensure that the packet is going out
with source 5.6.7.8 when flowing around, it should match to the second
rule, and skip the first altogether, right?  If I set it to hop to source
1.2.3.4, it should choose the first nat rule, and then skip the second one
altogether, right?

thanks much,

mohan






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-09-30 16:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1864EE7E43ED511AFCB00105ADCEC2604A997@IP_NTS02>
2002-09-30 14:52 ` Nobody can help me ??? :( Hanz F.
2002-09-29 13:30 SNAT matching question Mohan Khurana
2002-09-30  8:27 ` Nobody can help me ??? :( Hanz F.
2002-09-30  8:49   ` Nick
2002-09-30  9:30   ` Gaël Le Mignot
2002-09-30 15:01     ` Hanz F.
2002-09-30 16:53       ` Gaël Le Mignot
2002-09-30  9:54   ` Michael

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox