Xosa 撰寫於文章 <846v0i$7nu$1@news.tw.aunet.net>...
>
>網中人 <netman2000@crosswinds.net> wrote in message
>news:3865b61c@dnews.tpgi.com.au...
>>
>>
>> Xosa 撰寫於文章 <3865775e_1@news.lexicomp.net>...
>> >謝謝您的答覆。
>> >我實際的網路確實如您所說是用 26bit ,而非我圖上所標示的 24bit。
>>
>> 哦﹐原來如此。
>>
>> >原本我畫圖只想釐清我自己本身觀念是否正確?所以用3個 Class C
>> >來代表我實際的網路架構(事實上我公司的確有三個 Class C)
>>
>> 看來您對 IP 劃分的概念很清晰啦~~~  ^_^
>>
>> >
>> >我現在把我真正網路架構繪製如下:
>> >網路 A eth0=0x280  5    ip : 100.100.1.7   netmask=255.255.255.192
>> >網路 B eth1=0x300  9    ip : 100.100.1.65   netmask=255.255.255.192
>> >網路 C eth2=0x320  10  ip : 100.100.3.1   netmask=255.255.255.0
>> >
>> >網路 A,B是用 一個Class C切成四個 subnet(100.100.1.0和100.100.1.64)
>> >而 routeing Table 就是我原先貼的那份(還未加  routed 之前)
>> >
>> >     internet
>> >          |
>> >          |
>> >[ Cisco Router ]
>> >100.100.1.1/26                      Linux Box
>> >          |
>> >          |                                          __
>> >100.100.1.0/26 <-> 100.100.1.7 |__| 100.100.1.65<-> 100.100.1.64/26
>> >             網路 A                    100.100.3.1
>> 網路B
>> >                                                      |
>> >                                                      |
>> >                                                      |
>> >                                           100.100.3.0/24
>> >                                                網路C
>> >
>> >100.100.3.1    *                255.255.255.255   UH    0      0
0
>> eth2
>> >100.100.1.65    *              255.255.255.255   UH    0      0        0
>> eth1
>> >100.100.1.7     *               255.255.255.255   UH    0      0
0
>> eth0
>> >100.100.3.0     *               255.255.255.0        U      0      0
>> 0 eth2
>> >100.100.1.64    *              255.255.255.192   U      0      0
0
>> eth1
>> >100.100.1.0     *               255.255.255.192   U      0      0
>0
>> eth0
>> >127.0.0.0       *                 255.0.0.0               U      0
0
>> 0  lo
>> >default         cisco-router  0.0.0.0                   UG    0      0
>> 0 eth0
>> >
>> >我的問題還是一直無法解決,BC可互通,B可上Internet沒問題,
>> >但是C的機器(100.100.3.2)只能 ping 到 100.100.1.7,無法連上
>>
>> 除了 100.100.1.7 之外﹐網路 A 中的其它 IP 可以 ping 到麼﹖
>
>不行,只能 ping 到 100.100.1.7
>
>>
>> >Internet。小弟的網路 B或C 的機器有 NT也有 Linux ,不過只要在
>> >網路C中就無法跨過 router。
>>
>> 本來我以為可能是 ipchains 在 eth0 這個節點上沒有對網路C 開放 (input or
>> output)﹐但觀乎您上次的 post ﹐應該不是火牆的問題了。
>>
>> 但如果是 routing 的問題﹐我們必須要知道 routing 是雙向的﹐雖然您設定了由
C
>> 到 A 的 routing ﹐但如何 route back 也要確定無誤。只看上面這個 route
>> table ﹐恕小弟愚頓﹐看不出這台帶三個界面的 Linux box 設定上的問題。
>>
>> 然而﹐我卻無法知道在各網路中各主機的 route table 是如何的﹖可否分別將網路
>> A、B、C 中的主機 route table 打上來麼﹖
>>
> =====================================================
>
>這是在網路C中的一台 Linux 機器
>
>[root@bp /root]# route
>Kernel IP routing table
>Destination     Gateway   Genmask         Flags Metric Ref    Use Iface
>100.100.3.100  *               255.255.255.255 UH    0      0        0 eth0
>100.100.3.0   *                 255.255.255.0   U     0      0        0
eth0
>127.0.0.0       *                 255.0.0.0       U     0      0        0
lo
>default         100.100.3.1  0.0.0.0         UG    0      0        0 eth0
>
>======================================================
>
>這是在網路B中的一台 Linux 機器
>
>[root@bp /root]# route
>Kernel IP routing table
>Destination     Gateway         Genmask         Flags Metric Ref    Use
>Iface
>100.100.1.121  *               255.255.255.255 UH    0      0        0 eth0
>100.100.1.64   *               255.255.255.192  U     0      0        0
eth0
>127.0.0.0       *                255.0.0.0               U     0      0
>0 lo
>default      100.100.1.65  0.0.0.0                   UG    0      0
0
>eth0
>
>
>==========================================================
>
>這是在網路A中的一台 WinNT機器
>
>Network Destination         Netmask           Gateway        Interface
>Metric
>      0.0.0.0                       0.0.0.0             100.100.1.62
100.100.1.10       1
>    127.0.0.0                  255.0.0.0            127.0.0.1    127.0.0.1
1
> 100.100.1.0              255.255.255.192   100.100.1.10  100.100.1.10    1
> 100.100.1.10            255.255.255.255   127.0.0.1        127.0.0.1    1
> 100.100.1.255          255.255.255.255   100.100.1.10  100.100.1.10
1
>     224.0.0.0              224.0.0.0               100.100.1.10
100.100.1.10       1
> 255.255.255.255      255.255.255.255   100.100.1.10  100.100.1.10       1
>=========================================================

看上面這個 route table ﹐關於自身網路指向自身的界面是沒有錯﹐其預設 gateway
指向 62 也沒錯。但問題是﹐通向網路 C 卻沒有指定了﹐這時候﹐就算封包是回應到
網路 C 的話﹐也會送到 62 而不是 7 (即 Linux Box)。所以您得加上這樣下面這樣一
行在路由表裡面﹕

100.100.3.0              255.255.255.0   100.100.1.7  100.100.1.10    1

在 NT 裡面的命令是﹕
 route   ADD 100.100.3.0     MASK 255.255.255.0   100.100.1.7  METRIC  1  IF
1

在 Linux 裡面的命令是﹕
route add -net 100.100.3.0 gw 100.100.1.7 netmask 255.255.255.0 dev eth0

>
>小弟認為是否為 Cisco Router 的問題(與網路A相連並上  Internet)
>在 Static Routing 中好像上層的 static routing table 必須要指對路徑
>,否則即使下層對了,也會無法相通!(小弟這麼說不知是否正確)

理應如此﹐因為 routing 都是雙向的。

>
>底下是我 Cisco Router 的 路徑表
>
>Router>sh ip route
>Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
>       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
>       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
>       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
>       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate
>default
>       U - per-user static route, o - ODR
>
>Gateway of last resort is 0.0.0.0 to network 0.0.0.0
>
>C    100.100.2.0/24 is directly connected, Ethernet0
>C    100.100.3.0/24 is directly connected, Ethernet0
>      100.100.1.0/26 is subnetted, 4 subnets
>C    100.100.1.0 is directly connected, Ethernet0
>S    100.100.1.64 [1/0] via 100.100.1.7
>S    100.100.1.128 [1/0] via 100.100.1.6
>S    100.100.1.192 [1/0] via 100.100.1.7
>
>     100.100.254.0/24 is variably subnetted, 2 subnets, 2 masks
>C    100.100.254.168/30 is directly connected, Serial0
>C    100.100.254.169/32 is directly connected, Serial0
>S*   0.0.0.0/0 is directly connected, Serial0

看上面這個 table ﹐犯著和 NT 主機上面相同的錯誤﹐就是少了通往網路 C 的路由資
訊。我不知道 cisco router 上面的指令﹐您將下面這個靜態路由加上應該沒問題了。
S    100.100.3.0 [1/0] via 100.100.1.7

至於再上層的 router 應該可以使用動態路由協定獲得網路 C 的資訊﹐如果不行﹐用
靜態路由試試吧。

>
>
>> >
>> >ps : 之前有位網友建議小弟將 routed 打開,小弟試著加上後,發現
>> >       除了多了三個UG外,也一樣無法解決,請問小弟該如何取消
>> >       routed的功能?謝謝!!
>>
>> 非常抱歉﹐我也沒設定過 routed 這個東東﹐實在不知道如何取消。不知道您是如

>加
>> 上去的呢﹖
>
>我是下一個指令 routed 之後就多了三個 UG 。
>


嗯﹐我 man 了一下 routed 也不得要領﹐或許您可以修改
/etc/sysconfig/static-routes 這個檔案看看吧。不過﹐其實那幾行 UG 留著也不礙
事啦﹐只是略嫌多餘罷了。