About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A Linux server or gateway that logs nf_conntrack: table full, dropping packet has used up its connection tracking table. New connections cannot be recorded, so their packets are dropped. The check happens when a new entry is created, so connections that already have an entry are not affected. The cure is to learn what is filling the table and then either raise nf_conntrack_max, shorten a timeout that holds entries too long, or stop tracking traffic that does not need it.
What the symptom means
Connection tracking (conntrack) is the part of the kernel's Netfilter framework that remembers each connection, so that stateful firewall rules and NAT can work. Each tracked connection takes one entry in a table.
In the mainline kernel source (nf_conntrack_core.c), a new connection increments the entry count. If the count would pass nf_conntrack_max, the kernel first tries an early drop, which evicts an entry from a nearby hash bucket, skipping entries flagged as assured. If nothing can be evicted, it undoes the count increase, refuses the new entry and prints nf_conntrack: table full, dropping packet. Inside a network namespace the message reads nf_conntrack: table full in netns, followed by a number, then , dropping packet. The source calls a rate-limited print function, so the number of log lines understates the number of drops.
The kernel documentation defines the two numbers you need:
nf_conntrack_countis "Number of currently allocated flow entries" and is read-only.nf_conntrack_maxis the "Maximum number of allowed connection tracking entries" and "is set to nf_conntrack_buckets by default".
The same page notes that entries are added to the hash table twice, once for the original direction and once for the reply, so with default settings "a maxed-out table will have a average hash chain length of 2".
The default for nf_conntrack_buckets, when not given at module load, is the total memory divided by 16384, with a floor of 1024 and a ceiling of 262144. Because the documentation gives that rule for buckets only, read your live nf_conntrack_max rather than computing it.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Table too small for the real load | Count rises with traffic and sits at the maximum at busy times | nf_conntrack_count close to nf_conntrack_max at peak |
| Many idle TCP connections held for days | Count high with little traffic | Established TCP timeout default is 432000 seconds (5 days); list established entries |
| Short-lived flows in bulk (scans, DNS, health checks, a client opening many connections) | Count rises quickly, many entries in early TCP states or UDP | List entries by protocol and state with conntrack -L |
| A gateway or NAT box serving many clients | Messages on the gateway, not on the servers behind it | Count on the gateway against client numbers |
| Traffic that needs no tracking being tracked | Large share of entries for one service | Candidate for a notrack rule |
Prove the cause before changing anything
All of these are read-only.
1. Read the log. journalctl -k shows kernel messages (the journalctl manual describes -k, --dmesg as "Show only kernel messages" and says it implies --boot=0, the current boot). To read the previous boot, use journalctl -k -b -1, the form the manual's examples show. Look for nf_conntrack: table full and note when it happens.
2. Read the count and the maximum.
sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max
sysctl variable reads a key, and the manual says the / separator is accepted in place of .. The kernel documentation lists these variables under /proc/sys/net/netfilter/. A count at or near the maximum confirms exhaustion. Record both numbers with the time.
3. Count entries.
conntrack -C
The conntrack-tools manual describes -C, --count as "Show the table counter". Compare it with nf_conntrack_count from step 2, and run it again at the busy time.
4. See which entries dominate.
conntrack -L -p tcp
-L lists the table and -p filters by protocol. The manual says that without -f the listing uses the IPv4 layer 3 protocol by default, so on a host that carries IPv6 run conntrack -L -p tcp -f ipv6 as well. The listing can be very long on a loaded system, so redirect it to a file. The manual lists TCP states you can filter with --state, including ESTABLISHED, TIME_WAIT and SYN_SENT. Source addresses can be filtered with -s.
5. Compare with timeouts. The kernel page gives these defaults, in seconds: TCP established 432000 (5 days), TCP time_wait 120, TCP syn_sent 120, TCP close_wait 60, TCP fin_wait 120, UDP 30, UDP stream 120, ICMP 30 and generic 600. Five days is 5 x 24 x 3600 = 432000 seconds. With these defaults, a client that opens a connection and goes silent keeps its entry for that long unless a closing exchange or a reset arrives first.
6. Read statistics. conntrack -S shows in-kernel connection tracking statistics. The conntrack manual does not explain the fields, so use it only to see whether counters rise during the incident.
Fix
Choose by cause. Raising the limit is the first step when the count is legitimately high. Shortening timeouts is for entries held by idle connections.
Raise the limit
Disruptive step: changing a kernel setting affects every connection on the host. First print the current value and keep it:
sysctl net.netfilter.nf_conntrack_max
Then set a higher value, for example double the printed number:
sysctl -w net.netfilter.nf_conntrack_max=524288
-w is documented as "Force all arguments to be write arguments". If the printed value was 262144, doubling gives 2 x 262144 = 524288. The kernel documentation gives no memory figure per entry, so raise in steps and watch memory use. Also check sysctl net.netfilter.nf_conntrack_buckets: the kernel page says that with the default (maximum equal to buckets) a maxed-out table has an average hash chain length of 2, so a maximum well above the bucket count makes the chains longer. To back out, run the same command with the value you printed.
Make the change survive a reboot
First save what is there. List the directory and the main file, and note the live value printed earlier with sysctl net.netfilter.nf_conntrack_max:
ls -l /etc/sysctl.d/ /etc/sysctl.conf
grep -rn nf_conntrack_max /etc/sysctl.conf /etc/sysctl.d/
Confirm that no file named 90-conntrack.conf exists. The systemd manual says files are sorted by name and, for the same option, the lexicographically latest file wins, so choose a name that sorts after any file that already sets this key. The sysctl manual adds that /etc/sysctl.conf is read last, so it can override anything set in the directories: if the grep shows the key set there, change it there instead.
Disruptive step: write a new file /etc/sysctl.d/90-conntrack.conf containing the single line net.netfilter.nf_conntrack_max = 524288. Then load only that file, not every system file:
sysctl -p /etc/sysctl.d/90-conntrack.conf
The sysctl manual describes -p as loading settings from the file named. Avoid sysctl --system for this change: the manual describes it as loading settings from all system configuration files, so it re-applies every other setting too, and a value changed by hand and never written to a file would return to its file value. To back out, delete the one file you created with its own command, rm /etc/sysctl.d/90-conntrack.conf, then set the live value back to the one you noted with sysctl -w net.netfilter.nf_conntrack_max= followed by that number, because deleting the file does not change the running value.
The systemd manual also warns that many parameters exist only once a kernel module is loaded, and that systemd-sysctl.service runs early in boot, so it will not configure such parameters if they become available after it has run. If the setting does not apply after a reboot, the conntrack module may load later than the sysctl service. The manual recommends a udev rule for this, and describes adding the module to modules-load.d as "a slightly simpler and less efficient option". The modules-load.d manual says files there must have the .conf extension.
If you take the modules-load.d option, first list the directory with ls -l /etc/modules-load.d/ and confirm that no file named nf_conntrack.conf exists. Disruptive step: create /etc/modules-load.d/nf_conntrack.conf containing the single line nf_conntrack. This changes what the kernel loads at the next boot. To back out, delete that one file with its own command, rm /etc/modules-load.d/nf_conntrack.conf; the module stays loaded until the next reboot.
Shorten a timeout that holds entries too long
First print the current value, for example:
sysctl net.netfilter.nf_conntrack_tcp_timeout_established
Risk: a shorter established timeout drops the table entry of a quiet but valid session. The session can then break, for example a database connection that is idle overnight. Keep the new value longer than the longest idle period of any real session or keepalive interval. The kernel documentation does not say what happens to a session after its entry expires. To back out, write the printed value back with sysctl -w.
Stop tracking traffic that does not need it
The nftables wiki describes a notrack statement that skips tracking, and says the rule must be in a chain with the prerouting hook and a priority lower than -200, with -300 (raw) "a good choice". Risk: a firewall that matches on connection state will see untracked packets as having no state, so rules for that traffic must allow it explicitly. Plan and test this on a spare host first; it is a larger change than a limit. No rule is given here; the wiki page shows the syntax. Before you write any such rule, save the current ruleset to a dated file. The nft manual page describes nft list ruleset as printing the ruleset in human-readable format, and says its output may be used as input to nft -f. Save it with nft list ruleset > /root/nft-ruleset-2026-11-20.txt and keep it as a reference. To back out, list the rules with their handles (nft -a list ruleset; the manual describes -a, --handle as "Show object handles in output") and delete only the notrack rule you added by its handle, in the form the manual shows: nft delete rule inet filter input handle 5, where the family, table, chain and handle are yours. Do not load the saved file over a live ruleset, because the manual does not describe that case.
Example (illustrative): gw01 is a NAT gateway for an office. The kernel log shows nf_conntrack: table full, dropping packet every afternoon. sysctl prints a count of 262144 against a maximum of 262144 at 3 pm, and 41000 at midnight. conntrack -L -p tcp redirected to a file shows most entries in the established state with idle clients, and 300 clients each holding about 800 idle connections is 240000 entries. The administrator records the limit (262144), raises it to 524288, and sets the same value in a new file under /etc/sysctl.d. The next afternoon the count peaks at 291000, below the new limit, and the messages stop.
Confirm the fix
sysctl net.netfilter.nf_conntrack_maxprints the new value.- At the next peak,
nf_conntrack_countstays below the maximum, with room to spare. journalctl -kshows no newtable fulllines for a full busy period.- After a reboot, the value is still applied.
What to watch afterwards
- Chart
nf_conntrack_countas a percentage ofnf_conntrack_max, and alert before it reaches the limit. - Look at the cause again if the count grows over weeks, since a limit that is only raised will fill again.
- Watch memory on the host after each increase.
- If sessions that sit idle are being dropped, compare timers on firewalls and load balancers. See "Connections drop after a few idle minutes through a firewall or load balancer: idle timers and TCP keepalive".
Read next
Related articles you may want next.
- TroubleshootingConnections drop after a few idle minutes through a firewall or load balancer: idle timers and TCP keepaliveTCP sessions die after the same idle time through a firewall or load balancer. Find the idle timer and set keepalive below it on Linux, nginx or SSH.Read article
- TroubleshootingSmall Requests Work but Large Transfers Hang: Proving a Path MTU Black HolePing works but large transfers or TLS stall? Prove a PMTU black hole with DF pings and captures, then fix it by allowing ICMP, clamping MSS or lowering MTU.Read article
- TroubleshootingHAProxy 503 Service Unavailable: No server is available to handle this requestHAProxy 503: No server is available to handle this request. Read the log flags and server status to find a failed health check, backend rule or queue.Read article
Risks and limits
- These commands have not been run or lab-tested.
- The log wording and eviction behaviour are taken from the current mainline source file. Distribution kernels may differ.
- The kernel documentation page shows version 7.4.0-rc3. Defaults on older kernels may differ.
- The kernel documentation does not give a memory cost per entry or a safe maximum for a given amount of memory.
- A raised limit hides a cause that is not capacity, such as a flood. Read the entries before you decide the load is real.
- Containers and network namespaces have their own tables and messages; the steps above apply to the host's main table.
Sources
- Netfilter Conntrack Sysfs variables — The Linux Kernel documentation, no date shown (page version 7.4.0-rc3), accessed 20 November 2026
- nf_conntrack_core.c — Linux kernel source, master branch, no date shown, accessed 20 November 2026
- conntrack(8) — conntrack-tools manual page as rendered by Arch Linux, August 9, 2019, accessed 20 November 2026
- sysctl(8) — procps-ng manual page as rendered by Arch Linux, 2024-07-19, accessed 20 November 2026
- sysctl.d — systemd documentation, no date shown (page version systemd 262), accessed 20 November 2026
- modules-load.d — systemd documentation, no date shown (page version systemd 262), accessed 20 November 2026
- journalctl — systemd documentation, no date shown (page version systemd 262), accessed 20 November 2026
- nft(8) — netfilter.org nftables manual page, page shows "Updated: 07/02/2026", accessed 20 November 2026
- Setting packet connection tracking metainformation — nftables wiki, last edited 16 April 2021, accessed 20 November 2026
This article was originally published on .