routing problem

Post Reply
Message
Author
User avatar
killerhippy
Posts: 529
Joined: 19. May 2000 19:36
Contact:

routing problem

#1 Post by killerhippy »

Folgende Situation:
<blockquote><pre><font size="1" face="">code:</font><hr><font face="Courier New" size="2">
---schnipp---

mit rass = router stefan-sascha
killerghost = router.sascha
10.0.1.100 = router.stefan
main.sascha = compi im netz sascha
router rass mit router.sascha ... router.stefan verbunden via patchkabel von ethx zu ethx

netz stefan 10.0.1.0/24
netz sascha 192.168.111.0/24


routing table rass:

10.0.1.0 10.0.1.100 255.255.255.0 UG 0 0 0 eth1
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
172.16.0.0 172.16.0.1 255.255.255.0 UG 0 0 0 eth2
172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2

ifconfig rass:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:193 errors:0 dropped:0 overruns:0 frame:0
TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0

eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.111.254 Bcast:192.168.111.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:6
Collisions:0
Interrupt:3 Base address:0x300

eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:10.0.1.2 Bcast:10.0.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:648 errors:0 dropped:0 overruns:0 frame:0
TX packets:1877 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0
Interrupt:5 Base address:0x320

eth2 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:172.16.0.2 Bcast:172.16.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5050 errors:0 dropped:0 overruns:1 frame:0
TX packets:3187 errors:0 dropped:0 overruns:0 carrier:0
Collisions:0
Interrupt:15 Base address:0xe000


routing table killerghost:

172.16.0.0 172.16.0.2 255.255.255.0 UG 0 0 0 eth1
172.16.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.111.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo

ifconfig killerghost:

eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.111.1 Bcast:192.168.111.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20230 errors:0 dropped:0 overruns:0 frame:0
TX packets:15653 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:10

eth1 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:172.16.0.1 Bcast:172.16.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4680 errors:0 dropped:0 overruns:0 frame:0
TX packets:6873 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:12 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:174 errors:0 dropped:0 overruns:0 frame:0
TX packets:174 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

routing table main.sascha:

192.168.111.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.111.1 0.0.0.0 UG 0 0 0 eth0

ifconfig main.sascha:

eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.111.2 Bcast:192.168.111.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MTU:1490 Metric:1
RX packets:562 errors:0 dropped:0 overruns:0 frame:0
TX packets:600 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:9 Base address:0x9000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0

---schnapp---


auf killerghost geht ping 172.16.0.2, nicht aber ping 10.0.1.100
auf main.sascha geht ping 172.16.0.2 nicht, ping 10.0.1.100 auch nicht
auf rass geht aber ping 10.0.1.100

... ich dachte, dieses routing muesste erlauben, dass ich von main.sascha 192.168.111.2 den gate.stefan 10.0.1.0.100 erreiche, und damit sein netz...
</font><hr></pre></blockquote>

btw: die mac-adressen habe ich hier gegen 00:00:00:00:00:00 ausgetauscht, for security reasons...
...was habe ich falsch gemacht?
Es gibt keine dumme Fragen!

Killerhippy

gewitter
Posts: 1354
Joined: 09. Apr 2001 9:03

Re: routing problem

#2 Post by gewitter »

das ist schon im vorfeld völlig undurchsichtig.

nehmen wir mal an du würdest drei teilnetze 192.168.10.0, 192.168.20.0 und 192.168.30.0 miteinander routen wollen und du hast in zwei rechnern zwei netzkarten, dann ist nach folgenden schritten vorzugehen:

1. /etc/hosts in den routern (router1 und router2) erhält alle namen der rechner aus den verbundenen netzwerken
2. /etc/networks erhält die namen der netzwerke (netz1 für 192.168.10.0 und netz2 für 192.168.20.0 usw... )
3. jetzt werden zusätzliche routen gelegt:
auf router1
# route add -net netz1 eth1
# route add -net netz3 gw ip-router2 eth0

auf router2
# route add -net netz3 eth0
# route add -net netz1 gw ip-router1 eth1

auf den rechnern im mittleren teilnetz:
# route add -net netz3 gw ip-router2
# route add -net netz1 gw ip-router1

auf den rechnern in den äusseren teilnetzen:
# route add default gw ip-nächster-router

empfehlung: eine sinnvolle netzplanung erspart enorme fehlersuchereien. eine vernünftige namensgebung erleichtert das interpretieren. wenn ich dein chaos richtig interpretiere, unterhältst du nur zwei netze, dann brauchst du auch nur einen router auf dem gilt:
# route add -net netz1 eth1
# route add -net netz2 eth0

auf den rechnern in den teilnetzen:
# route add default gw ip-nächster-router(eth0/eth1)interface
Last edited by gewitter on 13. Jan 2002 11:21, edited 1 time in total.

Post Reply