[Eisfair] Block_Complete_Networks mit Geoip

Olaf Jaehrling eisfair at ojaehrling.de
Do Jul 27 21:56:08 CEST 2017


Hallo Dirk,

Dirk Alberti schrieb am 27.07.2017 um 19:06:
> Hallo zusammen,
> 
> ich nutze schon seit längerem das BCN-Paket und mache mittels
> "Remote-Blocking" schon am Fli4l-Router dicht.
> 
> Jetzt habe ich aber etwas gefunden von einem GeoIP-Modul für iptables. (1)
> Würde das vielleicht die Arbeit des BCN-Paketes etwas vereinfachen und
> man könnte schneller große IP-Bereiche blocken?

Jupp, das würde die ganze Sache vereinfachen. Dazu müsste aber iptables
bzw der Kernel neu kompiliert werden.

If you have an older version, e.g. in Lenny 1.4.2, and you do not want
to update it, you should download xtables-addons v1.12.
xtables-addons contains many interesting modules, as e.g. TARPIT. You
may choose any modules in the file "mconfig". "build_geoip = m" should
remain in config file, than the geoip will be compiled.

Danach wäre es ja einfach (in deinem Fall vermutlich als whitelist)
==================== Whitelist ======================================
Allow ssh for own country(DE) and the country where you take holidays(FR)

iptables -A INPUT -p tcp --dport 22 -m geoip --src-cc DE,FR -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP

==================== Blacklist ======================================
Block access to FTP server for Papua New Guinea (PG)

iptables -A INPUT -p tcp --dport 21 -m geoip --src-cc PG -j DROP
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
=====================================================================

Gruß

Olaf

> 
> Gruß
> 
> Dirk
> 
> (1) http://www.wipmania.com/en/blog/geoip-for-iptables/
> 


Mehr Informationen über die Mailingliste Eisfair