/ _ \ \_\(_)/_/ _//"\\_ more on JOHLEM.net / \ 0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0 ===================================================================== SUBNETTING CHEATSHEET ===================================================================== ---------------------- SUBNETTING OVERVIEW ---------------------- - Definition: Dividing a network into smaller pieces is known as **Subnetting**. - Purpose: * Organize devices into logical groups. * Improve efficiency, security, and control. * Enable larger networks to function effectively. ===================================================================== SUBNETTING TERMINOLOGY (Q&A FORMAT) ===================================================================== 1. **What is the technical term for dividing a network into smaller pieces?** Answer: Subnetting 2. **How many bits are in a subnet mask?** Answer: 32 bits 3. **What is the range of a section (octet) of a subnet mask?** Answer: 0-255 4. **What address is used to identify the start of a network?** Answer: Network address Example: A device with an IP address `192.168.1.100` is on the network identified by `192.168.1.0`. 5. **What address is used to identify devices within a network?** Answer: Host address Example: An IP address `192.168.1.100` is a host within the network `192.168.1.0`. 6. **What is the name used to identify the device responsible for sending data to another network?** Answer: Default gateway Example: Default gateway is typically `192.168.1.254` or the first/last IP in the subnet range. ===================================================================== SUBNET MASKS AND CIDR NOTATION ===================================================================== - **What is a subnet mask?** A subnet mask determines which portion of an IP address identifies the network and which part identifies the host. - Example Subnet Mask: * `255.255.255.0` means the first 3 octets (24 bits) are for the network, while the last octet (8 bits) is for hosts. - **CIDR Notation:** Classless Inter-Domain Routing (CIDR) is a shorthand way to represent subnet masks. Example: * `/24` is equivalent to `255.255.255.0`. * `/16` is equivalent to `255.255.0.0`. - **Subnetting Examples:** * `/24`: 256 IPs per subnet (254 usable for hosts). * `/25`: 128 IPs per subnet (126 usable for hosts). * `/26`: 64 IPs per subnet (62 usable for hosts). ===================================================================== SUBNETTING CALCULATIONS ===================================================================== 1. **How to calculate the number of subnets?** Formula: `2^n`, where `n` is the number of borrowed bits. Example: Borrowing 3 bits in a `/24` subnet gives `2^3 = 8 subnets`. 2. **How to calculate the number of hosts per subnet?** Formula: `2^h - 2`, where `h` is the number of host bits. Example: For `/26`, there are 6 host bits: `2^6 - 2 = 62 hosts`. 3. **Subnetting Example Problem:** - Network: `192.168.1.0/24` - Subdivide into 4 subnets. - Borrow 2 bits (`/26`): `2^2 = 4 subnets`. - Subnets: 1. `192.168.1.0 - 192.168.1.63` 2. `192.168.1.64 - 192.168.1.127` 3. `192.168.1.128 - 192.168.1.191` 4. `192.168.1.192 - 192.168.1.255` ===================================================================== IP ADDRESS CLASSES AND SUBNETTING ===================================================================== 1. **IP Address Classes:** - **Class A**: `0.0.0.0 - 127.255.255.255` (Default `/8`) - **Class B**: `128.0.0.0 - 191.255.255.255` (Default `/16`) - **Class C**: `192.0.0.0 - 223.255.255.255` (Default `/24`) - **Class D**: `224.0.0.0 - 239.255.255.255` (Multicast) - **Class E**: `240.0.0.0 - 255.255.255.255` (Experimental) 2. **Private IP Ranges:** - **Class A**: `10.0.0.0 - 10.255.255.255` - **Class B**: `172.16.0.0 - 172.31.255.255` - **Class C**: `192.168.0.0 - 192.168.255.255` 3. **Reserved IPs:** - `127.0.0.1`: Loopback address for testing local network stack. - `169.254.x.x`: APIPA (automatic private IP addressing). ===================================================================== BENEFITS OF SUBNETTING ===================================================================== - **Efficiency:** * Prevents wasting IP addresses. * Makes network management easier. - **Security:** * Isolates sensitive parts of the network (e.g., employee vs public). - **Traffic Control:** * Reduces broadcast traffic, improving overall performance. - **Scalability:** * Allows networks to grow while maintaining organization. ===================================================================== TROUBLESHOOTING SUBNETTING ===================================================================== 1. **Common Issues:** - Incorrect subnet mask causes devices to fail communication. - Overlapping subnets lead to IP conflicts. 2. **How to Verify Subnets?** Use tools like: * `ping`: Test connectivity. * `ipconfig` (Windows) or `ifconfig` (Linux): Check network details. * `traceroute`: Verify routing paths. ===================================================================== USEFUL SUBNETTING SHORTCUTS ===================================================================== | CIDR | Subnet Mask | # of Subnets | # of Hosts | |-------|-------------------|--------------|-------------| | /24 | 255.255.255.0 | 1 | 254 | | /25 | 255.255.255.128 | 2 | 126 | | /26 | 255.255.255.192 | 4 | 62 | | /27 | 255.255.255.224 | 8 | 30 | | /28 | 255.255.255.240 | 16 | 14 | | /29 | 255.255.255.248 | 32 | 6 | | /30 | 255.255.255.252 | 64 | 2 | ===================================================================== Save this as "Subnetting_Cheatsheet_Extended.txt" for quick reference! =====================================================================