Step 7 of 8 · lab · 25 min
Firewall: open the site to the office
The server's site must open from the office and stay closed to everyone else, yet the office waits until the timeout. Find the cause and fix the persistent nftables configuration.
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
- From
192.0.2.20, the sitehttp://192.0.2.10/answers HTTP 200. - From
192.0.2.30, the site does not open. - The rules in the kernel are the ones in
/etc/nftables.conf, and thenftablesservice is enabled, so everything stays the same after a reboot. - The
droppolicy of theinputchain and the SSH permission on port22are in place.
The tools you need are already installed. There's no internet on this machine.
Lab · on your own
No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.
Goals
0 of 4-
From the office address 192.0.2.20 the site http://192.0.2.10/ answers HTTP 200 — not done yet
-
From the address 192.0.2.30 the site does not open — not done yet
-
The rules are loaded from /etc/nftables.conf, and the nftables service is enabled — not done yet
-
The drop policy and the SSH permission are in place — not done yet
The machine is starting
Hints
0 of 3Lab goals
0 of 4-
From the office address 192.0.2.20 the site http://192.0.2.10/ answers HTTP 200 — not done yet
-
From the address 192.0.2.30 the site does not open — not done yet
-
The rules are loaded from /etc/nftables.conf, and the nftables service is enabled — not done yet
-
The drop policy and the SSH permission are in place — not done yet
Goals are checked on the machine after every command.