Đi tới nội dung

Tính subnet CIDR

Phân tích dải CIDR, tính dải địa chỉ, chia nhỏ subnet và kiểm tra một IP có nằm trong mạng hay không.

Chạy cục bộ trên trình duyệt

Network address10.0.0.0
Broadcast address10.0.255.255
First usable10.0.0.1
Last usable10.0.255.254
Usable hosts65,534
Total addresses65,536
Subnet mask255.255.0.0
Wildcard mask0.0.255.255
Prefix length/16

// split /16 into smaller subnets

#NetworkRangeUsable
010.0.0.0/1810.0.0.1 - 10.0.63.25416,382
110.0.64.0/1810.0.64.1 - 10.0.127.25416,382
210.0.128.0/1810.0.128.1 - 10.0.191.25416,382
310.0.192.0/1810.0.192.1 - 10.0.255.25416,382

Cách hoạt động

How CIDR works

Prefix length

The number after the slash is the prefix length. It tells you how many bits of the address are the network portion. /24 means the first 24 bits are the network, leaving 8 bits (256 addresses) for hosts.

Usable vs total

Every normal subnet reserves the first address for the network identifier and the last for broadcast. Usable hosts = total addresses minus 2. Point-to-point links (/31) and host routes (/32) are the exceptions.

Common prefixes

  • /32: a single host (1 address)
  • /30: 4 addresses, 2 usable (point-to-point link)
  • /24: 256 addresses, 254 usable (classic LAN)
  • /16: 65,536 addresses (AWS VPC default)
  • /8: 16,777,216 addresses (one of the old class-A ranges)

Câu hỏi thường gặp

What does /24 mean in CIDR?

A /24 CIDR block has 24 bits of network prefix, leaving 8 bits for hosts. That gives 256 total addresses, of which 254 are usable (the first is the network address, the last is broadcast).

How many usable IP addresses does a /16 have?

A /16 has 2^16 = 65,536 total addresses. Subtracting the network and broadcast addresses leaves 65,534 usable host addresses. AWS VPCs commonly use /16 as the VPC CIDR.

Can I split a CIDR block into smaller subnets?

Yes. Use the subnet splitter on this page to divide a parent CIDR into equal-sized children. For example, a /16 can be split into 4 /18 subnets, 16 /20 subnets, and so on.

How do I check if an IP is inside a CIDR range?

Enter the CIDR block, then paste the IP into the checker. The tool bit-masks the IP with the subnet mask and compares it to the network address to confirm inclusion.

Các công cụ được port từ DevOps Daily theo giấy phép MIT.Xem bản gốc

Công cụ khác

Giải mã JWT

Xem nội dung bất kỳ JWT nào ngay trên trình duyệt. Không gửi gì lên server.

Mở công cụ

Tạo UUID và secret

Định danh và secret ngẫu nhiên an toàn về mật mã, tạo ngay trên trình duyệt.

Mở công cụ