[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: logs iptables



>>>>> "Rudy" == Rudy -sh <stone_head@linuxmail.org> writes:

    >> Hay alguna forma de hacer que el iptables mande los logs a un
    >> archivo especifico por ejemplo "/var/log/iptables.log"

    Rudy> si, ya se dijo antes en la lista, debes poner en el
    Rudy> syslog.conf *.debug /var/log/iptables.log

    Rudy> y en la directiva de iptables LOG poner log-level=debug

    Rudy> Esto enviara los resultados al archivo /var/log/iptables.log
    Rudy> ojo, que no solamente estos estaran ahi, se enviaran otros
    Rudy> tambien de debug del kernel.

Hay otra.

Compilar el kernel para dar soporte al "parámetro" -ULOG.

De la página man de iptables:

   ULOG
       This target provides userspace logging of matching packets.
       When this target is set for a rule,  the  Linux
       kernel  will  multicast  this packet through a netlink
       socket. One or more userspace processes may then sub-
       scribe to various multicast groups and receive the packets.

       --ulog-nlgroup nlgroup
              This specifies the netlink group (1-32) to which the
              packet is sent.  Default value is 1.

       --ulog-prefix prefix
              Prefix log messages with the specified prefix; up to 32
              characters long, and useful fro  distinguish-
              ing messages in the logs.

       --ulog-cprange size
              Number  of  bytes to be copied to userspace. A value of
              0 always copies the entire packet, regardless
              of its size. Default is 0.

       --ulog-qthreshold size
              Number of packet to queue inside kernel. Setting this
              value  to,  e.g.  10  accumulates  ten  packets
              inside  the  kernel  and  transmits them as one netlink
              multipart message to userspace.  Default is 1
              (for backwards compatibility).


No parece muy sencillo utilizar esto para redirigir a un archivo, pero
con el demonio `ulog' la cosa cambia:

       "ulogd is a program that takes netfilter log messages from the
       ULOG target over a netlink  socket,  and  logs
       them to any combination of a file, syslog emulation, and
       mySQL."

Hace tiempo que tenía que ponerme con ULOG y ulogd, pero no tengo
tiempo. Si alguien lo configura que comparta, O:-)


Saludos.

-- 
          ________________________________________
          Cosme P. Cuevas - cosmepc telefonica net
             ICQ 86011094 - GnuPG KeyID: 0A4305FB
                   Debian - GNU/Linux
          ----------------------------------------



Reply to: