Änderungen von Dokument RangeeOS - Firewall mit ipables Skript
Zuletzt geändert von Tobias Wintrich am 2022/10/28 10:30
<
>
bearbeitet von Tobias Wintrich
am 2022/10/28 10:10
am 2022/10/28 10:10
bearbeitet von Tobias Wintrich
am 2022/10/28 10:15
am 2022/10/28 10:15
Änderungskommentar:
Es gibt keinen Kommentar für diese Version
Zusammenfassung
-
Seiteneigenschaften (1 geändert, 0 hinzugefügt, 0 gelöscht)
Details
- Seiteneigenschaften
-
- Inhalt
-
... ... @@ -36,37 +36,37 @@ 36 36 37 37 **Entfernt alle bestehenden Regeln:** 38 38 39 -{{{iptables - F}}}39 +{{{iptables --flush}}} 40 40 41 41 **Block sämtliche eingehenden Pakete die nicht explizit erlaubt sind:** 42 42 43 -{{{iptables - PINPUT DROP}}}43 +{{{iptables --policy INPUT DROP}}} 44 44 45 45 **Erlaubt das Aufrechterhalten von Aufgebauten Verbindungen (RDP, ICA, VMwareView...):** 46 46 47 -{{{iptables - AINPUT -m state --state RELATED,ESTABLISHED -j ACCEPT}}}47 +{{{iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT}}} 48 48 49 49 == Port / Protokoll / Netzwerk erlauben == 50 50 51 51 **Erlaubt Kontakt zur Kommbox per Browser / TCMS auf Port 443 TCP von dem 24er Subnetz 192.168.255.0/24:** 52 52 53 -{{{iptables - AINPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT}}}53 +{{{iptables --append INPUT --protocol tcp --dport 443 --source 192.168.255.0/24 --jump ACCEPT}}} 54 54 55 55 **Erlaubt SSH zum Client auf Port 22 TCP von einzelner IP 192.168.255.56/32:** 56 56 57 -{{{iptables - AINPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT}}}57 +{{{iptables --append INPUT --protocol tcp --dport 22 --source 192.168.255.56/32 --jump ACCEPT}}} 58 58 59 59 **Erlaubt VNC zum Client auf Port 5900 TCP vom 16er Subnetz 192.168.0.0/16:** 60 60 61 -{{{iptables - AINPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT}}}61 +{{{iptables --append INPUT --protocol tcp --dport 5900 --source 192.168.0.0/16 --jump ACCEPT}}} 62 62 63 63 **Für WebVNC aus Kommbox oder TCMS zusätzlich Port 80 TCP vom 16er Subnetz 192.168.0.0/16:** 64 64 65 -{{{iptables - AINPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT}}}65 +{{{iptables --append INPUT --protocol tcp --dport 80 --source 192.168.0.0/16 --jump ACCEPT}}} 66 66 67 67 **Erlaubt ICMP (Ping) von überall** 68 68 69 -{{{iptables - AINPUT -p icmp -j ACCEPT}}}69 +{{{iptables --append INPUT --protocol icmp --jump ACCEPT}}} 70 70 71 71 = Skript anlegen = 72 72 ... ... @@ -83,20 +83,20 @@ 83 83 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: 84 84 85 85 {{{#Zeilen welche mit '#' beginnen werden nicht ausgewertet und können als Kommentare verwendet werden 86 -iptables - F87 -iptables - PINPUT DROP88 -iptables - AINPUT -m state --state RELATED,ESTABLISHED -j ACCEPT89 -iptables - AINPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT86 +iptables --flush 87 +iptables --policy INPUT DROP 88 +iptables --append INPUT --match state --state RELATED,ESTABLISHED --jump ACCEPT 89 +iptables --append INPUT --protocol tcp --dport 443 --source 192.168.255.0/24 --jump ACCEPT 90 90 91 91 # Erlaube SSH Admin PC 92 -iptables - AINPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT92 +iptables --append INPUT --protocol tcp --dport 22 --source 192.168.255.56/32 --jump ACCEPT 93 93 94 94 # Erlaube VNC 95 -iptables - AINPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT96 -iptables - AINPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT95 +iptables --append INPUT --protocol tcp --dport 5900 --source 192.168.0.0/16 --jump ACCEPT 96 +iptables --append INPUT --protocol tcp --dport 80 --source 192.168.0.0/16 --jump ACCEPT 97 97 98 98 # Erlaube PING 99 -iptables - AINPUT -p icmp -j ACCEPT}}}99 +iptables --append INPUT --protocol icmp --jump ACCEPT}}} 100 100 101 101 Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden: 102 102