|
|
|
@ -19,9 +19,9 @@ before = iptables-common.conf
|
|
|
|
|
[Definition]
|
|
|
|
|
|
|
|
|
|
actionstart = ipset create fail2ban-<name> hash:ip timeout <bantime>
|
|
|
|
|
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
|
|
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 <actiontype> -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
|
|
|
|
|
|
|
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
|
|
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 <actiontype> -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
|
|
ipset flush fail2ban-<name>
|
|
|
|
|
ipset destroy fail2ban-<name>
|
|
|
|
|
|
|
|
|
@ -44,6 +44,23 @@ chain = INPUT_direct
|
|
|
|
|
|
|
|
|
|
bantime = 600
|
|
|
|
|
|
|
|
|
|
# Option: actiontype
|
|
|
|
|
# Notes.: defines additions to the blocking rule
|
|
|
|
|
# Values: leave empty to block all attempts from the host
|
|
|
|
|
# Default: Value of the multiport
|
|
|
|
|
actiontype = <multiport>
|
|
|
|
|
|
|
|
|
|
# Option: allports
|
|
|
|
|
# Notes.: default addition to block all ports
|
|
|
|
|
# Usage.: use in jail config: banaction = firewallcmd-ipset[actiontype=<allports>]
|
|
|
|
|
# for all protocols: banaction = firewallcmd-ipset[actiontype=""]
|
|
|
|
|
allports = -p <protocol>
|
|
|
|
|
|
|
|
|
|
# Option: multiport
|
|
|
|
|
# Notes.: addition to block access only to specific ports
|
|
|
|
|
# Usage.: use in jail config: banaction = firewallcmd-ipset[actiontype=<multiport>]
|
|
|
|
|
multiport = -p <protocol> -m multiport --dports <port>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# DEV NOTES:
|
|
|
|
|
#
|
|
|
|
|