iptables logs going to all ttys
Morning all,
I have the following in my firewall script, and to my knowledge this is meant to stop all logs from going to all ttys but this is not the case and its a real *pain* in the ass.
$IPTABLES -N drop-and-log-it
$IPTABLES -A drop-and-log-it -j LOG --log-level info $IPTABLES -A drop-and-log-it -j DROP
If someone could give me a hint as to what i have overlooked that would be much appreciated, thanks
General Details:
iptables v1.2.8
syslogd 1.4.1
LFS 4.1
Signature · 3 lines
lucas $([email protected]) "Experience is something you don't get until just after you need it."
lucas wrote:
Morning all,
I have the following in my firewall script, and to my knowledge this is meant to stop all logs from going to all ttys but this is not the case and its a real *pain* in the ass.
$IPTABLES -N drop-and-log-it
$IPTABLES -A drop-and-log-it -j LOG --log-level info $IPTABLES -A drop-and-log-it -j DROP
If someone could give me a hint as to what i have overlooked that would be much appreciated, thanks
Iptables logging is handled by syslog and the output will go to the same tty/file as the rest of the kernel messages. Your chain sets the log level to kern.info, logs the packet, then drops it. To change the output you can edit your /etc/syslog.conf file.
Jeff
Quoted 6 lines · lucas
Morning all,
I have the following in my firewall script, and to my knowledge this is meant to stop all logs from going to all ttys but this is not the case and its a real *pain* in the ass.
Quoted 6 lines
$IPTABLES -N drop-and-log-it
$IPTABLES -A drop-and-log-it -j LOG --log-level info $IPTABLES -A drop-and-log-it -j DROPIf someone could give me a hint as to what i have overlooked that would be much appreciated, thanks
Syslog configuration is probably what you missed. check /etc/syslog.conf. Very likely you have something like:
kern.* /dev/console
in there, which states that all kernel messages of whatever level will be sent to /dev/console.
For myself, I disable the /dev/console setting, then add:
kern.=debug /var/log/firewall
kern.=warning /var/log/firewalladmin
Unless you're running a custom kernel with debugging enabled, the first channel (debug) should be almost empty of traffic, ideal for redirection to a firewall-only log file with "--log-level debug". Everything of level 'info' or higher usually goes to /var/log/messages as well.
j