06-19-2020, 07:39 PM
Have you already tried https://www.ip2location.com/free/visitor-blocker ?
At "Download List" select your country, IPv4 or IPv6 and then at "Output Format" select "Linux iptables".
You will get a text file with commands to black a ton of ranges from selected country. Just upload that text file to your server, rename it to sh and run it with bash. It should execute the commands. If you want them to stick permanently I would recommend to use iptables-persistent.
iptables-persistent (reference - just look it up yourself for your specific OS):
- http://www.microhowto.info/howto/make_th...ebian.html
- https://linuxconfig.org/how-to-make-ipta...t-on-linux
For firewalld hm... you could use find and replace to modify the commands in the file but it would still require more editing to make the permanent.
At "Download List" select your country, IPv4 or IPv6 and then at "Output Format" select "Linux iptables".
You will get a text file with commands to black a ton of ranges from selected country. Just upload that text file to your server, rename it to sh and run it with bash. It should execute the commands. If you want them to stick permanently I would recommend to use iptables-persistent.
iptables-persistent (reference - just look it up yourself for your specific OS):
- http://www.microhowto.info/howto/make_th...ebian.html
- https://linuxconfig.org/how-to-make-ipta...t-on-linux
For firewalld hm... you could use find and replace to modify the commands in the file but it would still require more editing to make the permanent.