Mailing List Archive

GeoIP support added to tcpserver
Is anyone interested in a GeoIP enabled version of tcpserver?

If yes we will put the new code on our inter7 website for download.

Recently we wanted to block incoming emails from some countries that
were only sending us spam. And we did not want to go through the bother
of finding all the IP ranges assigned to a country and adding them to
a firewall.

So we added code to tcpserver to do a GeoIP lookup of the country code
using the TCPREMOTEIP and GeoIP's database that's included in recent
packages. "/usr/share/GeoIP/GeoIP.dat"

We also added two environment variables. One for a comma separated list
of country codes to deny "DENYCOUNTRY" and another for a comma separated
list of country codes to only allow "ALLOWCOUNTRY"

If the country code is in the DENYCOUNTRY list then tcpserver denies
the connection.

If the country code is not in the ALLOWCOUNTRY list then tcpserver
denies the connection.

Otherwise the connection is allowed.

Neither, either or both DENYCOUNTRY and ALLOWCOUNTRY can be used.

The DENYCOUNTRY and ALLOWCOUNTRY environment variables would be a comma
separated list of standard 2 character country codes.
For example: "US,CA"

On our server we are using just the DENYCOUNTRY environment variable to
block certain countries that are only sending us spam.

Please let me know if you are interested and I'll put together a webpage
and documentation.

Thanks,
Ken Jones
inter7
Re: GeoIP support added to tcpserver [ In reply to ]
Hi Ken,

it sounds interesting... I'd appreciate if you upload your code, thanks!

Regards.

Iván L. Morales - Director comercial.
Logosur de telecomunicación S.L.
ivanlopez@logosur.com <mailto:ivanlopez@logosur.com> - www.LogoSur.com
<http://www.logosur.com>
··············································································

Pol.Ind. Zeus S/N
41703 Dos hermanas
Sevilla
Teléfono 955669108




El 19/02/2020 a las 21:08, Ken Jones escribió:
> Is anyone interested in a GeoIP enabled version of tcpserver?
>
> If yes we will put the new code on our inter7 website for download.
>
> Recently we wanted to block incoming emails from some countries that
> were only sending us spam. And we did not want to go through the bother
> of finding all the IP ranges assigned to a country and adding them to
> a firewall.
>
> So we added code to tcpserver to do a GeoIP lookup of the country code
> using the TCPREMOTEIP and GeoIP's database that's included in recent
> packages. "/usr/share/GeoIP/GeoIP.dat"
>
> We also added two environment variables. One for a comma separated list
> of country codes to deny "DENYCOUNTRY" and another for a comma separated
> list of country codes to only allow "ALLOWCOUNTRY"
>
> If the country code is in the DENYCOUNTRY list then tcpserver denies
> the connection.
>
> If the country code is not in the ALLOWCOUNTRY list then tcpserver
> denies the connection.
>
> Otherwise the connection is allowed.
>
> Neither, either or both DENYCOUNTRY and ALLOWCOUNTRY can be used.
>
> The DENYCOUNTRY and ALLOWCOUNTRY environment variables would be a comma
> separated list of standard 2 character country codes.
> For example: "US,CA"
>
> On our server we are using just the DENYCOUNTRY environment variable to
> block certain countries that are only sending us spam.
>
> Please let me know if you are interested and I'll put together a webpage
> and documentation.
>
> Thanks,
> Ken Jones
> inter7
Re: GeoIP support added to tcpserver [ In reply to ]
A nit – GeoIP and country-based allow/deny are two very different things.
A couple of simple examples – the IP space for NL, the Netherlands,
includes Holland, but also places in the Netherlands Antilles. FR, France,
might include IP addresses in the South Pacific or North America
(Saint-Pierre et Miquelon). GeoIP knowledge is much more precise, and the
CDN companies (e.g., Akamai) know where your IP address really is.


On Wed, Feb 19, 2020 at 12:15 PM Ken Jones <kbo@inter7.com> wrote:

> Is anyone interested in a GeoIP enabled version of tcpserver?
>
> If yes we will put the new code on our inter7 website for download.
>
> Recently we wanted to block incoming emails from some countries that
> were only sending us spam. And we did not want to go through the bother
> of finding all the IP ranges assigned to a country and adding them to
> a firewall.
>
> So we added code to tcpserver to do a GeoIP lookup of the country code
> using the TCPREMOTEIP and GeoIP's database that's included in recent
> packages. "/usr/share/GeoIP/GeoIP.dat"
>
> We also added two environment variables. One for a comma separated list
> of country codes to deny "DENYCOUNTRY" and another for a comma separated
> list of country codes to only allow "ALLOWCOUNTRY"
>
> If the country code is in the DENYCOUNTRY list then tcpserver denies
> the connection.
>
> If the country code is not in the ALLOWCOUNTRY list then tcpserver
> denies the connection.
>
> Otherwise the connection is allowed.
>
> Neither, either or both DENYCOUNTRY and ALLOWCOUNTRY can be used.
>
> The DENYCOUNTRY and ALLOWCOUNTRY environment variables would be a comma
> separated list of standard 2 character country codes.
> For example: "US,CA"
>
> On our server we are using just the DENYCOUNTRY environment variable to
> block certain countries that are only sending us spam.
>
> Please let me know if you are interested and I'll put together a webpage
> and documentation.
>
> Thanks,
> Ken Jones
> inter7
>


--

"Well," Brahm? said, "even after ten thousand explanations, a fool is no
wiser, but an intelligent person requires only two thousand five hundred."

- The Mah?bh?rata