Some changes in per IP Connection Limit.

This commit is contained in:
Christoph 2024-04-04 18:57:36 +02:00
parent 2532b116b8
commit e6566bafeb
3 changed files with 11 additions and 1 deletions

View File

@ -4,7 +4,7 @@
# --- Default Parameter / Options # --- Default Parameter / Options
# ------------- # -------------
per_IP_connection_limit=111 default_per_IP_connection_limit=111
# ------------- # -------------

View File

@ -814,6 +814,11 @@ fi
echononl "\tLimit connections per source IP" echononl "\tLimit connections per source IP"
if $limit_connections_per_source_IP ; then if $limit_connections_per_source_IP ; then
if ! is_number $per_IP_connection_limit ; then
per_IP_connection_limit=$default_per_IP_connection_limit
fi
if $log_rejected || $log_all ; then if $log_rejected || $log_all ; then
$ip6t -A INPUT -p tcp -m connlimit --connlimit-above $per_IP_connection_limit -j $LOG_TARGET $tag_log_prefix "$log_prefix CONN limit per IP: " $ip6t -A INPUT -p tcp -m connlimit --connlimit-above $per_IP_connection_limit -j $LOG_TARGET $tag_log_prefix "$log_prefix CONN limit per IP: "
fi fi

View File

@ -967,6 +967,11 @@ fi
echononl "\tLimit connections per source IP" echononl "\tLimit connections per source IP"
if $limit_connections_per_source_IP ; then if $limit_connections_per_source_IP ; then
if ! is_number $per_IP_connection_limit ; then
per_IP_connection_limit=$default_per_IP_connection_limit
fi
if $log_rejected || $log_all ; then if $log_rejected || $log_all ; then
$ipt -A INPUT -p tcp -m connlimit --connlimit-above $per_IP_connection_limit -j $LOG_TARGET $tag_log_prefix "$log_prefix CONN limit per IP:" $ipt -A INPUT -p tcp -m connlimit --connlimit-above $per_IP_connection_limit -j $LOG_TARGET $tag_log_prefix "$log_prefix CONN limit per IP:"
fi fi