mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-05-14 04:08:06 +00:00
Merge pull request #1929 from somebodywashere/main
Changes to fail2ban jails to work with f2b 1.0+
This commit is contained in:
commit
2f1aad3e63
1 changed files with 5 additions and 5 deletions
10
x-ui.sh
10
x-ui.sh
|
@ -947,8 +947,8 @@ run_speedtest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
create_iplimit_jails() {
|
create_iplimit_jails() {
|
||||||
# Use default bantime if not passed => 30 minutes
|
# Use default bantime if not passed => 15 minutes
|
||||||
local bantime="${1:-30}"
|
local bantime="${1:-15}"
|
||||||
|
|
||||||
# Uncomment 'allowipv6 = auto' in fail2ban.conf
|
# Uncomment 'allowipv6 = auto' in fail2ban.conf
|
||||||
sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf
|
sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf
|
||||||
|
@ -959,8 +959,8 @@ enabled=true
|
||||||
filter=3x-ipl
|
filter=3x-ipl
|
||||||
action=3x-ipl
|
action=3x-ipl
|
||||||
logpath=${iplimit_log_path}
|
logpath=${iplimit_log_path}
|
||||||
maxretry=4
|
maxretry=2
|
||||||
findtime=60
|
findtime=32
|
||||||
bantime=${bantime}m
|
bantime=${bantime}m
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ EOF
|
||||||
|
|
||||||
cat << EOF > /etc/fail2ban/action.d/3x-ipl.conf
|
cat << EOF > /etc/fail2ban/action.d/3x-ipl.conf
|
||||||
[INCLUDES]
|
[INCLUDES]
|
||||||
before = iptables-common.conf
|
before = iptables-allports.conf
|
||||||
|
|
||||||
[Definition]
|
[Definition]
|
||||||
actionstart = <iptables> -N f2b-<name>
|
actionstart = <iptables> -N f2b-<name>
|
||||||
|
|
Loading…
Reference in a new issue