Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to ban a range of IP addresses?
I have identified a particular group of spammers who appear to be coming from the same range of IP addresses. I would like to block these addresses.

I have gone to Admin CP -> Configuration -> Banning -> Banned IPs. I can see how to enter a single address to be banned, but I can't see how to enter an entire range. The instructions say

Quote:use * (Ex: 127.0.0.*) or CIDR notation (Ex:

Does the star in the example indicate a wildcard? If so, what format should this be in?

For example, suppose I wanted to ban IP addresses in the range to (this is just an example that I made up myself), what would I enter in the box? 

Thanks in advance.

Both works if you set those through MyBB ACP.
* represents 0 to 255 all.
If you are still not convinced use .htaccess
[Image: dehibernate.png]
Thanks for your reply. I'm not contesting that "they both work". I simply want to know what format the wild card takes.

For example, to ban addresses in the range to, do I enter 59.2*.*.*? Or do I enter 59.200.*.*, adn then 59.201.*.*, and so on, as separate entries? Or what?

It looks like the wildcard can only be substituted for whole 8-bit groups (x.x.*.x, without digits before or after); may help with converting arbitrary ranges to CIDR blocks. (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪
imho you should use htaccess for banning CIDR blocks
Thanks for all your replies. It's a lot clearer now. I'll try your various suggestions.

A supplementary question:

Assuming I use the Admin CP to ban the relevant addresses (as opposed to .htaccess), what exactly will a banned visitor see? If someone tries to register or log in from a banned address, do they see a message telling them their address or banned? Or what?

(This is not something I can test for myself, for obvious reasons.)

You can test this opening the ACP in separate window. Ban your own IP and refresh main site. You will see:

Quote:I'm sorry, but you are banned. You may not post, read threads, or access the forum. Please contact your forum administrator should you have any questions.

Unban the IP from ACP.
[Image: dehibernate.png]
Thanks, Effone. Very helpful.

And I see that message is defined in global.lang.php. I should have thought to look there first.


Forum Jump:

Users browsing this thread: 1 Guest(s)