Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Router leitet Pakete nicht weiter [Solved]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Jongking
n00b
n00b


Joined: 17 Jan 2005
Posts: 3

PostPosted: Wed Aug 31, 2005 9:48 pm    Post subject: Gentoo Router leitet Pakete nicht weiter [Solved] Reply with quote

Hallo zusammen,

ich habe mir einen Gentoo Router nach dem Howto konfiguriert.
Beim hochfahren der einzelnen Dienste gibt es keine Probleme oder irgendwelche Warnmeldungen und der Router findet per PPPoE den Weg ins Internet. Da fangen die Probleme dann aber an:

Ich lasse meinen Gentoo-Clienten nun per DHCP eine neue IP, bzw. Konfiguration zuweisen, funktioniert einwandfrei. Pinge ich mit dem Clienten nun ein Ziel außerhalb meines LANs an, wird zwar die Domain in eine IP aufgelöst, danach gibt es aber keine Antwort vom Zielrechner.
Code:

23:34 jong@plueschi:~ $ ping www.gentoo.de
PING www.gentoo.de (217.160.170.104) 56(84) bytes of data.

Danach geschieht nichts.

Auch mit direkten IP Adressen kommen die Clienten nicht ins Netz der Netze. Ich weiß leider überhaupt nicht mehr weiter und bin für jede Antwort dankbar. Sollten noch Informationen fehlen, bitte melden.

Hier mal iptables -L vom Router
Code:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere           
ACCEPT     all  --  anywhere             anywhere           
REJECT     udp  --  anywhere             anywhere            udp dpt:bootps reject-with icmp-port-unreachable
REJECT     udp  --  anywhere             anywhere            udp dpt:domain reject-with icmp-port-unreachable
DROP       udp  --  anywhere             anywhere            udp dpts:0:1023
DROP       tcp  --  anywhere             anywhere            tcp dpts:0:1023

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  anywhere             192.168.0.0/16     
ACCEPT     all  --  192.168.0.0/16       anywhere           
ACCEPT     all  --  anywhere             192.168.0.0/16     

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Code:

flauschi ~ # epm -q iptables dhcp rp-pppoe dnsmasq baselayout
iptables-1.3.2
dhcp-3.0.2
rp-pppoe-3.5-r11
dnsmasq-2.22
baselayout-1.11.13
flauschi ~ # cat /proc/sys/net/ipv4/ip_forward
1


Danke schonmal,
Jongking


Last edited by Jongking on Thu Sep 01, 2005 3:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
friedegott
n00b
n00b


Joined: 06 Sep 2004
Posts: 60
Location: Munich, Germany

PostPosted: Wed Aug 31, 2005 10:23 pm    Post subject: Reply with quote

was sagt
Code:
cat /proc/sys/net/ipv4/ip_forward
?
das sollte auf 1 stehen, wenn pakete weitergeleitet werden sollen
also einfach zb
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward

falls es daran liegen sollte...
Back to top
View user's profile Send private message
zielscheibe
l33t
l33t


Joined: 02 Apr 2004
Posts: 804
Location: Aachen

PostPosted: Wed Aug 31, 2005 10:35 pm    Post subject: Reply with quote

friedegott wrote:
was sagt
Code:
cat /proc/sys/net/ipv4/ip_forward
?
das sollte auf 1 stehen, wenn pakete weitergeleitet werden sollen
also einfach zb
Code:
echo 1 > /proc/sys/net/ipv4/ip_forward

falls es daran liegen sollte...


Hat der Threadstarter schon aktiviert.

@Jongking

Hast du das Masquerading aktiviert bzw., was sagt ein "iptables -L -t nat"?
Welche Ip-Bereiche haben die angeschlossenen Clients?
Back to top
View user's profile Send private message
mbroeker
n00b
n00b


Joined: 01 Sep 2005
Posts: 2
Location: Germany

PostPosted: Thu Sep 01, 2005 1:16 am    Post subject: Der Caching Nameserver läuft, der Rest nicht Reply with quote

Wenn ich das richtig sehe, ist das Gentoo Howto nicht richtig ( umgesetzt ) worden.

Wie willst du
a) von deinem kleinen Gentoo-Rechner über den Router andere zu erreichen ?
# ping www.google.de ---> router eth0 --->> ipforwarding --->>> eth1 --->>>> google.de ok
( 192.168.0.2 ) ----> 192.168.0.1 --->> -------->>> 192.168.1.1 --->>>> ( 212.220.12.1 )
# www.google.de ---> router --> ?????? (FEHLER )
( 217.220.12.1 ) ---> ( 192.168.1.1 ) ?

Deine Pakete werden zwar nach google geschickt, kommen aber nicht zurück.

b) Dein Caching Nameserver läuft einwandfrei, da es ein fertiges Paket ist.
Deswegen finden deine Rechner auch www.google.de

c) Ich verstehe weder bei dir noch im Howto den Eintrag
DROP all -- anywhere 192.168.0.0/16
ACCEPT all -- 192.168.0.0/16 anywhere
ACCEPT all -- anywhere 192.168.0.0/16

# Finally we add the rules for NAT
jongking $ iptables -I FORWARD -i ${LAN} -d 192.168.0.0/255.255.0.0 -j DROP
jongking $ iptables -A FORWARD -i ${LAN} -s 192.168.0.0/255.255.0.0 -j ACCEPT
jongking $ iptables -A FORWARD -i ${WAN} -d 192.168.0.0/255.255.0.0 -j ACCEPT
jongking $ iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE

Dein Router ist doch für 192.168.0.1/255.255.255.0 oder eben 192.168.0.1/24 konfiguriert.
Woher kommt diese /16 also 192.168.0.1/255.255.0.0 ?

Versuche mal statt einer 16er Netzmaske eine 24er und speichere diese Einstellungen mit /etc/init.d/iptables save !!!
_________________
We both get the same two kinds of customers
Back to top
View user's profile Send private message
FLP
n00b
n00b


Joined: 18 May 2005
Posts: 16

PostPosted: Thu Sep 01, 2005 10:14 am    Post subject: Re: Gentoo Router leitet Pakete nicht weiter Reply with quote

Code:
Chain INPUT (policy ACCEPT)
Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
DROP       all  --  anywhere             192.168.0.0/16     
ACCEPT     all  --  192.168.0.0/16       anywhere           
ACCEPT     all  --  anywhere             192.168.0.0/16     


Iptables arbeitet nach dem "erster treffer gewinnt" Prinzip, d.h. nach dem Drop ist schluß, da es auf alles zutrifft. Zuerst Accept und dann Drop wenn du wie zielscheibe schon sagte auch noch Masquerading betreibst, sollte dein Problem behoben sein. Zudem solltest du auch im Forward Chain ein Reject benutzen, zumindest von Intern nach Extern, aber das ist nur der höflichkeit halber.

Edit: ich seh gerade, deine Rejects und Drops im Input Chain, sind etwas unsinnig wenn du vorher alles erlaubst. Du solltest deine Regeln "umdrehen" damit sie etwas bewirken.
Back to top
View user's profile Send private message
Jongking
n00b
n00b


Joined: 17 Jan 2005
Posts: 3

PostPosted: Thu Sep 01, 2005 3:46 pm    Post subject: Reply with quote

Erstmal danke für die Hilfe. Ich habe alles getestet, doch leider hat es nichts geholfen.
Zum Glück hab ich im IRC noch 'nen Fachmann, na eher 'ne Fachfrau getroffen, die mir folgendes Script gab:

Code:
#!/bin/bash
IPTABLES='/sbin/iptables'
# Set interface values
EXTIF='ppp1'
INTIF1='eth0'
echo "if=$INTIF1 ef=$EXTIF"
#INTIF2='eth2'

#enable ip forwarding in the kernel
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
# flush rules and delete chains
$IPTABLES -F
$IPTABLES -X

# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
# forward LAN traffic from $INTIF1 to Internet interface $EXTIF
$IPTABLES -A FORWARD -i $INTIF1 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT

# forward LAN traffic from $INTIF2 to Internet interace $EXTIF
#$IPTABLES -A FORWARD -i $INTIF2 -o $EXTIF -m state --state NEW,ESTABLISHED -j ACCEPT
#echo -e "       - Allowing access to the SSH server"
$IPTABLES -A INPUT --protocol tcp --dport 22 -j ACCEPT
#echo -e "       - Allowing access to the HTTP server"
$IPTABLES -A INPUT --protocol tcp --dport 80 -j ACCEPT
#echo -e "       - Allowing access to the FTP server"
$IPTABLES -A INPUT --protocol tcp --dport 21 -j ACCEPT
# block out all other Internet access on $EXTIF
#$IPTABLES -A INPUT -i $EXTIF -m state --state NEW,INVALID -j DROP
#$IPTABLES -A FORWARD -i $EXTIF -m state --state NEW,INVALID -j DROP
#$IPTABLES -t mangle -A PREROUTING -p tcp --dport 6667 -j TOS --set-tos Minimize-Delay
#$IPTABLES -t mangle -A PREROUTING -p tcp --dport 10050 -j TOS --set-tos Minimize-Delay


Damit läuft es Prima. Danke nochmal,
Jongking
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum