Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Nils Juergens <ju@isf.rwth-aachen.de>
To: netfilter@lists.netfilter.org
Subject: Re: How to log what is drop
Date: Thu, 08 Jul 2004 11:38:39 +0200	[thread overview]
Message-ID: <20040708093839.GD3933@koala7> (raw)
In-Reply-To: <200407080844.08036.gdh@acentral.co.uk>

On Thu, 08.07.04, Gavin Hamill <gdh@acentral.co.uk> wrote:

> > And I had the following rule:
> > 	Iptables -A FORWARD -j LOG
> >
> > It seems that all connections is logged so it is very difficult to read the
> > log.
> 
> Firstly, do you actually have DROP statements in your ruleset? If so, the LOG 
> statement should appear JUST BEFORE the block of DROP statements. Since 
> ACCEPT or DROP are one-way-streets for packets, you want to LOG just before 
> they get DROPped, but not log any of the ACCEPTed packets.

A very good way to do this is via a special chain "logdrop"

iptables -N logdrop
iptables -A logdrop -j LOG --log-prefix ' log drop '
iptables -A logdrop -j DROP

And then you replace every -j DROP (that you want logged) with -j logdrop.

I think this is mentioned in a part of the netfilter docs.

hth,
Nils



      reply	other threads:[~2004-07-08  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-08  7:30 How to log what is drop IZEM Farid
2004-07-08  7:44 ` Gavin Hamill
2004-07-08  9:38   ` Nils Juergens [this message]

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=20040708093839.GD3933@koala7 \
    --to=ju@isf.rwth-aachen.de \
    --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