iptables and dmesg
Hello. This is my first time installing Linux. I got iptables set up with logging level 6. I also added kern.info to syslog.conf. Now, I get the iptables logs in my file that I want of /var/log/iptables, but the same logs also appear when I type dmesg. If I look at the dmesg in /var/log, it does not containg any of the iptable information. Is there a way to keep the iptables info from showing up when I type dmesg?
Thanks! Ryan kern.info -/var/log/iptables # Log anything (except mail) of level info or higher. # Don't log private authentication messages! *.info;mail.none;authpriv.none;cron.none;kern.none /var/log/messages # The authpriv file has restricted access. authpriv.* /var/log/secure # Log all the mail messages in one place. mail.* -/var/log/maillog # Log cron stuff cron.* /var/log/cron # Everybody gets emergency messages *.emerg * # Save news errors of level crit and higher in a special file. uucp,news.crit /var/log/spooler # Save boot messages also to boot.log local7.* /var/log/boot.log |
Hi Ryan,
And welcome to LQ! :) Not really, the output of the command dmesg is the content of the kernels ring-buffer... if you log iptables messages, they will show in the buffer ... Cheers, Tink |
Is there a way to filter dmesg at all? I guess I need to know what the dmesg log in /var/log/dmesg is, and how does it compare to the dmesg command? I read that dmesg reads message from the kernel... so I assume that kernel messages are the only messages in dmesg? Is there any function or code to filter these? Is the dmesg logged somewhere by default? I guess if I'm worried about missing kernel messages because of iptables logs, i could just log all kernel info to a file and grep in or out ip tables log when appropriate. Just trying to determine if this is the standard way or not.
Thanks again! Ryan |
You wouldn't miss anything ... dmesg reads a BUFFER.
Anything that is in there is being written to the relevant logs, e.g. /var/log/messages, /var/log/debug, /var/log/syslog, /var/log/dmesg is just the status of dmesg when the box reaches it's selected initial runlevel, 3 in my case. Cheers, Tink |
Thanks Tink!
|
All times are GMT -5. The time now is 08:34 AM. |