BlogBlog ÜbersichtjailscriptportsoptFreeBSDLinksThermoskanneKontakt

pf-Logdatei auslesen

Benutzt man die pf-Firewall so können zum Beispiel alle geblockte Pakete aufgezeichet werden. Dazu muss auf FreeBSD der pf-Log-Mechanismus in der /etc/rc.conf aktiviert werden:

pflog_enable="YES"

Regeln in der pf-Konfiguration, die das Schlüsselwort log enthalten, zeichnen nun die Pakete auf, welche auf die Regel zutreffen:

block log all

Die Logdatei kann nun mit Hilfe von tcpdump(1) ausgelesen werden:

# tcpdump -n -e -ttt -r /var/log/pflog

Auch können die aufgezeichneten Pakete in Echtzeit betrachtet werden:

# tcpdump -n -e -ttt -i pflog0

Mehr Informationen findet man in der Manpage pflogd(8).

Comments (3)  Permalink

Comments

SIFE @ 22.11.2009 10:05 CET
http://www.chruetertee.ch/blog/archive/2009/09/30/pf-logdatei-auslesen.html
SIFE @ 25.11.2009 16:20 CET
Salamo Alikom
i setup my pflog in rc.conf like this :
pflog_enable="YES"
pflog_flags=""
pf_logfile="/var/log/pf"
but i found logs in /var/log instead /var/log/pf ,how can i fix this ?
SIFE @ 03.12.2009 17:00 CET
salamo alikom
how can i convert pflog to plain text , i need the output in file to parse it later .

add a comment

The Trackback URL to this post is:
http://www.chruetertee.ch/blog/plugin=trackback(1520).xml
Trackbacks are moderated.

This blog is gravatar enabled.
Your email adress will never be published.
Comment spam will be deleted!

Name*
E-Mail
For Spammers Only
URL
Comment*
Notify me via E-Mail when new comments are made to this entry
Remember me (needs cookies)