linux-l: Firewall-Roules

Thomas Knop t.knop at isv-gmbh.de
Di Feb 6 14:23:43 CET 2001


On, Tue, 06 Feb 2001, Ulrich Wiederhold wrote:
> also, ich will alles nach draußen erlauben, aber Zugriff auf meinen
> ftp-server und sshd haben (port 21 und 22).
> 
> iptables -N filter
> iptables -A filter -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A filter -m state --state NEW -i ! ppp0 -j ACCEPT
> iptables -A filter -m state --state NEW -i ppp0 -p ! ftp,ssh -j DROP
> iptables -A filter -m state --state NEW -i ppp0 -p tcp,ftp --dport 21 -j ACCEPT
> iptables -A filter -m state --state NEW -i ppp0 -p tcp,ssh --dport 22 -j ACCEPT
> 
> iptables -A INPUT -j filter
> iptables -A FORWARD -j DROP
> iptables -A OUTPUT -j ACCEPT
Ich kenne zwar (noch) nicht iptables, nehme aber mal zwei dinge an:
1) Option -p heißt Protokoll und kommt aus /etc/protocols
2) Auch Kernel 2.4.x implementiert noch kein Application-Gatway
daraus würde dann folgen:
a) Zeile 3 "-p ! ftp,ssh" ist quatsch; sie muss als letzte(!) Zeile mit -p
   all stehen und optionalem -dport 1:1023
b) Zeile 3,4 jeweils nur "-p tcp"

Gruß Thomas

PS: Sollte ich mit dem geratenem "-p" == "Protokoll" richtig liegen, wundert
mich, dass iptables -p ftp,ssh "schluckt".

-- 
Thomas Knop - ISV GmbH Berlin - Am Treptower Park 75 - 12435 Berlin
Tel/Fon: +49-30-5343 3408/3435               http://www.isv-gmbh.de
ech`echo o Si6uxuWyt s isr|tr 6yWS nepL|sed 'sU\(upe\)\(.*\)\( is\)U\3\2\1U'`



Mehr Informationen über die Mailingliste linux-l