Router & Default Gateway

Once you understand private IPs, the next question is:

How does your laptop talk to a server outside your home network?

That is where the router and default gateway come in.


What is a Router?

A router connects different networks.

At home, your router connects:

Your local Wi-Fi network
↓
Internet provider network
↓
Internet

Inside your home, devices talk using private IPs.

To reach the internet, they send traffic to the router.


What is a Default Gateway?

A default gateway is the device your computer sends traffic to when the destination is outside the local network.

In most home networks:

Default Gateway = Router IP

Example:

Laptop IP       : 192.168.1.10
Default Gateway : 192.168.1.1

If the laptop wants to reach:

8.8.8.8

that destination is not inside 192.168.1.0/24.

So the laptop sends the packet to:

192.168.1.1

which is the router.


Simple Flow

Laptop
192.168.1.10

↓ sends to default gateway

Router
192.168.1.1

↓ forwards toward internet

Google DNS
8.8.8.8

Router vs Default Gateway

Router Default Gateway
A device that connects networks The router address your device uses to leave the local network
Physical or virtual network device A configuration value on your machine

Interview Answer

If an interviewer asks:

What is a default gateway?

You can answer:

A default gateway is the router address a device uses when it needs to send traffic outside its local network. If the destination IP is not in the local subnet, the device sends the packet to the default gateway, which forwards it toward another network.