iptables logging on kubuntu with rsyslogd

From thelinuxwiki
Revision as of 15:30, 15 October 2014 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

versions

kubuntu version 14

problem

iptables is logging to /var/log/syslog, but we want it logging to a separate file.


solution

  1. create /etc/rsyslog.d/iptables.conf file with the following contents
:msg, contains, "iptables" -/var/log/iptables.log
& ~
  1. restart rsyslogd
/etc/init.d/rsyslogd restart
  1. verify functionality (you might need to generate some traffic to the host)
# tail -f /var/log/iptables.log