online posts 15
labs

Networking 101, part 2: hands on

Log in to real computers, a switch and two routers, and run the commands network engineers use every day: ip addr, ip route, ping, traceroute, ip neigh, dig, ss and curl, and the switch's and routers' show commands. Each task ties what they print back to an idea from the lessons. In your browser, nothing to install.

First lab here? Meet the lab shows how every lab works, once.

Part 1 showed you how networks work with diagrams you could pause and step through. In this part you work on a real one. It isn’t made of real boxes on a desk: it’s a small network that runs in the cloud, inside one codespace, but the computers, the switch and the routers inside it behave just as real ones do. You log in to them, ask them questions, and see the same things from the lessons: MAC addresses, IP addresses, prefixes, gateways, broadcasts.

The network

NameWhat it is
laptop, printer, broken-pcthree hosts at home, all plugged into the switch
sw1the home network’s switch
r1router 1: the home network’s gateway, and its DHCP server
r2router 2, in front of the servers
web, dnsa web server and a DNS server, on networks of their own

The hosts are small Linux computers. The switch and the routers run CapeOS, a network operating system made for labs, whose commands look like the ones on most of the world’s switches and routers.

In the lab, the Topology tab draws this network. Hover over a device to see what it is and how it’s cabled; click it to open a terminal on it, in a tab of its own.

How each task works

The same five parts as the lessons: explain, show, follow along, challenge, then check. You write your answers in the box under the guide, and the Check task button under it compares them with what the network says.

Quick start

  1. Open the lab and sign in with GitHub. The lab is your own copy, in a codespace on your GitHub account's free allowance (what that means). The first start takes a few minutes; coming back takes about one.
  2. The lab opens in your browser: this guide on the left, VS Code on the right, and the network's state at the top. Wait for it to say network up.
  3. Follow task 1.1. Check task, under the guide, tells you when you've got it right.

Finished? Finish lab, top right, deletes the codespace. Left it open? It stops itself after 20 minutes without activity, and Open the lab picks up where you were.

Advanced: run it on your laptop Docker, Git and VS Code
$ git clone https://gitlab.com/networkdoodles-labs/networking-101-lab.git
$ cd networking-101-lab
$ code .            # then: Reopen in Container
$ make check T=1.1

Same dev container, on your own Docker (4 GB of memory is plenty), and the lab app at http://localhost:8000. No dev container? make up runs it on Linux with Docker, containerlab, Python 3 and make.

3 chapters · 7 tasks

ch 1 Your computerOpen a terminal on the laptop, find its MAC address, IP address and prefix, and watch it get an address from DHCP. 50 min
  1. 1.1 Meet your computerOpen a terminal on the lab’s laptop and find its MAC address, IP address and prefix with ip addr. Then do the same on the printer, and work out its network and broadcast addresses. 25 min
  2. 1.2 Get an addressFind the four things the laptop borrowed from DHCP (its address and mask, its gateway, its DNS server, and how long it can keep them), watch it ask again message by message, then make r1 keep 192.168.1.50 for the laptop. 25 min
ch 2 Your networkHow a host finds the MAC address that goes with an IP address (ARP), what the switch learns, and a PC that can print but can’t reach the web server, because of one wrong number. 60 min
  1. 2.1 Who's next door?Watch the laptop find the printer’s MAC address with ARP, read its neighbour table, find each host’s port in the switch’s MAC address table, and work out what the laptop asks ARP about when the destination is on another network. 30 min
  2. 2.2 One wrong numberFind out why broken-pc can reach the printer but not web, using only ip addr, ip route, ping and ip neigh. Then fix its prefix and give it a default gateway. 30 min
ch 3 Other networksFollow a packet through two routers with traceroute, fix a missing route, turn names into addresses with DNS, and find the port behind a service. 85 min
  1. 3.1 Across two routersFollow a packet from the laptop to web with traceroute, read r1’s and r2’s routing tables, then find and fix a router that’s missing a route, using only what the network tells you. 30 min
  2. 3.2 Names for addressesSee where the laptop’s DNS server came from, ask it for names with dig and nslookup, open web by name, then give the printer a name of its own. 30 min
  3. 3.3 Which door?Find which ports web and dns are listening on with ss, read the laptop’s own temporary port from curl, see what a closed port says, then open a second door on web: port 8080. 25 min