Pcornel
Networking · IP Fundamentals › IPv4

Addressing

Cheat sheet · https://pcornel.dk/topic.php?topic=563

Back to the Topic

Answer

IPv4 addressing divides a 32-bit value into a prefix and host portion; subnetting and VLSM allocate differently sized routed segments from an address block.

Remember

  • Prefix length and mask describe the same boundary
  • Network and directed-broadcast addresses are not ordinary host addresses
  • Hosts per traditional subnet are 2^(host bits)-2, with point-to-point exceptions
  • VLSM allocates largest requirements first and must avoid overlap.

First checks

  • show ip interface brief — addresses on each interface.
  • show ip interface <if> | include Internet address — address with prefix length.
  • show ip route connected — the subnets the router derives from its addresses.
  • show ip route <prefix> longer-prefixes — overlapping or more specific routes.
  • Subnet calculator (e.g. ipcalc <ip>/<len> on Linux) — network, broadcast and host range.

Commands

show ip interface <interface>
Inspect interface IPv4 address, prefix and protocol state.
ip addr
ip route

Verify in this order

address and prefix → network, broadcast and host range calculated → hosts and gateway inside the same range → no overlap with other subnets → connected route installed

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

Addressing · technical reference

ConceptMeaning
Prefix lengthNumber of network bits
Network addressHost bits all zero
BroadcastHost bits all one
ForwardingLongest matching route wins

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=563

Confirmation

Confirm action

Continue?