[MEGOLDVA] iptables -j LOG nem logol

Fórumok

Hi!

Egy tűzfalscript utolsó soraiban a semmihez nem illő csomagokat logolja és eldobja:


        # Create LOG chains to log and drop packets
        $IPTABLES -N INLOG
        $IPTABLES -A INLOG -j LOG --log-prefix "INPUT_DROP: " --log-level debug
        $IPTABLES -A INLOG -j DROP

        $IPTABLES -N OUTLOG
        $IPTABLES -A OUTLOG -j LOG --log-prefix "OUTPUT_DROP: " --log-level debug
        $IPTABLES -A OUTLOG -j DROP

        # Log&Drop all other traffic
        $IPTABLES -A INPUT -j INLOG
        $IPTABLES -A OUTPUT -j OUTLOG

    
        $IPTABLES -P INPUT DROP
        $IPTABLES -P OUTPUT DROP
        $IPTABLES -P FORWARD DROP
        $IP6TABLES -P INPUT DROP
        $IP6TABLES -P OUTPUT DROP
        $IP6TABLES -P FORWARD DROP

Az otthoni Debianommal (kernel 2.6.15, iptables 1.3.6) szépen írja bele a syslogba amit kell, de egy 2.6.8-cal (Debian stable, iptables 1.2.11) futó gépen nem.

syslog.conf azonos (semmit sem változtattam):


# First some standard logfiles.  Log by facility.
#

auth,authpriv.*                 /var/log/auth.log
*.*;auth,authpriv.none          -/var/log/syslog
#cron.*                         /var/log/cron.log
daemon.*                        -/var/log/daemon.log
kern.*                          -/var/log/kern.log
lpr.*                           -/var/log/lpr.log
mail.*                          -/var/log/mail.log
user.*                          -/var/log/user.log
uucp.*                          /var/log/uucp.log

#
# Logging for the mail system.  Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info                       -/var/log/mail.info
mail.warn                       -/var/log/mail.warn
mail.err                        /var/log/mail.err

# Logging for INN news system
#
news.crit                       /var/log/news/news.crit
news.err                        /var/log/news/news.err
news.notice                     -/var/log/news/news.notice

#
# Some `catch-all' logfiles.
#
*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages

#
# Emergencies are sent to everybody logged in.
#
*.emerg                         *

#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.

daemon,mail.*;\
        news.=crit;news.=err;news.=notice;\
        *.=debug;*.=info;\
        *.=notice;*.=warn       /dev/tty12

# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
# you must invoke `xconsole' with the `-file' option:
#
#    $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
#      busy site..
#
daemon.*;mail.*;\
        news.crit;news.err;news.notice;\
        *.=debug;*.=info;\
        *.=notice;*.=warn       |/dev/xconsole

kern.=debug     -/var/log/bandwidth

A syslogd verziója is, mindkét helyen 1.4.1.

A szabályok alkalmazásakor semmi hibaüzenetet nem kapok egyik gépen sem.
Mi lehet a gondja?

edit: a /var/log alatt sehol semmi nyoma az iptables logjának (grep "DROP" -r *)...

Hozzászólások

Megvan: a dmesg kiírja.
Na de a syslogd-t már vagy 5x újraindítottam azóta. Ezek hogy kerülnek bele a logba?
Sehol máshol nem léteznek csak a dmesg bufferében.

Fut, közben megoldottam, a dmesg-es felfedezés után a guglin keresve gyerekjáték volt:
A klogd "-s" opcióval kell fusson (az initscriptben van egy KLOGD="" változó, itt lehet állítani), így a syslogba nyomja az üzeneteket.
Utána már azzal azt csinálsz amit akarsz (pl. "kern.=debug /var/log/iptables.log" sorral saját fileba)