New videos every week — proxies, VPNs & antidetect browsers, explained.

Subscribe
GuidesDec 5, 202618 min read

Subnet Bans Explained: Why a /24 Block Takes Down Neighboring IPs

What a /24 subnet ban is, why sites block whole IP ranges, how to measure /24 and ASN diversity in a proxy pool, and what to do after a ban.

Table of contents

You buy a batch of proxies, everything works for a few days, and then one morning every IP in the batch starts returning 403s, CAPTCHAs or timeouts at the same moment. You didn't change your scraper. You didn't touch your request rate. Nothing about your own traffic looks different. What probably happened is a subnet ban: the target site stopped judging your addresses one at a time and blocked the whole range they live in, usually a /24, taking every neighbouring IP down with them.

This guide is the long-form companion to our short subnet glossary entry and to What Is an ASN?. It explains what a /24 and other CIDR sizes actually mean, why defenders find whole-block bans so attractive, how the common tools express them, how to measure the /24 and ASN diversity of a proxy pool yourself, and what to do once a subnet ban has already hit you.

What a subnet ban actually is

An IP ban blocks one address. A subnet ban blocks a contiguous range of addresses that share the same leading bits, written as a network address followed by a slash and a number, for example 203.0.113.0/24. Any request whose source address falls inside that range gets the same treatment, whether that address ever misbehaved or not.

That last point is what makes subnet bans feel unfair from the proxy user's side. Your own IP might have sent a handful of polite requests per minute. But if other addresses in the same block were hammering the site, or if the block simply belongs to a hosting network the site has decided it doesn't want traffic from, your address is collateral damage. The ban isn't about you; it's about the neighbourhood you're renting in.

Subnet bans sit in the middle of a ladder of blocking granularity. Below them are single-IP bans. Above them are bans on an entire autonomous system (every prefix one network operator announces), and bans by country. Each step up catches more abusers with fewer rules and also catches more innocent users. Our overview of why proxies get blocked covers the full set of signals sites use; this post zooms in on the range-level part of that picture.

CIDR in plain English: what /24 really means

The slash notation comes from Classless Inter-Domain Routing (CIDR), documented in RFC 4632. An IPv4 address is 32 bits long. The number after the slash, called the prefix length, says how many of those leading bits are fixed. Whatever bits are left over can vary, and every combination of them is an address inside the block.

So in 203.0.113.0/24, the first 24 bits (the 203.0.113 part) are fixed and the last 8 bits are free. Eight free bits give 256 addresses (2 to the power of 8), from 203.0.113.0 to 203.0.113.255. Every time you shorten the prefix by one bit, the block doubles; every time you lengthen it by one, the block halves. The table below follows the address-count table in RFC 4632.

PrefixAddresses in blockEveryday descriptionWhat a ban on it means for proxies
/321A single hostOnly that one IP is affected
/2816A small slice of a blockRare as a ban unit; a handful of neighbours affected
/24256Legacy "Class C" sizeThe classic subnet ban; every IP sharing the first three octets goes down
/221,024Four adjacent /24sA whole small allocation can be wiped out in one rule
/1665,536Legacy "Class B" sizeVery broad; tends to hit large parts of one network operator's space
ASNVaries (all prefixes the network announces)An entire network operatorEvery IP routed by that operator, often across many unrelated customers

Two practical shortcuts help when you're eyeballing proxy lists. First, for a /24 you only need to compare the first three octets: 198.51.100.9 and 198.51.100.240 are in the same /24, while 198.51.100.9 and 198.51.101.9 are not. Second, a smaller number after the slash means a bigger block, which trips people up constantly.

A note on the examples: The ranges used throughout this post, 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, are reserved for documentation by RFC 5737, and 2001:db8::/32 is the IPv6 documentation prefix. They don't belong to any real network, so you can copy the examples safely.

CIDR size diagram: blocks labeled /32, /24 (256 IPS) and /16 grow left to right under a bar labeled NETWORK BITS
A smaller prefix number means a bigger block: a /24 holds 256 addresses, a /16 holds 65,536.

Why /24 became the default unit of a ban

Nothing in any standard says "ban by /24". It's a convention, and it exists because /24 lines up with how the internet is actually organised.

It's the smallest block that's routed globally

Networks announce their address space to each other over BGP, and most operators refuse to accept announcements that are too specific. RFC 7454, the IETF's BGP operations and security guidance, notes that the RIPE community has documented that IPv4 prefixes longer than /24 (and IPv6 prefixes longer than /48) are generally neither announced nor accepted on the internet. In practice that means a /24 is the smallest IPv4 chunk that can have its own independent route. All the addresses inside one /24 travel the same path and are usually controlled by the same operator.

Neighbouring addresses tend to share an owner

Because space is handed out and routed in blocks, the addresses next to a misbehaving IP are statistically likely to belong to the same hosting company, the same customer, or even the same rented server range. If a defender sees abuse from 203.0.113.14, 203.0.113.87 and 203.0.113.150, it's a reasonable guess that the rest of 203.0.113.0/24 is under the same control. Banning the block anticipates the next address the attacker will rotate to.

It's the legacy "Class C" boundary

Before CIDR, IPv4 used fixed classes, and a Class C network was exactly 256 addresses. RFC 4632 still labels /24 as the legacy Class C size. Decades of tooling, documentation and habit grew up around that boundary, so "the /24" is simply the unit many admins reach for first.

Why sites ban whole blocks instead of single IPs

From the defender's chair, banning ranges is efficient. A few reasons come up again and again:

  • Rotation makes single-IP bans whack-a-mole. Rotating proxies are designed to hand out a fresh address per request or per session. If abuse is coming from a rotating pool, blocking each address after it misbehaves barely slows the traffic down. Blocking the block it rotates within stops it in one step. Our explainer on how rotating proxies work shows why that rotation usually happens inside a limited set of ranges.
  • Fewer rules, less maintenance. One range rule replaces hundreds of single-address entries and keeps firewall and WAF lists manageable.
  • Hosting space rarely contains real customers. A retail or ticketing site doesn't expect many genuine shoppers to browse from cloud or server ranges. Blocking a datacenter /24 carries little collateral risk for the site, which is exactly why datacenter proxies are the most exposed to this kind of ban.
  • Reputation is tracked per range. IP reputation and blocklist services often score and list networks, not just individual hosts. If a block has a history of spam, scanning or scraping, the whole block inherits a poor score, which feeds straight into automated blocking decisions. See our IP reputation glossary entry for the basics.
  • It's a cheap first response during an incident. When a site is under heavy automated load, an engineer can stop the bleeding quickly by blocking a few ranges, then refine later. Those "temporary" rules sometimes stay in place for a long time.

The trade-off for the site is collateral damage. Blocking a range of residential or mobile addresses can lock out real customers, especially where many people share addresses through carrier-grade NAT (see CGNAT). That's why defenders are usually more cautious with consumer ISP space than with hosting space, and why residential proxies tend to survive range-level blocking better than datacenter ones.

How the tools express a range ban

It helps to see how little effort a subnet ban takes on the defender's side. The mainstream tools all accept CIDR notation directly:

  • nginx: the ngx_http_access_module deny directive accepts an address, a CIDR range, unix: or all. A single line such as deny 203.0.113.0/24; shuts out all 256 addresses. The nginx docs note that rules are checked in order until the first match.
  • Cloudflare IP Access rules: Cloudflare's documentation lists IP Access rules that act on a single IP, an IP range, an Autonomous System Number or a country. For ranges, the documented IPv4 options are /24 and /16, and the IPv6 options are /128, /64, /48 and /32. Notice that the smallest IPv4 range option is exactly a /24, and that ASN-wide rules sit right next to it.
  • AWS WAF IP sets: AWS's documentation says IP sets take addresses in CIDR notation and support all IPv4 and IPv6 CIDR ranges except /0, so a defender can block anything from a single /32 to a very broad range.

Commercial bot-management products layer behavioural scoring on top of this, but the basic mechanism is the same: once a range is judged bad, a single rule covers every address in it.

A ban you can't see from the outside

You usually can't tell from the response alone whether you were blocked as an individual IP, as a /24 or as a whole ASN. A 403, a CAPTCHA wall and a silent timeout can all come from the same range rule. The diagnosis steps later in this post are how you tell them apart.

IPv6 changes the unit: /64, /56 and /48

IPv6 addresses are 128 bits long, and the address space is so large that "one IP" stops being a meaningful unit. RFC 4291, the IPv6 addressing architecture, requires interface identifiers to be 64 bits long for most addresses, which makes /64 the standard size of a single IPv6 subnet. A single /64 contains 2 to the power of 64 addresses; Cloudflare's own documentation spells that out as 18,446,744,073,709,551,616.

End sites are typically given far more than one /64. RFC 6177 says end sites should be able to obtain at least a /64 and in most cases significantly more, and notes that RIRs have encouraged assigning /56 blocks to end sites, replacing the older blanket recommendation of a /48. That is why IPv6 defenders commonly reason in /64, /56 or /48 blocks rather than individual addresses: a visitor can cycle through millions of addresses inside their own /64 without ever leaving it.

For proxy buyers, the consequence is simple. A provider advertising "millions of IPv6 addresses" may be selling addresses from a small number of /64s or /48s. If the target site rate-limits or bans per /64, those millions collapse into a handful of effective identities. Our guide to IPv4 vs IPv6 proxies covers which sites even accept IPv6 traffic and when it's worth paying for.

Subnet bans vs IP bans vs ASN bans

Range bans are one layer of a stack. It's worth knowing how they compare, because the fix depends on which layer you hit.

Ban typeWhat it coversTypical triggerCollateral damageWhat usually fixes it
Single IPOne address (/32 in IPv4)That IP's own request rate or behaviourLowRotate to another IP, ideally in a different /24
Subnet (/24 or similar)Every address sharing the prefixAbuse spread across several neighbouring IPs, or a poor range reputationMedium: everyone renting space in that blockMove to IPs in different /24s, and fix whatever triggered it
IPv6 /64 or /48One customer's IPv6 allocationRate limits or abuse from many addresses in the same allocationUsually one customer, sometimes moreUse addresses from different allocations, or fall back to IPv4
ASNEvery prefix one network operator announcesThe operator is a known hosting or proxy network, or has a poor overall reputationHighSwitch to IPs on different networks; often means switching proxy type
CountryAll traffic geolocated to a countryBusiness or legal policy rather than abuseVery highUse exits in a permitted location, if your use case allows it

The ASN row is where subnet bans most often escalate. If a site keeps seeing bad traffic from different /24s that all belong to the same hosting provider, banning the whole autonomous system becomes the efficient next step. That's covered in depth in our ASN explainer.

How to measure /24 and ASN diversity in a proxy pool

Raw IP count is the number providers like to advertise, but distinct blocks and distinct networks are what determine how a pool survives range-level blocking. You can measure both yourself.

Step 1: collect real exit IPs

Don't trust the gateway hostname; you need the addresses your traffic actually exits from. Send a few hundred requests through the pool to an IP-echo endpoint and log the address each one reports. For rotating pools, sample over time and across sessions so you see the real spread, not just the first few addresses. Our guide on how to test a proxy covers echo endpoints and leak checks.

Step 2: group them by /24 (and /64 for IPv6)

With the IPs in a text file, one per line, Python's standard ipaddress module does the grouping without any extra packages:

import ipaddress
from collections import Counter

def block_of(ip_str):
    ip = ipaddress.ip_address(ip_str.strip())
    prefix = 24 if ip.version == 4 else 64
    return ipaddress.ip_network(f"{ip}/{prefix}", strict=False)

with open("exit_ips.txt") as f:
    ips = [line for line in f if line.strip()]

blocks = Counter(block_of(ip) for ip in ips)
top_block, top_count = blocks.most_common(1)[0]

print(f"exit IPs:        {len(ips)}")
print(f"distinct blocks: {len(blocks)}")
print(f"largest block:   {top_block} ({top_count} IPs, {top_count / len(ips):.0%})")

Two numbers matter. Distinct blocks tells you how many separate range rules a defender would need to block everything you've seen. Largest block share tells you how much of your traffic a single /24 ban would take out. A pool where one /24 carries a big share of your exits is fragile no matter how many IPs it claims.

Step 3: map blocks to ASNs

Next, find out which networks those addresses belong to. Team Cymru runs a free IP-to-ASN mapping service with a whois interface at whois.cymru.com; a verbose lookup returns the origin AS, the announced BGP prefix, the country, the registry and the AS name. Its documentation shows the pattern:

whois -h whois.cymru.com " -v 198.51.100.9"

The leading space inside the quotes is deliberate; Team Cymru's docs explain it stops your local whois client from treating the flags as its own. For large lists, their docs describe a bulk mode over netcat. Count distinct ASNs the same way you counted /24s, and note whether they're consumer ISPs, mobile carriers or hosting companies.

The announced BGP prefix in that output is also useful: if many of your /24s sit inside one larger announced prefix from one operator, they're less independent than they look.

Step 4: read the results

  • Many IPs, few /24s: high subnet-ban risk. One or two rules could take out the pool.
  • Many /24s, one ASN: resilient to subnet bans, but exposed to an ASN-wide block.
  • Many /24s across many consumer ASNs: the most resilient shape, typical of residential and mobile pools, though usually priced accordingly.

Ask before you buy

For datacenter and ISP proxy packages, ask the provider how many distinct /24s and ASNs the package spans, and whether you can request IPs from different subnets. A provider that answers clearly is giving you a much better quality signal than the headline IP count.

Flowchart: PROXY POOL splits into GROUP BY /24 and GROUP BY ASN, both feeding a gauge labeled DIVERSITY SCORE
Group your pool by /24 and by ASN to see how concentrated it really is.

Signs you've hit a subnet ban

A subnet ban has a recognisable fingerprint once you know what to look for:

  1. Several IPs fail at the same time. Individual IP bans trickle in as each address crosses a threshold. Range bans flip a group of addresses from working to blocked together.
  2. The failures cluster by prefix. Group your failing and working IPs with the script above. If every address in certain /24s fails and every address in other /24s works, the range is the unit being blocked.
  3. Fresh, unused IPs in the same block fail immediately. If an address that has never sent a request to the site is blocked on its first attempt, it wasn't judged on its own behaviour.
  4. Other sites still work. If the same IPs load other targets normally, the block is specific to that site's rules rather than a provider outage.
  5. Failures span /24s from one provider network. If whole groups of different /24s fail and they all map to the same ASN, you're likely looking at an ASN-level block instead.

Run this diagnosis before you change anything. Rotating blindly mixes evidence from different causes and makes it harder to know what actually worked.

What to do after a subnet ban

Once you're fairly sure a range is banned, work through these steps in order.

1. Stop sending traffic from the banned range

Keep hitting a blocked range and you just generate more negative signals for that block and possibly for the rest of the provider's network. Pull those IPs out of rotation for that target. They may still be fine for other sites.

2. Find and fix the trigger

A subnet ban is often a reaction to what happened inside the range, and some of that may have been your traffic. Check your request rate, concurrency, retry behaviour and headers. If you were running many parallel workers against one site, fresh IPs will end up in the same place. Our guide to ethical web scraping covers rate limits and robots.txt, which also happen to be the habits that keep ranges healthy.

3. Ask your provider for replacements in different subnets

For static datacenter or ISP proxies, contact support and ask specifically for replacement IPs in different /24s, and ideally on a different network, rather than "new IPs". Replacements from the same block are likely to be just as blocked. Providers' replacement policies differ, so check yours.

4. Re-measure diversity before scaling back up

Run the /24 and ASN check on the new set before you put it under load. If the replacements sit in one or two blocks, you've only postponed the next ban.

5. Consider a different proxy type for that target

If a site keeps banning ranges across a datacenter provider's space, or blocks the provider's whole ASN, more datacenter IPs won't solve it. Residential or mobile exits spread across consumer ISP networks are harder to block wholesale, because doing so would lock out real users. That resilience usually costs more per gigabyte or per IP, so reserve it for targets that really need it.

6. Don't count on the ban expiring

Some range rules are temporary and some are permanent; you generally can't know which from the outside. You can test a banned block again after a long pause, but plan as if it won't come back.

Don't try to "out-rotate" a ban

Responding to a block by throwing more IPs and more concurrency at the same site is the fastest way to turn a single subnet ban into an ASN ban, and it can breach the site's terms. If a site clearly doesn't want automated traffic, the right answer may be an official API, a data licence or a lower request rate, not a bigger pool.

Who should worry about subnet bans (and who shouldn't)

Worry most if you run datacenter or static ISP proxies against well-defended targets such as large e-commerce, ticketing, sneaker or social platforms; if your package is a few hundred IPs in a couple of adjacent ranges; or if you share ranges with other customers whose traffic you can't see. Shared datacenter IPs are the most exposed, because your reputation depends on strangers' behaviour.

Worry less if you're using a residential or mobile pool whose exits are spread across many consumer ISPs, or if your targets are low-sensitivity sites that rarely block at all. You can still be blocked per IP or per session, but a single range rule is unlikely to take out a meaningful share of a well-diversified pool.

Personal use, such as a VPN or a single proxy for privacy, can also run into range bans, typically as extra CAPTCHAs or blocked logins when a VPN or hosting range has a poor reputation. Switching to a different server location usually moves you to a different block.

Final thoughts

A subnet ban is the internet's way of judging you by your neighbours. Because routing, ownership and reputation are all organised around blocks, and /24 is the smallest IPv4 block that's routed globally, defenders can wipe out 256 addresses with one line of nginx or one WAF rule. IPv6 moves the unit up to /64, /56 or /48, and ASN bans sit one step above all of it.

The practical takeaways are short. Judge proxy pools by distinct /24s and ASNs, not headline IP counts. Measure your own exits with a simple script and a Team Cymru lookup. When a range goes dark, confirm it's really a range ban, stop using that block, fix the behaviour that triggered it, and ask for replacements in genuinely different subnets. And if a target keeps banning whole networks, take that as a signal to change proxy type or approach rather than trying to outrun it.

Frequently asked questions

A subnet ban blocks a whole contiguous range of IP addresses, such as a /24, instead of a single IP. Every address inside the range gets the same treatment, so innocent neighbouring IPs are blocked along with the ones that misbehaved.

A /24 fixes the first 24 of an IPv4 address's 32 bits and leaves 8 bits free, which gives 256 addresses. For example, 203.0.113.0/24 covers 203.0.113.0 through 203.0.113.255.

Neighbouring addresses usually share an operator and a route, so abuse from a few IPs suggests the rest of the block is under the same control. One range rule also stops rotating traffic that would dodge single-IP bans, and it is easier to maintain than hundreds of individual entries.

Look for several IPs failing at the same moment and group the failures by /24. If every IP in certain /24s fails while IPs in other /24s still work, and even unused IPs in the bad blocks fail on their first request, the range itself is being blocked.

Stop sending traffic to that site from the banned range, fix whatever rate or behaviour triggered the block, and ask your provider for replacement IPs in different /24s, ideally on a different network. Re-check the diversity of the replacements before you scale back up.

No. A subnet ban covers one prefix such as a /24, while an ASN ban covers every prefix a network operator announces, which can be many unrelated blocks. Sites often escalate to an ASN ban when they keep seeing abuse from different subnets on the same network.

IPv6 subnets are normally /64, and a single /64 contains an enormous number of addresses, so defenders tend to rate-limit or ban per /64, /56 or /48 rather than per address. Millions of IPv6 proxies drawn from a few /64s can behave like only a few identities.

They are more resistant, not immune. Residential exits are spread across many consumer ISP ranges, and blocking those ranges would also lock out real users, so sites are more cautious about it. Individual residential IPs can still be blocked per IP or per session.

Found this useful? Share it.