Not sure if this is the correct subforum for this, but it concerns networking so why not?
I'll explain it all in case there's an easier procedure that I've missed. I understand cron jobs but I need to add my own data to the IP blocks
I block Chinese and Korean spam by using a list of IP blocks from here - the guy who maintains the list has added China or Korea to identify the origin country of each block.
I paste the list into /var/smoothwall/ipblock/config and use Find/Replace to edit the rules into the correct syntax recognised by the Smoothwall
I start with 1.11.0.0/16 Korea. I use Find to locate all instances of ' Korea' and use Replace to replace all instance with ',off,DROP,on,#Korea'. I end up with - 1.11.0.0/16,off,DROP,on,#Korea
off stops the firewall logs being filled up with hits from these IPs | DROP drops the packets | on enables the rule | #<text> adds a comment or identifier to the rule
This works. Korean/Chinese spam is blocked and my logs aren't full of hits.
Still with me?
I'd like to add Russia and a few other questionable blocks to my spamblocklist. Country IP Blocks™ has the data I need, but the blocks aren't labelled and there's a lot of them.
Code:
# Country: RUSSIAN FEDERATION
# ISO Code: RU
# Total Networks: 4,654
# Total Subnets: 37,036,552
2.60.0.0/14
2.92.0.0/14
31.3.....
Word, Wordpad, Notepad, Notepad+ and so on do not allow you to replace 'nothing' with text, so I can't use Find/Replace.
So, the whole point of this post is to ask how I can add ,off,DROP,on,#Russia to the end of each of the 4,654(!) lines.