CrushMFT Documentation

Banning by country#

The server can refuse connections by the country an address is in. The two lists are at the bottom of the IP Restrictions And Bans panel of Banning, under GeoIP Country Restrictions.

GeoIP Country Restrictions

Before it does anything#

The server finds the country of an address by asking the service ipstack.com. It needs your key for that service: GeoIP access key (ipstack) in Misc, where you can also test it. Without a key no address is checked by country, whatever the lists say.

The server must be able to reach ipstack.com, and the addresses of those who connect are sent there to be looked up.

The two lists#

Each list holds countries separated by commas. A country is written as its two-letter code, such as US, or as its English name as ipstack gives it, such as United States. Upper and lower case are the same.

Banned Countries Allowed Countries Who is refused
empty empty nobody: no check by country
filled empty addresses in the banned countries
empty filled addresses in every country that is not on the allowed list
filled filled addresses in the banned countries, and addresses in every country that is not on the allowed list

In the picture only the United States, Canada and the United Kingdom may connect.

What is not checked#

  • Addresses of private networks: 10.*, 172.16.* to 172.31.*, 169.254.* and 127.0.0.*. They have no country.
  • An address whose country the service does not know is let in.
  • An address in Never ban these IPs (Banning) is let in whatever its country. Put the addresses of partners there who must reach you from a country you otherwise refuse.

What a refused address sees#

The connection is refused before any login, on every protocol. The address is not put on a ban list: it is simply refused each time it connects. The server log says why:

Log line Meaning
"IP banned by country (in blacklist): …" the country is in Banned Countries
"IP banned by country (not in whitelist): …" there are Allowed Countries and the country is not one of them