I am experimenting with CrowdSec as a means of blocking bad actors - mostly scrapers - from our sites. It seems like quite a good tool, and it automatically loads some ipsets for iptables to use. But it doesn’t seem to be using them.
I added a rule from the command line, such as
sudo iptables -A INPUT -m set --match-set crowdsec-blacklists-0 src -j DROP
and it accepts it, but after a reboot it disappears, so it’s obviously not persistent. How to make it so?
I’ve run into something similar before. The rule works fine when added manually but won’t survive a reboot unless you save it. You can use iptables-save and iptables-restore or install something like iptables-persistent to reload the rules on startup. That way your ipset rules will stick around after a reboot.