Skip to content

Instantly share code, notes, and snippets.

@frgaudet
Created December 2, 2014 09:22
Show Gist options
  • Save frgaudet/cb47f72e9b29cc9178eb to your computer and use it in GitHub Desktop.
Save frgaudet/cb47f72e9b29cc9178eb to your computer and use it in GitHub Desktop.
Using CSF to limit connections
# 1 rsync connection
cat << EOF > /etc/csf/csfpre.sh
iptables -A INPUT -p tcp --syn --dport 873 -m connlimit --connlimit-above 1 -j REJECT
EOF
# 4 HTTP connection
cat << EOF > /etc/csf/csfpre.sh
iptables -A INPUT -p tcp --syn --dport 80 -m connlimit --connlimit-above 4 -j REJECT
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment