Error when adding IP List for blocking

Hello, wonderful team and community of HestiaCP. Thank you developers for this product, thank you forum moderators for your great answers!

The problem is as follows, I was trying to add a list of ip addresses in .txt format.
It is a list of scanners, found a script in this repository to generate this list.

The command to generate it is
python3 bin/asutil.py text > list.txt

Here’s a link for an example of my list.txt

The file will contain both ipv4 and ipv6 addresses, I separated them through grep and wrote them into separate files. But so far I’ve tried only ipv4 and I’m stuck on it.
Accordingly, I checked, there were no ipv6 addresses in the file, the number of addresses is 8200 and so is the “blacklist-malicious” list added.

The file was added like this:
file:/opt/folder/list.txt

And I get error “Error: Populating ipset table”.
Can you please tell me what could be the problem and what can be done?

Have a look here: Firewall | Hestia Control Panel
and here: GitHub - chriscapisce/iptables-personal-blacklists.

1 Like

Thank you for your reply, you’ve helped me a lot, but unfortunately it’s not quite the answer I needed.
But your answer led me to the right answer.

The list I have is not sorted according to the rules. That’s why HestiaCP returns an error.

For the list to be accepted you need to apply similar code, if suddenly your file is local and not remote, in the answer above, a script with ip extraction from https was suggested.

sed -r -e '/^(0\.0\.0\.0|10\.|127\.|172\.1[6-9]\.|172\.2[0-9]\.|172\.3[0-1]\.|192\.168\.|22[4-9]\.|23[0-9]\.)/d' "/path/to/unsorted/list" | sort -n | sort -mu >iplist.txt

Then just add ipset file:/path/to/iplist.txt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.