---
id: "ipv6subnet"
kind: "datatype"
status: "stable"
is_pii: true
categories: ["internet"]
langs: ["common"]
quality: 90
url: "http://registry.apicrafter.io/datatype/ipv6subnet"
---

# IPv6 routing prefix (subnet) (`ipv6subnet`)

Block of IPv6 addresses written as an IPv6 address, a slash and a prefix length from 0 to 128 (RFC 4291, section 2.3), such as 2001:db8::/32. Most single network segments are /64, because the interface identifier takes the last 64 bits of an address. Wikidata records the address blocks of organizations in property P3793.

- Parent datatype: `ipsubnet`
- Personal data (PII): yes
- Categories: Internet (internet)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:(?:[0-9A-Fa-f]{1,4}:){6}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|::(?:[0-9A-Fa-f]{1,4}:){5}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4}|(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)/(?:12[0-8]|1[01][0-9]|[1-9]?[0-9])$
```

## Examples

- `2001:610::/29` — SURFnet (example of Wikidata property P3793)
- `2001:630:440::/44` — University of Oxford (example of Wikidata property P3793)
- `2001:db8::/32` — Documentation prefix (RFC 3849)
- `08:00-22:00` (invalid example) — A time range, not an IPv6 prefix
- `2001:db8::` (invalid example) — An IPv6 address without the prefix length
- `2001:db8::/129` (invalid example) — The prefix length is larger than 128

## Mappings

- wikidata: `P3793`

## Translations

- ru: Префикс сети IPv6 (подсеть): Блок IPv6-адресов: адрес, косая черта и длина префикса до 128, например 2001:db8::/32.

## Sources

- wikipedia: <https://en.wikipedia.org/wiki/IPv6_address>
- wikidata: <https://www.wikidata.org/wiki/Property:P3793>
- doc: <https://www.rfc-editor.org/rfc/rfc4291#section-2.3>

## Quality

Score 90/100. Missing: detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/ipv6subnet.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/ipv6subnet.yaml>
