====== subnetting cheatsheet====== [[HOWTO:HOWTO|{{ :howto:howto.jpeg?120|}}]] ===== context===== dit document beschrijft hoe subnetting in mekaar zit ===== 1. IP Address Structure ===== IPv4 addresses are **32-bit** numbers divided into 4 octets: 192.168.10.5 | 8 bits | 8 bits | 8 bits | 8 bits | ===== 2. Classes (Old Way, Still Useful) ===== ^ Class ^ First Octet Range ^ Default Mask ^ Use ^ | A | 1–126 | /8 | Large networks | | B | 128–191 | /16 | Medium networks | | C | 192–223 | /24 | Small networks | | D | 224–239 | N/A | Multicast | | E | 240–254 | N/A | Experimental | ---- ===== 3. Subnet Mask Basics ===== A subnet mask tells which part is **network** and which part is **host**. Example: 255.255.255.0 → /24 ---- ===== 4. CIDR Notation ===== ^ Subnet Mask ^ CIDR ^ | 255.0.0.0 | /8 | | 255.255.0.0 | /16 | | 255.255.255.0 | /24 | | 255.255.255.128 | /25 | | 255.255.255.192 | /26 | | 255.255.255.224 | /27 | | 255.255.255.240 | /28 | | 255.255.255.248 | /29 | | 255.255.255.252 | /30 | ---- ===== 5. Subnetting Steps (Fast Method) ===== ==== Step 1: Convert mask to binary ==== Example: /26 = 255.255.255.192 = 11111111.11111111.11111111.11000000 ==== Step 2: Find number of subnet bits ==== * /26 has **2 bits** for subnet (since default /24 + 2) ==== Step 3: Calculate number of subnets ==== 2^subnet_bits = 2^2 = 4 subnets ==== Step 4: Calculate hosts per subnet ==== 2^(host_bits) - 2 = 2^6 - 2 = 62 hosts ---- ===== 6. Shortcut: Subnet Increments ===== If you know the subnet mask, the increment is the value of the **last 1 bit** in the mask. Example: **/26 mask = 255.255.255.192** Binary: 11000000 Increment = 64 So subnets: 0, 64, 128, 192 ---- ===== 7. Key Rules ===== * **Network address**: all host bits = 0 * **Broadcast address**: all host bits = 1 * **Cannot use network or broadcast addresses for hosts** ---- ===== 8. Common Subnetting Values ===== ^ Mask ^ Subnet Size ^ Hosts ^ | /24 | 256 | 254 | | /25 | 128 | 126 | | /26 | 64 | 62 | | /27 | 32 | 30 | | /28 | 16 | 14 | | /29 | 8 | 6 | | /30 | 4 | 2 | ---- ===== 9. Practice Example ===== **Given:** 192.168.1.0 /26 **Find subnets and ranges** Subnets (increment 64): 192.168.1.0 → hosts .1 to .62 → broadcast .63 192.168.1.64 → hosts .65 to .126 → broadcast .127 192.168.1.128 → hosts .129 to .190 → broadcast .191 192.168.1.192 → hosts .193 to .254 → broadcast .255 ---- ===== 10. Useful Mnemonic ===== **“Network, Subnet, Host”** Think of it as: * Network = **fixed** * Subnet = **variable** * Host = **variable** ===== meer info ===== voeg hier linken toe naar verdere uitleg {{tag>HOWTO}}