Wiki source code of RangeeOS - Firewall mit ipables Skript
Version 17.1 by Tobias Wintrich on 2022/10/28 10:29
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
5.1 | 1 | Das RangeeOS stellt keine grafische Benutzeroberfläche zur Erstellung und Verwaltung von Firewall Regeln bereit. Auf Wunsch können aber beliebige Regeln über das Linux Kommandozeilen Tool //**iptables **//erstellt und über das Skripte Modul auch auf verschiedene Geräte übertragen werden. |
![]() |
2.1 | 2 | |
![]() |
10.1 | 3 | {{toc/}} |
4 | |||
![]() |
2.1 | 5 | = Voraussetzung = |
6 | |||
7 | Auf dem RangeeOS Client muss das Softwaremodul **scripts **in zur Firmware passender Version installiert sein. | ||
8 | |||
9 | {{info}} | ||
10 | Sollte Ihnen unter **Softwareaktualisierung **das Modul nicht angeboten werden, wenden Sie sich bitte an unseren [[Support>>mailto:support@rangee.com]] | ||
11 | {{/info}} | ||
12 | |||
![]() |
6.1 | 13 | = Firewallregeln = |
![]() |
2.1 | 14 | |
![]() |
6.1 | 15 | Hier finden Sie verschiedene Regeln um nur definierten, eingehenden Datenverkehr zum RangeeOS auf Netzwerkebene zu erlauben . Das Blockieren ausgehender Verbindungen auf Clientseite wird nicht empfohlen. |
![]() |
2.1 | 16 | |
![]() |
14.1 | 17 | {{info}} |
![]() |
15.1 | 18 | Weitere Informationen zur Verwendung von iptables finden Sie hier: |
![]() |
9.1 | 19 | |
![]() |
15.1 | 20 | * [[https:~~/~~/linux.die.net/man/8/iptables>>url:https://linux.die.net/man/8/iptables]] |
![]() |
14.1 | 21 | * [[https:~~/~~/wiki.ubuntuusers.de/iptables/>>url:https://wiki.ubuntuusers.de/iptables/]] |
22 | {{/info}} | ||
23 | |||
![]() |
2.1 | 24 | == Standard verwerfen == |
25 | |||
![]() |
9.1 | 26 | **Entfernt alle bestehenden Regeln:** |
27 | |||
![]() |
12.1 | 28 | {{{iptables --flush}}} |
![]() |
9.1 | 29 | |
![]() |
2.1 | 30 | **Block sämtliche eingehenden Pakete die nicht explizit erlaubt sind:** |
31 | |||
![]() |
12.1 | 32 | {{{iptables --policy INPUT DROP}}} |
![]() |
2.1 | 33 | |
34 | **Erlaubt das Aufrechterhalten von Aufgebauten Verbindungen (RDP, ICA, VMwareView...):** | ||
35 | |||
![]() |
12.1 | 36 | {{{iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT}}} |
![]() |
2.1 | 37 | |
![]() |
3.1 | 38 | == Port / Protokoll / Netzwerk erlauben == |
![]() |
2.1 | 39 | |
![]() |
8.1 | 40 | **Erlaubt Kontakt zur Kommbox per Browser / TCMS auf Port 443 TCP von dem 24er Subnetz 192.168.255.0/24:** |
![]() |
2.1 | 41 | |
![]() |
13.1 | 42 | {{{iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT}}} |
![]() |
2.1 | 43 | |
![]() |
8.1 | 44 | **Erlaubt SSH zum Client auf Port 22 TCP von einzelner IP 192.168.255.56/32:** |
![]() |
2.1 | 45 | |
![]() |
13.1 | 46 | {{{iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT}}} |
![]() |
2.1 | 47 | |
![]() |
8.1 | 48 | **Erlaubt VNC zum Client auf Port 5900 TCP vom 16er Subnetz 192.168.0.0/16:** |
![]() |
2.1 | 49 | |
![]() |
13.1 | 50 | {{{iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT}}} |
![]() |
2.1 | 51 | |
![]() |
8.1 | 52 | **Für WebVNC aus Kommbox oder TCMS zusätzlich Port 80 TCP vom 16er Subnetz 192.168.0.0/16:** |
![]() |
2.1 | 53 | |
![]() |
13.1 | 54 | {{{iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT}}} |
![]() |
2.1 | 55 | |
56 | **Erlaubt ICMP (Ping) von überall** | ||
57 | |||
![]() |
12.1 | 58 | {{{iptables --append INPUT --protocol icmp --jump ACCEPT}}} |
![]() |
2.1 | 59 | |
![]() |
6.1 | 60 | = Skript anlegen = |
![]() |
2.1 | 61 | |
62 | {{warning}} | ||
63 | Bevor Sie die Regeln per Skript automatisiert ausführen, wird empfohlen Sie händisch per SSH oder Root Shell zu testen. Informationen zum Zugang zum Linux Terminal finden Sie hier: | ||
64 | |||
65 | * [[Root-Terminal Passwort>>doc:Handbuecher.Handbuch11.Kapitel 3 - Administration des Clients.3\.C Benutzereinstellungen.3\.C\.A\. Root-Terminal-Passwort]] | ||
66 | * [[Remote Access via SSH>>doc:Handbuecher.Handbuch11.Kapitel 4 - Erweiterte Administration.4\.C\. Remote Access via SSH.WebHome]] | ||
67 | * [[Hotkeys (lokales Terminal öffnen)>>doc:Handbuecher.Handbuch11.Kapitel 2 - Getting Started.2\.B\. Hotkeys.WebHome]] | ||
68 | {{/warning}} | ||
69 | |||
70 | Navigieren Sie in der Kommbox zu {{status title="Verbindungen & Anwendungen"/}} -> {{status title="Script Konfiguration"/}} und legen Sie eine {{status title="Neue Verbindung"/}} an. | ||
71 | |||
72 | Vergeben Sie die von Ihnen benötigen Regeln (eine je Zeile) in das Feld **Skript **ein. Ein Skript mit allen Regeln aus den Beispielen diese Seite sieht so aus: | ||
73 | |||
74 | {{{#Zeilen welche mit '#' beginnen werden nicht ausgewertet und können als Kommentare verwendet werden | ||
![]() |
12.1 | 75 | iptables --flush |
76 | iptables --policy INPUT DROP | ||
77 | iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT | ||
![]() |
13.1 | 78 | iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT |
![]() |
2.1 | 79 | |
80 | # Erlaube SSH Admin PC | ||
![]() |
13.1 | 81 | iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT |
![]() |
2.1 | 82 | |
83 | # Erlaube VNC | ||
![]() |
13.1 | 84 | iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT |
85 | iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT | ||
![]() |
2.1 | 86 | |
87 | # Erlaube PING | ||
![]() |
12.1 | 88 | iptables --append INPUT --protocol icmp --jump ACCEPT}}} |
![]() |
2.1 | 89 | |
90 | Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden: | ||
91 | |||
![]() |
17.1 | 92 | (% style="width:1934.5px" %) |
93 | |(% style="width:584.5px" %)Verbindungsname *|(% style="width:921.5px" %)Frei wählbarer Anzeigename der Verbindung | ||
94 | |(% style="width:584.5px" %)Als root ausführen *|(% style="width:921.5px" %)an - Führt das Skript mit den benötigten rechten aus | ||
95 | |(% style="width:584.5px" %)Automatischer Start|(% style="width:921.5px" %)an - Sorgt dafür, dass die Firewall beim Start des Geräts aktiviert wird | ||
96 | |(% style="width:584.5px" %)Desktop-Verknüpfung erstellen |(% style="width:921.5px" %)aus | ||
97 | |(% style="width:584.5px" %)Verknüpfung im Startmenü erstellen|(% style="width:921.5px" %)aus | ||
98 | |||
99 | [[image:RangeeOS-Firewall.png||height="498" width="600"]] | ||
100 | |||
101 |