Understanding Routers & NAT
Discover how devices communicate between networks, why your home uses private IP addresses and how NAT connects them to the internet.
What does a router actually do?
A router connects different IP networks and forwards packets towards their destinations. Your home router usually connects your local network to your internet provider.
An IP address identifies a destination. A router helps traffic find a route towards that destination.
Getting outside your network.
When your computer needs to communicate with a destination outside its local network, it normally sends the packet to its default gateway. That gateway is usually your router.
192.168.1.25
192.168.1.1
Your computer uses its routing table and network configuration to decide whether traffic should stay local or use a gateway.
Why doesn't every device need a public IPv4 address?
Most home networks use private IPv4 addresses. These addresses can be reused across different private networks and aren't routed directly across the public internet.
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
How does NAT work?
Network Address Translation changes IP addressing information as packets pass through a router or firewall.
A common home setup uses Port Address Translation (PAT), allowing multiple private devices to share one public IPv4 address. The router tracks connections and translates addresses and ports so returning traffic reaches the correct device.
192.168.1.25
203.0.113.10
198.51.100.20:443
What about incoming connections?
Port forwarding creates a translation that directs traffic arriving at a particular external address and port to an internal device and port.
This can make an internal service reachable from outside your network, provided firewall rules and upstream connectivity allow it.
What does a SOC analyst see?
Firewall and NAT logs can help analysts understand connections between internal devices and external systems.
DST=198.51.100.20
PROTO=TCP
SPT=52144
DPT=443
ACTION=ALLOW
The source identifies the internal device before translation. Depending on where logging occurs, an external observer may instead see the router's translated public address and port.
Find your default gateway.
On Linux:
ip routeOn Windows:
ipconfigLook for your default gateway. This is usually the router your device uses to reach other networks.
HTTP & HTTPS.
Next we'll explore how browsers and web servers communicate, and how HTTPS protects data in transit.