Beginner

Router Between Two Networks

A client and a web server on two different subnets, joined by a router. Learn what a default gateway does by taking one away.

Open this lab

Free interactive lab. No signup. Runs in your browser.

The scenario

Client (10.0.1.10/24) and Server (10.0.2.20/24, a web server on TCP port 80) are on different subnets, so neither can deliver to the other directly. Router has one interface in each network: ge0 is 10.0.1.1 on the Client's side and ge1 is 10.0.2.1 on the Server's side. Each host has a default route pointing at the Router's address on its own subnet. That default route, the default gateway, is the host's rule for everything that is not local: hand it to the router.

What you will work out

See why hosts need a default gateway and how a router moves packets between two LANs.

Why this matters

Every time a laptop opens a website, it hands the packet to its default gateway, the home or office router, which passes it on toward the destination. When a device can reach its own subnet but nothing beyond, the default gateway is the first thing to check: does the host have one, and is it the router's address on the host's own subnet?

Running it

Router Between Two Networks opens on a canvas, already wired and addressed. Trace a packet through it hop by hop, or run the same topology live on real Linux network namespaces. How the two modes differ.

Open Router Between Two Networks

Runs in your browser. No install, no signup, and the simulation starts instantly.

Open the lab →