Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

OUTPUT

Direct answer

The OUTPUT chain filters packets the host itself sends. Most hosts allow all output; restricted servers allow only needed destinations (DNS, NTP, updates, specific services).

When to use this

Use it when restricting outbound traffic, or when the host cannot reach something although the network is fine.

First 30 seconds

1. Output policy drop? nft list ruleset | grep -A3 output.

2. Needed destination allowed (DNS, NTP, repos)?

3. Counters on the drop rule increase during the test?

4. Test: curl -v <url> / dig <name>.

5. Add the specific allow and persist.

Operational verification

local process sends → routing → output hook rules → postrouting → leaves the host

Evidence · next step

For Firewall → OUTPUT, continue with the first unproven Topic check: Identify the exact originating process/socket and namespace, destination family/tuple, selected source address and route/interface. If that boundary is healthy, advance to the adjacent check: Inspect all output-hook base chains, policy routing marks and NAT rules that can change route or tuple. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it when restricting outbound traffic, or when the host cannot reach something although the network is fine.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

local process/socket → OUTPUT hook chains → marking/DNAT as applicable → route/reroute → POSTROUTING/SNAT → egress interface → remote service/response

Healthy evidence: the process generates the expected tuple, output rules permit/deny it as intended, capture shows correct egress translation and the application receives the expected result.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Identify the exact originating process/socket and namespace, destination family/tuple, selected source address and route/interface.

  • Inspect all output-hook base chains, policy routing marks and NAT rules that can change route or tuple.
  • Correlate rule trace/counters with egress capture and conntrack while reproducing the original client transaction.
  • Verify the remote response and local application result after the smallest policy change, plus a negative egress-policy regression case.

Verification chain. local process/socket → OUTPUT hook chains → marking/DNAT as applicable → route/reroute → POSTROUTING/SNAT → egress interface → remote service/response

Step 3 Commands Verify boundary
nft list chain inet filter output
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: operators inspect INPUT/FORWARD for a local client flow, rule counters do not match the process traffic, marks reroute unexpectedly, or output ACCEPT is blamed for a remote-side failure.

Step 5 Common mistakes Narrow the fault
  • Blocking outbound DNS/NTP needed by the host.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

With a restrictive output policy remember DNS (53), NTP (123), package repositories and replies — and the loopback interface. Locally generated traffic does not pass INPUT or FORWARD.

Key checks
  • nft list ruleset — all nftables rules
  • iptables -S; iptables -t nat -S — iptables rules (if used)
  • firewall-cmd --list-all — firewalld zone settings
  • ufw status verbose — UFW rules and defaults
  • ss -tulpn — which services listen
ReferenceWhat it is1 section · depth on demand

Core model

Pin the originating process/socket, namespace, effective source/destination tuple and route decision. Trace locally generated traffic through output-hook chains, possible DNAT/marking, rerouting and postrouting/SNAT, then verify egress capture and remote/application response.

ReferenceImportant terms & boundaries5 sections · depth on demand

What this shows and what it does not

OUTPUT is confirmed only when locally generated traffic is shown to receive the intended output verdict, leave through the expected route/translation and complete the original remote transaction.

In depth

OUTPUT: traffic created by the host

The OUTPUT chain sees packets generated by local processes, before they leave the host. The iptables(8) manual page lists OUTPUT in all five tables: filter, nat, mangle, raw and security. Its nat version can rewrite destinations of locally generated traffic. Most hosts leave OUTPUT open (policy ACCEPT), but restricting it is a strong control on servers whose outbound needs are well known.

Why filter outbound traffic

ThreatEffect of an OUTPUT allow list
Malware calling homeBlocked unless the destination is allowed
Data exfiltrationLimited to approved destinations
A compromised web app scanning the internal networkBlocked
Misconfigured software talking to the InternetVisible in the logs

An outbound allow list

OrderRule
1Accept established and related
2Accept lo
3DNS to the internal resolvers only (UDP and TCP 53)
4NTP to the internal time servers
5HTTP(S) to the package mirror or proxy
6Syslog and metrics to the collectors
7Application-specific destinations (database, APIs)
8Log and reject everything else

Use reject rather than drop for outbound traffic. Applications then fail at once with "connection refused" instead of waiting for timeouts, which makes problems much easier to diagnose.

Matching by owner

On the output hook, rules can match the UID or GID of the process that created a packet. For example, only the user reportapi may reach the partner API, and only _apt may reach the package mirrors.

host$ sudo nft add chain inet filter output '{ type filter hook output priority filter; policy accept; }'
host$ sudo nft add rule inet filter output ct state established,related accept
host$ sudo nft add rule inet filter output oif lo accept
host$ sudo nft add rule inet filter output ip daddr { 10.20.0.53, 10.20.0.54 } meta l4proto { tcp, udp } th dport 53 accept
host$ sudo nft add rule inet filter output meta skuid reportapi ip daddr 198.51.100.80 tcp dport 443 accept
host$ sudo nft add rule inet filter output tcp dport { 80, 443 } ip daddr 10.40.0.10 accept
host$ sudo nft add rule inet filter output log prefix '"nft-out-reject: "' limit rate 10/minute reject
host$ sudo journalctl -k -g nft-out-reject -n 3
nft-out-reject: IN= OUT=eth0 SRC=10.110.0.64 DST=203.0.113.99 PROTO=TCP SPT=48122 DPT=4444 UID=33 GID=33

Reading the log line

A process running as UID 33 (www-data on Debian) tried to connect to port 4444 on an outside address. That isn't something a web server needs. It's exactly the kind of event outbound filtering is meant to stop and reveal. The UID= field appears because the log statement runs on the output hook.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

OUTPUT is part of Firewall → OUTPUT. OUTPUT is the netfilter path for locally generated packets after a local process creates traffic and before final egress processing; it is distinct from forwarding and can evaluate locally known attributes, marks, destination state and post-routing/NAT behavior.

Topic-specific state model. OUTPUT is the netfilter path for locally generated packets after a local process creates traffic and before final egress processing; it is distinct from forwarding and can evaluate locally known attributes, marks, destination state and post-routing/NAT behavior.

Interpretation rule. - Remote inbound traffic ≠ OUTPUT traffic; server replies are locally generated and do traverse output paths, but the request itself does not.

  • OUTPUT ACCEPT ≠ return path or remote firewall permits the packet.
  • Process connect error ≠ firewall drop; DNS, route, listener or TLS/application failures can produce similar symptoms.
  • Packet seen on loopback ≠ packet leaves the intended external interface after routing/NAT.

Quick reference

OUTPUT filtering controls what the host may initiate. Default accept is common; default drop is used on high-security servers:

chain output {
  type filter hook output priority 0; policy drop;
  ct state established,related accept
  oif lo accept
  udp dport 53 ip daddr { 10.0.0.53, 10.0.0.54 } accept
  udp dport 123 accept
  tcp dport { 80, 443 } ip daddr @update_mirrors accept
  tcp dport 514 ip daddr 10.0.0.60 accept
}

Restricting egress limits malware callbacks and data exfiltration, but requires listing DNS, NTP, package mirrors, logging, monitoring, LDAP/Kerberos and backup destinations.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Limits and how it fails

Primary failure point. OUTPUT is confirmed only when locally generated traffic is shown to receive the intended output verdict, leave through the expected route/translation and complete the original remote transaction.

ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. OUTPUT owns locally generated firewall policy. Linux Networking owns route/source selection; NAT owns translation; applications own client behavior and remote services own acceptance.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Firewall → OUTPUT. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://wiki.nftables.org/wiki-nftables/index.php/Main_Page · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
iptables output chainnft output hooklinux outbound firewallegress firewall linux
Embedded reference data

Quick lookup tables

OUTPUT operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for OUTPUT.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateOUTPUT is the netfilter path for locally generated packets after a local process creates traffic and before final egress processing; it is distinct from forwarding and can evaluate locally known attributes, marks, destination state and post-routing/NAT behavior.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin exact namespace + five-tuple + interfaces/direction → prove route/listener prerequisites → identify manager/backend → snapshot full ruleset + hook priorities/default policies → reproduce with counters/trace + packet capture → correlate conntrack/NAT → change one demonstrated cause → read back effective state → repeat original workload + negative regression flow.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainlocal process/socket → OUTPUT hook chains → marking/DNAT as applicable → route/reroute → POSTROUTING/SNAT → egress interface → remote service/responseTrace requested/configured state through effective state to the observed workload result.
Failure boundaryOUTPUT is proven only when locally generated traffic is shown to receive the intended output verdict, leave through the expected route/translation and complete the original remote transaction.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux firewall evidence can establish this proof path: local process/socket → OUTPUT hook chains → marking/DNAT as applicable → route/reroute → POSTROUTING/SNAT → egress interface → remote service/responseUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured namespace, family, five-tuple, interface/direction, manager/backend, ruleset generation, conntrack/NAT state, time window or application scope. OUTPUT is proven only when locally generated traffic is shown to receive the intended output verdict, leave through the expected route/translation and complete the original remote transaction.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven firewall boundary: preserve the current ruleset/state, capture the exact packet path and rule verdict, change only the demonstrated cause through the authoritative manager, read back effective policy, then repeat the original workload and regression flows.Continue to the next unresolved boundary while preserving the original test condition.

OUTPUT · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryOUTPUT
Topic pathFirewall → OUTPUT
Runtime stateOUTPUT is the netfilter path for locally generated packets after a local process creates traffic and before final egress processing; it is distinct from forwarding and can evaluate locally known attributes, marks, destination state and post-routing/NAT behavior.
Fast checks- Identify the exact originating process/socket and namespace, destination family/tuple, selected source address and route/interface. - Inspect all output-hook base chains, policy routing marks and NAT rules that can change route or tuple. - Correlate rule trace/counters with egress capture and conntrack while reproducing the original client transaction. - Verify the remote response and local application result after the smallest policy change, plus a negative egress-policy regression case.
Verification chainlocal process/socket → OUTPUT hook chains → marking/DNAT as applicable → route/reroute → POSTROUTING/SNAT → egress interface → remote service/response Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryOUTPUT is proven only when locally generated traffic is shown to receive the intended output verdict, leave through the expected route/translation and complete the original remote transaction. Boundary chain: process/context → userspace configuration → kernel subsystem/resource → device/network/filesystem dependency → effective state → original workload.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?