IP Addressing and Subnets

Summary

This note explains the basic mental model behind IP addressing and subnets. The goal is not advanced subnetting speed, but a calm understanding of how hosts, networks, and masks relate to each other.

AWS VPC subnet diagram from official documentation

Official AWS diagram showing a network layout with multiple subnets and clear address boundaries.

Why this matters

  • IP addressing is one of the first filters in almost every networking problem
  • Linux, Windows, cloud, and firewall work all depend on basic subnet awareness
  • a lot of troubleshooting becomes easier once you can quickly tell whether two devices are even meant to talk directly

Environment / Scope

ItemValue
TopicIPv4 addressing basics
Best use for this notebuilding a subnet mental model
Main focushost, network, mask, gateway
Safe to practise?yes, on any lab network

Key concepts

  • IP address - the address assigned to a host on a network
  • Subnet mask - what tells the system which part of the address is the network and which part is the host
  • Network address - the address that identifies the subnet itself
  • Host range - the usable addresses for devices inside the subnet
  • Broadcast address - the address used to talk to all hosts in the subnet

Mental model

Think about a subnet as a neighbourhood:

  • the network address is the name of the neighbourhood
  • the host addresses are the houses inside it
  • the default gateway is the way out to other neighbourhoods

Example:

ItemExample
IP address192.168.1.10
Subnet mask255.255.255.0
CIDR form/24
Network192.168.1.0
Usable hosts192.168.1.1 to 192.168.1.254

Everyday workflow

QuestionWhat to check
Is the host in the expected subnet?IP address and mask
Can two hosts talk directly?whether they are in the same subnet
Does traffic need routing?whether destination is outside the local subnet
Is the gateway sensible?whether the configured gateway is reachable on the local subnet

Common misunderstandings

MisunderstandingBetter explanation
”Same first three numbers means same network”not always; the subnet mask decides that
/24 means any home network”it is common, but still just one subnet size
”Gateway can be anywhere”the default gateway normally needs to be reachable from the local subnet
”If ping fails, the subnet is wrong”subnetting is only one of several checks

Verification

CheckExpected result
ip addr or ipconfigshows IP and subnet details
ip route or route printshows default gateway and routes
Compare host addressesconfirms same subnet or routed path

Pitfalls / Troubleshooting

ProblemLikely causeWhat to check
Host cannot reach local peerswrong IP or maskaddress, mask, duplicate addressing
Host cannot reach outside networkgateway missing or wrongdefault route
Address plan feels confusingweak network vs host mental modelrewrite subnet as network, range, gateway

Key takeaways

  • the subnet mask is what tells you whether hosts are local to each other
  • the default gateway matters when traffic leaves the local subnet
  • calm IP troubleshooting starts with address, mask, and route, not with guesswork