Skip to content
WebsiteHosting.com

concept Security & reliability

Connection tracking state and firewall decisions

A packet can be NEW whether a firewall allows it or denies it. Follow a Linux Netfilter example from packet observation to tracking label to filter verdict, and see which conclusions the label cannot support.

Latest recorded source check · P0111

What it means

Connection tracking in Linux Netfilter uses what it remembers about a flow to classify a packet. The firewall can use that classification in a rule, but the rule decides whether to allow the packet. A NEW label, for example, tells you how the tracker sees the packet, not whether the packet got through.

Try it

Simulation: compare two decisions about the same synthetic packet. With Observed packet state set to first, Required scenario evidence set to provided, and New flow permission set to allow, the tracking label is NEW. The model allows the packet because its rule permits new flows.

Connection tracking state and firewall decisions

Explain stateful filtering with a simplified NEW/ESTABLISHED/RELATED/INVALID lifecycle

Simulation
Modeled outcome: Allowed new

New tracked flow matches the modeled NEW allow rule.

Connection tracking state and firewall decisions: synthetic scenario inputs
Replaces all inputs with the documented starting example and the indicated change. Reset restores the starting example.
Connection state and rule outcome

Packet evaluation

  1. Packet observationfirst
  2. Conntrack stateNEW
  3. NEW policyallow
  4. Modeled verdictAllow NEW

The state is stipulated packet evidence, not a TCP flag or the verdict itself.

Evaluated inputs

Required scenario evidence
provided
Observed packet state
first
New flow permission
allow

Linux Netfilter symbolic states supplied, not a TCP finite-state or packet parser; no network changes or claims about a real ruleset.

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.

Change only New flow permission to deny. The verdict changes to deny, but the label stays NEW: you changed the rule, not the evidence about the packet.

Now leave deny selected and change Observed packet state to reply. This example supplies a reply belonging to a flow already tracked in both directions. Its label is ESTABLISHED, and a separate, fixed rule in the simulation allows it. The new-flow setting is still selected but is not evaluated. This is a different packet scenario, not a reply produced by the packet you just denied. Reset restores first, allow, and provided.

Reading the state before the verdict

Think of the tracking label as an answer to “How does this packet relate to a flow?” A reply in the tracked flow and an error associated with that flow need not have the same answer. The simulation labels the recognized reply ESTABLISHED. It labels a recognized associated error RELATED. An ICMP error tied to an existing connection is one example. The model allows both, but for different matches; neither label promises that another firewall will allow the packet.

The reverse distinction matters, too: one verdict can hide two different observations. Select invalid and the model drops a packet labeled INVALID. Select untracked and it drops a packet labeled UNTRACKED. In the first case, the tracker has classified the packet as invalid. In the second, the packet is not being tracked. Neither case consults the permission for new flows.

In the visual result, Drop UNTRACKED and Drop INVALID are distinct labels. That avoids treating the policy’s decision to drop both classes as evidence that they represent the same connection-tracking state. In a real trace, the observed class and the rule that acted on it still need separate evidence.

A missing observation is different from either drop. With evidence provided and packet state unknown, there is no established classification on which to base a verdict. With evidence missing, the model does not even evaluate the selected packet or its policy. In both cases, report no verdict rather than guessing “denied.”

In practice

When reading firewall evidence, record three things separately: what packet you observed, what label connection tracking assigned, and what filter verdict you observed for that packet. For example, if the record identifies a reply and shows ESTABLISHED but gives no filtering decision, write “verdict not observed.” Look for the corresponding filter decision before saying the packet was allowed. Even an observed allow verdict would not tell you that a user logged in.

This simulation takes symbolic packet observations as inputs. It does not parse packets, run a TCP state machine, or inspect or change your firewall. Do not change a real rule on the strength of the example. If the packet evidence, filtering decision, or applicable implementation version is unknown, stop at what you can establish: the tracking label can explain why a rule might match; evidence of the verdict tells you what the firewall decided.

Frequently asked questions

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

Is NEW always a TCP SYN?

No; conntrack state is not identical to TCP flags.

Does ESTABLISHED imply application login?

No. It describes the tracker’s relationship to a flow, not whether an HTTP request, SSH login or database authentication succeeded. Application authorization and a filter verdict need their own evidence.

Why might a packet be untracked?

A packet can be deliberately excluded from connection tracking. In nftables the notrack statement must take effect before tracking lookup. Do not equate an untracked packet with a tracked connection whose state is unknown.

Can RELATED describe an error packet?

Yes. For example, an ICMP error associated with an existing connection can be classified as RELATED. This is a tracking classification, not a promise that a firewall will allow the packet.

Sources & model boundaries

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

  1. nft(8): nftables reference manual

    Connection tracking expressions; notrack statement. Connection tracking state and status are distinct. notrack must take effect before the tracking lookup. Neither a tracking classification nor lack of tracking proves application authentication.

    Checked .

  2. iptables-extensions(8)

    conntrack: RELATED state. An ICMP error associated with an existing connection can be classified as RELATED. This classification does not itself permit a packet through a firewall.

    Checked .

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