課題內容:雙點雙向重分佈解決方案 (EIGRP vs OSPF)redis
目標:掌握企業網多協議互操做場景中多點雙向重分佈應用解決方案;網絡
拓撲:ide
拓撲介紹:oop
EIGRP自治系統號碼爲 90,其中R3的環回口 0 33.1.1.1/32宣告進EIGRP,環回口 10 33.1.2.1/32重分佈進EIGRP;學習
OSPF全部設備進程號爲 110,區域爲 0,R2的環回口 0宣告進入OSPF;字體
配置IP地址及路由協議 (步驟省略)this
驗證:spa
pingorm
show ip interface briefrouter
show ip ospf neighbor
show ip ospf interface brief
show ip eigrp neighbor
show ip eigrp interface
show ip route
在R1和R4兩臺ASBR上執行雙點雙向重分佈
R一、R4
router ospf 110
redistribute eigrp 90 subnets
router eigrp 90
redistribute ospf 110 metric 1544 2000 255 1 1500
驗證重分佈效果:
R3#show ip route eigrp | begin Gateway
Gateway of last resort is not set
12.0.0.0/24 is subnetted, 1 subnets
D EX 12.1.1.0 [170/2195456] via 10.1.1.4, 00:00:29, Ethernet0/2
[170/2195456] via 10.1.1.1, 00:00:29, Ethernet0/2
22.0.0.0/32 is subnetted, 1 subnets
D EX 22.1.1.1 [170/2195456] via 10.1.1.4, 00:00:29, Ethernet0/2
[170/2195456] via 10.1.1.1, 00:00:29, Ethernet0/2
24.0.0.0/24 is subnetted, 1 subnets
D EX 24.1.1.0 [170/2195456] via 10.1.1.4, 00:00:29, Ethernet0/2
[170/2195456] via 10.1.1.1, 00:00:29, Ethernet0/2
R2#show ip route ospf | begin Gateway
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
O E2 10.1.1.0 [110/20] via 24.1.1.4, 00:03:31, Serial1/1
[110/20] via 12.1.1.1, 00:03:46, Serial1/0
33.0.0.0/32 is subnetted, 1 subnets
O E2 33.1.1.1 [110/20] via 24.1.1.4, 00:03:31, Serial1/1
[110/20] via 12.1.1.1, 00:03:46, Serial1/0
在R3上將一條直連路由重分佈進入EIGRP,模擬來自EIGRP外部的路由;
同時,爲了便於管理及操控,咱們爲該路由作上標記 爲 6.6.6.6
route-tag notation dotted-decimal //將路由標記顯示爲 點分十進制
route-map RED permit 10 //定義一個route-map
match interface Loopback10 //僅僅將環回口 10 的網絡重分佈進入 EIGRP
set tag 6.6.6.6 //爲引入的前綴打上標記,標記值爲 6.6.6.6
驗證:
R3#show ip eigrp topology all-links //在R3的EIGRP拓撲表中竟然可以從R1和R4兩個方向收取到關於自身引入的外部路由的信息;
P 33.1.2.1/32, 1 successors, FD is 128256, tag is 6.6.6.6, serno 6
via Rconnected (128256/0)
via 10.1.1.1 (2195456/2169856), Ethernet0/2
via 10.1.1.4 (2195456/2169856), Ethernet0/2, serno 87
R1#show ip route eigrp //在R1和R4兩臺設備上觀察EIGRP路由,關於33.1.2.1/32的路由處於不穩定狀態,一下子有一下子沒有
由此引起出次優路徑,以及數據轉發環路等問題:
R1#traceroute 33.1.2.1 numeric
Type escape sequence to abort.
Tracing the route to 33.1.2.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.1.1.3 1 msec *
12.1.1.2 9 msec
R1#traceroute 33.1.2.1 numeric
Type escape sequence to abort.
Tracing the route to 33.1.2.1
VRF info: (vrf in name/id, vrf out name/id)
1 12.1.1.2 7 msec 8 msec 9 msec
2 24.1.1.4 18 msec 17 msec 18 msec
3 24.1.1.2 18 msec 11 msec 17 msec
4 24.1.1.4 27 msec 26 msec 27 msec
5 24.1.1.2 26 msec 27 msec 26 msec
6 24.1.1.4 32 msec 35 msec 35 msec
7 24.1.1.2 29 msec 36 msec 35 msec
8 24.1.1.4 38 msec 44 msec 39 msec
9 24.1.1.2 43 msec 44 msec 39 msec
10 24.1.1.4 52 msec 48 msec 52 msec
11 24.1.1.2 48 msec 52 msec 48 msec
12 24.1.1.4 61 msec 56 msec 57 msec
13 24.1.1.2 61 msec 56 msec 62 msec
14 24.1.1.4 64 msec 65 msec 70 msec
15 24.1.1.2 65 msec 65 msec
10.1.1.3 50 msec
解決方案:
經過修改管理距離來避免次優路徑的產生,從而預防數據轉發不按照管理員意願的狀況出現;
行之有效的修改方法,就是將OSPF協議外部路由的管理距離修改成大於EIGRP外部路由的管理距離;
R一、R4
router ospf 110
distance ospf external 175
驗證:
R1#show ip protocols | section ospf
Redistributing: ospf 110
Routing Protocol is "ospf 110"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Router ID 11.1.1.1
It is an autonomous system boundary router
Redistributing External Routes from,
eigrp 90, includes subnets in redistribution
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Maximum path: 4
Routing for Networks:
Routing on Interfaces Configured Explicitly (Area 0):
Serial1/0
Routing Information Sources:
Gateway Distance Last Update
22.1.1.1 110 00:00:59
44.1.1.1 175 00:00:54
Distance: intra-area 110 inter-area 110 external 175
R4#show ip route eigrp | begin Gateway //R1和R4的路由表都變得穩定,再也不翻動//
Gateway of last resort is not set
33.0.0.0/32 is subnetted, 2 subnets
D 33.1.1.1 [90/409600] via 10.1.1.3, 00:40:27, Ethernet0/2
D EX 33.1.2.1 [170/409600] via 10.1.1.3, 00:00:55, Ethernet0/2
小結:經過在上述環境中修改OSPF的外部路由管理距離,能夠預防因爲網絡中存在EIGRP外部路由而產生的次優路徑問題;
事實證實,這種解決方案在現有環境是可行且行之有效的;
那麼問題來了,若是如今R2上產生了一個OSPF外部路由,這個網絡還會不會處於穩定狀態?
在R2上建立環回口 10,配置IP地址爲 22.1.2.1/32,並重分佈進入OSPF,設置標記爲 8.8.8.8
interface Loopback10
ip address 22.1.2.1 255.255.255.255
route-map RED permit 10
match interface Loopback10
set tag 134744072
router ospf 110
redistribute connected subnets route-map RED
驗證:
R2#show ip os database | begin Type-5
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
10.1.1.0 11.1.1.1 690 0x80000002 0x00D3B1 0
10.1.1.0 44.1.1.1 673 0x80000002 0x00A9BA 0
22.1.2.1 22.1.1.1 105 0x80000001 0x00D27A 134744072
22.1.2.1 44.1.1.1 102 0x80000001 0x000C2B 134744072
33.1.1.1 11.1.1.1 690 0x80000002 0x009DCF 0
33.1.1.1 44.1.1.1 673 0x80000002 0x0073D8 0
33.1.2.1 11.1.1.1 925 0x80000119 0x00EE4D 101058054
33.1.2.1 44.1.1.1 595 0x80000001 0x00F73C 101058054
嚴重注意紅色字體,很明顯的,發現源自於R2的22.1.2.1/32這條前綴,卻由R4產生了一個外部LSA,這是正常的,但顯然不是咱們想要的結果;
R4#show ip route 22.1.2.1
Routing entry for 22.1.2.1/32
Known via "eigrp 90", distance 170, metric 2195456
Tag 8.8.8.8, type external
Redistributing via eigrp 90, ospf 110
Advertised by ospf 110 subnets
Last update from 10.1.1.1 on Ethernet0/2, 00:09:42 ago
Routing Descriptor Blocks:
* 10.1.1.1, from 10.1.1.1, 00:09:42 ago, via Ethernet0/2
Route metric is 2195456, traffic share count is 1
Total delay is 21000 microseconds, minimum bandwidth is 1544 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
Route tag 8.8.8.8
因爲OSPF的外部路由管理距離已經修改成 175,所以當前的EIGRP外部路由管理距離 170更加優先;
次優路徑再次出現;
引入另外一種解決方案:
經過路由共同點,tag或者源協議、源網關等屬性,來針對路由作批量操控
既然要引入新的解決方案,咱們暫時放棄全部關於管理距離的配置,將其刪除掉;(步驟省略)
分析問題根源:
R2和R3相互須要學習到來自對方協議的路由,並且還包括對方協議的外部路由;
如今R2和R3並不參與路由重分佈操做,次優路徑也僅僅存在於R1和R4兩臺ASBR上;
如今須要操控的就是ASBR上的路由表;
經過應用分發列表,來在in方向控制ASBR上的路由表;
鏈路狀態型協議,in方向僅僅影響本設備;
首先解決來自EIGRP的外部路由的次優路徑問題;
在R1和R4上應用分發列表,阻止來自OSPF域內的關於EIGRP外部路由前綴的路由放入OSPF路由表;
配置:
R一、R4 //定義一個route-map
route-map OO deny 10
match tag 6.6.6.6 //拒絕掉全部攜帶TAG爲 6.6.6.6的前綴
route-map OO permit 20 //放行其它全部路由
應用分發列表 (R一、R4)
R1(config)#router ospf 110
R1(config-router)#distribute-list route-map OO in
驗證:
R1#show ip route 33.1.2.1
Routing entry for 33.1.2.1/32
Known via "eigrp 90", distance 170, metric 409600
Tag 6.6.6.6, type external
Redistributing via eigrp 90, ospf 110
Advertised by ospf 110 subnets
Last update from 10.1.1.3 on Ethernet0/2, 00:00:49 ago
Routing Descriptor Blocks:
* 10.1.1.3, from 10.1.1.3, 00:00:49 ago, via Ethernet0/2
Route metric is 409600, traffic share count is 1
Total delay is 6000 microseconds, minimum bandwidth is 10000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
Route tag 6.6.6.6
R4#show ip route 33.1.2.1
Routing entry for 33.1.2.1/32
Known via "eigrp 90", distance 170, metric 409600
Tag 6.6.6.6, type external
Redistributing via eigrp 90, ospf 110
Advertised by ospf 110 subnets
Last update from 10.1.1.3 on Ethernet0/2, 00:00:59 ago
Routing Descriptor Blocks:
* 10.1.1.3, from 10.1.1.3, 00:00:59 ago, via Ethernet0/2
Route metric is 409600, traffic share count is 1
Total delay is 6000 microseconds, minimum bandwidth is 10000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1
Route tag 6.6.6.6
R1#show ip route 22.1.2.1
Routing entry for 22.1.2.1/32
Known via "ospf 110", distance 110, metric 20
Tag 8.8.8.8, type extern 2, forward metric 64
Redistributing via eigrp 90
Advertised by eigrp 90 metric 1544 2000 255 1 1500
Last update from 12.1.1.2 on Serial1/0, 00:04:24 ago
Routing Descriptor Blocks:
* 12.1.1.2, from 22.1.1.1, 00:04:24 ago, via Serial1/0
Route metric is 20, traffic share count is 1
Route tag 8.8.8.8
R4#show ip route 22.1.2.1
Routing entry for 22.1.2.1/32
Known via "ospf 110", distance 110, metric 20
Tag 8.8.8.8, type extern 2, forward metric 64
Redistributing via eigrp 90
Advertised by eigrp 90 metric 1544 2000 255 1 1500
Last update from 24.1.1.2 on Serial1/1, 00:00:51 ago
Routing Descriptor Blocks:
* 24.1.1.2, from 22.1.1.1, 00:00:51 ago, via Serial1/1
Route metric is 20, traffic share count is 1
Route tag 8.8.8.8
那麼,關於OSPF外部路由的次優路徑問題也解決了;
總結:經過分發列表在ASBR的鏈路狀態型路由協議in方向作干涉,是一個很巧妙的行爲,既可以避免ASBR上的路由表加載次優路徑,又不影響鏈路狀態型協議自治系統內其它設備的路由學習和傳遞;