How to block a country?

How do i block an entire country with openwrt, is that possible?

I want to block the country with the shortcut CN because im getting massive spam results in an online game, the spam results are so many so that genuine results are burried.
I can do this with my firewall on the OS level but i would preffer doing it with openwrt directly, can i do this without installing any "extension" to openwrt, is such a function built in?

For new readers, i commented below with much more detail that should explain clearly what the problem is and what i try to solve.

Use banip package ?

It depends on the amount of false positives and false negatives you are willing to tolerate:

Yes and no, technically you could add IP address lidsts to block to the firewall, but practically you would have to solve many of the issues the banip and geoip-shell have already solved.
But be advised geoip information is decent, but not perfect.

Please explain the online game scenario. Are you one of several players and getting spammed while playing with others in a lobby by your opponents? I can imagine there is not much you can do without tinkering with the traffic in a way that I would consider indistinguishable from cheating, no matter the device you're doing it with.

This! The geo-ip blocking solutions will drop unsolicited incoming packets from the blocked countries. But that's not the mechanism by which your game client is receiving the spam that's bothering you.

The spam in the game is coming from an internal game chat mechanism, so the originating IP addresses are likely neither identifiable nor the real originators of the chat message, which is probably just relayed to your game client by the game server.

So even if you did setup a geo-ip blocking solution using banIP or something else, it would likely have no effect on your in-game spam

Sorry, i'll explain in detail.

The game itself works normally, it boots up within seconds, it never crashed and it does NOT use any anticheat software (i don't play rootkit malware games).

However after the game loaded there is no singleplayer since it's intended as an online only.
Without other players there would be nothing todo.

So when the game loaded, i hit hit multiplayer aka serverlist.

Let me note something here, i launch the game through steam and since there are often random issues with loading the serverlist such as not finding any results at all or certain server not appearing in the list, i have to often change the steam settings > game options > pings per minute, i change it from 5000 down to 250 and everything inbetween and do the same thing within the game itself. Randomly the server list will either load or show nothing at all or exclude certain servers i want to play on. But one thing that always remains the same, if the serverlist does load then there are dozens of spam servers in the list and all of them include chinese characters.

For example if i set the serverlist results to 300 then chances are the spam servers dominate the whole list with barely any legit results shown. If i set the cap to 500 then more legit results apear inbetween the spam trash. Problem is despite steam including a 5000 result limit / pings per minute, the game wont load more than 530 results for me no matter what.

I can also say im not the only person affected with this type of game-behaviour and being affected of the spam server results, there is a tons of people on the net describing the exact same issue but since the game is old the developers wont patch anything.

To finally get to the point, i blocked the entire country of china in my os-level firewall and i can confirm a tons of blocked connections all chinese within the firewall. However despite the chinese connections being blocked, the spam servers do still show up in the ingame serverlist.
For me it doesnt make sense, i blocked china but the chinese spam servers still appear in the serverlist. So i tried some other things, for example i blocked the whole game in my firewall and allow only the country of germany to connect, this is because the server i want to play is hosted in germany. But when i did that the serverlist never showed any results at all, then i noticed amazonwebservices aka aws was also blocked which is obvious since i blocked the entire game, so i unblocked only aws and germany, but the serverlist still does not load any results with this configuration, so i perceeded to check all the connections from all the countries show in the games profile in the firewall and i noticed most of them where peer to peer and came from dozen of different ASN providers, like valve and a tons of others. I had the idea to block the ASN who is behind the spam servers but i have no idea if this would work and no idea which ASN is the one pushing the spam junk, and testing every single one individually where theres possible dozen of them is not something i want to spent alot of time with. Let me say one more thing, when i had this configuration in the firewall to block the entire game and allow only aws plus germany, then i perceeded to also allow US connections and suddenly the serverlist loaded up normally, this is despite every other country apart from the US and germany (and aws) where blocked, i saw all the other countries and peer to peer stuff was blocked in the firewall but as soon as i unblocked the US the serverlist got its functionality back. But this didnt help at all because the chinese spam servers still fill up around 80% of the total server results despite china and all the other countries being blocked. So this makes me guess the chinese spam servers are atleast partially not hosted from china but from the US, but when i block US the server list remains fully empty, when i unblocked the US the serverlist loads but including 80% spam results. I need to find a way to block only these malicious results or block everything other than those connections that are mandatory for the games functionality. I'd imagine unblocking aws and the ip adress of the server i want to connect to should make it so only this particular server shows up in the serverlist, but it does not.
I guess i could really use some help here...

Try this:

This might help to some degree. Realistically though yoj need to talk to the peoplf making the game or running their servers to clean up their act...

Well, you just learned the limits of geoip... nobody is forced to use servers in their home country so especially shady characters will move wherever bullet proof hosters can bd found. Or put differently you just empirically found out that pure geoip based blocking does not solve your issue.

IMO the list (including the spam) is retrieved by the game from a central server, rather than (as you seem to believe) from individual spammers. Which means that no amount of geoip blocking will clean up that list. If those Chinese entries are actually spam, rather than legitimate users, then the game is simply poorly supervised and the logical course of action is IMO to uninstall the game and move on. Otherwise it is possible that the game is simply much more popular in Chinese-speaking countries.

Regardless, I don't think that you can selectively filter the list by means of firewall rules, be it on the router or your computer.

The central hub, maintaining the server list isn't in China (or you wouldn't be able to connect if you blocked CN)..

They need to block them, not you.

You're barking up the wrong tree.

The game to my knownledge doesnt have any central servers.
There is no official public server cathegorie, there is only the serverlist where anyone can host their own server.
I fand it really strange a game released back in 2015 over 10 years has this many spam-servers but it appears this is infact whats happening.

Let me explain, the game has two branches merged into a single game, on steam you get to decide which version of the game you download. The legacy branche or the new one called "envrima" however the newer one uses kernel anticheat so this is a nogo for me.

All the servers show for example 199/200 players. But this is in the legacy version.
It makes no sense. And there is dozens of these servers, hundreds if not thousands.
On a single page i can see a total of 24 spam server results, every single one of them shows 198 of 200 players, so 24 times 198 thats 4752 players total. But that is only a single page in the serverlist, if i scroll down further the list goes on and on and on, with a total of 500 results where around 80% of the serverlist is made of these spam servers thats 80% of 500 makes 400, so 400 times 4752 would be a total of 1900800 players. Did i do the maths right? That is completely impossible, so i am almost certain those servers are spam. Maybe an attempt to infect a visitor with a virus if such a server is joined, im not sure about the purpose.
As a last resort, could you share your opinion if blocking a particular ASN might work out in effectively removing the spam server from the result list?

Here are some screenshots that hopefully are of use.

"They" wont do anything, they abandoned this branche of the game (legacy) and focus only on the new version which is not released yet and probably wont be for a while to come.
So if i can find a "fix" on my end that would still be great.

PS, you might have a look at the screenshots i attached above?

Silly question, is there no way to sort the server list by property and then sort by country to be able to skip these servers more easily?

I would sort by country and then manually pick a server.
Back in my days you could also bookmark servers.

Btw does the game has no feature for ignoring other players? Or vote to kick player out of the game? This all sounds like social but not technical problems here. :person_shrugging:

I think you are misunderstanding what I mean by "server". What I mean by that word is a machine connected to a network which serves some data on-demand. In this case, it serves the list of game servers. Game servers is where the game is actually hosted. While game servers may be many, the server which provides the list is probably only one (technically, the implementation may involve multiple physical machines, but from the point of view of a player, for all intents and purposes, there is one central server).

I'm not speaking out of specific knowledge of this game, but this is how many games work, and this is the impression I'm getting for this game.

I googled about this issue with this game a bit, and this is what the internet is saying:

  1. You are trying to play the "legacy" branch of this game which is no longer supported by the developers and no official servers are maintained for this branch.
  2. Someone is tricking the game into displaying many servers in the list which feature fake player counts, most likely for malicious purposes.
  3. The developers of the game for some reason are not addressing this issue, and this has been the case for years.
  4. The newer branch ("Evrima") apparently has official servers which players can join, and the Chinese servers are either not an issue there or not such a big issue.
  5. Some people claim that there is a way to join a "proper" server even in the legacy branch, e.g. this. I don't know if this works or not.

As I explained above, I do not think that any firewall rules (including geoblocking or ASN-blocking) are going to help you with this issue because firewall rules can not modify the content of the list delivered to your machine by the central server.

Anyway, personally I would not risk playing a game which knowingly allows malicious actors to take over the list of game servers. This is a big red flag for me.

If there was i would have done so.
There is a filter by server name option, but it doesnt work anymore...

  1. Thanks for the explanation, it sounds logical.
  2. I hate google and when i saw you wrote "googled" i immediately thought, oh no not another one. No offense, i'm simply saying we can search the web without making google a monopoly. Google sucks, its an evil company with zero morales, its a piece of shit so to say.
    I recommend searxng. hey sorry buddy but i had to get it off my chest, everyone around me uses facebook, instagram, tiktok, google, microsoft, apple, tesla, it makes me tired sometimes so i decide to confront people from time to time and tell them it might not be the best thing they are doing or using. Think about the companies who get your data make billions with that data and they use the money for lobbying which ultimately makes the place where we life bad. Think of "mandatory age verification". Alright i guess this is enough...
    Back to topic, i like your description of central server.
    I think of the options you mentioned both 1, 2 and 3 are all accurate at the same time.
    From what i know devs of the legacy branche where partially chinese and had a dispute with some other devs which ultimately resulted in the game splitting into two branches. I just tried the supposed solution you shared a reddit link to.
    Use the Steam Server Browser (The most reliable way) The in-game browser is broken. Do this instead: • Close The Isle. • Open your Steam Client. • In the top menu, click View -> Servers. • Select the Favorites tab. • Click Add a Server at the bottom right. • Enter the IP of the server you want (You can find these on the Asura or Teutonic Discord). • Once added, right-click the server and "Add to Favorites." • Now, when you launch the game, go to the Favorites tab in-game. They should appear there.
    it didnt work. error - did not find any server at that adress, try specifing the port. So i did specifc the port and the same error occured. The ip is accurate. 185.172.175.15:8100 and 185.172.175.15:8200

You can do this with the banIP package

You're 48hrs late, and it won't work.