I know this is a few years old but why not just make a simple shell script with all the IP addreses and then run that shell script. I add hundreds of IP addresses this way.
Example: (done in Centos 8 using vi
as the editor)
vi manual-blacklist.sh
Then in the manual-blacklist.sh
file add all your IP addresses as listed below: (Press the i key to insert your lines)
ipset add manual-blacklist 123.45.67.111
ipset add manual-blacklist 123.45.67.112
ipset add manual-blacklist 123.45.67.113
And so on until all your IP addresses are added. To speed things up I use Excel to make my lists of IP addresses and then export it as a text file and then do a copy and paste into my shell script file.
Save the file. Press ESC key and then :wq!
and then press the Enter key to save the file.
Then to run it use the following command:
./manual-blacklist.sh
All your IP addresses will be added to your manual-blacklist ipset file. And if it notices any duplicates it will ignore them as they were already added prior.
Then save this file: (I save it to my home directory and the etc directory)
ipset save > /etc/ipset.conf
ipset save > /home/username/ipset.conf
And to restore:
ipset restore -f /etc/ipset.conf
The -f
switch specifies a filename to print into instead of stdout
(list or save commands) or read from instead of stdin
(restore command).
Hope this helps.
ipset add badip
≠ipset add manual-blacklist
.