Kann man iptables zusammen mit nftables ohne Konflikte verwenden?
Also iptables für die Firewall und nftables nur für fail2Ban:
Code: Alles auswählen
[DEFAULT]
banaction = nftables
Code: Alles auswählen
[DEFAULT]
banaction = nftables
Benutzt Du iptables mit "xtables-nft-multi" oder mit "xtables-legacy-multi"?fulltilt hat geschrieben:29.06.2020 11:25:34Ich habe ein komplexes iptables script in Verwendung was u.a. auch IP ranges blockt, manchmal kommt es deswegen bei Fail2Ban zu errors wenn die IP in einer blockierten Range bereits vorhanden ist ...
verwende das standard iptables package von Stretch ...mat6937 hat geschrieben:29.06.2020 11:59:19Benutzt Du iptables mit "xtables-nft-multi" oder mit "xtables-legacy-multi"?fulltilt hat geschrieben:29.06.2020 11:25:34Ich habe ein komplexes iptables script in Verwendung was u.a. auch IP ranges blockt, manchmal kommt es deswegen bei Fail2Ban zu errors wenn die IP in einer blockierten Range bereits vorhanden ist ...
Unabhängig davon könnte es sein, wenn Du nftables und iptables benutzt, dass eine nftables-Regel oder eine iptables-Regel nie wirksam werden kann, wenn die Bedingung sowohl in einer iptables- als auch in einer nftables-Regel vorhanden ist. Das solltest Du testen. Wird als 1., die nftables- oder die iptables-Regel ausgeführt?
Code: Alles auswählen
iptables -I INPUT -s 2.58.46.0/24 -j DROP
Statt der netmask (für das ganze 24er-Subnetz) kannst Du auch nur bestimmte Bereiche verwenden. Z. B.:fulltilt hat geschrieben:29.06.2020 12:10:24gibt es sonst noch eine andere Möglichkeit IP ranges mit iptables zu sperren was dann besser mit Fail2Ban zusammen funktioniert?Code: Alles auswählen
iptables -I INPUT -s 2.58.46.0/24 -j DROP
Code: Alles auswählen
iptables -I INPUT -m iprange --src-range 2.58.46.21-2.58.46.199 -j DROP
Wie ist die Ausgabe von:fulltilt hat geschrieben:29.06.2020 12:10:24verwende das standard iptables package von Stretch ...
Code: Alles auswählen
iptables -V
Code: Alles auswählen
iptables -V
Code: Alles auswählen
iptables v1.6.0
OK. Das ist dann noch iptables-legacy (ohne nf_tables).
Code: Alles auswählen
:~# iptables -V
iptables v1.8.2 (nf_tables)
Code: Alles auswählen
nano /etc/fail2ban/fail2ban.local
[Definition]
# Options: dbfile
# Notes.: Set the file for the fail2ban persistent data to be stored.
# A value of ":memory:" means database is only stored in memory
# and data is lost when fail2ban is stopped.
# A value of "None" disables the database.
# Values: [ None :memory: FILE ] Default: /var/lib/fail2ban/fail2ban.sqlite3
dbfile = None
Code: Alles auswählen
[postfix-sasl]
enabled = true
port = smtp,465,submission,imap2,imaps,pop3,pop3s
filter = postfix-sasl
logpath = /var/log/mail.warn
maxretry = 1
bantime = 3600
logencoding = utf-8
[dovecot]
enabled = true
port = smtp,465,submission,imap2,imaps,pop3,pop3s
filter = dovecot
logpath = /var/log/mail.log
maxretry = 4
bantime = 3600
Code: Alles auswählen
smtp,465,submission,imap,imaps,pop3,pop3s