How to i Can Block specific country from my server?
Is it possible to do so?
Yes, definitely and very easily you can block certain countries from your server ?
Follow me step by step
step 1 :
What is the state required blocked?
For example, the State of Israel to block
i have get all ips country from : http://www.ip2location.com/free/visitor-blocker
select country and Select one output format from list. ( CIDR )
then start download ips list
Step 2 :
login ssh your server :
touch new file
and paste ips
Step 3 :
touch new file block.sh and put this code :
ips=$(grep -Ev “^#” $shit)
for ip in $ips
ip r a blackhole $ip
make sure replace israel.txt to your file name
step 4 :
run it : sh block.sh
now all done ?
If there are other questions i’m present for help via free support: