Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Banning IP by ranges

Quote Reply
Banning IP by ranges
Good day all!

For the ban ip function under Gossamer Forum Admin-->Users-->Edit bans, is there a way to specify ranges of IP addresses to ban instead of all or nothing masks? Let's say I want to ban 100.50.0.0 to 100.100.255.255. Any ideas on how I could do that?

Thanks!
Quote Reply
Re: [Jumbolaya] Banning IP by ranges In reply to
Hi,

Not easily, AFAIK.

You could do something like this - save as ips.cgi, CHMOD to 755 - and put this code in it:

Code:
#/usr/bin/perl

print "Content-Type: text/html \n\n";

for (my $i = 50; $i <= 100; $i++;) {
print qq|100.$i.*.*<br />|;
}

Then, that would print out the list of IP bans (i.e 100.50.*.* , 100.51.*.* , etc)

Then, putting those into the ban field - *should* work.

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] Banning IP by ranges In reply to
So in the end that's just a cut and paste after having all the ranges generated as text? Thanks!
Quote Reply
Re: [Jumbolaya] Banning IP by ranges In reply to
Hi,

Yup, should work (the script is untested - as I just wrote it =))

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Jumbolaya] Banning IP by ranges In reply to
Looking at the code. It currently only allows you to specify ranges for the last octet (so, just 10.0.0.1-50). You'll have to use Andy's little script to generate your range.

Adrian