Skip to content
WebsiteHosting.com

troubleshooting Security & reliability

Firewall rule shadowing in one ordered chain

To tell whether a later firewall rule is shadowed, look for traffic it could still match after earlier terminal verdicts in the same chain. Even one remaining class makes the difference.

Latest recorded source check · P0113

What it means

A firewall rule is fully shadowed when every packet it could match already receives a terminal verdict earlier in the same chain. A terminal verdict ends that packet's evaluation in this chain. Finding traffic that matches both rules proves overlap; it does not, by itself, prove shadowing.

Try it

Simulation: compare two terminal rules in one ordered chain. There are three separate traffic classes: web, ssh, and other. The scope all includes all three. These are labels, not tests of real ports or traffic.

Firewall rule shadowing in one ordered chain

Find rules that cannot match because an earlier terminal verdict captures the same traffic

Simulation
Modeled outcome: Shadowed

Every traffic class matching the later rule is consumed by the earlier terminal rule.

Firewall rule shadowing in one ordered chain: synthetic scenario inputs
Replaces all inputs with the documented starting example and the indicated change. Reset restores the starting example.
Later rule match set

Covered by earlier terminal rule

  1. webEarlier verdict: drop

Still eligible at later rule

  1. RemainingNone

Result

  1. Shadowingshadowed
  2. Default verdictdrop (after earlier/later rules)

Only classes matched by the later rule are displayed. Classes consumed by the earlier terminal rule cannot reach it.

Evaluated inputs

Required scenario evidence
provided
Earlier rule scope
all
Later rule scope
web
Default verdict
drop
Earlier verdict
drop

Three disjoint synthetic traffic classes, two terminal rules in one chain; no sets, jumps, counters, stateful rules or policy changes.

About this model

The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.

Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.

Start with Earlier rule scope set to all and Later rule scope set to web. Both Earlier verdict and Default verdict are drop, and Required scenario evidence is provided. The overlap is web, and nothing remains for the later rule to match. The result is shadowed: the earlier rule drops every packet in the later rule's scope.

Change only Earlier rule scope to ssh. The overlap is now empty, and web remains. The result is reachable: a web packet can reach the later rule and match it. In this example, other matches neither rule, so it takes the default path. The default verdict describes that path; it does not decide whether web can reach the later rule.

Set Required scenario evidence to missing to see the difference between no overlap and unknown overlap. With evidence missing, the simulation does not compare the scopes at all. Reset restores all five starting choices. Nothing here reads or changes a firewall.

Which classes remain?

Start with the later rule's scope and remove the classes that the earlier terminal rule handles. The direction matters. With all first and web second, removing web leaves the later rule nothing. Reverse those scopes: with web first and all second, the overlap is still exactly web, but now ssh and other remain. The result is partial. Those two classes can match the later rule; they are not traffic that falls through to the default.

Compare the later rule’s original scope with the remaining set, not just the size of the overlap. In the partial example, two of its three synthetic classes remain. That is a statement about these named classes, not an estimate of the percentage of real packets affected.

The earlier verdict and the coverage answer different questions. Changing the earlier verdict from drop to accept changes what happens to the overlapping traffic at that rule. It doesn't change which classes remain, because both verdicts end evaluation in the modeled chain. Conversely, in nftables a matching rule that issues no verdict continues to the next rule. Don't subtract its matches as though it were terminal.

In practice

If a later rule recorded no hits during an observation interval, first inspect the rule order, match conditions, and verdicts that applied during that interval. There are two different explanations to distinguish: no packet could have reached the rule and matched, or a matching packet could have reached it but none did. A zero count does not distinguish them.

Keep the conclusion local to the chain. In nftables, an accept in one base chain does not prevent a later base chain at the same hook from dropping the packet. The related article on nftables hooks, priorities and multiple chains addresses that separate question. This simulation does not interpret nftables sets, jumps, counters, or stateful matches, and it does not determine a packet's final fate.

If the applicable configuration, order, verdicts, or supported version are unknown, stop at insufficient evidence. Do not reorder or remove a real rule on the strength of this example. For a read-only review, ask one concrete question: can you name a class the later rule would match that no earlier terminal verdict covers? One such class rules out full shadowing; to establish full shadowing, account for them all.

Frequently asked questions

Editorial questions based on the listed sources and explicitly labeled local examples.

Can an earlier accept shadow a later drop?

Yes, within the stipulated first-terminal chain.

Does partial overlap make the later rule useless?

No. Classes not covered by the earlier terminal rule can still reach it. In this example the overlapping set can be identical for full and partial shadowing, because the later rule’s original scope differs.

Do counters alone prove shadowing?

No. A zero hit count could also mean no traffic matched during the observation interval. This example proves coverage from stipulated traffic classes and terminal rule order, not from observed counters.

Does the analysis cover other hooks?

No; this is one ordered chain.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. nftables configuring chains

    Rules and verdicts. Ordered chain traversal and terminating verdicts are distinct from the final policy and traversal of additional base chains.

    Checked .

  2. nft(8): nftables verdict statements

    Verdict statements. A matching nftables rule need not terminate the chain: a rule issuing no verdict continues to the next rule. This lab addresses terminal decisions only.

    Checked .

Report an issue. Include the article URL and ID, not passwords or access keys.