Linux Labs

Networking / Stage 7 of 14

Allow what is needed, keep the block

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 8 · on a machine · 5 min

A listener, yet the client waits

What you will learn

  • Read an nftables ruleset — the table, the chain, the conditions and the verdicts.
  • Find the rule that fires on a request from the rule order and the counters.
  • Open access for one source through the rules file and check that the block for others stays.

The site on the lab-server server listens on 192.0.2.10:8080, as the output of ss shows. The lab-client client cannot connect: its request hangs. Take a look yourself.

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

Exercise · look

A socket, but no answer

Check the listening socket on port 8080 on the server, then request the site from the client and send the server two echo requests.

First, predict

The socket on 192.0.2.10:8080 is there. What will curl print on the client?

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

Why did the client wait until the timeout, although the site listens on 192.0.2.10:8080?

  • Without a way ping would print Network is unreachable. It sent both requests: 2 packets transmitted.

  • ss showed 192.0.2.10:8080, exactly where the client went. On another address there would be an immediate refusal, with no wait.

  • It is not only the site that is silent: ping got no reply either, and the server's kernel answers ping without any site.

The client's packets reach the server and are silently dropped there: neither the site nor the kernel answers.

Ubuntu 24.04
Loading…