Linux Netfilter discussions
 help / color / mirror / Atom feed
* Filtering in the nat table - opinions wanted
@ 2003-03-24 18:20 Aldo Lagana
  2003-03-24 19:32 ` Kim Jensen
  2003-03-24 22:09 ` Joel Newkirk
  0 siblings, 2 replies; 3+ messages in thread
From: Aldo Lagana @ 2003-03-24 18:20 UTC (permalink / raw)
  To: netfilter

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

by default I set the nat chains (PREROUTING POSTROUTING, etc) to ACCEPT.  first off is this bad?

For my web & mail servers using DNAT, I need to add rules - and I do.  Same w/ SNAT rules...

The problem has come up with our mail server - we were getting spam from one IP address - since my DNAT rule was ACCEPT and forward, the mail server kept getting these spam messages.  I stopped the SPAM by adding a rule to the beginning of PREROUTING to DROP packets from that address.

This made me start thinking - am I doing it right by having all the nat chains default ACCEPT?

aldo




[-- Attachment #2: Type: text/html, Size: 1462 bytes --]

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

* Re: Filtering in the nat table - opinions wanted
  2003-03-24 18:20 Filtering in the nat table - opinions wanted Aldo Lagana
@ 2003-03-24 19:32 ` Kim Jensen
  2003-03-24 22:09 ` Joel Newkirk
  1 sibling, 0 replies; 3+ messages in thread
From: Kim Jensen @ 2003-03-24 19:32 UTC (permalink / raw)
  To: Aldo Lagana; +Cc: netfilter

Hi Aldo,

You shouldn't drop packets in the prerouting part, use the filtering part to 
do this. in the pre/post routing you should just try to keep things clean.

So, no I don't find it bad to have the nat policy to accept - it is the filter 
policies I would be worried about :-)

/Kim


On Monday 24 March 2003 19:20, Aldo Lagana wrote:
> by default I set the nat chains (PREROUTING POSTROUTING, etc) to ACCEPT. 
> first off is this bad?
>
> For my web & mail servers using DNAT, I need to add rules - and I do.  Same
> w/ SNAT rules...
>
> The problem has come up with our mail server - we were getting spam from
> one IP address - since my DNAT rule was ACCEPT and forward, the mail server
> kept getting these spam messages.  I stopped the SPAM by adding a rule to
> the beginning of PREROUTING to DROP packets from that address.
>
> This made me start thinking - am I doing it right by having all the nat
> chains default ACCEPT?
>
> aldo



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

* Re: Filtering in the nat table - opinions wanted
  2003-03-24 18:20 Filtering in the nat table - opinions wanted Aldo Lagana
  2003-03-24 19:32 ` Kim Jensen
@ 2003-03-24 22:09 ` Joel Newkirk
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Newkirk @ 2003-03-24 22:09 UTC (permalink / raw)
  To: Aldo Lagana, netfilter

On Monday 24 March 2003 01:20 pm, Aldo Lagana wrote:
> by default I set the nat chains (PREROUTING POSTROUTING, etc) to
> ACCEPT.  first off is this bad?
>
> For my web & mail servers using DNAT, I need to add rules - and I do. 
> Same w/ SNAT rules...
>
> The problem has come up with our mail server - we were getting spam
> from one IP address - since my DNAT rule was ACCEPT and forward, the
> mail server kept getting these spam messages.  I stopped the SPAM by
> adding a rule to the beginning of PREROUTING to DROP packets from that
> address.
>
> This made me start thinking - am I doing it right by having all the
> nat chains default ACCEPT?
>
> aldo

Yes.  ACCEPT policy for nat and mangle chains.  You should look to 
setting a DROP policy on FORWARD, though, and ACCEPT only the traffic 
you want to allow through there.  For something like DROPping a specific 
IP, you should have those rules first in FORWARD, followed by the ACCEPT 
rules to let through classes of traffic.  (IE, email connections to and 
from the mail server and ESTABLISHED & RELATED state connections)

If you don't have anything in FORWARD right now, but an ACCEPT policy, 
you should definitely concentrate there.  Start with rules to accept the 
traffic through that you really need, with a LOG rule at the end if the 
chain.  This way everything will still work as it does now, and you can 
check the rules listing to see what rules are matching packets, and 
check the LOG to see what isn't matching any rule.  (and write a rule to 
ACCEPT it if you need it)

j



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

end of thread, other threads:[~2003-03-24 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-24 18:20 Filtering in the nat table - opinions wanted Aldo Lagana
2003-03-24 19:32 ` Kim Jensen
2003-03-24 22:09 ` Joel Newkirk

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