Re: Logging denied packets (iptables)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, October 17, 2007 2:05 pm, Ashley M. Kirchner wrote:
>
>     One of our offices has several network ranges blocked in iptables
> (essentially '-A INPUT -s www.xxx.yyy.zzz/aa -j DROP').  What I'd like
> to do is create a log entry each time a packet is dropped, IF it matches
> any of those networks.  I think I need to assign all of those networks
> to a "group" and then log dropped packets from that group only.  And
> while I realize this might have other ramifications, such as logs
> growing exponentially, for now we're taking small steps.  Later on I can
> then look for things like logging the same IP only once...
>
>     So how do I tell iptables to create a group or name, or whatever
> it's called for those ranges, and then log dropped packets from those
> ranges only?

Here's what I do:

-N LOGDROP
-A LOGDROP -j LOG --log-prefix "$IPTABLES drop:"
-A LOGDROP -j DROP

Then you can add lines for the things you want logged like this:

-A INPUT -s www.xxx.yyy.zzz/aa -j LOGDROP

I tend to use LOGDROP, rather than DROP, for everything I drop, except for
some really common things.

Mike


-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux