Linux Netfilter discussions
 help / color / mirror / Atom feed
From: "Taylor, Grant" <gtaylor@riverviewtech.net>
To: netfilter <netfilter@lists.netfilter.org>
Subject: Re: Iptables efficiency, order of execution
Date: Fri, 06 May 2005 22:53:25 -0500	[thread overview]
Message-ID: <427C3BB5.8050601@riverviewtech.net> (raw)
In-Reply-To: <427B8CC5.6070003@danbbs.dk>

Mogens Valentin wrote:
> 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.

Gnerally I like to put the rule(s) that will match the highest percentage of the time towards the top followed by the next highest percent matched rules on down the list to the least likely to match at the botom.  The idea behind this is to have the most common packets match rules at the top (start) of the list so they have to traverse as few rules as possible.

If you are going to have a LARGE block of IPs that you are going to match on, namely each IP in a class (C)


256 / 4
 64 / 4
 16 / 4
  4 / 4


  reply	other threads:[~2005-05-07  3:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-06 15:27 Iptables efficiency, order of execution Mogens Valentin
2005-05-07  3:53 ` Taylor, Grant [this message]
2005-05-07  4:52 ` Taylor, Grant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=427C3BB5.8050601@riverviewtech.net \
    --to=gtaylor@riverviewtech.net \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox