bash - fail2ban adding hostname to iptables instead of IP -


i need fail2ban adding hostnames (instead of ip) maillog iptables. fail2ban.log shows correct ip being banned, iptables -l shows hostname forged in cases.

system details;

fedora 24 beta (ver. 4.5.5-300.fc24.x86_64) firewalld.

gnu bash, version 4.3.42(1)-release-(x86_64-redhat-linux-gnu).

fail2ban v0.9.4, bannedaction=iptables-multiport.

iptables -l

chain f2b-postfix-rbl (1 references)

target prot opt source destination

drop -- static.vnpt.vn anywhere

fail2ban.log

2016-05-25 02:51:49,360 fail2ban.actions [4181]: notice [postfix-rbl] ban 14.177.53.221

fail2ban.log has correct ip....

thanks.

i managed resolve errors;

on fedora firewalld use banaction = firewallcmd-new not iptables-multiport.

i tried first getting other errors, such as;

fail2ban.action [7175]: error firewall-cmd --direct --get-chains ipv4 filter | grep -q 'f2b-postfix$' -- stdout: ''

fail2ban.commandaction [7175]: error invariant check failed. trying restore sane environment

solution modify firewallcmd-new.conf;

from:

actioncheck = firewall-cmd --direct --get-chains ipv4 filter | grep -q 'f2b-<name>$'

to: actioncheck = firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q 'f2b-<name>$'

original article; https://github.com/fail2ban/fail2ban/issues/908


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -