Wie könnte ich das einstellen? Wenn ich in der syslog ja was umstelle, loggt er ja auch andere Meldungen in die firewall, ich will aber nur den Output der Firewall und nichts anderes
![Smile :)](./images/smilies/icon_smile.gif)
Code: Alles auswählen
--log-level debug
Code: Alles auswählen
kern.=debug /var/log/firewall
Code: Alles auswählen
apt-get install ulogd
Code: Alles auswählen
iptables ... -j ULOG ....
Ich hab das jetzt so gemacht:Hendri hat geschrieben:Hallo,
du solltest zuerst bei all deinen Log Regeln eineinbauen.Code: Alles auswählen
--log-level debug
Im Syslog mußt du dann eineinfügen um alle Kernel debug Meldungen in das Firewall log zu schreiben...Code: Alles auswählen
kern.=debug /var/log/firewall
Code: Alles auswählen
ptables -A OUTPUT -j LOG --log-prefix "OUTPUT geblockt: " --log-level debug
iptables -A FORWARD -j LOG --log-prefix "FORWARD geblockt: " --log-level debug
iptables -A INPUT -j LOG --log-prefix "INPUT geblockt: " --log-level debug
Code: Alles auswählen
kern.=debug /shared/log/firewall.txt
Code: Alles auswählen
iptables -A OUTPUT -j LOG --log-level info --log-prefix "OUTPUT:"
iptables -A FORWARD -j LOG --log-level info --log-prefix "FORWARD:"
iptables -A INPUT -j LOG --log-level info --log-prefix "INPUT:"
Code: Alles auswählen
localhost:~# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
DROP tcp -- anywhere anywhere tcp flags:!SYN,RST,ACK/SYN state NEW
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
DROP all -- localhost/8 anywhere
DROP all -- localhost/12 anywhere
DROP all -- localhost/24 anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere multiport dports ftp,www,https,2001,4662,6881,6882,6883,6884,6885,6886
ACCEPT udp -- anywhere anywhere multiport dports ntp,2001,3998,4672,ipp,8767
LOG all -- anywhere anywhere LOG level info prefix `INPUT:'
Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere localhost multiport dports 8889,9089,ircd,27900,28900,29900,29901,32772,33114
ACCEPT udp -- anywhere localhost multiport dports 6500,13139,27900,32772,32790,33114
LOG all -- anywhere anywhere LOG level info prefix `FORWARD:'
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
LOG all -- anywhere anywhere LOG level info prefix `OUTPUT:'
Code: Alles auswählen
kern.=info -/shared/log/firewall.txt
Das kann man bei mir auch sagen, wenn ich das firewallscript und die /etc/syslog.conf wie oben habe erstellt er zwar die Logdatei an sich wenn ich den syslogd neustarte, aber diese ist eben leer.dann hat er aber garnichts mehr gelogged...
Code: Alles auswählen
*.*;auth,authpriv.none -/var/log/syslog
Code: Alles auswählen
Oct 27 23:31:01 localhost /USR/SBIN/CRON[25968]: (root) CMD (/root/pppd-checker.sh)
Oct 27 23:32:01 localhost /USR/SBIN/CRON[25975]: (root) CMD (mysqldump -u root --password=**** -B forum > /shared/temp/forum-mysql/forumDB.sql)
Oct 27 23:32:01 localhost /USR/SBIN/CRON[25976]: (root) CMD (/root/pppd-checker.sh)
Oct 27 23:33:01 localhost /USR/SBIN/CRON[25995]: (root) CMD (mysqldump -u root --password=**** -B forum > /shared/temp/forum-mysql/forumDB.sql)
Oct 27 23:33:01 localhost /USR/SBIN/CRON[25997]: (root) CMD (/root/ip.sh)
Oct 27 23:33:01 localhost /USR/SBIN/CRON[25998]: (root) CMD (/root/pppd-checker.sh)
Oct 27 23:34:01 localhost /USR/SBIN/CRON[26014]: (root) CMD (mysqldump -u root --password=**** -B forum > /shared/temp/forum-mysql/forumDB.sql)
Oct 27 23:34:01 localhost /USR/SBIN/CRON[26016]: (root) CMD (/root/pppd-checker.sh)
Code: Alles auswählen
iptables -A MY_REJECT -p tcp -m limit --limit 7200/h -j LOG --log-level debug --log-prefix "REJECT TCP "
Code: Alles auswählen
kern.debug /var/log/iptables
Code: Alles auswählen
kern.debug -/var/log/iptables
Code: Alles auswählen
iptables blabla
Code: Alles auswählen
iptables -A INPUT -j DROP
Code: Alles auswählen
iptables -A INPUT -j LOG --log-level info --log-prefix "INPUT:"