Changes for page RangeeOS - Firewall mit ipables Skript
Last modified by Tobias Wintrich on 2022/10/28 12:30
From version 10.1
edited by Tobias Wintrich
on 2022/10/28 10:09
on 2022/10/28 10:09
Change comment:
There is no comment for this version
To 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
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 - 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,19 +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 -P INPUT DROP 87 -iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 88 -iptables -A INPUT -p tcp --dport 443 -s 192.168.255.0/24 -j ACCEPT 86 +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 89 89 90 90 # Erlaube SSH Admin PC 91 -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 92 92 93 93 # Erlaube VNC 94 -iptables - AINPUT -p tcp --dport 5900 -s 192.168.0.0/16 -j ACCEPT95 -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 96 96 97 97 # Erlaube PING 98 -iptables - AINPUT -p icmp -j ACCEPT}}}99 +iptables --append INPUT --protocol icmp --jump ACCEPT}}} 99 99 100 100 Zusätzlich zum Skript sollten (* = müssen) folgende Optionen in der Verbindung definiert werden: 101 101