Linux Labs

Networking / Stage 7 of 14 · step 7 of 8

Firewall: open the site to the office

medium ~25 min
Not running Starting usually ~20 s
Report a problem

Situation

The server runs a site: nginx on port 80. It must open from the office, from the address 192.0.2.20, and stay closed to every other address on the network. The office complains: the site does not open, the request hangs. On the server itself curl http://127.0.0.1/ answers.

The office is the lab-client network namespace, and its interface has two addresses: 192.0.2.20 (the office) and 192.0.2.30 (another address on the same network). The server's address on this network is 192.0.2.10. A request from the right address:

sudo ip netns exec lab-client curl -sS --connect-timeout 3 \
  --interface 192.0.2.20 http://192.0.2.10/

The server's firewall is loaded by the nftables service from /etc/nftables.conf.

Task

  1. From 192.0.2.20, the site http://192.0.2.10/ answers HTTP 200.
  2. From 192.0.2.30, the site does not open.
  3. The rules in the kernel are the ones in /etc/nftables.conf, and the nftables service is enabled, so everything stays the same after a reboot.
  4. The drop policy of the input chain and the SSH permission on port 22 are in place.

The tools you need are already installed. There's no internet on this machine.

Visible only to you. Saved as you type.

All notes

Lab goals

0 of 4
  • From the office address 192.0.2.20 the site http://192.0.2.10/ answers HTTP 200 — not checked yet
  • From the address 192.0.2.30 the site does not open — not checked yet
  • The rules are loaded from /etc/nftables.conf, and the nftables service is enabled — not checked yet
  • The drop policy and the SSH permission are in place — not checked yet

Hints

0 of 3 open · they open one at a time
Hint 1
Show the solution after 3 failed checks

Leave the lab?

The machine keeps running for 10 more minutes, then it is removed. Files are lost; completed goals stay.

Loading…