Install
openclaw skills install cidr-calcCalculate subnet information from CIDR notation. Use when the user asks to calculate a subnet, find the network address, broadcast address, host range, subnet mask, or number of hosts for an IP in CIDR notation like 192.168.1.0/24.
openclaw skills install cidr-calcGiven an IP address in CIDR notation, compute all subnet parameters: network address, broadcast, host range, subnet mask, wildcard mask, host counts, IP class, and binary representation.
A.B.C.D/N (e.g. 192.168.1.0/24)A structured result with these fields:
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}. Each octet must be 0–255. Prefix must be 0–32.maskNum = (0xFFFFFFFF << (32 - prefix)) >>> 0wildcardNum = ~maskNum >>> 0networkNum = (ipNum & maskNum) >>> 0broadcastNum = (networkNum | wildcardNum) >>> 0totalHosts = 2^(32 - prefix)usableHosts: if prefix == 32 → 1; if prefix == 31 → 2; else totalHosts - 2| CIDR | Subnet Mask | Total Hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 |
| /16 | 255.255.0.0 | 65,536 |
| /20 | 255.255.240.0 | 4,096 |
| /22 | 255.255.252.0 | 1,024 |
| /24 | 255.255.255.0 | 256 |
| /28 | 255.255.255.240 | 16 |
| /30 | 255.255.255.252 | 4 |
| /32 | 255.255.255.255 | 1 |
Input: 192.168.1.0/24
Output:
CIDR Notation: 192.168.1.0/24
Network Address: 192.168.1.0
Broadcast: 192.168.1.255
Subnet Mask: 255.255.255.0
Wildcard Mask: 0.0.0.255
First Host: 192.168.1.1
Last Host: 192.168.1.254
Total Hosts: 256
Usable Hosts: 254
IP Class: C
Network Type: Private
Binary: 11000000.10101000.00000001.00000000
Input: 10.0.0.0/8
Output:
CIDR Notation: 10.0.0.0/8
Network Address: 10.0.0.0
Broadcast: 10.255.255.255
Subnet Mask: 255.0.0.0
Wildcard Mask: 0.255.255.255
First Host: 10.0.0.1
Last Host: 10.255.255.254
Total Hosts: 16,777,216
Usable Hosts: 16,777,214
IP Class: A
Network Type: Private
Binary: 00001010.00000000.00000000.00000000
A.B.C.D/N).192.168.1.1), ask for the prefix length or assume /32.