Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Connmark
Cyber Security

Connmark

← Back to Glossary
By NHI Mgmt Group Updated November 3, 2026 Domain: Cyber Security

Connmark is the connection tracking mark associated with a network flow in Linux packet filtering. It lets the system save a mark on the connection state and restore or copy it to packets, so later rules can steer routing, filtering or quality of service decisions for the same flow.

Connmark as a connection tracking mark

Connmark is a mark attached to the tracked state of a network connection rather than to one packet in isolation. In Linux packet filtering, that distinction matters because the mark can follow the flow across multiple packets, letting policy stay consistent even as packets traverse different hooks, interfaces, or routing decisions.

That makes connmark useful when a firewall or policy engine needs to remember something about an established flow, such as which class of traffic it belongs to or which policy path it should continue to follow. The mark becomes part of the connection’s metadata, not just a transient packet attribute.

How connmark is used in packet processing

Connmark is typically written once to the connection tracking entry and then restored or copied onto packets later in the processing path. That enables matching on a stable flow-level value after the first packet has already revealed the connection’s characteristics.

This is especially helpful in rule sets that separate classification from enforcement. For example, one stage can decide how a flow should be treated, then later stages can reuse that decision without re-evaluating every packet from scratch.

The practical value is consistency. If a connection is marked early, the same mark can influence downstream filtering, routing, policy routing, or traffic shaping decisions for the rest of the session.

Why connmark matters for routing and policy decisions

Connmark is most useful when packet-level inspection alone is not enough to express a policy. A route choice or filter decision often needs to persist for the lifetime of the flow, especially when reply traffic must be handled differently from new traffic.

Because the mark is associated with connection state, it can carry policy context across packets that are part of the same conversation. That makes it a common building block for multi-step firewall logic, asymmetric routing handling, and quality of service classification.

Used well, connmark reduces duplication in rulesets and helps avoid inconsistent decisions that would happen if each packet were classified independently. Used poorly, it can make policy harder to understand because the effective decision is spread across multiple tables or chains.

Operational considerations for connmark rule design

Connmark works best when the rule set has a clear division between where a mark is set, where it is restored, and where it is consumed. That separation helps operators reason about the lifecycle of a flow and avoid accidental rule interactions.

It is also important to keep the mark namespace disciplined. If multiple policies reuse the same bits or values without a plan, later rules may misclassify flows or override each other’s intent.

From an operational standpoint, connmark is a state-management tool. Its value comes from preserving intent across the life of a connection, so the rule design should be explicit about when the mark is authoritative, when it is copied, and when it should be cleared or ignored.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 3, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org