# IP-undernetberegner

> Indtast en IPv4-adresse i CIDR-notation, og få netværk, netmaske, broadcastadresse, første og sidste vært samt antallet af værter. Gratis.

Free tool by Orkosi. Page: https://orkosi.com/tools/ip-subnet-calculator?lang=da

Planlægger du en VPC, en firewallregel eller et kontornetværk? Indtast en adresse med præfiks, og se hele blokken: hvor den starter, hvor den slutter, og hvor mange maskiner den rummer.

1. Indtast en IPv4-adresse med et præfiks, f.eks. 10.0.4.20/22.
2. Tryk på Beregn.
3. Se intervallet, masken og antallet af værter.

## Input

| Field | Type | Required | What it is |
| --- | --- | --- | --- |
| `cidr` | text | yes | Adresse og præfiks. |

## Example

Input:

```json
{
  "cidr": "10.0.4.20/22"
}
```

Result:

```json
{
  "network": "10.0.4.0/22",
  "netmask": "255.255.252.0",
  "wildcard": "0.0.3.255",
  "broadcast": "10.0.7.255",
  "first_host": "10.0.4.1",
  "last_host": "10.0.7.254",
  "usable_hosts": 1022,
  "total_addresses": 1024,
  "scope": "Privat (RFC 1918)"
}
```

## Run it

It needs a free Orkosi account, nothing else. No credits are used.

- **A person**: open the page, enter an e-mail once, use the tool.
- **Claude or ChatGPT**: add the Orkosi connector `https://orkosi.com/api/v1/public/mcp` and sign in, or create the free account on the sign-in page. Then call `orkosi_run_free_tool` with `{ "tool": "ip-subnet-calculator", "input": { … } }`.
- **Any agent or program that can make an HTTP request**:

  1. Once, create the account: `POST https://orkosi.com/api/v1/public/signup` with `{ "name": "…", "email": "…", "terms_accepted": true }` and no key. Ask the person for the e-mail and their agreement to the terms first. The answer carries `data.api_key`, shown once.
  2. Run the tool:

```bash
curl -X POST https://orkosi.com/api/v1/public/tools/ip-subnet-calculator/run \
  -H "Authorization: Bearer $ORKOSI_API_KEY" -H "Content-Type: application/json" \
  -d '{"input":{"cidr":"10.0.4.20/22"}}'
```

The answer is `{ "data": { "tool": "…", "result": { … } } }`. A call without a key is answered 401 with the signup steps as data.

## Questions

**Hvad betyder /24?**

De første 24 bit angiver netværket, og de resterende 8 angiver værterne: 256 adresser, hvoraf 254 kan bruges.

**Hvorfor kan to adresser ikke bruges?**

Den første er netværksadressen, og den sidste er broadcastadressen. /31 og /32 er undtagelserne: alle adresser tæller.

**Hvilke intervaller er private?**

10.0.0.0/8, 172.16.0.0/12 og 192.168.0.0/16. De dirigeres aldrig på det offentlige internet.

All free tools: https://orkosi.com/tools.md
