Changes for page RangeeOS - Firewall mit ipables Skript
Last modified by Tobias Wintrich on 2022/10/28 12:30
From version 12.1
edited by Tobias Wintrich
on 2022/10/28 10:15
on 2022/10/28 10:15
Change comment:
There is no comment for this version
To version 11.1
edited by Tobias Wintrich
on 2022/10/28 10:10
on 2022/10/28 10:10
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -36,37 +36,37 @@ 36 36 37 37 **Entfernt alle bestehenden Regeln:** 38 38 39 -{{{iptables - -flush}}}39 +{{{iptables -F}}} 40 40 41 41 **Block sämtliche eingehenden Pakete die nicht explizit erlaubt sind:** 42 42 43 -{{{iptables - -policyINPUT DROP}}}43 +{{{iptables -P INPUT DROP}}} 44 44 45 45 **Erlaubt das Aufrechterhalten von Aufgebauten Verbindungen (RDP, ICA, VMwareView...):** 46 46 47 -{{{iptables - -appendINPUT --matchstate --state RELATED,ESTABLISHED --jumpACCEPT}}}47 +{{{iptables -A INPUT -m state --state RELATED,ESTABLISHED -j 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 - -appendINPUT --protocoltcp --dport 443 --source192.168.255.0/24 --jumpACCEPT}}}53 +{{{iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j 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 - -appendINPUT --protocoltcp --dport 22 --source192.168.255.56/32 --jumpACCEPT}}}57 +{{{iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j 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 - -appendINPUT --protocoltcp --dport 5900 --source192.168.0.0/16 --jumpACCEPT}}}61 +{{{iptables -A INPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j 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 - -appendINPUT --protocoltcp --dport 80 --source192.168.0.0/16 --jumpACCEPT}}}65 +{{{iptables -A INPUT -p tcp --dport 80 -s 192.168.0.0/16 -j ACCEPT}}} 66 66 67 67 **Erlaubt ICMP (Ping) von überall** 68 68 69 -{{{iptables - -appendINPUT --protocolicmp --jumpACCEPT}}}69 +{{{iptables -A INPUT -p icmp -j 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 - -flush87 -iptables - -policyINPUT DROP88 -iptables - -appendINPUT --matchstate --state RELATED,ESTABLISHED --jumpACCEPT89 -iptables - -appendINPUT --protocoltcp --dport 443 --source192.168.255.0/24 --jumpACCEPT86 +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 90 90 91 91 # Erlaube SSH Admin PC 92 -iptables - -appendINPUT --protocoltcp --dport 22 --source192.168.255.56/32 --jumpACCEPT92 +iptables -A INPUT -p tcp --dport 22 -s 192.168.255.56/32 -j ACCEPT 93 93 94 94 # Erlaube VNC 95 -iptables - -appendINPUT --protocoltcp --dport 5900 --source192.168.0.0/16 --jumpACCEPT96 -iptables - -appendINPUT --protocoltcp --dport 80 --source192.168.0.0/16 --jumpACCEPT95 +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 97 97 98 98 # Erlaube PING 99 -iptables - -appendINPUT --protocolicmp --jumpACCEPT}}}99 +iptables -A INPUT -p icmp -j ACCEPT}}} 100 100 101 101 Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden: 102 102