ich habe heute morgen meine Iptables Regeln ausprobiert und Sie waren auf meinem neuen System ohne Wirkung. Beispielsweise war das Pingen des Servers immer noch möglich.
Code: Select all
#!/bin/sh
echo "initialisiere Firewall"
# Firewallregeln löschen
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -Z
#eigene Chains erstellen
iptables -N MYDROP
iptables -N MYACCEPT
#Loopback-Kommunikation
iptables -A INPUT -i venet0 -j ACCEPT
iptables -A OUTPUT -o venet0 -j ACCEPT
#Stateful Inspection
iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -m state --state INVALID -j MYDROP
iptables -A OUTPUT -m state --state ESTABLISHED -j ACCEPT
#eigene Chains MYDROP und MYACCEPT konfigurieren
iptables -A MYDROP -j LOG --log-prefix "FW-DROP: "
iptables -A MYDROP -j DROP
iptables -A MYACCEPT -j LOG --log-prefix "FW-ACCEPT: "
iptables -A MYACCEPT -j ACCEPT
#SSH
iptables -A INPUT -p tcp --dport 32421 -j MYACCEPT
#www
iptables -A INPUT -p tcp --dport 80 -j MYACCEPT
iptables -A OUTPUT -p tcp --dport 80 -j MYACCEPT
echo "iptables konfiguriert"
Gruß
sonnenrot