Correct way to increase max active connections?

22.03-SNAPSHOT was defaulting to about 14k max active connections, I want to increase this number to 32k as I have more than enough RAM, but while researching the topic I found the information around sysctl to be confusing, OpenWRT does not follow the official guidance.

I've ran this script:

cat << "EOF" >> /etc/sysctl.conf
net.netfilter.nf_conntrack_buckets=32768 #was 14000
net.netfilter.nf_conntrack_expect_max=256 #was 232
net.netfilter.nf_conntrack_max=32768 #was 14000
/etc/init.d/sysctl restart

But I'm not sure if it makes sense, could someone with better knowledge give me pointers on this topic?

root@barracuda:[~]#cat /etc/sysctl.conf 
# Defaults are configured in /etc/sysctl.d/* and can be customized in this file

Seems quite alright to me and I am also adding my customizations there too.

1 Like

The release version (22.03.x) appears to have 64,512 set by default - at least on my device.


The default values depend on your system's hardware resources, both in master and 22.03

Here is the 22.03 commit:


How much RAM does your device have?

1 Like

OK, I recall multiple discussions on that notion - which I've followed since OpenWrt added the parameter (as I'm sure you recall). Cool.

The device I screenshoted has 512 MB of RAM.

I have two routers with 512 MB RAM , and they have somewhat different values:
59392 in my R7800 and 31744 in my RT3200 as the shown number of max. connections.

Here is mine