How can I log iptables in Ubuntu just in /var/log/firewall with rsyslogd

10,814

Use a discard action after the iptables log, but before the other logs.

kern.warning   /var/log/firewall.log
kern.warning   ~
*.*            /var/log/messages
Share:
10,814

Related videos on Youtube

IRousso
Author by

IRousso

I do things with linux!

Updated on September 17, 2022

Comments

  • IRousso
    IRousso over 1 year

    I am using ubuntu 10.10. with iptables! I want to log my firewall drops in the file /var/log/firewall and NOT in any other logfile.

    So I added the following line to my file: /etc/rsyslog.d/50-default.conf:

    #iptables Log
    kern.warning    /var/log/firewall.log
    

    This way my drops and logs from iptables are logging into the right file!

    Now i dont know what to add to not log the drops in the other files.. At this time it write every drop in /var/log/messages /var/log/kern.log and /var/log/syslog

    Heeeelp :)

    I found this one : Add a local application to syslog excluded from /var/log/messages but it doesnt work.. Maybe because its Rsyslogd in Ubuntu 10.10?

    Thanks!

  • Stefan Lasiewski
    Stefan Lasiewski over 13 years
    What does ~ mean? (the rsyslog manual is a little vague).