Block the traffic of a whole country

josejuegos

Member
Mar 13, 2017
14
4
38
Hello, I need to block the traffic of a whole country, give me some clue as to how to do it?

I'm getting brute-force attacks and bots to my VPS services only from Japanese IPs, and I need to block all of Japan's IP traffic.

I tried with IPTABLES with https://www.ip2location.com/blockvisitorsbycountry.aspx with the file "iptables-japan.txt" but when creating so many firewall rules the VPS collapses, the "CPU Load" goes up to 25 or 30 and the VPS stops responding, I'm attaching the file to you to see it.

They can give me an alternative or another way to do it, I have been testing for several days and I am not able to solve the problem of blocking all the traffic of a country to avoid bots or brute force.

Greetings.
 

Attachments

  • iptables-japan.txt
    828.8 KB · Views: 42

Jackbox

Active Member
Jan 2, 2016
197
96
74
Hello, I need to block the traffic of a whole country, give me some clue as to how to do it?

I'm getting brute-force attacks and bots to my VPS services only from Japanese IPs, and I need to block all of Japan's IP traffic.

I tried with IPTABLES with https://www.ip2location.com/blockvisitorsbycountry.aspx with the file "iptables-japan.txt" but when creating so many firewall rules the VPS collapses, the "CPU Load" goes up to 25 or 30 and the VPS stops responding, I'm attaching the file to you to see it.

They can give me an alternative or another way to do it, I have been testing for several days and I am not able to solve the problem of blocking all the traffic of a country to avoid bots or brute force.

Greetings.
May I please know your VPS hosting provider?
 

EscuderoKevin

Well-Known Member
Jul 2, 2015
380
181
130
You like block people in your ts3 ? or in VM ?

---- Automatically Merged Double Post ----

Hello, I need to block the traffic of a whole country, give me some clue as to how to do it?

I'm getting brute-force attacks and bots to my VPS services only from Japanese IPs, and I need to block all of Japan's IP traffic.

I tried with IPTABLES with https://www.ip2location.com/blockvisitorsbycountry.aspx with the file "iptables-japan.txt" but when creating so many firewall rules the VPS collapses, the "CPU Load" goes up to 25 or 30 and the VPS stops responding, I'm attaching the file to you to see it.

They can give me an alternative or another way to do it, I have been testing for several days and I am not able to solve the problem of blocking all the traffic of a country to avoid bots or brute force.

Greetings.

https://www.ip2location.com/free/visitor-blocker For block in your VM
If u need block to your ts3 you need make script for BAN all users with that "flag" its easy.
 
Last edited:

Jackbox

Active Member
Jan 2, 2016
197
96
74
Any idea ?
2 options:

  1. Contact ExtraVM support and let them know what you want to do. It is possible their security or hosting team already has a solution to block certain countries for you. If you are hosting a website and want web protection, consider using the free Cloudflare solution or pay Sucuri for their monthly WAF (web app firewall). With Cloudflare you may need to dig through the options to block countries but they do indeed allow you to block specific countries which can be helpful.
  2. Upgrade your hosting solution to something more powerful, like a dedicated server. Hetzner always has great bidding options if you are looking for an affordable dedicated hosting provider. They like to verify your information though, to combat spam and other malicious network behavior. Another great option is Kimsufi or So you Start --- discounted OVH servers from my understanding.

If you have any questions about any of this or want some help, just let me know. I will figure out a way to either make video tutorials for you, or definitely get the information to you that I think will help.
 
Last edited:
Top