Labs / First Contact / IP addressing & subnets

Lab 1 of 4 · IP addressing & subnets

A home network, from the laptop's point of view

A home network lab: follow one laptop's traffic through it, end to end.

Start this lab, free Free 6 steps

The idea

A laptop at home, the home router (its way out, which also looks up names), and a web server on another network. Follow one request from the laptop to the server, one piece at a time: this home network lab runs on real Linux machines.

Not on my network: hand it to the router
Not on my network: hand it to the router
One connection, two addresses
One connection, two addresses

Steps

  1. Where the laptop is

    Every device on a network has a number, like a street address, so that packets for it know where to go. Before the laptop can talk to anyone, it needs its own. Ask the laptop for it.

    laptop:~# ip -4 addr show eth0
  2. The way out

    The web server, 10.0.2.10, is outside the laptop's 10.0.1. network, and the laptop can only reach its own network directly. So it needs one place to hand everything else to. Read where the laptop sends packets.

    laptop:~# ip route
  3. Names become addresses

    People type names like webServer.lab, but every packet carries an address, so a name must become an address before anything is sent. Ask for the address behind the name.

    laptop:~# dig +short webServer.lab
  4. Talk to the server

    You have the address and the way there; a browser does exactly this next. Ask the web server for its page over HTTP, the language of web pages.

    laptop:~# curl -s http://webServer.lab
  5. The router hides the laptop

    The laptop's 10.0.1.10 is a private address: the internet never sends replies to it. So who does the server see? Fetch the page again while the server records what reaches it.

    laptop:~# curl -s http://webServer.lab
  6. A server goes down

    Servers go down, and the symptom tells you where to look. The lab turns the web server off; ask for its name and its page, then it comes back on.

    laptop:~# dig +short webServer.lab
    laptop:~# curl -sS -m 5 http://webServer.lab
    laptop:~# curl -s http://webServer.lab

Run these steps on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Start free