banIP: Temporary blocked IPs disappear after automatic reload

Hello,

I have noticed an issue with banIP on NethSecurity.

NethSecurity automatically runs a banIP reload (scheduled approximately every 4 hours). When this reload occurs, the IP addresses temporarily added to the blocklist.v4 set disappear, even though their configured expiration time has not elapsed.

My current configuration uses:

banip.global.ban_nftexpiry='3d'

After the automatic reload, the blocklist.v4 set becomes empty and the temporarily blocked IP addresses are lost.

Could you please investigate this behavior? Temporary blocklist entries should remain in place until their configured expiration time expires, including after an automatic banIP reload.

Thank you.

Hello Niko,
thanks for the report.

I reproduced it, but it is how baniP is designed to work.

The ban_nftexpiry is the expiry timeout of added entry inside the nft set, not a retention.
Data are stored in RAM and lost when banip is reloaded or restarted.

Inside NethSecurity there is a fork of banip for some minor changes to integrate it better inside NethSecurity.
You can still try to propose the change to upstram packages/net/banip at master · openwrt/packages · GitHub and we will get it back on the next release cycle.