<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://znil.net/index.php?action=history&amp;feed=atom&amp;title=Ufw_Geoblocking_mit_Ubuntu_24.04</id>
	<title>Ufw Geoblocking mit Ubuntu 24.04 - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://znil.net/index.php?action=history&amp;feed=atom&amp;title=Ufw_Geoblocking_mit_Ubuntu_24.04"/>
	<link rel="alternate" type="text/html" href="https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;action=history"/>
	<updated>2026-05-19T07:04:31Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in znilwiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15784&amp;oldid=prev</id>
		<title>BLinz am 10. April 2026 um 07:09 Uhr</title>
		<link rel="alternate" type="text/html" href="https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15784&amp;oldid=prev"/>
		<updated>2026-04-10T07:09:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 10. April 2026, 09:09 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Zeile 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür habe ich diese Anleitung gefunden:&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Dafür habe ich diese Anleitung gefunden:&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  https://www.seenlyst.com/blog/geo-blocking-ufw-iptables/&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  https://www.seenlyst.com/blog/geo-blocking-ufw-iptables/&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Die aber für Ubuntu &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;24&lt;/del&gt;.04 geschrieben wurde und so nicht mehr funktioniert.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Die aber für Ubuntu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;20&lt;/ins&gt;.04 geschrieben wurde und so nicht mehr funktioniert.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ich habe die Fehler und Änderungen herausgesucht und hier ist meine Version des Artikels:&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Ich habe die Fehler und Änderungen herausgesucht und hier ist meine Version des Artikels:&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BLinz</name></author>
	</entry>
	<entry>
		<id>https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15764&amp;oldid=prev</id>
		<title>BLinz: /* Beispiele für weitere Regeln */</title>
		<link rel="alternate" type="text/html" href="https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15764&amp;oldid=prev"/>
		<updated>2026-02-16T14:34:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Beispiele für weitere Regeln&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 16. Februar 2026, 16:34 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l101&quot;&gt;Zeile 101:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 101:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  -A ufw6-before-input -p tcp --dport 3000 -m geoip --src-cc RU,CN -j DROP&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  -A ufw6-before-input -p tcp --dport 3000 -m geoip --src-cc RU,CN -j DROP&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sperrt TCP Datenverkehr auf Port 3000 für RU und CN&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Sperrt TCP Datenverkehr auf Port 3000 für RU und CN&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Cronjob erstellen==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Einmal im Monat sollte man die Geodaten aktualisieren:&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; Kommt noch - es muss das Skript einfach noch einmal gestartet werden&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;----&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Kommentare==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Kommentare==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;comments /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;comments /&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>BLinz</name></author>
	</entry>
	<entry>
		<id>https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15763&amp;oldid=prev</id>
		<title>BLinz: Die Seite wurde neu angelegt: „==Vorwort== Unter Apache2 nutze ich ein Geoblocking - ich habe aber nach einer Möglichkeit gesucht, das ganz schon vor dem Apache zu blockieren (und mir die Logeinträge dafür damit zu sparen).&lt;br&gt; Dafür habe ich diese Anleitung gefunden:&lt;br&gt;  https://www.seenlyst.com/blog/geo-blocking-ufw-iptables/ Die aber für Ubuntu 24.04 geschrieben wurde und so nicht mehr funktioniert.&lt;br&gt; Ich habe die Fehler und Änderungen herausgesucht und hier ist meine Versi…“</title>
		<link rel="alternate" type="text/html" href="https://znil.net/index.php?title=Ufw_Geoblocking_mit_Ubuntu_24.04&amp;diff=15763&amp;oldid=prev"/>
		<updated>2026-02-16T14:31:33Z</updated>

		<summary type="html">&lt;p&gt;Die Seite wurde neu angelegt: „==Vorwort== Unter Apache2 nutze ich ein Geoblocking - ich habe aber nach einer Möglichkeit gesucht, das ganz schon vor dem Apache zu blockieren (und mir die Logeinträge dafür damit zu sparen).&amp;lt;br&amp;gt; Dafür habe ich diese Anleitung gefunden:&amp;lt;br&amp;gt;  https://www.seenlyst.com/blog/geo-blocking-ufw-iptables/ Die aber für Ubuntu 24.04 geschrieben wurde und so nicht mehr funktioniert.&amp;lt;br&amp;gt; Ich habe die Fehler und Änderungen herausgesucht und hier ist meine Versi…“&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Vorwort==&lt;br /&gt;
Unter Apache2 nutze ich ein Geoblocking - ich habe aber nach einer Möglichkeit gesucht, das ganz schon vor dem Apache zu blockieren (und mir die Logeinträge dafür damit zu sparen).&amp;lt;br&amp;gt;&lt;br /&gt;
Dafür habe ich diese Anleitung gefunden:&amp;lt;br&amp;gt;&lt;br /&gt;
 https://www.seenlyst.com/blog/geo-blocking-ufw-iptables/&lt;br /&gt;
Die aber für Ubuntu 24.04 geschrieben wurde und so nicht mehr funktioniert.&amp;lt;br&amp;gt;&lt;br /&gt;
Ich habe die Fehler und Änderungen herausgesucht und hier ist meine Version des Artikels:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Vorwort==&lt;br /&gt;
Ich wechsle einmal am Anfang zum {{code|root}}, alle nachfolgenden Befehle werden also als dieser ausgeführt!&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo -i&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Voraussetzungen installieren==&lt;br /&gt;
 apt update -y&lt;br /&gt;
 apt upgrade -y&lt;br /&gt;
 apt install curl perl unzip xtables-addons-common libtext-csv-xs-perl libmoosex-types-netaddr-ip-perl&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Verzeichnis für unsere Daten erstellen==&lt;br /&gt;
 mkdir -p /usr/share/xt_geoip&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Downloadskript erstellen==&lt;br /&gt;
 nano /usr/local/bin/update-geoip.sh&lt;br /&gt;
mit folgendem Inhalt:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# Create temporary directory&lt;br /&gt;
mkdir -p /usr/share/xt_geoip/tmp/&lt;br /&gt;
mkdir -p /usr/share/xt_geoip/tmp/ip2loc/&lt;br /&gt;
&lt;br /&gt;
# Download latest from db-ip.com&lt;br /&gt;
cd /usr/share/xt_geoip/tmp/&lt;br /&gt;
/usr/libexec/xtables-addons/xt_geoip_dl&lt;br /&gt;
&lt;br /&gt;
# Download maxmind legacy csv and process&lt;br /&gt;
wget https://mailfud.org/geoip-legacy/GeoIP-legacy.csv.gz -O /usr/share/xt_geoip/tmp/GeoIP-legacy.csv.gz&lt;br /&gt;
gunzip /usr/share/xt_geoip/tmp/GeoIP-legacy.csv.gz&lt;br /&gt;
cat /usr/share/xt_geoip/tmp/GeoIP-legacy.csv | tr -d &amp;#039;&amp;quot;&amp;#039; | cut -d, -f1,2,5 &amp;gt; /usr/share/xt_geoip/tmp/GeoIP-legacy-processed.csv&lt;br /&gt;
rm /usr/share/xt_geoip/tmp/GeoIP-legacy.csv&lt;br /&gt;
# rm /usr/share/xt_geoip/tmp/GeoIP-legacy.csv.gz&lt;br /&gt;
&lt;br /&gt;
# Download latest from https://github.com/sapics/ip-location-db&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country/geo-whois-asn-country-ipv4.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/geo-whois-asn-country/geo-whois-asn-country-ipv6.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/iptoasn-country/iptoasn-country-ipv4.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/iptoasn-country/iptoasn-country-ipv6.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/dbip-country/dbip-country-ipv4.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/dbip-country/dbip-country-ipv6.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/geolite2-country/geolite2-country-ipv4.csv&lt;br /&gt;
wget -P /usr/share/xt_geoip/tmp/ https://cdn.jsdelivr.net/npm/@ip-location-db/geolite2-country/geolite2-country-ipv6.csv&lt;br /&gt;
&lt;br /&gt;
# Combine all csv and remove duplicates&lt;br /&gt;
cd /usr/share/xt_geoip/tmp/&lt;br /&gt;
cat *.csv &amp;gt; geoip.csv&lt;br /&gt;
sort -u geoip.csv -o /usr/share/xt_geoip/dbip-country-lite.csv&lt;br /&gt;
&lt;br /&gt;
# Remove temp directory and update geoip xtables&lt;br /&gt;
cd /usr/share/xt_geoip/&lt;br /&gt;
rm -r /usr/share/xt_geoip/tmp/&lt;br /&gt;
/usr/libexec/xtables-addons/xt_geoip_build -D /usr/share/xt_geoip/ -i /usr/share/xt_geoip/dbip-country-lite.csv&lt;br /&gt;
rm /usr/share/xt_geoip/dbip-country-lite.csv&lt;br /&gt;
&lt;br /&gt;
# reload ufw&lt;br /&gt;
ufw reload&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Das Skript noch ausführbar machen und testen:&amp;lt;br&amp;gt;&lt;br /&gt;
 chmod +x /usr/local/bin/update-geoip.sh&lt;br /&gt;
 /usr/local/bin/update-geoip.sh&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Blocking in Firewallregeln einbauen==&lt;br /&gt;
 nano /etc/ufw/before.rules&lt;br /&gt;
und unten vor dem {{code|COMMIT}} in der letzten Zeile folgendes einfügen:&amp;lt;br&amp;gt;&lt;br /&gt;
 #GeoBlocking&lt;br /&gt;
 -A ufw-before-input -m geoip --src-cc RU,CN,HK -j DROP&lt;br /&gt;
Das gleiche für IPv6:&amp;lt;br&amp;gt;&lt;br /&gt;
 nano /etc/ufw/before6.rules&lt;br /&gt;
und unten das hier einfügen (ist nicht das gleiche wie bei IPv4!)&lt;br /&gt;
 #GeoBlocking&lt;br /&gt;
 -A ufw6-before-input -m geoip --src-cc RU,CN,HK -j DROP&lt;br /&gt;
Damit ist Russland (RU), China (CN) und Hongkong (HK) für alles gesperrt!&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Regel aktivieren==&lt;br /&gt;
 ufw reload&lt;br /&gt;
Gibt es dabei eine Fehler, so ist die Firewall ausgeschaltet!&lt;br /&gt;
In der Fehlermeldung wird die Datei und die Zeile stehen in der etwas falsch ist.&amp;lt;br&amp;gt;&lt;br /&gt;
Korrigieren und dann die Firewall mit&lt;br /&gt;
 ufw enable&lt;br /&gt;
 ufw reload&lt;br /&gt;
neu starten und die Regeln prüfen!&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
==Beispiele für weitere Regeln==&lt;br /&gt;
{{code|/etc/ufw/before.rules}}&lt;br /&gt;
 -A ufw-before-input -p tcp --dport 3000 -m geoip --src-cc RU,CN -j DROP&lt;br /&gt;
{{code|/etc/ufw/before6.rules}}&lt;br /&gt;
 -A ufw6-before-input -p tcp --dport 3000 -m geoip --src-cc RU,CN -j DROP&lt;br /&gt;
Sperrt TCP Datenverkehr auf Port 3000 für RU und CN&lt;br /&gt;
==Kommentare==&lt;br /&gt;
&amp;lt;comments /&amp;gt;&lt;/div&gt;</summary>
		<author><name>BLinz</name></author>
	</entry>
</feed>