in reply to Getting a signal from iptables

First of all, your question isn't a Perl question. It's a Linux question, and you're far more likely to get a useful answer on a Linux or a Linux networking forum than you will be getting here.

Having said that, I don't think iptables has anything build in that does a callback. Depending on what you're defending against, you could place a wrapper around the various /sbin/iptables* programs; replace said programs with ones you wrote yourself, or hack the kernel.

But again, there's nothing Perl specific in either the question, or the answer.

Replies are listed 'Best First'.
Re^2: Getting a signal from iptables
by mr.nick (Chaplain) on Dec 20, 2011 at 19:57 UTC
    You could potentially have a perl script that is executed every X minutes by cron (or that loops and sleeps) and compares the current set of rules to the last-known set to detect differences.

    mr.nick ...

      thanks for your replies guys, all good suggestions although i need something that will trigger immediately rather than polling at regular intervals. I wouldnt know where to start with hacking the linux kernel! I've found a few iptables modules on cpan, might see if i can use those.