Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th January 2008, 00:35
wpwood3 wpwood3 is offline
Senior Member
 
Join Date: Oct 2007
Location: Atlanta, GA USA
Posts: 197
Thanks: 21
Thanked 31 Times in 21 Posts
 
Lightbulb Block a range of IP's with Bastille & iptables

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!


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.
Attached Files
File Type: gz block_iprange.tar.gz (1.7 KB, 981 views)
__________________
CentOS 5.4 64bit (the Perfect Setup)
ISPConfig 2.2.40
WP3 Photography

Last edited by wpwood3; 28th January 2008 at 00:59.
Reply With Quote
The Following User Says Thank You to wpwood3 For This Useful Post:
falko (28th January 2008)
Sponsored Links
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables gateway with one lan adapter tsmr Installation/Configuration 1 7th August 2008 12:02
ISPConfig Firewall Bastille udp port range stefanr Installation/Configuration 6 31st January 2008 17:45
iptables Bastille not blocking wpwood3 General 1 27th January 2008 05:18
Match IP with MAC using iptables for squid block cooljai Server Operation 0 30th August 2007 18:30
configuring IPTABLES firewall adityavpratap HOWTO-Related Questions 9 27th May 2006 21:42


All times are GMT +2. The time now is 09:03.


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