0

I'm trying to configure Fail2ban to redirect instead of banning, I've found plenty of posts about redirecting to a different port for HTTP traffic to display a different webpage, but I need to redirect to a different IP address entirely. I see the -j REDIRECT function will let me redirect to a different port but not IP Does anyone know how to redirect banned traffic to a specified IP rather than dropping?

iptables-multiport-24.conf
actionstart = iptables -I <chain> -p <protocol> -m multiport --dports <port> -j fail2ban-<name>
actionban = iptables -I fail2ban-<name> 1 -s <ip>/24 -j <blocktype>

jail.local
action = iptables-multiport-24[name=SPAMTRAP, port=smtp, protocol=tcp]
logpath = /var/log/maillog
2
  • please share your configurations for both iptables and fail2ban jail. Commented Feb 16, 2023 at 6:55
  • Configs added above... Commented Feb 17, 2023 at 13:38

0

You must log in to answer this question.

Browse other questions tagged .