[linux-l] firewall, iptables -i lo

Thomas Kaepernick Thomas.Kaepernick at web.de
Di Feb 6 21:19:14 CET 2007


Am Mon, Feb 05, 2007 at 10:28:08AM +0000, schrieb Ivan F. Villanueva B.:
> Am Sa, Feb 03, 2007 11:56:26 +0100, Thomas Kaepernick schrieb:
> > Am Thu, Feb 01, 2007 at 10:34:40PM +0100, schrieb Steffen Dettmer:
> > > * Ivan F. Villanueva B. wrote on Thu, Feb 01, 2007 at 16:21 +0000:
> > > > [root at samsung]# /sbin/iptables -A INPUT -j ACCEPT -i lo
> > > > [root at samsung]# dict verklagen                         
> > > > dict: Access to server localhost.2628 denied when connecting
> > > 
> > > > Warum?
> > > 
> > > hilft "/sbin/iptables -I INPUT -j ACCEPT -i lo"?
> > Vielleicht Regel umstellen: "/sbin/iptables -I INPUT -i lo -j ACCEPT" ?
> 
> Das Problem wird davon verursacht:
> 
>     /sbin/iptables -t nat -A POSTROUTING -j MASQUERADE
> 
> D.h, bevor es ausgeführt wird, funktioniert dict, danach nicht mehr.
> 
> Warum? Was für eine Regel brauche ich noch?
> 
> Zur Info (meine gesammte Firewall):
> 
>     #! /bin/sh
>     /sbin/iptables -F
>     /sbin/iptables -t nat -F
>     /sbin/iptables -t mangle -F
>     /sbin/iptables -X
>     /sbin/iptables -P INPUT DROP
>     /sbin/iptables -P OUTPUT ACCEPT
>     /sbin/iptables -A INPUT -i lo -j ACCEPT
>     /sbin/iptables -A INPUT -p icmp -j ACCEPT
>     /sbin/iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
>     echo "1" > /proc/sys/net/ipv4/ip_forward
>     echo "1" > /proc/sys/net/ipv4/ip_dynaddr
>     /sbin/iptables -P FORWARD DROP
>     /sbin/iptables -A FORWARD -i ppp0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
>     /sbin/iptables -A FORWARD -i ppp0 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
>     /sbin/iptables -A FORWARD -o ppp0 -i eth1 -j ACCEPT
>     /sbin/iptables -A FORWARD -o ppp0 -i eth0 -j ACCEPT
>     /sbin/iptables -t nat -A POSTROUTING -j MASQUERADE
> 
> BTW, Braucht man noch etwas wichtiges, das ich vergessen habe?
Ich habe in der Zeile:
      /sbin/iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
Möglich ist auch 
      /sbin/iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
Dann sind alle Netzwerkkarten angesprochen.

Gruß Thomas



Mehr Informationen über die Mailingliste linux-l