Calculate exact IPv4 CIDR subnet masks, network and broadcast addresses, and usable host IP ranges—and generate copy-ready Apache/LiteSpeed .htaccess, Nginx, and Linux UFW firewall rules to allow or block IP blocks.
How Webmasters Use CIDR Blocks in .htaccess & Firewalls
- Block Aggressive Scraper Subnets: Instead of blocking single IPs one by one, blocking a `/24` CIDR subnet stops all 256 contiguous addresses in a single rule.
- Whitelist Cloudflare Edge Proxies: Ensure your server firewall allows Cloudflare’s `/13` and `/20` IPv4 blocks so you never trigger a Cloudflare Error 522.