MyBB Community Forums
How to ban a range of IP addresses? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: Security Management and Support (https://community.mybb.com/forum-179.html)
+--- Thread: How to ban a range of IP addresses? (/thread-221404.html)



How to ban a range of IP addresses? - Mike QS - 01-07-2019

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: 127.0.0.0/8)


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 59.200.0.0 to 59.207.255.255 (this is just an example that I made up myself), what would I enter in the box? 

Thanks in advance.

Mike


RE: How to ban a range of IP addresses? - effone - 01-07-2019

Both works if you set those through MyBB ACP.
* represents 0 to 255 all.
If you are still not convinced use .htaccess


RE: How to ban a range of IP addresses? - Mike QS - 01-07-2019

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 59.200.0.0 to 59.207.255.255, do I enter 59.2*.*.*? Or do I enter 59.200.*.*, adn then 59.201.*.*, and so on, as separate entries? Or what?

MIke


RE: How to ban a range of IP addresses? - Devilshakerz - 01-07-2019

It looks like the wildcard can only be substituted for whole 8-bit groups (x.x.*.x, without digits before or after); https://www.ipaddressguide.com/cidr may help with converting arbitrary ranges to CIDR blocks.


RE: How to ban a range of IP addresses? - labrocca - 01-08-2019

imho you should use htaccess for banning CIDR blocks


RE: How to ban a range of IP addresses? - Mike QS - 01-08-2019

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.)

Mike


RE: How to ban a range of IP addresses? - effone - 01-08-2019

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.


RE: How to ban a range of IP addresses? - Mike QS - 01-08-2019

Thanks, Effone. Very helpful.

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

Mike


RE: How to ban a range of IP addresses? - heenamajeed - 07-19-2019

Utilize this strategy when you have a quite certain scope of IP delivers you wish to square. CIDR - for instance 216.109.112.0/24 obstructs every one of the 256 IP addresses somewhere in the range of 216.109.112.0 and 216.109.112.255. Utilize this technique when you have an a lot bigger scope of IP delivers you wish to square, for example, nations or associations.