一,重分佈的定義
路由重分佈,是指鏈接到不同路由選擇域的邊界路由器在不同自主系統之間交換和通告路由選擇信息的能力。
二。重分佈的原則(我們必須理解重分佈的原則,否則對於重分佈所產生的問題將無從下手)
1,負責重分佈的路由器必須具有以被重分佈路由協議學到的路由條目或是具有被重分佈路由協議進程下的接口時,重分佈才能實現。
2,負責重分佈的路由器在重分佈前後路由表條目不發生改變。
下面通過一個個人認爲比較經典的重分佈實驗才論證這個原則:
實驗拓撲:
實驗要求:如圖配置各接口地址和路由協議;
按箭頭方向(順勢針)進行路由重分佈;
觀察各路由器的路由條目。
在實驗之前,我們不妨設想一下實驗的結果:(ps:就像本人當初想的一樣,衰~~~)
可能結果1:R1把rip-----》ospf,而ospf————》eigrp ,而eigrp-------》rip,哇!好大一個環路!無限的遞歸,嵌套........最後路由表將崩潰!
可能結果2:根本不會出現結果的情況,因爲比如拿R2來說當它的2.2.2.2 繞了一個彎再回來的時候根本不會再加這條路由,因爲本地已經有了優先級更高的直連2.2.2.2;可是R2應該可以學到R3的3.3.3.3,因爲本地沒有。相應的R3和R4也因如此。
好吧 其實上面兩種設想不無道理,但是都是錯的!關鍵是沒有理解重分佈的原則。
實驗配置:
第一步:配置各接口地址和路由協議(接口配置略)
R1:
router eigrp 100
network 14.1.1.1 0.0.0.0
auto-summary
!
router ospf 1
log-adjacency-changes
network 13.1.1.1 0.0.0.0 area 0
!
router rip
version 2
network 12.0.0.0
no auto-summary
R2:
router rip
version 2
network 0.0.0.0
no auto-summary
R3:
router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
R4:
router eigrp 100
network 0.0.0.0
no auto-summary
network 0.0.0.0
no auto-summary
第二步:在R1上配置路由重分佈:
router rip
version 2
redistribute eigrp 100 metric 1 (距離矢量協議重分佈時需指定metric)
!
router ospf 1
redistribute rip subnets (缺少關鍵字subnet,將無法對無類網絡進行重分佈)
redistribute rip subnets (缺少關鍵字subnet,將無法對無類網絡進行重分佈)
!
router eigrp 100
redistribute ospf 1 metric 10000 100 255 1 1500 (距離矢量協議重分佈時需指定metric)
redistribute ospf 1 metric 10000 100 255 1 1500 (距離矢量協議重分佈時需指定metric)
實現現象:
第一步完成後R1的路由表(未重分佈):
R1#sh ip route rip
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 12.1.1.2, 00:00:09, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 12.1.1.2, 00:00:09, Serial0/0
R1#sh ip route ospf
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 13.1.1.3, 00:06:15, Serial0/1
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 13.1.1.3, 00:06:15, Serial0/1
R1#sh ip route eigrp
4.0.0.0/32 is subnetted, 1 subnets
D 4.4.4.4 [90/409600] via 14.1.1.4, 00:06:36, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
D 4.4.4.4 [90/409600] via 14.1.1.4, 00:06:36, FastEthernet0/0
第二步完成後各路由器的路由表:
R1:
R1#sh ip route rip
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 12.1.1.2, 00:00:09, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 12.1.1.2, 00:00:09, Serial0/0
R1#sh ip route ospf
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 13.1.1.3, 00:06:15, Serial0/1
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 13.1.1.3, 00:06:15, Serial0/1
R1#sh ip route eigrp
4.0.0.0/32 is subnetted, 1 subnets
D 4.4.4.4 [90/409600] via 14.1.1.4, 00:06:36, FastEthernet0/0
4.0.0.0/32 is subnetted, 1 subnets
D 4.4.4.4 [90/409600] via 14.1.1.4, 00:06:36, FastEthernet0/0
以上驗證了原則2:“負責重分佈的路由器在重分佈前後路由表條目不發生改變”
R2:
R2#sh ip route rip
4.0.0.0/32 is subnetted, 1 subnets
R 4.4.4.4 [120/1] via 12.1.1.1, 00:00:05, Serial0/0 -----------------------------R1上以eigrp學到此條路由
14.0.0.0/24 is subnetted, 1 subnets
R 14.1.1.0 [120/1] via 12.1.1.1, 00:00:05, Serial0/0------------------------------該接口在R1的eigrp進程下
4.0.0.0/32 is subnetted, 1 subnets
R 4.4.4.4 [120/1] via 12.1.1.1, 00:00:05, Serial0/0 -----------------------------R1上以eigrp學到此條路由
14.0.0.0/24 is subnetted, 1 subnets
R 14.1.1.0 [120/1] via 12.1.1.1, 00:00:05, Serial0/0------------------------------該接口在R1的eigrp進程下
--------來自eigrp的引入------------------------------------------
(ps:無3.3.3.3吧)
R3:
R3#sh ip route ospf
2.0.0.0/32 is subnetted, 1 subnets
O E2 2.2.2.2 [110/20] via 13.1.1.1, 00:05:46, Serial0/1-----------------------------R1上以rip學到此條路由
12.0.0.0/24 is subnetted, 1 subnets
O E2 12.1.1.0 [110/20] via 13.1.1.1, 00:05:47, Serial0/1------------------------------該接口在R1的rip進程下
2.0.0.0/32 is subnetted, 1 subnets
O E2 2.2.2.2 [110/20] via 13.1.1.1, 00:05:46, Serial0/1-----------------------------R1上以rip學到此條路由
12.0.0.0/24 is subnetted, 1 subnets
O E2 12.1.1.0 [110/20] via 13.1.1.1, 00:05:47, Serial0/1------------------------------該接口在R1的rip進程下
----------------來自rip的引入------------------------------------
R4:
R4#sh ip route eigrp
3.0.0.0/32 is subnetted, 1 subnets
D EX 3.3.3.3 [170/307200] via 14.1.1.1, 00:06:26, FastEthernet0/0-----------------------------R1上以ospf學到此條路由
13.0.0.0/24 is subnetted, 1 subnets
D EX 13.1.1.0 [170/307200] via 14.1.1.1, 00:06:26, FastEthernet0/0 ---------------------該接口在R1的ospf進程下
D EX 3.3.3.3 [170/307200] via 14.1.1.1, 00:06:26, FastEthernet0/0-----------------------------R1上以ospf學到此條路由
13.0.0.0/24 is subnetted, 1 subnets
D EX 13.1.1.0 [170/307200] via 14.1.1.1, 00:06:26, FastEthernet0/0 ---------------------該接口在R1的ospf進程下
-------------------來自ospf的引入--------------------------------------------
可見未在相應路由進程下的條目無法被重分佈,說明我們之前的假設是錯誤的!
以上驗證了第一條原則:1,負責重分佈的路由器必須具有以被重分佈路由協議學到的路由條目或是具有被重分佈路由協議進程下的接口時,重分佈才能實現。
只有正確理解的路由重分佈的原則,才能正確處理後期因路由重分佈所產生的路由環路,路由不優等問題,才能摒棄比如:“被重分發的路由不能再被重分佈“的錯誤論斷!。。。。
PS:覺得把原則說成“在負責重分佈的路由器上,不管有沒有進行重分佈,被重分佈的路由必須以被重分佈路由協議的形式學到。”可能更加容易理解。
|
|
\/
這是進行雙點雙向重分佈時有時候同時只能有一個邊界路由器可以成功重分佈的最重要也是最關鍵因素!!