サブネット計算器 (IPv4 CIDR)
ネットワーク、ブロードキャスト、マスク、ワイルドカード、ホスト範囲、数などのIPv4サブネットの分解。
結果はタイプすると更新されます。
この計算機の情報
This subnet calculator turns an IPv4 address and a CIDR prefix into the full structure of a subnet. An IPv4 address is 32 bits, usually written as four dot-separated octets like 192.168.1.10, and a CIDR prefix such as /24 splits those 32 bits into a network part (the leading bits, fixed for every host in the subnet) and a host part (the remaining bits, unique to each device). This calculator takes an address and a prefix length and derives the network address, broadcast address, subnet mask, wildcard mask and the range of usable host addresses, along with the IP class and total address count.
The size of a subnet is set by the prefix: a /n block holds 2^(32−n) addresses, of which two are reserved — the network address (all host bits 0, naming the subnet) and the broadcast address (all host bits 1, reaching every host). So a /24 has 2^8 = 256 addresses and 254 usable hosts, a /25 has 128 addresses and 126 usable hosts, and each extra prefix bit halves the block. As a worked example, 192.168.1.10/24 gives a network of 192.168.1.0, a broadcast of 192.168.1.255, a 255.255.255.0 mask, a 0.0.0.255 wildcard mask, and a usable host range of 192.168.1.1 to 192.168.1.254.
Subnetting is how networks are carved into manageable, secure segments — separating departments, sizing VLANs, planning address allocation and writing firewall and routing rules. The wildcard mask (the bitwise inverse of the subnet mask) is what Cisco access-control lists and OSPF use to match ranges of addresses. The /31 and /32 prefixes are special cases: /31 is used for point-to-point links with two usable addresses and no broadcast, and /32 describes a single host.
よくある質問
サブネットには何台のホストが含まれていますか。
A /n subnet has 2^(32−n) addresses, minus two reserved for the network and broadcast. A /24 has 256 addresses and 254 usable hosts.
ワイルドカードマスクとは何ですか?
A wildcard mask is the bitwise inverse of the subnet mask (255.255.255.0 → 0.0.0.255). Access-control lists and OSPF use it to match ranges of addresses.
ネットワークアドレスとブロードキャストアドレスの違いは何ですか。
ネットワークアドレス (ホストビット 0 はすべて) はサブネットの名前を指定します。ブロードキャストアドレス (ホストビット 1 はすべて) は、サブネット上のすべてのホストに到達します。どちらもデバイスに割り当てることはできません。
CIDR プレフィックス (/24, /16) は何を意味しますか?
これはアドレスのネットワーク部分を構成する先頭のビットの数です。大きいプレフィックスはネットワークビットが多く、ホストビットが少ないことを意味します。小さいサブネットは、/24は254ホスト、/25は126ホストを提供します。余分なビットはブロックを半分にします。
ネットワークを小さなサブネットに分割するにはどうしますか?
プレフィックスを増やすことでホストビットを借りる。/24を2つの/25に分割すると、126ホストのブロックが2つになり、/26に移動すると、62ホストのブロックが4つになります。プレフィックスビットを追加するごとに、サブネットの数を倍にし、サイズを半分にします。
IPアドレスクラスとは何ですか?
古いクラスフル方式はアドレスを最初のオクテットで分割し、クラスA(1-126)、クラスB(128-191)、クラスC(192-223)をユニキャストに、マルチキャストにD、Eを予約した。
/31と/32サブネットは何に使われますか?
A /31 has just two addresses and no broadcast, used for point-to-point links between routers. A /32 is a single host address, common for loopbacks and host routes. The calculator handles both special cases.
API — コードからこの計算機を使う
この計算機を自由な JSON エンドポイントとして呼び出します。鍵は必要ありません。下のフィールド値をクエリパラメータまたは JSON として送信してください。 省略したものは、このページに既に入力されているデフォルトと同じ値を使用します。未知のパラメータは 400 で、サイレンスゼロはありません。 API ドキュメントを読む →
エンドポイント
GET https://calculator.free/api/v1/subnet/
curl
curl "https://calculator.free/api/v1/subnet/?ip=192.168.1.10&cidr=24"
JavaScript fetch()
const r = await fetch(
"https://calculator.free/api/v1/subnet/?" + new URLSearchParams({
"ip": "192.168.1.10",
"cidr": "24"
}));
const data = await r.json();
console.log(data.results);
結果は一般的な指導のための推定であり,財務的,医療的または税務的な助言ではない。