星期五, 4月 18, 2008

iptables LOG 機制 at SuSE Linux

之前在使用RedHat 系列的Linux時候
在使用 iptabls的時候會使用, 例如
#iptables -A INPUT -p icmp --icmp-type 8 -j LOG
來將ping的動作紀錄起來
以RedHat 系列會去檢查 /var/log/messages

但是由於SuSE Linux使用 syslog-ng的關係
在/etc/syslog-ng/syslog-ng.conf 設定中有把iptables 獨立出來
linux-nb:/var/log # cat /etc/syslog-ng/syslog-ng.conf | grep iptables
filter f_iptables { facility(kern) and match("IN=") and match("OUT="); };
filter f_console { level(warn) and facility(kern) and not filter(f_iptables)
filter f_messages { not facility(news, mail) and not filter(f_iptables); };
filter f_warn { level(warn, err, crit) and not filter(f_iptables); };
# All messages except iptables and the facilities news and mail:
# Firewall (iptables) messages in one file:
log { source(src); filter(f_iptables); destination(firewall); };
# Warnings (except iptables) in one file:

所以有關於iptables的LOG在 SuSE Linux 內
會被儲存在/var/log/firewall

︿︿