OS: Ubuntu Server 18.04
I am trying to understand a bug with my Fail2ban installation (I believe from my own making). I have a cron job that populates iptables with a predefined list using:
iptables -A INPUT -s <ip address> -j DROP iptables -A INPUT -s <ip address> -j DROP etc etc
At the beginning of this script, it runs:
iptables -F INPUT to flush the INPUT chain.
This cron job was present on the server before I installed Fail2ban to dynamically ban bad actors. However, I noticed I started getting a lot of notices stating that a particular IP was
already banned. When I stopped the iptables cron job from running, this error disappeared, and has been runnning without any issues whatsoever.
My question is: What sort of conflict am I creating by running
iptables -F INPUT while Fail2ban is still running? Shouldn't this command be fine since banned IPs are placed into their respective
f2b-<jail> chain, or am I misunderstanding? If this iptables script needs to run, should I also do something with the Fail2ban database (purge, etc)?