Linux Netfilter discussions
 help / color / mirror / Atom feed
From: <bmcdowell@coxhealthplans.com>
To: blancher@cartel-securite.fr, tedkaz@optonline.net
Cc: netfilter@lists.netfilter.org
Subject: RE: Chain Policy DROP versus ACCEPT and logging
Date: Mon, 13 Oct 2003 10:54:30 -0500	[thread overview]
Message-ID: <7A3B4AA360FDEF448F3390421FC8D731F419BF@coxhpexg.coxhp.com> (raw)


I may be a little late chiming in on this, but personally my rules use a 'BAD' chain.  That chain ends with the LOG and DROP just like a normal appended chain.  The difference is, I can explicitly deny things by sending them to -j BAD.

I do the same with -j GOOD, and then run sanity checks against the packet  -sending some stuff to BAD before it actually hits the ACCEPT.

-----Original Message-----
From: netfilter-admin@lists.netfilter.org
[mailto:netfilter-admin@lists.netfilter.org]On Behalf Of Cedric Blancher
Sent: Sunday, October 12, 2003 10:12 AM
To: tedkaz@optonline.net
Cc: netfilter@lists.netfilter.org
Subject: Re: Chain Policy DROP versus ACCEPT and logging


Le dim 12/10/2003 à 16:00, Ted Kaczmarek a écrit :
> Is their a way to log the default INPUT and FORWARD policies for dropped
> packets with them set to DROP as opposed to having them set to ACCEPT
> and putting in logs for any deny rules.

Logging in Netfilter does not behave as it used to with ipchains. You
cannot log and drop within the same rule. Suppose you want to log and
drop all UDP traffic :

	iptables -A INPUT -p udp -j LOG --log-prefix "UDP dropped : "
	iptables -A INPUT -p udp -j DROP

LOG is a target (non terminating one).

This said, if you want to log packets that hit chain policy, then you
have to put a logging rule at the very end of the chain :

	iptables -A INPUT -j LOG "INPUT chain policy drop : "

And you're done.

-- 
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE


             reply	other threads:[~2003-10-13 15:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-13 15:54 bmcdowell [this message]
2003-10-14  1:01 ` Chain Policy DROP versus ACCEPT and logging Ted Kaczmarek
2003-10-14  1:29   ` Jeffrey Laramie
  -- strict thread matches above, loose matches on Subject: below --
2003-10-12 14:00 Ted Kaczmarek
2003-10-12 15:06 ` Joel Newkirk
2003-10-12 15:12 ` Cedric Blancher

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=7A3B4AA360FDEF448F3390421FC8D731F419BF@coxhpexg.coxhp.com \
    --to=bmcdowell@coxhealthplans.com \
    --cc=blancher@cartel-securite.fr \
    --cc=netfilter@lists.netfilter.org \
    --cc=tedkaz@optonline.net \
    /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