How CIDR Works? How To Block Bulk IPs In WHM Using CIDR Method?


How Do CIDR Works In IP Blocking?

Well, blocking a specific range of IPs from Web Host Manager (WHM) will become easier if you understand the CIDR concept. So, before starting ahead, let’s try to understand the CIDR by the below image.

CIDR Chart To Block a Range Of IPs
CIDR Chart To Block a Range Of IPs

I’ll try to explain CIDR in the easiest way. I know you might be confused with the above chart, although you don’t have to remember all the CIDR arguments. Just remember the below steps to perform the maximum IPs related tasks.

  1. If you want to block a range of IPs starting from 123.x.x.x then you can use CIDR 8. For example, my website is getting too many bot traffics from the IP addresses that are starting from 123, in this case, I can block all the IPs starting from 123 with the help of CIDR which is 123.0.0.0/8
  2. Likewise, I can block all the range of IPs starting from 123.45.x.x by modifying the previous CIDR argument. See the 16th CIDR argument from the above chart. Using /16 after the IP address will block all the range of IPs starting from 123.45.0.0 to 123.46.255.255, and the final command will look like this: 123.45.0.0/16
  3. So, now you can block two ranges of IPs, but what if you want to narrow the range? Like, you want to block a specific range of IPs starting from 123.45.222.x. You can use the /24 argument to block all the 255 IPs. For example, 123.45.222.0/24 will block the range of IPs starting from 123.45.222.0 to 123.45.222.255.

That’s how you can easily block a range of IP addresses using the CIDR arguments. As shown in the image, there are several other arguments of CIDR that you can play with, but these were the most used CIDR commands that will help you put the bulk IP restrictions in WHM.

I hope now you understand the use of CIDR to block a range of IP addresses in WHM.

Now, let’s do it practically without wasting any time.


How To Block Range Of IPs In WHM Using CIDR

log in to WHM
log in to WHM
  • Either search for a Plugin or directly navigate to the Plugins section from the WHM dashboard.
Navigate to the Plugins
Navigate to the Plugins
  • Move inside the CSF (ConfigServer Security & Firewall).
Move Inside The CSF
Move Inside The CSF
  • Scroll down to the CSF – Quick Actions section. To block a range of IPs, type the IP address in a CIDR format. For example:
    • 123.0.0.0/8 to block all the IPs starting from 123.0.0.0 to 123.255.255.255

    • 180.132.0.0/16 to block all the IPs starting from 180.132.0.0 to 180.134.255.255

    • 45.129.21.0/24 to block all the IPs starting from 45.129.21.0 to 45.129.21.255

  • Hit the Quick Deny button to block the IPs.
Quick Deny Using CIDR
Quick Deny Using CIDR

That’s It.

Also See:

Transfer Files Using WinSCP


You’ve successfully blocked a range of IPs to access your website. I hope this helps you. Share this post if it helps you. Other than this, you can follow us on Facebook Twitter to stay updated with all the latest articles.

Moreover, you can purchase WHM Reseller Hosting from us & get 24/7 call support for all your Web Hosting related queries. We’ll be happy to help you.

Scroll to Top