ND-0014 / LINUX OPERATIONS
Verify What Your Firewall Actually Blocked
A client times out and somebody says the firewall blocked it. Before closing the ticket, gather two pieces of evidence: what the client tried and what the intended firewall rule counted. Use one approved client and one known endpoint. Keep the test to a lab or an approved change window on a network you administer. […]
A client times out and somebody says the firewall blocked it. Before closing the ticket, gather two pieces of evidence: what the client tried and what the intended firewall rule counted. Use one approved client and one known endpoint. Keep the test to a lab or an approved change window on a network you administer.
Start with a working control
From an approved path that should be allowed, make a fresh request to the intended service. Confirm the endpoint answers with the expected status or content. Write down the UTC time, source segment, destination address and address family, protocol, and port. If the control cannot reach the app, fix or explain that before interpreting a deny test. Use a new connection so an already-established session does not answer the wrong question.
Read the rule and record its counter
This example is for nftables. Substitute the real family, table, and chain names from your authorized ruleset. Listing is read-only. Do not flush rules, reset counters, or change the live policy to make the test easier.
sudo nft -a list chain inet filter input
Make sure the rule has a terminal verdict such as drop or reject. A counter by itself does not block traffic. In nftables the counter has to appear after the conditions you want it to measure. Record the full rule and handle, and verify that a named counter is not shared by other rules before attributing a change to this one. nftables counter documentation
Run one test and compare the results
From the approved source that policy says should be denied, make the same kind of request to the same endpoint and record the outcome. Re-read the counter promptly. Keep the sample quiet if you can; other traffic can move the same counter. Check the address family, forwarding path, and network namespace if the request never reaches the rule you expected.
Illustrative data, not a live test: The allowed control returned HTTP 200. The expected deny rule for a different source showed 120 packets before the attempt and 123 afterward. The denied client got no response. The delta is three packets counted at that rule, not three clients, requests, or connections. Retransmissions or unrelated matching packets could account for some of that change. Under isolated conditions and with a scope-specific rule, the signals together support attribution; under load they do not identify one client on their own.
Know what to write in the ticket
Record the expected policy, positive control, test window, client outcome, rule handle, and before/after values. A timeout with an unchanged counter is inconclusive. A rising counter on an accept or shared rule is inconclusive for a particular deny. If the service returns the expected response from the source you meant to deny, treat that as a failed test and verify whether you reached the right endpoint, path, and rule.
What we verified
The nftables project documents packet and byte counters, named sharing, and the significance of rule order. The figures here are synthetic. We did not run this example against a firewall or verify any production policy.