All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: SNAT in OUTPUT chain of the nat table question?
  2003-01-09  0:37 SNAT in OUTPUT chain of the nat table question? bauer
@ 2003-01-08 17:11 ` Ranjeet Shetye
  2003-01-09  1:29 ` Athan
  2003-01-09  2:36 ` Joel Newkirk
  2 siblings, 0 replies; 4+ messages in thread
From: Ranjeet Shetye @ 2003-01-08 17:11 UTC (permalink / raw)
  To: netfilter


On Thu, 2003-01-09 at 01:37, bauer@mit.edu wrote:
> Is there a good reason that I am unable to conceive of at the 
> moment why SNAT is not a valid target in the OUTPUT chain of the
> nat table? 
> 
> Thanks,
> Steve 
> 
> 

The OUTPUT chain is only for outgoing packets from the linux box itself.

The POSTROUTING chain is the one that contains all packets being
routed/forwarded.

-- 
Ranjeet Shetye
Senior Software Engineer
Zultys Technologies
Ranjeet dot Shetye2 at Zultys dot com
http://www.zultys.com/



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

* SNAT in OUTPUT chain of the nat table question?
@ 2003-01-09  0:37 bauer
  2003-01-08 17:11 ` Ranjeet Shetye
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bauer @ 2003-01-09  0:37 UTC (permalink / raw)
  To: netfilter

Is there a good reason that I am unable to conceive of at the 
moment why SNAT is not a valid target in the OUTPUT chain of the
nat table? 

Thanks,
Steve 



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

* Re: SNAT in OUTPUT chain of the nat table question?
  2003-01-09  0:37 SNAT in OUTPUT chain of the nat table question? bauer
  2003-01-08 17:11 ` Ranjeet Shetye
@ 2003-01-09  1:29 ` Athan
  2003-01-09  2:36 ` Joel Newkirk
  2 siblings, 0 replies; 4+ messages in thread
From: Athan @ 2003-01-09  1:29 UTC (permalink / raw)
  To: bauer; +Cc: netfilter

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

On Wed, Jan 08, 2003 at 07:37:21PM -0500, bauer@mit.edu wrote:
> Is there a good reason that I am unable to conceive of at the 
> moment why SNAT is not a valid target in the OUTPUT chain of the
> nat table? 

  From 'man iptables':

   SNAT
       This  target  is  only  valid  in  the  nat  table, in the
       POSTROUTING chain.  It specifies that the  source  address

SNAT gets done just as packets go out, hence only in the POSTROUTING
chain as you only know where they're going by then.

-Ath
-- 
- Athanasius = Athanasius(at)miggy.org / http://www.miggy.org/
                  Finger athan(at)fysh.org for PGP key
	   "And it's me who is my enemy. Me who beats me up.
Me who makes the monsters. Me who strips my confidence." Paula Cole - ME

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

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

* Re: SNAT in OUTPUT chain of the nat table question?
  2003-01-09  0:37 SNAT in OUTPUT chain of the nat table question? bauer
  2003-01-08 17:11 ` Ranjeet Shetye
  2003-01-09  1:29 ` Athan
@ 2003-01-09  2:36 ` Joel Newkirk
  2 siblings, 0 replies; 4+ messages in thread
From: Joel Newkirk @ 2003-01-09  2:36 UTC (permalink / raw)
  To: bauer, netfilter

On Wednesday 08 January 2003 07:37 pm, bauer@mit.edu wrote:
> Is there a good reason that I am unable to conceive of at the
> moment why SNAT is not a valid target in the OUTPUT chain of the
> nat table?

Turn this around somewhat.  Can you present a case where SNAT would need 
to be done in the nat OUTPUT chain, that could not also be performed in 
the nat POSTROUTING chain achieving the same effect?  Even if you're 
going to localhost, packets don't go from OUTPUT straight to INPUT.

That said, connections originating on the local box addressed to any IP 
of the box itself do NOT appear in the nat-PREROUTING chain. (If you try 
to DNAT in PREROUTING it still comes back in INPUT instead of 
forwarding) Obviously this is a case where DNAT would be required in nat 
OUTPUT, where it is in fact a valid target.  This is the only way to 
DNAT a connection from the box to itself and send it elsewhere.

> Thanks,
> Steve

j

(stealing someone else's apropos sig, I believe Antony Stone's :^)
--
Perfection in design is achieved not when there is nothing left to add, 
but rather when there is nothing left to take away.

 - Antoine de Saint-Exupery



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

end of thread, other threads:[~2003-01-09  2:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-09  0:37 SNAT in OUTPUT chain of the nat table question? bauer
2003-01-08 17:11 ` Ranjeet Shetye
2003-01-09  1:29 ` Athan
2003-01-09  2:36 ` Joel Newkirk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.