Geomate - Geographic Game Server Filter for OpenWrt

Hey everyone!

I wanted to present Geomate, an application that lets you control which game servers you connect to based on their location. The basic idea is simple - you draw circles on a map to define where you want to allow connections, and Geomate handles the rest.

What Does It Do?

  • Draw regions on a map to control where your games connect to
  • Create separate filters for different games
  • Automatically learns and tracks game server IPs while you play
  • Whitelist important servers that need to stay accessible
  • Has a web interface built into LuCI

How Does It Work?

  • Dynamic Learning: Monitors your game connections and collects server IP addresses
  • Geolocation: Queries online API to get geographical coordinates of collected IPs
    • Note: IP geolocation is not always 100% accurate
    • While IP addresses can change locations, gaming servers typically (at least in my experience) maintain stable IPs
    • This makes the approach particularly effective for gaming applications
  • Filtering Rules: Applies rules based on your defined map regions
  • Whitelisting: Allows essential servers regardless of location
  • Strict Mode: Controls how untracked connections are handled

Current Status

So far, it's been extensively tested with Call of Duty (MW3, BO6, Warzone) and @choppyc has done some initial testing with Fortnite.

Requirements

  • OpenWrt 23.05 or newer
  • About 5MB free space (CoD needs around 5MB for its IP lists)
  • A router with decent resources (750MHz CPU recommended)
  • Basic packages: curl, jq, lua, luci-lua-runtime

Installation

Geomate is designed for easy installation and can be set up with just a few commands. For detailed installation instructions, please refer to the readme.

Important Notes

  • Keep "Strict Mode" disabled initially while Geomate learns your game servers
  • Some games might need specific servers whitelisted (for matchmaking etc.)

:warning: IMPORTANT: Before asking questions, please thoroughly read the README! Most common questions and issues are already addressed there in detail.

Let me know what you think! I'm happy to answer any questions and looking forward to your feedback.

Special thanks to @choppyc for extensive testing and invaluable feedback throughout the development process.

Cod Server Locations:

12 Likes

@hudra - Amazing Work :+1:

2 Likes

@Hudra Great Work :saluting_face:
@choppyc thank you for testing

1 Like

All @hudra, I was just lucky to get to do some testing :slightly_smiling_face:

2 Likes

A BIG THANKS for your work hudra

2 Likes

Your guidance is highly appreciated

I tried the package there some points are not cleare for me

I read the read me on github but I couldn't know how to fill these points Allowed IPs and IP list file .

Source IP : will be my computer IP address


Allowed IP : is it game IP like this one (external IP or another thing else ?


IP list file ,
How I can get it for my server on MW3 or COD ?.
and how I can get it for another game ?


I faced the network failed to game server

When I enter the game I'm facing this issue ( I need to disable and enable Strict Mode to enter the game ) , my point should I keep always strict mode on ? or when I start playing I will enable it ?


my setup

did you run the "learning mode" like stated in the readme?

if you mean this step , yes

I think you understood most of it correctly.

Correct!

  • Just for your information, it looks like you're showing your public IP address (External IP Address) in the screenshot.
  • It seems like this is the network info from COD. When you install Geomate, it comes with a pre-configured geofilter for "Call of Duty." Here, you basically just need to activate it, enter your gaming IP as the source IP, and you’re good to go. The IP list file should be downloaded during the installation process and already correctly assigned in the geofilter. In fact, your first screenshot even shows that the Call of Duty geofilter already exists.

As mentioned, for COD, you can use the existing IP list, which should be automatically installed and includes almost 7,000 IPs.

Here are some general details about the IP list file:
Geomate needs to know which IPs belong to a game/geofilter. To achieve this, IPs must be collected beforehand and made available in a file (IP List File). There are several ways to create this IP list file:

A) If you’re dealing with a completely new game where neither I nor any other user has ever created a geofilter or collected IPs, you simply create a new geofilter with an empty IP list. In the dialog, there’s a button called "Create empty list." If you set the operational mode to Dynamic, Geomate will start collecting IPs while you play the game, gradually building a complete list of game server IPs over time.

B) If I (or someone else) have already completed step A and collected IPs for a game, the user can provide the IP list to you. You can download this list and either manually move it to the folder /etc/geomate.d (this is where all IP list files should be stored) and assign the path in the respective geofilter, or you can download the file and use the "Upload List" function in the geofilter dialog. However, be cautious: for very large files, the upload might fail (this is something I still need to look into). In such a case, simply download the file from your source and manually set the correct path/name in the geofilter.

If you setup a new geofilter with an existing list (and don’t train it yourself, as that happens automatically), it’s a good idea to briefly run "Run Manual Geolocation." This will query and save the geocoordinates for all active geofilters. While this process happens automatically at regular intervals, running it manually allows you to use the geofilter immediately.

This is because you’ve modified the Allowed IPs that came with the default Call of Duty geofilter. Make sure the following Allowed IPs are set for COD:

185.34.107.128
185.34.107.129
185.216.14.7

I’m not sure where you’re from, but I’m in Europe, and these Allowed IPs have always worked well for me. If you’re on a different continent, it’s possible that COD uses different authentication/matchmaking servers in your region.

Quick explanation:
Games (at least COD) have specific servers that always need to be reachable, such as matchmaking, authentication, or relay servers. These need to be identified (which I’ve already done for the COD geofilter) and added to the Allowed IPs list. Otherwise, it might be impossible to establish a game connection if these servers are outside your circle (region).

Finding these IPs involves a bit of trial and error, and tools like tcpdump, Wireshark, or QoSMate can help. Often, these are the IPs the game connects to right at the beginning when loading into the game.

I hope this answered your questions. I’ll see if I can make some adjustments to the README to make everything even clearer.

2 Likes

Unsolicited... If you do this one by one, maybe also try to check the RTT to these addresses? GeoIP is notoriously imprecise, but gamers, I assume, are less concerned which country the servers are truly located in and more how far away in network delay they are and for that direct RTT measurements seem pretty decent, no?

1 Like

I completely agree with you on this point, but at least in the case of Call of Duty (which is the game I primarily play), the IPs seem to be more or less static. This, of course, depends on them being correctly localized, which in turn relies on the Geo IP provider. However, based on my experience, this has been relatively reliable. I’m not sure if there are online games that use dynamic IP addresses for their servers, but in such cases, incorrect localization could indeed happen more often if the IP database isn’t up to date.

RTT-based filtering is definitely on my to-do list and planned for the near future. However, the primary focus so far has been on geographical filtering, which has its own advantages (and, of course, disadvantages).

I’m from Austria, and my nearest server is in Frankfurt (18 ms). There’s also a server in Paris nearby (around 20–22 ms). If I wanted to play exclusively in Frankfurt, using an RTT-based filter could get a bit tricky. Setting a threshold (above which connections wouldn’t be allowed) would mean I’d have to set it slightly higher than my base ping to account for ping spikes. Depending on the value I choose, this might result in either finding no games at all or being matched with games in both Frankfurt and Paris.

In theory, ping is king in online gaming. However, for example in my experience the Frankfurt server is often overloaded or performs poorly. I assume this is because the region is so central in Europe that many players end up on this server.. In such cases, playing on the Paris or any other server is often better for me although the ping is slightly higher...

That said, I believe RTT-based filtering would be a great addition. For many users, it might even be sufficient or better because it requires fewer resources and could, in certain situations, be more robust.

3 Likes

Hello Hudra, this script works perfectly :upside_down_face::slightly_smiling_face:. If later on you add an RTT option, will we need to change the QoS parameters of Cake to RTT 40 or 30?
Thanks.

2 Likes

Not pretending to be @hudra, but that paremeter for cake affects how long a flow can stay initially above the target delay before a drop/mark is performed (as long as that flow stays above target the next drops/marks will come sooner and sooner.) This really only affects bulk flows that move a lot of data, so for gaming traffic should not matter much.
Conceptually cake's interval/rtt setting should match the order of magnitude of the typical traffic's rtt. If cake's intervall is much shorter than the real RTT cake will be more aggressive which will reduce rtt-fairness a bit.
For the normal internet including crossing one ocean the default rtt of 100 works pretty well.

2 Likes

Thanks, I'm glad to hear that!

If an RTT filter option is introduced in the future, it will be a separate option. As @moeller0 has already explained, it is not related to the cake parameter.

2 Likes

Good evening Hudra, I think I’m having a small issue with the geo-filter. When my friends join my party, I immediately switch to "Relay Waiting," and my game shows "Relay Disconnected." Have you experienced this problem as well? Thanks!

What game?

Can you show me your config:

cat /etc/config/geomate

Is it reconnecting afterwards?

1 Like
config global 'global'
        option enabled '0'
        option debug_level '0'
        option strict_mode '0'
        option operational_mode 'dynamic'
        option geolocation_mode 'frequent'

config settings 'settings'
        option interface 'br-lan'

config geo_filter
        option name 'Fortnite'
        option enabled '0'
        option protocol 'udp'
        option src_ip '192.168.1.208'
        option dest_port '9000-9100'
        option ip_list '/etc/geomate.d/fortnite_servers.txt'

config geo_filter
        option name 'CoD'
        option enabled '1'
        option protocol 'udp'
        option src_ip '192.168.1.140'
        option src_port '3074'
        option ip_list '/etc/geomate.d/cod_servers.txt'
        list allowed_ip '185.34.107.128'
        list allowed_ip '185.34.107.129'
        list allowed_ip '185.216.14.7'
        list allowed_region 'circle:17.64402203:32.51953125:3738010'

It comes and goes—the screen shows "Waiting for Relay." If I leave my friends' party and restart the game, it switches to "Connected to Relay."

  1. You didn’t answer my question about what game you’re playing, but I assume it’s COD
  2. It also seems like geomate isn't even enabled?

I’ve encountered this message several times as well (in COD), but it hasn’t affected my ability to find games or anything like that if I remember correctly. I can’t tell you exactly what causes it, but it might be related to your region (geo-filter circle) being too small, potentially excluding or blocking necessary relay servers.

Here’s what you could try:

  1. Expand your region and check if the problem persists.
  2. Use QoSmate to find out which (relay) server the game is attempting to connect to. You can filter for connections in QoSmate like this (assuming 192.168.1.140 is your gaming device's IP):
udp 192.168.1.140 3074

Every time the message appears, monitor which connection is generating traffic with this filter applied. Then you could try adding the corresponding IP to your allowed IPs and see if it fixes the issue.

  1. In our private messages, you mentioned playing with a friend from Australia. If you’re in Europe and your geo-filter circle is centered there, you could try adding a second circle for the Call of Duty geo-filter to cover all of Australia. I’ve provided an explanation in the README on how to add an additional circle to an existing filter. https://github.com/hudra0/geomate?tab=readme-ov-file#creating-multiple-regions-for-a-game

Here’s an additional note - it might be related to your issue:
For the past few days, CoD has been acting a bit strange. It looks like, for every game, connections are now established not only with one server (as was the case before) but also with 1-2 additional servers. The primary traffic still flows through the main server, but additional connections to other IPs are maintained throughout the game.

I have a couple of theories about this:

  1. Anti-cheat countermeasures: It seems like cheaters can currently crash entire game lobbies. CoD might have implemented a kind of failover system, where connections to multiple servers are established, and if one connection drops, the session migrates to another server.
  2. Dynamic traffic routing: CoD might be trying to route traffic between servers to balance player pings, though in my opinion, this wouldn’t be ideal.
  3. Or it's just a bug in the game

These are just speculations, and without any official information, no one can say for sure what’s happening.

2 Likes

Hi Hudra, yes it's COD, and XDefiant had the same behavior as COD at the moment, connecting to multiple servers simultaneously.

I tried a technique: not activating GeoMate immediately, launching my game, waiting for the game to load the servers, and then activating GeoMate.

Yes, COD didn’t have this issue before, I think.
Ok for steps 3 i will try

Thank you very much for your clarification!

the solution has been found

i has disabled the upnp and only make port forward

i can geolocate where i want :wink:

not relay disconnected now,

edit : he has work a little bit moment but reappair

1 Like