# IPv6 CIDR subnets

`ipv6-cidr-subnets` · version 1.0.0 · URLs & IP addresses · free, no key needed

Split an IPv6 CIDR block into the full ordered list of equal-size subnets at a given longer prefix.

**Use when you need to: ipv6 cidr subnets · split ipv6 cidr into subnets · ipv6 subnetting.**

## Supported

- ipv6 cidr subnets
- split ipv6 cidr into subnets
- ipv6 subnetting

## Not supported

- IPv4
- unequal (VLSM) splits
- splitting into a target subnet count instead of a prefix

## Behavior

- cidr is address/prefix with host bits zero; new_prefix is a JSON integer strictly greater than cidr's prefix and at most 128.
- subnets is the ordered list of all 2^(new_prefix - prefix) equal-size /new_prefix blocks that exactly partition cidr, network-address first.
- Throws if 2^(new_prefix - prefix) would exceed 4096.

## Input

- `cidr` (string, required): max length 49
- `new_prefix` (integer, required): min 0; max 128

## Output

- `subnets` (array of string, required): max items 4096; each max length 49
- `count` (integer, required): min 1; max 4096

## Limits

- max cidr length: 49
- prefix max: 128
- max output subnets: 4096

## Example

Request input:

```json
{
  "cidr": "2001:db8::/32",
  "new_prefix": 34
}
```

Response:

```json
{
  "result": {
    "subnets": [
      "2001:db8::/34",
      "2001:db8:4000::/34",
      "2001:db8:8000::/34",
      "2001:db8:c000::/34"
    ],
    "count": 4
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "ipv6-cidr-subnets",
  "version": "1.0.0",
  "input": {
    "cidr": "2001:db8::/32",
    "new_prefix": 34
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/ipv6-cidr-subnets/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"cidr":"2001:db8::/32","new_prefix":34}'
```

The machine-readable contract is at [/v1/tools/ipv6-cidr-subnets/versions/1.0.0](/v1/tools/ipv6-cidr-subnets/versions/1.0.0).

### CLI

```sh
node cli.mjs run ipv6-cidr-subnets 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [IPv4 CIDR subnets](/tools/ipv4-cidr-subnets): Split an IPv4 CIDR block into the full ordered list of equal-size subnets at a given longer prefix.
- [IPv6 CIDR aggregate](/tools/ipv6-cidr-aggregate): Merge a list of IPv6 CIDR blocks into the minimal equivalent list of non-overlapping CIDR blocks.
- [IPv4 CIDR aggregate](/tools/ipv4-cidr-aggregate): Merge a list of IPv4 CIDR blocks into the minimal equivalent list of non-overlapping CIDR blocks.
- [IPv6 CIDR contains](/tools/ipv6-cidr-contains): Test whether one IPv6 CIDR block fully contains another IPv6 CIDR block.
- [IPv6 CIDR overlap](/tools/ipv6-cidr-overlap): Test whether two IPv6 CIDR blocks overlap (share at least one address).
- [IPv6 CIDR parse](/tools/ipv6-cidr-parse): Parse an IPv6 CIDR block into its canonical network address, prefix, first/last address, and total address count.
