,

Contents · IP addressing, CIDR, subnetting, NAT


IP addressing (IPv4/IPv6)

  • IPv4: 32-bit addresses, dotted decimal (e.g., 192.0.2.5).
  • IPv6: 128-bit, hex colon notation with zero compression (e.g., 2001:db8::1).
  • Unicast, multicast, anycast; private ranges (RFC1918) and ULA (RFC4193).
IPv4 private: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16
IPv6 ULA: fc00::/7 (commonly fd00::/8 used)

CIDR notation and masks

  • CIDR uses prefix length /n to denote network bits (e.g., 192.0.2.0/24).
  • Subnet mask equivalence (e.g., /24 ↔ 255.255.255.0).
  • Network, first usable, last usable, broadcast (IPv4); no broadcast in IPv6.
/30 → 4 addresses (2 usable); /29 → 8 (6 usable); /28 → 16 (14 usable)

Subnetting and VLSM

  • Borrow host bits to create smaller subnets; each subnet has its own network/broadcast.
  • VLSM: assign variable prefix lengths to fit host counts efficiently.
  • Summarization (supernetting) reduces routing table size.
Example: 192.0.2.0/24 → /26,/27,/28 pools per site or segment

NAT: SNAT, DNAT, PAT

  • SNAT (source NAT) for outbound; DNAT (destination NAT) for inbound port-forwarding.
  • PAT (NAPT) multiplexes many internal hosts onto one public IP via port mapping.
  • NAT traversal and implications for end-to-end connectivity; IPv6 prefers no NAT.
10.0.0.5:54321 → 203.0.113.10:54321 (PAT) → Internet

Address planning and design

  • Choose aggregation-friendly blocks; reserve growth; separate infra/user subnets.
  • Use DHCP for clients, static/reservations for infrastructure.
  • Document allocations; enforce ACLs between segments; plan IPv6 with /64 per LAN.

Troubleshooting addressing issues

  • Check IP, mask, gateway, DNS; verify ARP/ND entries; look for overlapping subnets.
  • Use ping/traceroute; inspect NAT tables; verify reverse DNS for services.
  • Beware asymmetric routing and stale ARP causing one-way connectivity.

Exercises

  1. From 10.10.0.0/16, design subnets for: 500 hosts, 60 hosts, 20 hosts, 2 point-to-point links.
  2. Given 172.16.32.0/20, create four equal subnets and list network/broadcast for each.
  3. Configure PAT on a lab router/firewall and capture translated flows.
Good addressing plans simplify routing, security, and operations—invest in them early.