workspace/skills/subnet-calculator/SKILL.md
IPv4 and IPv6 subnet calculator - CIDR breakdown, usable hosts, previous/next subnets, address classification, VLSM planning, and dual-stack analysis. Use when calculating subnets, figuring out how many hosts fit in a prefix, planning IP addressing, getting wildcard masks for ACLs, or checking if two IPs are in the same subnet.
npx skillsauth add automateyournetwork/netclaw subnet-calculatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
subnet_calculator — IPv4 Subnet Detailspython3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"192.168.1.0/24"}'
Parameters:
cidr (required): IPv4 CIDR notation, e.g., 10.0.0.0/8, 172.16.0.0/12, 192.168.1.0/24Returns:
subnet_calculator_v6 — IPv6 Subnet Detailspython3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8::/48"}'
Parameters:
cidr (required): IPv6 CIDR notation, e.g., 2001:db8::/32, fd00::/64, fe80::/10Returns:
subnet_calculator_auto — Auto-Detect IPv4/IPv6python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_auto '{"cidr":"10.0.0.0/24"}'
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_auto '{"cidr":"2001:db8:abcd::/48"}'
Automatically detects IP version and calls the appropriate calculator.
IPv4 /30 link:
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.1.1.0/30"}'
Result: 4 addresses, 2 usable (10.1.1.1 and 10.1.1.2). Standard for router-to-router links.
IPv4 /31 link (RFC 3021):
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.1.1.0/31"}'
Result: 2 addresses (10.1.1.0 and 10.1.1.1). No broadcast waste.
IPv6 /127 link (RFC 6164):
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:1::/127"}'
Result: 2 addresses. Recommended for IPv6 point-to-point links.
Break 10.10.0.0/16 into subnets for different departments:
# Engineering: 500 hosts needed → /23 (510 usable)
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.10.0.0/23"}'
# Sales: 100 hosts needed → /25 (126 usable)
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.10.2.0/25"}'
# Management: 10 hosts needed → /28 (14 usable)
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.10.2.128/28"}'
# Server VLAN: 30 hosts needed → /27 (30 usable)
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.10.2.192/27"}'
Produce an addressing plan:
Subnet Plan — 10.10.0.0/16
┌────────────┬─────────────────┬────────┬───────────┬───────────────┐
│ Department │ Subnet │ Prefix │ Usable │ Gateway │
├────────────┼─────────────────┼────────┼───────────┼───────────────┤
│ Engineering│ 10.10.0.0/23 │ /23 │ 510 hosts │ 10.10.0.1 │
│ Sales │ 10.10.2.0/25 │ /25 │ 126 hosts │ 10.10.2.1 │
│ Management │ 10.10.2.128/28 │ /28 │ 14 hosts │ 10.10.2.129 │
│ Servers │ 10.10.2.192/27 │ /27 │ 30 hosts │ 10.10.2.193 │
│ P2P Links │ 10.10.3.0/24 │ /30 ea │ 2 per link│ varies │
└────────────┴─────────────────┴────────┴───────────┴───────────────┘
Plan a /48 allocation for a campus:
# Site allocation
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:abcd::/48"}'
# Building 1 — first /56 from the /48
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:abcd::/56"}'
# Floor 1, Building 1 — first /64 from the /56
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:abcd::/64"}'
# Loopback /128
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:abcd::1/128"}'
# Point-to-point /127
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:abcd:ffff::/127"}'
IPv6 Allocation — 2001:db8:abcd::/48
┌──────────────┬──────────────────────────┬────────┬──────────────────────┐
│ Purpose │ Prefix │ Size │ Note │
├──────────────┼──────────────────────────┼────────┼──────────────────────┤
│ Site │ 2001:db8:abcd::/48 │ /48 │ 65,536 /64 subnets │
│ Building 1 │ 2001:db8:abcd::/56 │ /56 │ 256 /64 subnets │
│ Floor 1/B1 │ 2001:db8:abcd::/64 │ /64 │ SLAAC capable │
│ Loopback │ 2001:db8:abcd::1/128 │ /128 │ Single host │
│ P2P Link │ 2001:db8:abcd:ffff::/127 │ /127 │ RFC 6164 │
└──────────────┴──────────────────────────┴────────┴──────────────────────┘
# What's the wildcard for a /22?
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.0.0.0/22"}'
Use the wildcard_mask field directly in ACL configuration:
ip access-list extended EXAMPLE
permit ip 10.0.0.0 0.0.3.255 any
Verify both IPv4 and IPv6 assignments on an interface:
# IPv4 side
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.1.1.1/30"}'
# IPv6 side
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator_v6 '{"cidr":"2001:db8:1::1/127"}'
| Prefix | Hosts | Usable | Use Case | |--------|-------|--------|----------| | /30 | 4 | 2 | Point-to-point link | | /29 | 8 | 6 | Small DMZ | | /28 | 16 | 14 | Management VLAN | | /27 | 32 | 30 | Server VLAN | | /26 | 64 | 62 | Small department | | /25 | 128 | 126 | Medium department | | /24 | 256 | 254 | Standard subnet | | /23 | 512 | 510 | Large subnet | | /22 | 1024 | 1022 | Campus building | | /16 | 65536 | 65534 | Campus site |
| Prefix | Subnets (/64) | Use Case | |--------|--------------|----------| | /128 | 0 | Single host (loopback) | | /127 | 0 | Point-to-point link (RFC 6164) | | /64 | 1 | Standard subnet (SLAAC) | | /56 | 256 | Building or floor | | /48 | 65,536 | Site allocation | | /32 | 16,777,216 | ISP allocation |
After calculating subnets, use pyats-config-mgmt to apply:
# Calculate the subnet first
python3 $MCP_CALL "python3 -u $SUBNET_MCP_SCRIPT" subnet_calculator '{"cidr":"10.1.1.0/30"}'
# Then configure the interface
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "${PYATS_PYTHON:-python3} -u $PYATS_MCP_SCRIPT" pyats_configure_device '{"device_name":"R1","config_commands":["interface GigabitEthernet2","ip address 10.1.1.1 255.255.255.252","no shutdown"]}'
tools
Federate your NetClaw with other NetClaw operators over the BGP mesh — exchange capability inventories and ask your claw what a peer can do. (US1; remote invocation and chat land in later phases.)
tools
3D network topology visualization and interactive digital twin in Unreal Engine 5.8 via the built-in UE5 MCP server.
testing
Human-in-the-loop escalation via HumanRail — route low-confidence agent decisions, pre-destructive operation approvals, and ambiguous incident tickets to real human engineers. Human answers are verified and returned as structured output. Workers are paid via Lightning Network. Use when the agent is uncertain, when a destructive change needs explicit human sign-off beyond a ServiceNow CR, or when an ambiguous ticket requires human triage before automated handling.
testing
Manage network incident response workflows in Slack - incident channels, status updates, escalation, resolution tracking, and post-incident review coordination. Use when declaring a network incident, coordinating outage response in Slack, tracking incident status, or running a post-incident review.