blip.pl - Blocks and unblocks IPs using iptables.
Using the Unix iptables can be confusing, blip is a simple interface that un/blocks IPs and put them in a designated chain.
./blip.pl -block 114.80.97.88
./blip.pl -unblock 114.80.97.88You can pass to it multiple IPs by separating them with commas.
List the blocked IPs:
./blip.pl -listWhen you're tired of it all:
./blip.pl -wipeTurns on vebosity.
Defaults to /sbin/iptables if it's not there, set it yourself.
Chain or target to add IPs to. Defaults to BLIP.
BlockIP.pm - Simple interface for iptables.
$BLIP = BlockIP->new(@ARGV);
$BLIP->commands;Blocks and unblocks IPs to a special chain called BLIP.
Creates the object, subsequently, creates the CHAIN if doesn't exist.
Accepts these command-line args:
-verbose = 2 levels of outputs
-list = shows current table
-wipe = remove chain
-block = block this IP
-unblock = unblock this IPBlocks an IP if not already blacklisted.
Unblocks an IP in the chain.
Prepares iptables to accept un/block of IPs.
Creates a new chain and chain this to INPUT.
Execute command, if passed a regexp, it'll try to match it with the output returns true/false otherwise, return entire output for parsing.
Works just like printf except has a built-in check for -verbose.
20120314 - v1.0 - Created.
v1.0.1 - Remove README. Link README.pod to blip.pl. Change blip to blip.pl. Adds -chain option so user chan specify which chain/target to use.
v1.1 - Add chaining to INPUT for this thing to actually do the blocking. Oops.
This module by Paul Pham.
Copyright 2012 by Paul Pham
This program and library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.