Last modified by Tobias Wintrich on 2022/10/28 12:30

From version 13.1
edited by Tobias Wintrich
on 2022/10/28 10:16
Change comment: There is no comment for this version
To version 11.1
edited by Tobias Wintrich
on 2022/10/28 10:10
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -14,45 +14,59 @@
14 14  
15 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.
16 16  
17 - {{info}}Weitere Informationen zur Verwendung von iptables finden Sie hier:* [[https:~~/~~/linux.die.net/man/8/iptables>>url:https://linux.die.net/man/8/iptables]]
18 -* [[https:~~/~~/wiki.ubuntuusers.de/iptables/>>url:https://wiki.ubuntuusers.de/iptables/]]{{/info}}
17 +In folgenden Beispielen werden diese Parameter von iptables verwendet:
19 19  
20 -(((
19 +{{{-A => --append
20 +-p => --protocol
21 +-s => --source
22 +-m => --match
23 +-j => --jump
24 +-F => --flush
25 +-P => --policy
26 +--dport => --destination-ports}}}
27 +
28 +{{info}}
29 +Weitere Informationen zur Verwendung von iptables finden Sie hier:
30 +
31 +* [[https:~~/~~/linux.die.net/man/8/iptables>>url:https://linux.die.net/man/8/iptables]]
32 +* [[https:~~/~~/wiki.ubuntuusers.de/iptables/>>url:https://wiki.ubuntuusers.de/iptables/]]
33 +{{/info}}
34 +
21 21  == Standard verwerfen ==
22 22  
23 23  **Entfernt alle bestehenden Regeln:**
24 24  
25 -{{{iptables --flush}}}
39 +{{{iptables -F}}}
26 26  
27 27  **Block sämtliche eingehenden Pakete die nicht explizit erlaubt sind:**
28 28  
29 -{{{iptables --policy INPUT DROP}}}
43 +{{{iptables -P INPUT DROP}}}
30 30  
31 31  **Erlaubt das Aufrechterhalten von Aufgebauten Verbindungen (RDP, ICA, VMwareView...):**
32 32  
33 -{{{iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT}}}
47 +{{{iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT}}}
34 34  
35 35  == Port / Protokoll / Netzwerk erlauben ==
36 36  
37 37  **Erlaubt Kontakt zur Kommbox per Browser / TCMS auf Port 443 TCP von dem 24er Subnetz 192.168.255.0/24:**
38 38  
39 -{{{iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT}}}
53 +{{{iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT}}}
40 40  
41 41  **Erlaubt SSH zum Client auf Port 22 TCP von einzelner IP 192.168.255.56/32:**
42 42  
43 -{{{iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT}}}
57 +{{{iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT}}}
44 44  
45 45  **Erlaubt VNC zum Client auf Port 5900 TCP vom 16er Subnetz 192.168.0.0/16:**
46 46  
47 -{{{iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT}}}
61 +{{{iptables -A INPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT}}}
48 48  
49 49  **Für WebVNC aus Kommbox oder TCMS zusätzlich Port 80 TCP vom 16er Subnetz 192.168.0.0/16:**
50 50  
51 -{{{iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT}}}
65 +{{{iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT}}}
52 52  
53 53  **Erlaubt ICMP (Ping) von überall**
54 54  
55 -{{{iptables --append INPUT --protocol icmp --jump ACCEPT}}}
69 +{{{iptables -A INPUT -p icmp -j ACCEPT}}}
56 56  
57 57  = Skript anlegen =
58 58  
... ... @@ -69,20 +69,20 @@
69 69  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:
70 70  
71 71  {{{#Zeilen welche mit '#' beginnen werden nicht ausgewertet und können als Kommentare verwendet werden
72 -iptables --flush
73 -iptables --policy INPUT DROP
74 -iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT
75 -iptables --append INPUT --protocol tcp --destination-port 443 --source 192.168.255.0/24 --jump ACCEPT
86 +iptables -F
87 +iptables -P INPUT DROP
88 +iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
89 +iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT
76 76  
77 77  # Erlaube SSH Admin PC
78 -iptables --append INPUT --protocol tcp --destination-port 22 --source 192.168.255.56/32 --jump ACCEPT
92 +iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT
79 79  
80 80  # Erlaube VNC
81 -iptables --append INPUT --protocol tcp --destination-port 5900 --source 192.168.0.0/16 --jump ACCEPT
82 -iptables --append INPUT --protocol tcp --destination-port 80 --source 192.168.0.0/16 --jump ACCEPT
95 +iptables -A INPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT
96 +iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT
83 83  
84 84  # Erlaube PING
85 -iptables --append INPUT --protocol icmp --jump ACCEPT}}}
99 +iptables -A INPUT -p icmp -j ACCEPT}}}
86 86  
87 87  Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden:
88 88  
... ... @@ -89,4 +89,9 @@
89 89  |(% style="width:160px" %)Verbindungsname *|(% style="width:1346px" %)Frei wählbarer Anzeigename der Verbindung
90 90  |(% style="width:160px" %)Als root ausführen *|(% style="width:1346px" %)an - Führt das Skript mit den benötigten rechten aus
91 91  |(% style="width:160px" %)Automatischer Start|(% style="width:1346px" %)an - Sorgt dafür, dass die Firewall beim Start des geräts aktiviert wird
92 -|(% style="width:160px" %)Desktop-Verknüpfung erstellen
106 +|(% style="width:160px" %)Desktop-Verknüpfung erstellen|(% style="width:1346px" %)aus
107 +|(% style="width:160px" %)Verknüpfung im Startmenü erstellen|(% style="width:1346px" %)aus
108 +
109 +[[image:RangeeOS-Firewall.png||height="446" width="600"]]
110 +
111 +Das fertige Skript wird nun bei jedem Systemstart ausgeführt und wendet die definierten Regeln an. Das Skript kann beliebig per TCMS Konfiguration auf andere Geräte verteilt werden.