Firewall
Firewall
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
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
-
- Posts: 348
- Joined: 28. Dec 2000 13:30
- Location: Muenchen
Re: Firewall
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
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">
Re: Firewall
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.
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.
Re: Firewall
@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
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
Re: Firewall
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.
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.
Re: Firewall
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.
Bad argument `new'
Try `iptables -h' or 'iptables --help' for more information.
Bad argument `new'
Try `iptables -h' or 'iptables --help' for more information.
-
- Posts: 348
- Joined: 28. Dec 2000 13:30
- Location: Muenchen
Re: Firewall
es muss heissen:
... -m state --state NEW,ESTABLISHED ...
sorry, hatte mich vertan.
dev0
... -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">
Re: Firewall
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
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
Re: Firewall
<a href="http://netfilter.samba.org" target="_blank"><!--auto-->http://netfilter.samba.org</a><!--auto-->
Re: Firewall
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
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