How do I stop iptables logging to the console

David Clarke gadicath at
Fri Jan 11 17:14:11 EST 2002

On Fri, 11 Jan 2002, Howard Lowndes wrote:
> In a couple of situations the iptables logs go to the console as well as
> to the /var/log/messages, others log only to the log file.
	I think its the printk settings, the defaults make it so that
some messages go to the console, which isn't really what you want.  I
think it might have been something like "7 4 1 7", cat
/proc/sys/kernel/printk, to see what you current values are. You can use
sysctl to change this if you have sysctl support in the kernel. The line
I added to my sysctl.conf to stop this from happening was "kernel.printk
= 3 4 1 7".  Once you add that you can just run "sysctl -p" to update
changes.  Sysctl is normally run on boot, so that you will not have to
run the command each time.

The follow are from man 2 syslog, they just say what the different
levels are.  The first part of printk is the log level of the console,
which should be the one you need to change.

#define KERN_EMERG    "<0>"  /* system is unusable               */
#define KERN_ALERT    "<1>"  /* action must be taken immediately */
#define KERN_CRIT     "<2>"  /* critical conditions              */
#define KERN_ERR      "<3>"  /* error conditions                 */
#define KERN_WARNING  "<4>"  /* warning conditions               */
#define KERN_NOTICE   "<5>"  /* normal but significant condition */
#define KERN_INFO     "<6>"  /* informational                    */
#define KERN_DEBUG    "<7>"  /* debug-level messages             */

	Hope this helps,

All generalizations are false, including this one. -- Mark Twain
David Clarke <gadicath at> | David Clarke <s3353950>
Key Fingerprint :  869B 53DD 5E80 E1F0 93F6  9871 0508 0296 5957 F723

More information about the linux mailing list