Linux Labs

Networking / Stage 13 of 14

Restore a service from client to answer

Not running Starting usually ~20 s
Leave the lesson

Step 2 of 7 · theory · 6 min

The kind of failure points to the stage

The failures from the earlier lessons of the track fit into one table. The kind of error tells you where to look and on which machine.

What the client sees Where to look
Could not resolve host the name: the client's resolver
an error at once, and ip route get on the client fails too the client's route
waiting, then a timeout a filter or the return path: the packet or the reply gets lost
an error at once, nc -zv says Connection refused the server: nobody listens on that address and port
an answer, but the wrong one the site: the wrong page or the wrong server

curl prints Couldn't connect to server after 0 ms in two cases: the packet never left the client, or the server refused. ip route get on the client and nc -zv tell them apart.

There can be several causes at once. Fix one, and the request gets as far as the next, so the failure changes its look. That is progress: after each fix, read the new failure and continue down the table.

Change one thing at a time. If you change several at once and it works, you will not know what helped; if it does not, you will not know what broke.

Check yourself 1 question

curl from lab-node1 to 192.0.2.12:8080 prints Couldn't connect to server at once, and sudo ip -n lab-node1 route get 192.0.2.12 prints RTNETLINK answers: Invalid argument. Where do you look for the cause?

  • The request went by address, so no name was involved. A name error looks like Could not resolve host.

  • A filter with drop makes the client wait until the timeout, and this error came after 0 ms.

  • With a closed port on the server, ip route get on the client would print a path. The error here is on the client, before the packet is sent.

ip route get asks the client's kernel where to send the packet, and an error means there is no path or it is forbidden — by a blackhole entry, for example. The packet never reached the server, so you look at sudo ip -n lab-node1 route.

Key points

  • A timeout, a refusal and a name error point to different stages and different machines.
  • A fixed cause changes the look of the failure: the request has moved further along.
Ubuntu 24.04
Loading…