iptables and limiting the number of times an event gets logged
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
/var/log/messages is littered with these entries. Here is the relevant section from my iptables script:
$IPTABLES -A IPT_udp_packets -p udp --match multiport --ports 137,138,139,445 \
-m limit --limit 3/minute -j LOG --log-prefix "IPT_udp: Windoze DROP "
$IPTABLES -A IPT_udp_packets -p udp -s 0/0 --d.estination-port 137:139 -j DROP
$IPTABLES -A IPT_udp_packets -p udp -s 0/0 --destination-port 445 -j DROP
What do I have to add/change to limit the number of times this traffic gets logged?
Specifically, I only want the message to appear in the logfile once every three minutes. I thought the "--limit 3/minute" part would do this, but it doesn't.
--> S.O.S. to any iptables GURUS out there... plz help. Still getting lots of messages in logs, but I don't wanna turn off logging completely for these ports. Maybe it isn't possible to limit the log rate or (more probably) my syntax is wrong? Any help would be much appreciated.
-m limit --limit 3/minute -j LOG --log-prefix "IPT_udp: Windoze DROP
That's going to limit the number of times it's logged to 3 log entries per minute, not once every three minutes. To do once every three minutes, you'd have to do something like 0.333/minute but I believe you have to use integers, so it would probably have to be more like --limit 20/hour.