Firewall

Message
Author
Lino

Firewall

#1 Post by Lino »

ich habe ein paar iptables befehle aus diesem forum bekommen ...

leider funzt mein webserver für exteren zugriffe nicht mehr..

hier sind die befehle:

iptables -A POSTROUTING -t nat -j MASQUERADE -o ppp0

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A INPUT -j DROP -m state --state NEW,INVALID -i ppp0
iptables -A FORWARD -j DROP -m state --state NEW,INVALID -i ppp0

cerberusger
Posts: 348
Joined: 28. Dec 2000 13:30
Location: Muenchen

Re: Firewall

#2 Post by cerberusger »

is ja ganz logisch, du blockst ja jeden zugriff von aussen.

setze eine regel, die den http-traffic reinlaesst _vor_ die erste DROP-regel.

/usr/sbin/iptables -A INPUT -m state --NEW -dport 80 -i ppp0 -j ACCEPT

dev0
Linux is a wigwam - no windows, no gates, apache inside <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">

Lino

Re: Firewall

#3 Post by Lino »

danke für die schnelle Antwort.. leider funktioniert es nicht... es kommt ne fehlermeldung... warhscheinlich hast du dich in der Syntax vertan.

Diese Meldung kommt:

iptables v1.2.1a: Unknown arg `--NEW'
Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.1a: Unknown arg `--NEW'
Try `iptables -h' or 'iptables --help' for more information.

Max

Re: Firewall

#4 Post by Max »

@Lino
und was sagt iptables -h???
ich habe jetzt keinen Rechner mit 2.4 da und kenne auch den iptables Syntax nicht.
Aber wenn mir die Zeilen angucke die gepostet hast, dann sehe ich nach dem -m state ein --state
Was mir jetzt sagt das dies eine Option für -m state ist und anscheinend klein geschrieben wird.
Ergo Probier mal --new statt --NEW

Gruss Max

Lino

Re: Firewall

#5 Post by Lino »

im moment sieht es so aus:

iptables -A POSTROUTING -t nat -j MASQUERADE -o ppp0

echo 1 > /proc/sys/net/ipv4/ip_forward

iptables -A INPUT -m state --new -dport 80 -i ppp0 -j ACCEPT
iptables -A INPUT -m state --new -dport 21 -i ppp0 -j ACCEPT

iptables -A INPUT -j DROP -m state --state NEW,INVALID -i ppp0
iptables -A FORWARD -j DROP -m state --state NEW,INVALID -i ppp0


und es kommt diese Meldung:

iptables v1.2.1a: Can't use -N with -A

Try `iptables -h' or 'iptables --help' for more information.
iptables v1.2.1a: Can't use -N with -A

Try `iptables -h' or 'iptables --help' for more information.

BO

Re: Firewall

#6 Post by BO »

lass halt das -- vor new bzw NEW weg.......

BO

Re: Firewall

#7 Post by BO »

lass halt das -- vor new bzw NEW weg.......

BO

Re: Firewall

#8 Post by BO »

sorry, sollte nicht doppelt kommen

Lino

Re: Firewall

#9 Post by Lino »

dann kommt diese Fehlermeldung wenn ich die Striche vor new wegmachen..


Bad argument `new'
Try `iptables -h' or 'iptables --help' for more information.
Bad argument `new'
Try `iptables -h' or 'iptables --help' for more information.

cerberusger
Posts: 348
Joined: 28. Dec 2000 13:30
Location: Muenchen

Re: Firewall

#10 Post by cerberusger »

es muss heissen:

... -m state --state NEW,ESTABLISHED ...

sorry, hatte mich vertan.

dev0
Linux is a wigwam - no windows, no gates, apache inside <img src="http://www.pl-forum.de/UltraBoard/Images/Happy.gif" border="0" align="middle">

Lino

Re: Firewall

#11 Post by Lino »

ich habe jetzt:

iptables -A INPUT -m state --state NEW,ESTABLISHED -dport 80 -i ppp0 -j ACCEPT

dort stehen... bitte sag mir die komplette zeile.. danke

by lino

Lino

Re: Firewall

#12 Post by Lino »

dev0! Help me!

thanks

by lino

Lino

Re: Firewall

#13 Post by Lino »

help me

Max

Re: Firewall

#14 Post by Max »

<a href="http://netfilter.samba.org" target="_blank"><!--auto-->http://netfilter.samba.org</a><!--auto-->

Lino

Re: Firewall

#15 Post by Lino »

habe es jetzt geschafft.

Wenn jemand auch soll eine Funktion braucht:

als Masquerade, alle per Firewall blockieren und dann wieder bestimme Ports freischalten,

der sollte sich dieses Script mit einzelnen Iptables Befehlen herunterladen.

unter lino16.dyndns.org unter Download zu finden.

by lino

Post Reply