Linux Netfilter discussions
 help / color / mirror / Atom feed
* Iptables efficiency, order of execution
@ 2005-05-06 15:27 Mogens Valentin
  2005-05-07  3:53 ` Taylor, Grant
  2005-05-07  4:52 ` Taylor, Grant
  0 siblings, 2 replies; 3+ messages in thread
From: Mogens Valentin @ 2005-05-06 15:27 UTC (permalink / raw)
  To: netfilter

Sometimes questions pop up on various network lists about execution
order of rules.
Such questions are usually dealt with per example, but I sometimes
ponder about general guidelines, or try to logically derive my own.

For my own systems, I really don't have to care that much; it's a
different story for customers. Alas, currently I do not administer a
larger heavily loaded setup, so experiments are a bit tricky to verify.

Likewise, I'm interested in execution order for various types of
firewalling, i.e., do we have a large number of clients but few
lowtraffic servers, or high-volume servers and few clients..



Scheme for a general setup:

   Define variables, including PATH and path to iptables/modprobe..
   Load required modules

   Dectivate ICMP and forwarding
   Setup /proc stuff
   Set default policies to DROP
   Delete and flush chains + nat PRE/POSTROUTING

   Define general logging rules
   Define ICMP  rules
   Define TCP   rules
   Define UDP   rules

   Drop common unwanted (priv.ranges..), spoofed, portscans
   Activate ICMP

   Activate implementation-specifics:
     Prerouting/mangle for TOS etc..
     Prerouting/DNAT from external to DMZ/internal segments
     Input to the box itself
     Forward from external to internal segments
     Forward form internal segments to external
     Postrouting/SNAT from internal segments to external
     Outgoing rules (unless ALLOW any outgoing traffic)

   Log weird packets not caught elsewhere (for investigation)

   Activate forwarding


But where to place things like Taylor's counting rules?
(resent thread "How to stop the flood?")
I don't know enough about the performance penalty of having maybe quite
a number of such counting rules.
Counting should be very few mashineinstructions each, though.

-- 
Kind regards,
Mogens Valentin




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

end of thread, other threads:[~2005-05-07  4:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-06 15:27 Iptables efficiency, order of execution Mogens Valentin
2005-05-07  3:53 ` Taylor, Grant
2005-05-07  4:52 ` Taylor, Grant

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