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
| Name | What it is |
|---|---|
| laptop, printer, broken-pc | three hosts at home, all plugged into the switch |
| sw1 | the home network’s switch |
| r1 | router 1: the home network’s gateway, and its DHCP server |
| r2 | router 2, in front of the servers |
| web, dns | a 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
- 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.
- 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.
- 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.1Same 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
- 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. - 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.50for the laptop.
- 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.
- 2.2
One wrong numberFind out why broken-pc can reach the printer but not web, using only
ip addr,ip route,pingandip neigh. Then fix its prefix and give it a default gateway.
- 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. - 3.2
Names for addressesSee where the laptop’s DNS server came from, ask it for names with
digandnslookup, open web by name, then give the printer a name of its own. - 3.3
Which door?Find which ports web and dns are listening on with
ss, read the laptop’s own temporary port fromcurl, see what a closed port says, then open a second door on web: port 8080.