4 |
- |
1 |
# Fail2Ban configuration file
|
|
|
2 |
#
|
|
|
3 |
# Author: Daniel Black
|
|
|
4 |
#
|
|
|
5 |
# This is for ipset protocol 6 (and hopefully later) (ipset v6.14).
|
|
|
6 |
# Use ipset -V to see the protocol and version. Version 4 should use
|
|
|
7 |
# iptables-ipset-proto4.conf.
|
|
|
8 |
#
|
|
|
9 |
# This requires the program ipset which is normally in package called ipset.
|
|
|
10 |
#
|
|
|
11 |
# IPset was a feature introduced in the linux kernel 2.6.39 and 3.0.0 kernels.
|
|
|
12 |
#
|
|
|
13 |
# If you are running on an older kernel you make need to patch in external
|
|
|
14 |
# modules.
|
|
|
15 |
|
|
|
16 |
[INCLUDES]
|
|
|
17 |
|
34 |
- |
18 |
before = iptables-common.conf
|
4 |
- |
19 |
|
|
|
20 |
[Definition]
|
|
|
21 |
|
|
|
22 |
# Option: actionstart
|
|
|
23 |
# Notes.: command executed once at the start of Fail2Ban.
|
|
|
24 |
# Values: CMD
|
|
|
25 |
#
|
34 |
- |
26 |
actionstart = ipset create f2b-<name> hash:ip timeout <bantime>
|
|
|
27 |
iptables -I <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
|
4 |
- |
28 |
|
|
|
29 |
# Option: actionstop
|
|
|
30 |
# Notes.: command executed once at the end of Fail2Ban
|
|
|
31 |
# Values: CMD
|
|
|
32 |
#
|
34 |
- |
33 |
actionstop = iptables -D <chain> -p <protocol> -m multiport --dports <port> -m set --match-set f2b-<name> src -j <blocktype>
|
|
|
34 |
ipset flush f2b-<name>
|
|
|
35 |
ipset destroy f2b-<name>
|
4 |
- |
36 |
|
|
|
37 |
# Option: actionban
|
|
|
38 |
# Notes.: command executed when banning an IP. Take care that the
|
|
|
39 |
# command is executed with Fail2Ban user rights.
|
|
|
40 |
# Tags: See jail.conf(5) man page
|
|
|
41 |
# Values: CMD
|
|
|
42 |
#
|
34 |
- |
43 |
actionban = ipset add f2b-<name> <ip> timeout <bantime> -exist
|
4 |
- |
44 |
|
|
|
45 |
# Option: actionunban
|
|
|
46 |
# Notes.: command executed when unbanning an IP. Take care that the
|
|
|
47 |
# command is executed with Fail2Ban user rights.
|
|
|
48 |
# Tags: See jail.conf(5) man page
|
|
|
49 |
# Values: CMD
|
|
|
50 |
#
|
34 |
- |
51 |
actionunban = ipset del f2b-<name> <ip> -exist
|
4 |
- |
52 |
|
|
|
53 |
[Init]
|
|
|
54 |
|
|
|
55 |
# Option: bantime
|
|
|
56 |
# Notes: specifies the bantime in seconds (handled internally rather than by fail2ban)
|
|
|
57 |
# Values: [ NUM ] Default: 600
|
34 |
- |
58 |
#
|
4 |
- |
59 |
bantime = 600
|