Increase the 16384 maximum connection limit?

My router is Newifi D2 which has 512MiB of RAM, which is plenty.

Right now I have ~120 users, mostly wireless clients with light network usage. The Active Connections is around 7000. In the next few days, I shall merge another Wi-Fi system into this, and shall likely have ~300 users. More wired clients are planned.

It is likely that the maximum net.nf_conntrack_max of 16384 will be reached in no time. What should I do to increase that limit?

And can I limit the maximum connections per network device? I want to prevent bad guys from torrenting and bring the whole network down.

1 Like
cat << EOF >> /etc/sysctl.conf
net.nf_conntrack_max=$((2**16))
EOF
/etc/init.d/sysctl restart

See also: Nf_conntrack_count script? - #2 by vgaetera

Why does it even work? From the look of the extension, it looks much like a configuration file. But I can see it is parsed as shell script. Can I put arbitrary code inside it?

The config file has no variables by itself, just static lines.
It's a shell feature to expand commands and variables while saving a file:

cat << EOF > file
# Expand
EOF

cat << "EOF" > file
# No expand
EOF

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.