eine Frage an die Firewall-Experten unter Euch:
Ich habe mir ein kleines Script gebastelt, wo ich Firewall Regeln laden kann. Auf dem Server läuft kein KeyHelp, sondern ist ein nackter Server mit einem Testsystem. Dieses Script ist nur für IPv4. IPv6 hätte ich auch gern mit drin, nur da bin ich mir nicht ganz sicher wie ich diese eintragen soll.
Code: Select all
#!/bin/bash
# Firewall Regeln
iptables -F
iptables -X
iptables -N DENY
iptables -A DENY -p tcp -m tcp -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with tcp-reset
iptables -A DENY -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with icmp-proto-unreachable
iptables -A DENY -m comment --comment "Alles andere ignorieren" -j DROP
iptables -N SERVICES
iptables -A SERVICES -p tcp -m tcp --dport 53 -m comment --comment "Erlaube: DNS" -j ACCEPT
iptables -A SERVICES -p udp -m udp --dport 53 -m comment --comment "Erlaube: DNS" -j ACCEPT
iptables -A SERVICES -p tcp -m tcp --dport 443 -m comment --comment "Erlaube: Web-HTTPS" -j ACCEPT
iptables -A SERVICES -p udp -m udp --dport 21 -m comment --comment "Erlaube: FTP-Zugriff" -j ACCEPT
iptables -A SERVICES -p tcp -m tcp --dport 22 -m comment --comment "Erlaube: SSH-Zugriff" -j ACCEPT
iptables -A SERVICES -j RETURN
iptables -A INPUT -i lo -m comment --comment "Erlaube: Loopback" -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -m comment --comment "Erlaube: Related und Established Verbindungen" -j ACCEPT
iptables -A INPUT -m comment --comment "Erlaube Standard Dienste" -j SERVICES
iptables -A INPUT -p icmp -m comment --comment "Erlaube: ICMP" -j ACCEPT
iptables -A INPUT -m comment --comment "Ignoriere alles andere" -j DENY
iptables -P INPUT DROP
Code: Select all
ip6tables -A INPUT -i lo -m comment --comment "Erlaube: Loopback" -j ACCEPT
Ich danke schon jetzt für Eure Hilfe