← 返回
未分类 中文

Subnet Calc

CIDR and subnet calculator for network engineers. Calculate network address, broadcast, host range, subnet mask, wildcard mask, and more from CIDR notation....
面向网络工程师的 CIDR 与子网计算器。可根据 CIDR 表示法计算网络地址、广播地址、主机范围、子网掩码、通配符掩码等。
johnnywang2001 johnnywang2001 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 400
下载
💾 3
安装
1
版本
#latest

概述

Subnet Calc

CIDR/subnet calculator CLI. IPv4 and IPv6 support with no external dependencies.

Quick Start

# Basic subnet calculation
python3 scripts/subnet_calc.py 192.168.1.0/24

# JSON output
python3 scripts/subnet_calc.py 10.0.0.0/8 -f json

# Check if IP is in a network
python3 scripts/subnet_calc.py 172.16.0.0/16 --contains 172.16.5.10

# Split into smaller subnets
python3 scripts/subnet_calc.py 192.168.0.0/22 --split 24

# IPv6
python3 scripts/subnet_calc.py 2001:db8::/32

Output Fields (IPv4)

  • CIDR — Normalized CIDR notation
  • Network/Broadcast Address — First and last address in the range
  • Subnet Mask / Wildcard Mask — Standard and inverted masks
  • Total Addresses / Usable Hosts — Address count minus network and broadcast
  • First/Last Host — Usable host range
  • Binary representations — Network and mask in binary
  • Flags — Private, loopback, multicast, link-local detection

Options

FlagDescription
-------------------
-f, --formatplain or json output
--contains IPCheck if IP is within the network
--split PREFIXSplit into subnets with given prefix (IPv4)

Notes

  • Python 3 stdlib only (uses ipaddress module)
  • Handles /31 (RFC 3021 point-to-point) and /32 correctly
  • Input is normalized with strict=False (host bits are masked)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 16:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Free Ride - Unlimited free AI

shaivpidadi
管理OpenClaw的OpenRouter免费AI模型,自动按质量排名模型,配置速率限制备用方案,并更新opencla...
★ 471 📥 78,260
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomas-security
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 30,976
business-ops

Agent Invoice Generator

johnnywang2001
根据自然语言或结构化数据生成专业的PDF发票,适用于用户请求创建发票、向客户计费或生成收据等场景。
★ 0 📥 748