Linux Labs

Networking / Stage 7 of 14

Allow what is needed, keep the block

Not running Starting usually ~20 s
Leave the lesson

Step 8 of 8 · summary · 2 min

Summary

  • The nftables firewall keeps rules in tables and chains; hook input is for packets addressed to the machine itself.
  • A packet goes through the rules from top to bottom until the first verdict; if none decides, the chain policy applies.
  • counter values show which rule fired on a request.
  • Rules are changed in the file, checked with nft -c -f, loaded with nft -f and tested from both sides: the allowed source gets an answer, the others do not.
  • At the start of the lesson the client waited until the timeout: the permission for 192.0.2.20 was for port 8081, so the request to 8080 reached the last rule, drop.
Ubuntu 24.04
Loading…