How To block some country from your server

Hello guys block

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 :

select country and Select one output format from list. ( CIDR )



then start download ips list

Step 2 :

login ssh your server :

touch new file

touch /root/israel.txt

and paste ips

exp :
more ...

Step 3 :
touch new file 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


now all done ?

If there are other questions i’m present for help via free support:


Regards 🙂

Share Button