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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
/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.