Advertisement
Names the rule that fires · finds denies that never run

Is This IP in Your CIDR Range?
And Which Rule Actually Fires

Paste addresses on one side and your CIDR blocks on the other. Every pair gets tested — but instead of listing the blocks that happen to contain an address, this tells you which one matches first, because that is the only one a firewall ever runs. When nothing matches it names the nearest block and how far outside it you are, and it flags any rule that can never fire at all.

Up to 5,000 addresses against 1,000 blocks. Nothing is uploaded.

0

Matched

0

No match

0

Not recognised

0

Rules that never fire

Quick Answer: How Do You Tell If an IP Is in a CIDR Range?

Compare the leading bits. 203.0.113.55 sits inside 203.0.113.0/24 because the first 24 bits are identical. Against a list, what matters is which block matches first — that is the only rule your firewall will run.

Advertisement
Robert Harrison, OSINT and Network Utility Expert, on testing IP addresses against CIDR allowlists at TrustMyIP.com
Written & Verified By

Robert Harrison

OSINT and Network Utility Expert

Robert works on network diagnostics and the practical end of IP tooling — the conversions, lookups and calculations that sit underneath everything else.

Nobody opens a tool like this out of curiosity. They open it because somebody cannot get in, the allowlist looks correct, and the forty blocks in it all begin with the same three octets. A checker that answers yes or no has given you back the thing you already knew.

So this one answers the questions underneath. Which rule actually fires, because your firewall stops at the first one. How near the miss was, because "nine addresses below the start of your block" is a fix and "no" is not. And which of your rules can never run at all, which is the finding people are most surprised by and least likely to spot by reading.

Last reviewed 25 August 2026 · Runs entirely in your browser · Neither your addresses nor your rules are sent anywhere

View all articles by Robert Harrison
Advertisement

How Does a CIDR Block Decide What Belongs to It?

By counting leading bits. The number after the slash is how many bits at the front are fixed; everything after them is free. An address belongs to the block when those fixed bits are identical. That is the whole membership test.

It does not change with what the list is for. An allowlist, a denylist, or the thing your router still calls a whitelist — same arithmetic, opposite consequence.

203.0.113.0/24 fixes the first 24 bits, which is the first three octets. Any address starting 203.0.113. is inside it and nothing else is. That is the whole rule, and it is why /24 and the subnet mask 255.255.255.0 mean the same thing — both say the same 24 bits are fixed.

Where it stops being obvious is when the prefix does not land on an octet boundary. 203.0.113.64/26 fixes 26 bits, so it covers .64 through .127 and nothing outside that. Read quickly it looks like it covers the whole last octet. It covers a quarter of it.

This is the same arithmetic as bot verification. Checking whether a visitor is really Googlebot means testing its address against the blocks Google publishes — identical maths, different list. The difference is whose list it is: the bot verifier fetches the operators' published ranges live and you cannot change them, while this page tests against ranges you supply. One answers "is this really who it says", the other answers "why did my own rule not fire".

Order is part of the answer

An address can sit inside several of your blocks at once. Every other checker reports that as a list of matches, which is arithmetically true and practically useless, because almost nothing evaluates a rule list as a set.

iptables and nftables walk a chain top to bottom and stop at the first match. nginx reads its allow and deny directives the same way. Cloud firewalls evaluate by priority and stop. Most WAF rule sets and router ACLs do too. If an address hits your third rule and your seventh, rule seven never runs — and if rule seven was the one with the tighter port restriction, you have a problem that a list of matches will not show you.

So the results here lead with the first match, in the order you pasted your rules, and mention the others underneath as context rather than as answers.

Why Is My IP Not Matching the Allowlist?

Because of an off-by-a-boundary error, nearly every time. And "no match" is a useless answer to that, because it looks identical whether you are one address outside the block or in a different country.

Take a real shape of ticket. A user reports they cannot reach an internal service. Your allowlist has 203.0.113.64/26 in it. Their address is 203.0.113.55. Every octet matches. The block looks right. It is not right, and reading the two lines side by side will not tell you why.

what the checker says instead of "no" 203.0.113.55 NO MATCH nearest block 203.0.113.64/26 (.64 to .127) distance 9 addresses below the start would fit under 203.0.113.0/25

Nine addresses. The prefix is one bit too long, and the fix is either widening the block to /25 or adding the address on its own. Either way you now know which, and you knew in a second rather than after counting on your fingers.

The three ways an allowlist misses

  • Just below the start. The block begins after your address, as above. Almost always a prefix that is one bit too long.
  • Just past the end. The block stops before your address. 10.0.0.0/24 ends at 10.0.0.255, so 10.0.1.5 is outside by six addresses and looks like it should be inside.
  • Right family, wrong world. An IPv6 address tested against an IPv4-only allowlist is not a near miss at all. The results say so rather than reporting a distance that would mean nothing.

If the block you are checking against came from a start-and-end range somebody sent you, the range to CIDR converter is where that gets turned into blocks properly — a hand-written prefix is exactly where the off-by-one enters. And the CIDR calculator will show you a single block's first and last address if you want to check one by eye.

Which of Your Rules Can Never Match Anything?

The ones sitting inside an earlier block. They read as deliberate and they do nothing.

harmless — a shadowed allow is clutter 1 allow 10.0.0.0/8 ← matches everything in 10.x 2 allow 192.168.0.0/16 3 allow 10.0.5.0/24 ← never runs, but the traffic was allowed anyway

Rule three looks like somebody carefully permitted a subnet. Nothing reaches it, because rule one already matched everything it covers. Removing it would not change what the firewall does — which is the textbook definition of a shadowed rule, and the reason it is worth clearing out rather than worth panicking about.

The version that actually costs you something

Now change one word.

a hole — the block reads as protection and has never fired 1 allow 10.0.0.0/8 ← matches everything in 10.x 2 allow 192.168.0.0/16 3 deny 10.0.5.99 ← never runs. The host is NOT blocked.

Somebody wrote that deny for a reason. It sits in the config where anyone reviewing it will read it as protection. It has never once executed, and the host it names has full access.

This is the failure the industry writes about, and the symptom is specific enough to check for directly: the hit counter on the deny rule stays at zero while the counter on the broad allow above it climbs. You add a rule to block something, connections keep succeeding, and nothing in the config looks wrong.

A shadowed allow is untidy. A shadowed deny is a security hole. The checker separates them for that reason and leads with the denies. Label your rules — put allow, permit, deny, drop, reject or block in front of the block and it will tell you which kind you have. Unlabelled lines are read as allows, since that is what a bare allowlist is.

Shadowing is one of three rule conflicts

The literature groups them together and the distinction is worth having, because the fix differs.

  • Shadowed — an earlier rule matches everything this one would. It never runs. This is what the checker finds.
  • Redundant — a later rule matches the same traffic with the same action. It runs sometimes and changes nothing when it does. Harmless, and worth deleting for the same reason clutter always is.
  • Overly permissive — a rule that is correct but far wider than it needs to be. Nothing detects this from the addresses alone; it needs traffic data, which is why cloud providers only surface it after logging is switched on.

A conflict in the strict sense is two rules with opposite actions covering the same traffic. Order decides which wins, and if the order is wrong the config says one thing and the firewall does another.

How to fix one

Two options, and the right one depends on what you meant.

  • Move the specific rule above the broad one. Specific denies belong above broad permits. This is the fix in almost every case and it is the standard advice in every ACL review checklist.
  • Narrow the broad rule so it no longer covers the exception. More work, and the right answer when the broad rule was too generous to begin with.
  • Delete the shadowed rule — but only once you are sure it was never meant to do anything. Deleting rules on a tool's say-so is how outages happen.

This is trivial to see in three lines and impossible to see in forty, which is why the checker looks on every run and reports what it finds whether or not you asked. To compare your blocks against each other rather than against an address — duplicates, containment, adjacency and what the list merges down to — the CIDR overlap checker does that side. Nothing warns you otherwise: the config loads, the firewall starts, and the rule simply never fires.

This is a recognised category, not a curiosity. Google Cloud runs a whole feature for it — Firewall Insights flags shadowed rules as a medium-severity finding, defining them the same way: a rule sharing address ranges with another of higher or equal priority. Commercial analysers have done it for two decades. What none of them do is let you check a handful of rules in a browser in ten seconds without an account.

Sorting a rule list numerically makes the pattern much easier to read, since every broad block lands directly above the narrower ones inside it. The IP sorter handles that, including CIDR blocks ordered by network then prefix length.

What this tool cannot tell you

It answers a question about addresses and blocks. Your actual rules carry more than that.

It does not know your ports or actions

A real rule has a protocol, a port range and an allow or deny. This page sees only the address part, so "rule three matches first" means the address matches — whether that rule then permits what the user was trying to do is a separate question.

First-match assumes an ordered list

Most things evaluate in order, but not all. Cloudflare IP access rules and AWS security groups behave more like sets, where every rule is considered. The ordering here reflects how you pasted them, which is only meaningful if your platform reads them that way.

A match is not authorisation

An address being inside your allowlist says the packet gets through the filter. It says nothing about whether the request should have been made, or whether the address is really who it claims to be — that is a different check entirely.

Shadowing is reported, not judged

The page tells you a block can never match given the ones above it. Whether that is dead configuration or a deliberate leftover is a decision only you can make, and deleting rules on a tool's say-so is how outages happen.

If the addresses you are testing came out of an access log rather than a support ticket, the bulk bot checker will tell you which of them are genuine search crawlers before you add anything to a list.

And a network lookup tells you who an address belongs to, which is worth knowing before you widen a block to include it.

Frequently asked questions about IP and CIDR matching

How do I check if an IP is in a CIDR range?

Paste the address on one side and the CIDR blocks on the other. Each block is a network address plus a prefix length, and an address belongs to it when the leading bits match that prefix — 203.0.113.55 is inside 203.0.113.0/24 because the first 24 bits are identical. The check above runs that membership test for every address against every block at once, and validates both sides as it goes.

Does this work for a denylist as well as an allowlist?

Yes, and it is worth labelling which is which. The membership arithmetic is identical — an address is either inside a block or it is not — but the consequence is opposite. Put allow or deny in front of each block and the results tell you whether a matched address is being permitted or refused, and whether a rule that can never fire is harmless clutter or a hole in a denylist.

Why does it matter which rule matched first?

Because most things that read a rule list stop at the first match. iptables walks a chain top to bottom, and a cloud firewall evaluates by priority. If your address matches rule three and rule seven, only rule three ever runs — rule seven might as well not exist. Every other checker reports matches as an unordered set, which hides exactly the thing you were trying to find out.

Why is my IP not matching my allowlist?

Usually because the block is close but not close enough, and a plain "no" does not tell you that. When nothing matches, this page names the nearest block and how far outside it you are — 203.0.113.55 against a rule of 203.0.113.64/26 is nine addresses below the start, not a typo somewhere else. It also gives you the prefix that would have covered both.

What is a shadowed CIDR rule?

A block sitting entirely inside an earlier one, so the earlier rule always matches first and the later one never runs. 10.0.5.0/24 listed after 10.0.0.0/8 is dead configuration. The formal test is simple: if removing the rule would not change what your firewall does, it is shadowed. These are impossible to spot by eye in a list of forty, so the checker looks on every run.

Is a shadowed rule always a problem?

No, and the difference matters. A shadowed allow is clutter — the traffic was getting through anyway, so removing it changes nothing. A shadowed deny is a security hole: somebody wrote a block, it reads as protection to anyone reviewing the config, and it has never executed. The symptom in production is exact — the deny rule’s hit counter stays at zero while the broad allow above it climbs. The checker separates the two and leads with the denies.

Can I label my rules as allow or deny?

Yes, and you should. Put allow, permit, accept, deny, drop, reject or block in front of a block and the checker uses it — both to tell you whether a matched address is being permitted or refused, and to work out whether a shadowed rule is harmless clutter or a hole. Unlabelled lines are treated as allows, which is what a bare allowlist is.

Can I check several IPs at once?

Yes, and against several blocks at once. Paste a column of addresses and a column of blocks and every pair is tested, which is the shape of an allowlist audit or a support ticket with a handful of affected users. Up to 5,000 addresses against 1,000 blocks, all in your browser.

Does it handle IPv6?

Yes, using 128-bit arithmetic on the same code path. Addresses and blocks are matched within their own family, so an IPv6 address is never reported as missing from an IPv4 allowlist — that is not a miss, it is a different question.

How is this different from your bot verifier?

Whose list it is. The bot verifier checks an address against ranges that Google, Microsoft, OpenAI and others publish, fetched live — you cannot change them, and the question is whether a visitor really is who it claims. This page checks against your ranges: your allowlist, your WAF rules, your security group. The arithmetic is identical and the question is completely different.

What if a block is written with host bits set?

It still works, and the page tells you. 192.168.1.55/24 is not strictly a network address — the correct form is 192.168.1.0/24 — but most software silently masks the host bits and carries on. Rather than rejecting it or fixing it quietly, the results show the block as written alongside the network it actually means.

Can I paste a bare IP as a range?

Yes. An address with no prefix is treated as a single-host block, so 10.0.0.5 in the range column behaves as 10.0.0.5/32. Allowlists are full of individual addresses written that way and there is no reason to make you add the suffix.

Is anything uploaded?

No. The matching runs entirely in your browser, so neither your addresses nor your rule list is transmitted or logged. Internal allowlists are exactly the sort of thing that should not be pasted into a form that sends them somewhere.

Related IP tools

The rest of the addressing and verification toolkit.

Browse the full set on the TrustMyIP tools directory.

Last updated 25 August 2026 · Runs in your browser · Nothing you paste is sent anywhere