Menu
Coddy logo textTech

Recap: Reachability

Lesson 19 of 47 in Coddy's Networking with the Terminal course.

Diagnosis is a ladder, and each rung rules something out.

Is the machine there? Ping it. Remember that a failed ping proves little, since many hosts ignore ICMP.

Is the port open? nc -z. This is where "the server is up but the site is down" gets caught.

Is the service answering? Make a real request with curl and read the exit code: 0 worked, 7 refused, 28 timed out.

Climb in that order and each answer narrows the next question. Skipping to the top is how people end up restarting things at random.

challenge icon

Challenge

Hard

Climb the whole ladder against a server you start yourself.

  1. Create index.html containing up
  2. Serve the folder on port 9109
  3. Print 1: and the ping result (ok)
  4. Print 2: and the port result (ok)
  5. Print 3: and the page you fetched

Expected output:

1: ok
2: ok
3: up

Try it yourself

Terminal
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Networking with the Terminal

Practice on your own: Terminal playground