The server itself drops the client's packets — with its filter made of tables, chains and rules.
A firewall lets packets through or drops them by rules. In Linux the kernel holds the rules, and the nft program from the nftables suite sets them. Read the server's rules:
The output looks like this, only the counter numbers on your machine differ:
The table lab_filter groups chains; inet means it covers IPv4 and IPv6 at once. The chain input is a list of rules for packets addressed to the machine itself: the hook input line attaches it that way. Packets the machine sends itself go through a chain with hook output, and packets it passes on through one with hook forward.
Without sudo, nft prints Operation not permitted (you must be root).
The site runs on the server itself, and the client comes to it over the network. Which chain holds the rule that cuts requests to the site?
-
forwardis for packets the machine passes on, like a router. A request to the site is addressed to the server itself. -
outputis for packets the server sends itself. The client's request comes into the server.
Packets addressed to the machine itself go through the chain with hook input; on the practice server that is input in the lab_filter table. Packets passed on go through forward, and those the machine sends through output.
Key points
-
nftsets the firewall rules, andsudo nft list rulesetreads them. -
A table groups chains and a chain holds rules;
hook inputis for packets addressed to the machine itself.