Subnetting to simplicity - kevshouse/Net_Practice GitHub Wiki
Subnetting Cheat Sheet
A quick-reference guide for calculating subnets, network boundaries, and host ranges using binary tables. Ideal for CCNA exam prep and network troubleshooting.
Binary Conversion Table
Each IPv4 octet (8 bits) maps to the following decimal values:
Bit Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
Value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
Key Steps
- Convert Subnet Mask to Binary:
- Identify how many bits are set to 1 in the mask. For example:
255.255.255.128 β 11111111.11111111.11111111.10000000 (25 bits total for network/subnet).
The last octet (128) corresponds to the first bit (position 7, top left) in the table.
- Calculate Block Size:
Block Size = 256 - Subnet Mask Value (for the relevant octet).
Example: For 255.255.255.128, Block Size = 256 - 128 = 64.
- Determine Subnet Boundaries:
Subnets increment by the Block Size.`
Example: With Block Size 64, subnets are 0, 64, 128, 192.`
- Find Network Address: For an IP like 192.168.1.150 with mask 255.255.255.128:
Last octet of IP: 150 (binary 10010110).
Subnet bits (first bit on the left): 1 (value 128).
Network Address: 192.168.1.128.
- Find Broadcast Address and Host Range:
Broadcast Address: Next subnet - 1 β 128 + 64 - 1 = 191 β 192.168.1.191.
Usable Hosts: 192.168.1.129 to 192.168.1.190.
Example Scenarios
- Subnet Mask: 255.255.255.192 (/26)
Last octet: 192 = 128 + 64 (bits 7 and 6).
Block Size = 256 - 192 = 64.
Subnets: 0, 64, 128, 192.
Hosts per subnet: 2^6 - 2 = 62 (6 host bits).
- Subnet Mask: 255.255.255.248 (/29)
Last octet: 248 = 128 + 64 + 32 + 16 + 8 (bits 7β3).
Block Size = 256 - 248 = 8.
Subnets: 0, 8, 16, ..., 248.
Hosts per subnet: 2^3 - 2 = 6 (3 host bits).
- Check if Two IPs Are on the Same Subnet
IP1: 10.10.10.5, IP2: 10.10.10.123, Mask: 255.255.255.128.
Block Size = 128.
Subnet for 5: 0 (since 5 < 128).
Subnet for 123: 0 (same).
β Same subnet.
Summary
Binary Table: Use it to convert between binary and decimal for subnet masks.
Block Size: Determines subnet increments.
Network/Broadcast Addresses: Derived from Block Size and IP.
Host Range: Always Network + 1 to Broadcast - 1.
Practice with these steps to quickly calculate subnets, troubleshoot routing, and ace your CCNA! π
Worked Troubleshooting scenarios
Here are scenarios where IP addresses appear numerically close but are on different subnets, making direct communication impossible without a router:
Scenario 1: Same IP Range, Different Subnet Mask
IP1: 192.168.1.100
IP2: 192.168.1.200
Subnet Mask: 255.255.255.128 (/25)
Calculation:
Block Size = 256 - 128 = 64
Subnets: 0, 64, 128, 192
192.168.1.100 β Subnet 192.168.1.64 (64β127).
192.168.1.200 β Subnet 192.168.1.192 (192β255).
Result: Different subnets. β
Scenario 2: Adjacent IPs, Small Subnet
IP1: 10.0.0.1
IP2: 10.0.0.2
Subnet Mask: 255.255.255.254 (/31)
Calculation:
Block Size = 256 - 254 = 2
Subnets: 0, 2, 4, ...
10.0.0.1 β Subnet 10.0.0.0 (0β1).
10.0.0.2 β Subnet 10.0.0.2 (2β3).
Result: Adjacent IPs, different subnets. β
Scenario 3: Broadcast vs. Network Address
IP1: 172.16.30.127
IP2: 172.16.30.128
Subnet Mask: 255.255.255.128 (/25)
Calculation:
Subnet 1: 172.16.30.0 (0β127).
172.16.30.127 = Broadcast Address for Subnet 1.
Subnet 2: 172.16.30.128 (128β255).
172.16.30.128 = Network Address for Subnet 2.
Result: Broadcast and Network addresses are in different subnets. β
Scenario 4: Misleading Third Octet
IP1: 10.10.20.5
IP2: 10.10.30.5
Subnet Mask: 255.255.0.0 (/16)
Calculation:
Subnet for IP1: 10.10.0.0 (third octet 20 is part of the host portion).
Subnet for IP2: 10.10.0.0 (third octet 30 is part of the host portion).
Result: Same subnet! β (This is a trick example to highlight that subnet masks define which octets matter. If the mask were /24, theyβd be in different subnets.)
Scenario 5: Non-Contiguous Subnet Mask
IP1: 192.168.5.10
IP2: 192.168.5.20
Subnet Mask: 255.255.255.240 (/28)
Calculation:
Block Size = 256 - 240 = 16
Subnets: 0, 16, 32, ...
192.168.5.10 β Subnet 192.168.5.0 (0β15).
192.168.5.20 β Subnet 192.168.5.16 (16β31).
Result: Same IP range, different subnets. β
Key Takeaway Subnet masks define network boundaries β not the IP addresses themselves. Two IPs can appear numerically close but belong to different subnets if:
The subnet mask creates small block sizes (e.g., /31, /30).
One IP is a broadcast/network address of a subnet.
The mask focuses on different octets (e.g., /16 vs. /24).
Always calculate the network address for each IP using its subnet mask to confirm connectivity! π