IPv6 in CIDR
ipv6-in-cidr · version 1.0.0 · URLs & IP addresses · free, no key needed
Test whether an IPv6 address lies in a CIDR prefix whose host bits are zero.
Use when you need to: ipv6 in cidr · check ipv6 cidr membership · ipv6 address in network prefix.
Supported
- ipv6 in cidr
- check ipv6 cidr membership
- ipv6 address in network prefix
Not supported
- IPv4
- zone/scope IDs
Behavior
- address accepts any RFC 4291 textual form (see ipv6-parse).
- cidr is address/prefix with prefix a canonical decimal integer 0-128 and no leading zeros except 0.
- The CIDR network address must have host bits zero; otherwise the tool throws "cidr host bits must be zero".
- inside is true iff address's 128-bit value is in [network, network + 2^(128-prefix) - 1].
- network is the RFC 5952 canonical network address; prefix is a JSON integer.
Input
address(string, required): max length 45cidr(string, required): max length 49
Output
inside(boolean, required)network(string, required): max length 45prefix(integer, required): min 0; max 128
Limits
- max address length: 45
- max cidr length: 49
- prefix min: 0
- prefix max: 128
Example
Request input:
{
"address": "2001:db8::10",
"cidr": "2001:db8::/32"
}
Response:
{
"result": {
"inside": true,
"network": "2001:db8::",
"prefix": 32
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "ipv6-in-cidr",
"version": "1.0.0",
"input": {
"address": "2001:db8::10",
"cidr": "2001:db8::/32"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/ipv6-in-cidr/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"address":"2001:db8::10","cidr":"2001:db8::/32"}'
The machine-readable contract is at /v1/tools/ipv6-in-cidr/versions/1.0.0.
CLI
node cli.mjs run ipv6-in-cidr 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- IPv4 in CIDR: Test whether a canonical IPv4 address lies in a CIDR prefix whose host bits are zero.
- IPv6 CIDR contains: Test whether one IPv6 CIDR block fully contains another IPv6 CIDR block.
- IPv6 CIDR overlap: Test whether two IPv6 CIDR blocks overlap (share at least one address).
- IPv6 CIDR parse: Parse an IPv6 CIDR block into its canonical network address, prefix, first/last address, and total address count.
- IPv6 range to cidrs: Convert an arbitrary IPv6 address range into the minimal list of CIDR blocks that exactly covers it.
- IPv4 CIDR contains: Test whether one IPv4 CIDR block fully contains another IPv4 CIDR block.