Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Paketweiterleitung [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
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2955
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Fri Jan 19, 2007 10:58 pm    Post subject: Paketweiterleitung [solved] Reply with quote

Hallo

ich spiele zur Zeit mit dem Aufsetzten eines HOME Servers, aber ich hab jetzt ein kleines Problemchen, und weiß nicht recht, woran es liegen kann.

Ich habe 2 Netzwerkkarten, eth0 ist hinter einem Linksys Router und habe eine statische IP gewählt (192.168.5.10).
eth1 hat die Adresse 192.168.10.1.

Code:

config_eth0=( "192.168.5.10 netmask 255.255.255.0" )
routes_eth0=( "default gw 192.168.5.1" )

config_eth1=( "192.168.10.1 netmask 255.255.255.0" )


Ich habe "IP: advanced router" im Kernel festgewählt und ein cat /proc/sys/net/ipv4/ip_forward gibt eine 1 aus, außerdem habe ich die /etc/sysctl.conf geändert, so dass net.ipv4.ip_forward = 1 steht.

Ich habe mir einen named + dhcpd server aufgestellt, beide laufen problemlos.

Ich hab zuerst mit vmware alles getestet und zuerst meine vmware-Netzwerkkarte mit einem Bridge auf eth0 gestartet. Dort habe ich folgendes eingestellt

Code:

#vmware Umgebung
config_eth0=( "192.168.5.23 netmask 255.255.255.0" )
routes_eth0=( "default gw 192.168.5.10" )


dann geht alles

Code:

embedded ~ # ping www.google.de
PING www.l.google.com (72.14.221.103) 56(84) bytes of data.
64 bytes from fg-in-f103.google.com (72.14.221.103): icmp_seq=1 ttl=247 time=63.4 ms
From 192.168.5.10: icmp_seq=2 Redirect Host(New nexthop: 192.168.5.1)
64 bytes from fg-in-f103.google.com (72.14.221.103): icmp_seq=2 ttl=247 time=64.8 ms
64 bytes from fg-in-f103.google.com (72.14.221.103): icmp_seq=3 ttl=247 time=70.2 ms
64 bytes from fg-in-f103.google.com (72.14.221.103): icmp_seq=4 ttl=247 time=54.4 ms


Wenn ich aber die vmware-Nertwerkkarte mit einem Bridge auf eth1 starte und die IP über dhcp bekomme, kann ich innerhalb des Netzes pingen, aber google pingen geht nicht.

Code:

embedded ~ # ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:0C:29:66:DF:B4 
          inet addr:192.168.10.3  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:102 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:15990 (15.6 Kb)  TX bytes:21129 (20.6 Kb)
          Interrupt:18 Base address:0x1400

embedded ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.10.0    *               255.255.255.0   U     0      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.10.1    0.0.0.0         UG    0      0        0 eth0

embedded ~ # ping www.google.de
PING www.l.google.com (209.85.129.147) 56(84) bytes of data.


Ich dachte zuerst, es liegt am Vmware, aber das kann so nicht sein, denn jetzt teste ich mit einem Notbook, der an eth1 angeschlossen wird und per dhcp eine IP bekommt, und von dort aus geht das internet pingen auch nicht.

Hab ich was falsches getan oder was habe ich nicht getan? Liegt es überhaupt an mir oder am Linksys router, von dem ich die Internet Verbindung bekomme?

edit: Oder muss ich etwas spezielles im Kernel wählen, da eth0 ja nicht direkt am Internet gebunden ist sondern ebenfalls hinter einem Router?
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!


Last edited by pablo_supertux on Sat Jan 20, 2007 2:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
anello
Guru
Guru


Joined: 17 Jul 2005
Posts: 557
Location: EU -> DE -> Stuttgart

PostPosted: Sat Jan 20, 2007 10:25 am    Post subject: Reply with quote

Du musst auf deinem GW (was in diesem Fall deinem Server entspricht, wenn ich das richtig verstanden habe) einen Routingeintrag für das Netz 192.168.10.0/24 zum default GW (linksys Router = 192.168.5.X) machen. Du arbeitest mit zwei verschiedenen Netzen ...
_________________
Antonino Catinello | http://catinello.eu
Back to top
View user's profile Send private message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2955
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Sat Jan 20, 2007 12:42 pm    Post subject: Reply with quote

anello wrote:
Du musst auf deinem GW (was in diesem Fall deinem Server entspricht, wenn ich das richtig verstanden habe) einen Routingeintrag für das Netz 192.168.10.0/24 zum default GW (linksys Router = 192.168.5.X) machen. Du arbeitest mit zwei verschiedenen Netzen ...


wird das nicht schon automatsich gemacht?

Code:

supertux ~ # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.5.0     *               255.255.255.0   U     0      0        0 eth0
192.168.10.0    *               255.255.255.0   U     0      0        0 eth1
loopback        *               255.0.0.0       U     0      0        0 lo
default         192.168.5.1     0.0.0.0         UG    0      0        0 eth0


oder wie soll ich das machen?
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
Back to top
View user's profile Send private message
anello
Guru
Guru


Joined: 17 Jul 2005
Posts: 557
Location: EU -> DE -> Stuttgart

PostPosted: Sat Jan 20, 2007 1:57 pm    Post subject: Reply with quote

Hast du denn schon die iptables Regeln auf erlaubt gestellt bzw. Maskierung aktiviert?

Code:
# iptables -A FORWARD -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

_________________
Antonino Catinello | http://catinello.eu
Back to top
View user's profile Send private message
pablo_supertux
Advocate
Advocate


Joined: 25 Jan 2004
Posts: 2955
Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)

PostPosted: Sat Jan 20, 2007 2:27 pm    Post subject: Reply with quote

anello wrote:
Hast du denn schon die iptables Regeln auf erlaubt gestellt bzw. Maskierung aktiviert?

Code:
# iptables -A FORWARD -m state --state ESTABLISHED,RELATED,NEW -j ACCEPT
# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE


Nein, das habe ich nicht getan. Da ich mich ohne Howto an die Konfiguration rangewagt habe, hab ich an iptables nicht gedacht.

Jetzt geht alles, vielen Dank

Gruss
Pablo
_________________
A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth!
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