Ubiquiti · EdgeOS

EdgeRouter Firewall and NAT Counters: Follow One Connection

When a rule does not appear to work, identify the packet's path before editing the rule. Traffic addressed to the router and traffic passing through it are different cases. A successful ping to the gateway does not test the same firewall path as an HTTPS session to a server behind it.

Scope: EdgeRouter/EdgeOS IPv4 named firewall rulesets and NAT. Interface-direction examples do not replace a zone-based firewall design. Commands documented in Ubiquiti's unversioned EdgeOS articles; not UniFi Policy Engine or EdgeSwitch ACL syntax.

In the familiar EdgeOS example, WAN_LOCAL handles traffic destined for the router, while WAN_IN handles traffic arriving from WAN and forwarded onward. The names themselves have no magic: inspect the actual interface and direction where each ruleset is attached. A carefully written ruleset that is not attached to the relevant path cannot affect that traffic.

Read the existing rules and counters #

Operational mode; substitute your real ruleset names:

Read the existing rules and counters
EdgeOS · EdgeOS operational CLI / shell for tcpdump

Read-only

Replace these example values: WAN_IN.

show firewall name WAN_IN statistics
Read-only

Replace these example values: WAN_LOCAL.

show firewall name WAN_LOCAL statistics
Read-only
show nat statistics
Read-only
show configuration commands | no-more
Output may contain sensitive operational data.

Treat configuration output as sensitive. Locate the relevant interface attachment, rule order, match conditions and NAT rule in the output instead of publishing an entire router configuration for a single question.

Compare before and after one test #

Record the counter values, generate one new connection from a known client, then collect them again. Use the same destination and protocol on each attempt. A long-running browser connection may continue to use existing state, so it is a poor substitute for a deliberately fresh test.

EvidenceUseful next check
Expected policy counter stays unchangedInterface attachment, direction, earlier match or wrong traffic path
A drop rule incrementsWhich specific condition matched this test?
Expected allow rule incrementsWhere does the packet go next, and does a reply return?
A NAT rule records activityIs the observed translated address/port the one the server expects?
NAT activity without successFirewall, server listener and return routing still need checking

Counters are not a complete packet trace. Their meaning depends on the table and connection processing, and background traffic can increment them during your test. Do not convert a counter increase directly into a claim that the whole application session succeeded.

For a port forward, write the outside destination, translated inside destination, server port and expected return gateway on one line. Capture on both relevant sides if the counter comparison cannot explain the loss. For router-hosted services, inspect the local path instead of changing a forwarding rule.

Keep troubleshooting read-only until you can name the failing step. Flushing connections or disabling the entire WAN firewall may create an apparent improvement while erasing the evidence and exposing unrelated services. A useful fix changes the relevant match, attachment or return path and then repeats the same controlled test.

Sources

Documentation reviewed: 8 October 2026