한 게시물에 대한 세 가지 답변 :
1) 스크립트로 디버그 :
#!/bin/bash
debug() {
if [ -n "$debug" ]; then
$@ || echo -e "The command which launched the error:\n$@"
else
$@
fi
}
debug=1
IPTABLES="debug /sbin/iptables"
$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
....
2) syslog에 의한 디버그
이 웹 사이트에서 : http://www.brandonhutchinson.com/iptables_fw.html
If you want to make a syslog entry of dropped packets, change:
# Drop all other traffic
/sbin/iptables -A INPUT -j DROP
To:
# Create a LOGDROP chain to log and drop packets
/sbin/iptables -N LOGDROP
/sbin/iptables -A LOGDROP -j LOG
/sbin/iptables -A LOGDROP -j DROP
# Drop all other traffic
/sbin/iptables -A INPUT -j LOGDROP
You may also want to configure the --log-level to log dropped packets to a separate file instead of /var/log/messages:
# Drop all other traffic
/sbin/iptables -A INPUT -j LOGDROP --log-level debug
/etc/syslog.conf change:
# Send iptables LOGDROPs to /var/log/iptables
kern.=debug /var/log/iptables
Reload the syslogd service for the change to take effect.
/sbin/service syslog reload
3) 디버그 없음, 멋진 iptables 편집 :
또한 이것은 도움이 될 수 있습니다 : http://www.fwbuilder.org/