Linux Labs

Networking / Stage 6 of 14

From connection to application response

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 7 · on a machine · 5 min

Three “the site is down” complaints

What you will learn

  • Tell a refused connection, a timeout and an application error answer apart.
  • Read the HTTP status separately from curl's exit code.
  • Write a service check that fails on an HTTP error and does not wait for a silent server.

Users all write the same thing: "The site is down." The addresses in their complaints differ. Check all three from the client.

Start on the card builds the client and the server 192.0.2.10, and commands containing lab-client run on the client.

Exercise · look

Three addresses from the complaints

Run the three requests from the complaints on the client and compare what curl prints each time.

First, predict

There is no host 192.0.2.99 on the network. What will the second curl do?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Check yourself 1 question

How does the request to :8081 differ from the request to 192.0.2.99?

  • curl printed different lines with different numbers: curl: (7) … Couldn't connect to server and curl: (28) … Timeout was reached.

  • Both requests ran under sudo with the same rights. The refusal came from the server: nobody listens on port 8081.

At 192.0.2.10:8081 the server's kernel refused at once, while at 192.0.2.99 there was nobody to answer, so curl waited until the timeout.

Ubuntu 24.04
Loading…