* How to log what is drop
@ 2004-07-08 7:30 IZEM Farid
2004-07-08 7:44 ` Gavin Hamill
0 siblings, 1 reply; 3+ messages in thread
From: IZEM Farid @ 2004-07-08 7:30 UTC (permalink / raw)
To: netfilter
Hi all,
Just a Simple question.
How do i log what is being rejected or drop by my Firewall.
I configure my syslog.conf like this:
kern.* /var/log/kernel
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.
Thanks,
Best regards,
Farid IZEM
Ingénieur Système Unix
Société ABX Logistics France
48-50, route principale du port
92232 Gennevilliers
Tél. : 01-41-47-61-78
Email : farid.izem@abxlogistics.fr
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to log what is drop
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
0 siblings, 1 reply; 3+ messages in thread
From: Gavin Hamill @ 2004-07-08 7:44 UTC (permalink / raw)
To: netfilter
On Thursday 08 July 2004 08:30, IZEM Farid wrote:
> Hi all,
>
> Just a Simple question.
>
> How do i log what is being rejected or drop by my Firewall.
>
> I configure my syslog.conf like this:
> kern.* /var/log/kernel
>
> 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.
Cheers,
Gavin.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to log what is drop
2004-07-08 7:44 ` Gavin Hamill
@ 2004-07-08 9:38 ` Nils Juergens
0 siblings, 0 replies; 3+ messages in thread
From: Nils Juergens @ 2004-07-08 9:38 UTC (permalink / raw)
To: netfilter
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-07-08 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.