Interview Prep/Linux/Networking, DNS and firewalls

`dmesg` is flooded with `nf_conntrack: table full, dropping packet` and new connections randomly fail.

AdvancedTroubleshootingNetworking, DNS and firewalls
Answer

Likely causes → The connection tracking table is full: high connection rates on a NAT gateway, load balancer or busy host with stateful firewall rules.

Diagnose →

sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max
sudo conntrack -S | head
sudo conntrack -L 2>/dev/null | awk '{print $1, $4}' | sort | uniq -c | sort -rn | head

Fix → Raise the limit: sysctl -w net.netfilter.nf_conntrack_max=1048576 (and nf_conntrack_buckets via module options), shorten timeouts (nf_conntrack_tcp_timeout_time_wait), or exempt high-volume traffic with notrack rules.

Prevent → Alert at 80% of nf_conntrack_max; size for peak.

All Linux questions Roadmap: Linux

More on Networking, DNS and firewalls