How to block IP range in CSF firewall

If you want to block a complete IP range in CSF firewall, please follow these steps:

Let’s say you want to block following IP range:
[alert style=orange_a]58.253.xxx.xxx[/alert]

Step 1:

Login in root WHM.

Step 2:

Navigate to: WHM >> Plugins >> ConfigServer Security&Firewall

Step 3:

Block following IP using Quick Deny box.
[alert style=green_a]58.253.0.0/16[/alert]

Done!!!
You may need to restart CSF firewall after adding / removing IPs.
You can also block from SSH using following SSH command:
[alert style=green_a]csf -d 58.253.0.0/16[/alert]

Quick Note

To block 111.xxx.xxx.xxx range, use following rule
[alert style=green_a]111.0.0.0/8[/alert]

To block 111.111.xxx.xxx range, use following rule
[alert style=green_a]111.111.0.0/16[/alert]

To block 111.111.111.xxx range, use following rule
[alert style=green_a]111.111.111.0/24[/alert]

[dedicated_hosting]

Related Posts