Example 10.0.0.50/22
- convert your address to binary (8bits each number)
decimal | binary |
---|---|
10.0.0.50 | 00001010.00000000.00000000.00110010 |
22 (means 1(binary) with 22 bits) | 11111111.11111111.11111100.00000000 |
- get network address by AND calculation
00001010.00000000.00000000.00110010 (ip)
AND
11111111.11111111.11111100.00000000 (mask)
=
00001010.00000000.00000000.00000000 (network address: 10.0.0.0)
- reverse your netmask address
11111111.11111111.11111100.00000000 (mask)
00000000.00000000.00000011.11111111 (netmask reversed)
- get broadcast address by OR calculation
00001010.00000000.00000000.00110010 (ip)
OR
00000000.00000000.00000011.11111111 (netmask reversed)
=
00001010.00000000.00000011.11111111 (broadcast address)
then we know the broadcast is 10.0.3.255, the available adreess range is 10.0.0.0 – 10.0.3.254
以前知道ip地址后面那个/24 /26什么的跟子网掩码有关
博主写的挺明了 总算知道怎么推算了
😉 学习了
pretty good blog,come again next time。
thanks a million