Issue Plesk 18.0.71 Update 2: Fail2ban fails to ban IPv6 hosts due to wrong address format

B_P

Regular Pleskian
Server operating system version
Ubuntu 22.04
Plesk version and microupdate number
18.0.71 #2
Hi all,

It looks like there is an issue with Fail2Ban where IPv6 cannot be banned correctly due to using the wrong shortening string :):: instead of ::):


Code:
2025-08-25 18:33:12,593 fail2ban.filter         [3412088]: INFO    [plesk-apache] Found 201:1234:2:123:::0 - 2025-08-25
 18:33:12
2025-08-25 18:33:12,609 fail2ban.filter         [3412088]: INFO    [plesk-apache] Found 201:1234:2:123:::0 - 2025-08-25
 18:33:12
2025-08-25 18:33:12,669 fail2ban.filter         [3412088]: INFO    [plesk-apache] Found 201:1234:2:123:::0 - 2025-08-25
 18:33:12
2025-08-25 18:33:12,685 fail2ban.filter         [3412088]: INFO    [plesk-apache] Found 201:1234:2:123:::0 - 2025-08-25
 18:33:12
2025-08-25 18:33:12,802 fail2ban.actions        [3412088]: NOTICE  [plesk-apache] Ban 201:1234:2:123:::0
2025-08-25 18:33:12,808 fail2ban.filter         [3412088]: INFO    [recidive] Found 201:1234:2:123:::0 - 2025-08-25 18:
33:12
2025-08-25 18:33:12,839 fail2ban.utils          [3412088]: ERROR   7ff56df25d90 -- exec: iptables -w -I f2b-apache 1 -s
201:1234:2:123:::0 -j REJECT --reject-with icmp-port-unreachable
2025-08-25 18:33:12,839 fail2ban.utils          [3412088]: ERROR   7ff56df25d90 -- stderr: "iptables v1.8.7 (nf_tables):
 host/network `201:1234:2:123:::0' not found"
2025-08-25 18:33:12,839 fail2ban.utils          [3412088]: ERROR   7ff56df25d90 -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2025-08-25 18:33:12,840 fail2ban.utils          [3412088]: ERROR   7ff56df25d90 -- returned 2
2025-08-25 18:33:12,857 fail2ban.utils          [3412088]: ERROR   7ff56f597730 -- exec: iptables -w -I f2b-apache 1 -s 201:1234:2:123:::0 -j REJECT --reject-with icmp-port-unreachable
2025-08-25 18:33:12,857 fail2ban.utils          [3412088]: ERROR   7ff56f597730 -- stderr: "iptables v1.8.7 (nf_tables): host/network `201:1234:2:123:::0' not found"
2025-08-25 18:33:12,857 fail2ban.utils          [3412088]: ERROR   7ff56f597730 -- stderr: "Try `iptables -h' or 'iptables --help' for more information."
2025-08-25 18:33:12,857 fail2ban.utils          [3412088]: ERROR   7ff56f597730 -- returned 2
2025-08-25 18:33:12,858 fail2ban.actions        [3412088]: ERROR   Failed to execute ban jail 'plesk-apache' action 'iptables-multiport-apache' info 'ActionInfo({'ip': '201:1234:2:123:::0', 'family': None, 'fid': <function Actions.ActionInfo.<lambda> at 0x7ff56f5e9fc0>, 'raw-ticket': <function Actions.ActionInfo.<lambda> at 0x7ff56f5ea680>})': Error banning 201:1234:2:123:::0
 
It looks like the corresponding log file entry in one of the Apache log files is the following:

Code:
201:1234:2:123:: - - [24/Aug/2025:17:43:24 +0200] "GET / HTTP/1.0" 200 4613 "http://www.domain.com" "Mozilla/5.0 (
Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
 
Back
Top