HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=19)
-   -   Block a range of IP's with Bastille & iptables (http://www.howtoforge.com/forums/showthread.php?t=19868)

wpwood3 28th January 2008 00:35

Block a range of IP's with Bastille & iptables
 
1 Attachment(s)
I needed an easy way to block a range of IP addresses so I wrote a little bash script.

You enter IP ranges like 128.121.0.0-128.121.255.255 into a simple text file. The script produces the iptables code for you and puts it in the correct folder for the Bastille firewall to use. All you have to do is restart Bastille and your rules are working and blocking all of the IP's in the range. Enter each range you want to block on a separate line in the text file. Enter as many lines as you want.

I use Snort for intrusion detection so this script gives me the ability to quickly and easily manage the IP ranges I want to block. To make a change all you do is edit the text file, run the script and restart Bastille. Rules remain in effect even if you reboot your server.

Enjoy!
:D

PS - I tried about 6 times to upload it here as a zip file and each time it was corrupted. Finally I tried tar.gz and that seems to work fine. :confused:


All times are GMT +2. The time now is 06:17.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.