FULL AI ANALYSIS

Edge Linux router drops long-lived TCP uploads after conntrack table thrash under heavy NAT load

Generated Oct 25, 2026, 9:44:56 AM

Analysis summary

The kernel conntrack table protects NAT state; when the table is full or heavily resized, state insertions can fail or existing entries can be dropped, which breaks NAT mapping and causes mid-stream stalls even though TCP state on endpoints remains established. Primary causes are under-provisioned nf_conntrack_max/hashsize, aggressive timeouts or hash collisions (hashsize too small), vendor scripts lowering hashsize on reboot, or interaction with conntrack bypass/raw rules that lead to inconsistent state life cycles. Less likely causes: PMTU/ICMP filtering or asymmetric routing, but logs strongly point to conntrack exhaustion.

Possible causes

nf_conntrack table exhaustion (nf_conntrack_max too low) causing new NAT state inserts to be dropped and existing flows evicted

92%

Conntrack hashsize misconfigured too small leading to excessive collisions and slow hashchain traversal under load

68%

Vendor startup script or firewall rule periodically shortens conntrack timeouts or forces table rehash causing transient loss of NAT entries

45%

Asymmetric routing or middlebox rewriting causing stale conntrack entries to be mismatched for return packets

20%

Suggested fixes

1

Diagnostic step 1

Monitor conntrack usage (watch -n1 cat /proc/sys/net/netfilter/nf_conntrack_count and nf_conntrack_max) during the backup window to correlate stalls with exhaustion.

2

Diagnostic step 2

Increase nf_conntrack_max and re-calculate appropriate hashsize: set nf_conntrack_max to expected entries * 2 and tune net.netfilter.nf_conntrack_buckets (hashsize) to a prime near nf_conntrack_max/4; on Debian set at boot via /etc/sysctl.d and ensure vendor scripts don't override.

3

Diagnostic step 3

Tune TCP conntrack timeouts for established connections (net.netfilter.nf_conntrack_tcp_timeout_established) to avoid premature eviction for known long uploads; reduce timeouts for ephemeral UDP if needed.

4

Diagnostic step 4

Consider marking trusted long-lived flows to bypass conntrack (using raw table and NOTRACK) for internal backup hosts, or place those hosts on a 1:1 NAT or routed subnet to avoid heavy NAT churn.

5

Diagnostic step 5

After changes, reproduce during low-impact window and verify stalls gone by monitoring /proc/net/nf_conntrack entries per flow and using tcpdump to confirm NAT mappings persist. Roll back sysctl changes by restoring previous values if unexpected side effects occur.