本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案將介紹通過影響不同的增強型內部閘道路由通訊協定(EIGRP)功能來建立優先路徑的過程。
思科建議您瞭解以下主題:
本檔案所述內容不限於特定軟體和硬體版本,但本檔案中的資訊是根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
EIGRP路徑選擇可能會通過操作協定用於確定到達目的地的最佳路徑的各種度量而受到影響。EIGRP根據不同的度量計算到達目標的最佳路徑,路徑選擇過程包括評估這些度量以確定最佳路由。EIGRP度量包括頻寬、延遲、負載、可靠性和最大傳輸單位(MTU)。瞭解這些度量及其重要性有助於網路管理員根據特定要求或網路條件修改EIGRP路徑選擇。預設情況下,EIGRP僅使用到達目的網路的路徑上的最小頻寬和計算路由度量的總延遲。此外,頻寬和延遲度量是根據介面上配置的靜態值來確定的,這些靜態值來自通向目的地的路徑上的裝置,換句話說,這兩個引數不是動態測量的。
除了度量操控,路由過濾還可用於影響EIGRP中的路徑選擇。路由過濾包括控制允許或拒絕進入或退出路由器路由表的資訊。過濾路由的原因多種多樣,包括最佳化路由表或管理網路流量。EIGRP中與路由過濾相關的一些關鍵功能包括:分發清單、字首清單、路由對映和洩漏對映。這些機製為控制路由資訊提供了一種強大而靈活的方式,網路管理員可以使用這些方式定製EIGRP路由表以滿足特定標準並提高網路效率。
在路由協定的動態環境中,管理員經常會發現自己需要調整路由決策,使之與特定的網路要求保持一致,並最佳化通訊流。這涉及利用各種技術和配置來影響路由器做出路徑選擇決策的方式。接下來的示例提供了不同的替代方案,管理員可以採用策略配置來操縱EIGRP路徑選擇。
1.影響力通過修改延遲度量來選擇路徑
通過調整路由器介面上的延遲度量,管理員可以通過影響鏈路上的此特定引數來影響路由決策。這種微妙的操作可以引導流量根據更改的延遲值選擇首選路徑。
2.使用偏移清單影響路徑選取
使用偏移清單能夠選擇性地修改特定字首的度量,從而提供影響特定介面上的路徑選擇的針對性方法。此機制用於增加通過EIGRP獲知的路由的傳入和傳出度量,並用於在特定路徑上選擇性地優先使用某些字首。
3.通過總結影響路徑選擇
引入總結路由後,管理員可以影響字首的最長匹配首選項。路由總結會影響路由決策的粒度,最佳化路由表並提高整體網路效率。
4.使用洩漏對映影響路徑選擇
在通告總結路由的過程中利用洩漏對映提供了選擇性通告更特定路由的機制。此方法可確保戰略性地公佈總結資訊,從而保持路由靈活性並影響路徑選擇。
5.通過修改字首的管理距離(AD)影響路徑選擇
更改字首的管理距離是控制路由資訊來源的有益方法。在需要從路由資訊庫(RIB)中排除來自某些來源的路由的情況下,此功能尤其有用。
6.通過路由過濾影響路徑選擇
路由過濾是一種功能強大的方法,用於控制路由協定內外的特定路由的通告或接受。它通常用於根據指定條件過濾路由資訊,防止某些路由被通告或獲知。
distribute-list是用於過濾EIGRP中的字首的主要工具之一,它可以與訪問清單(ACL)、字首清單或路由對映配合使用。
使用字首清單有助於從特定鄰居對字首進行粒度過濾。此控制級別對於管理路由更新以修改路徑首選項至關重要。
修改任何配置之前,必須檢查裝置的初始配置和狀態(每個方案的初始配置相同)。根據網路圖,R1、R2、R3和R4是EIGRP鄰居(每台路由器有兩個鄰接關係),R4也是中間系統到中間系統(IS-IS)域的一部分,並在IS-IS和EIGRP之間執行相互重分發。必須注意的是,R1的路由表中有兩條路徑(通過介面Gi1/0/3和Gi1/0/4)通過EIGRP到達10.20.x.x和10.30.x.x子網,而子網10.10.x.x直接連線。
R1 | |
組態 | 狀態 |
|
|
對於R2和R3,所有字首10.10.x.x、10.20.x.x和10.30.x.x都是通過EIGRP獲取的。
R2 | |
組態 | 狀態 |
|
|
R3 | |
組態 | 狀態 |
|
|
R4 | |
組態 | 狀態 |
|
|
在本例中,延遲值用於影響EIGRP,使其優先使用通過R3的路徑。 在進行任何更改之前,您可以確認EIGRP在介面Gi1/0/3和Gi1/04之間進行了負載均衡,因為這兩個介面具有相同的10微秒延遲值。
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
D EX 10.20.40.0/24
[170/66560] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
D EX 10.20.50.0/24
[170/66560] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
D EX 10.20.60.0/24
[170/66560] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
D 10.30.70.0/24 [90/16000] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
D 10.30.80.0/24 [90/16000] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
D 10.30.90.0/24 [90/16000] via 192.168.3.2, 5d22h, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 5d22h, GigabitEthernet1/0/4
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 1w5d, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 1w5d, GigabitEthernet1/0/3
R1#show interface GigabitEthernet1/0/3 | i DLY
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
R1#show interface GigabitEthernet1/0/4 | i DLY
MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec,
現在,我們修改並增大介面GigabitEthernet1/0/4的延遲。通過將延遲值更改為100(十微秒),RIB僅安裝通過介面Gi1/0/3的路徑。
通過檢視EIGRP拓撲表,您可以確認介面Gi1/0/4仍顯示為所有字首的可行後繼路由,並且總延遲較高。
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface GigabitEthernet1/0/4
R1(config-if)#delay 100
R1(config-if)#end
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
D EX 10.20.40.0/24
[170/66560] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D EX 10.20.50.0/24
[170/66560] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D EX 10.20.60.0/24
[170/66560] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D 10.30.70.0/24
[90/16000] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D 10.30.80.0/24
[90/16000] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D 10.30.90.0/24
[90/16000] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/20480] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
D 172.16.4.0 [90/15360] via 192.168.3.2, 00:05:52, GigabitEthernet1/0/3
R1#show interface GigabitEthernet1/0/4 | i DLY MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 1000 usec,
R1#show ip eigrp topology EIGRP-IPv4 VR(LAB) Topology Table for AS(100)/ID(192.168.3.1) Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply, r - reply Status, s - sia Status P 192.168.3.0/30, 1 successors, FD is 1310720 via Connected, GigabitEthernet1/0/3 P 10.30.70.0/24, 1 successors, FD is 2048000 via 192.168.3.2 (2048000/1392640), GigabitEthernet1/0/3 via 192.168.1.2 (66928640/1392640), GigabitEthernet1/0/4 P 10.20.50.0/24, 1 successors, FD is 8519680 via 192.168.3.2 (8519680/7864320), GigabitEthernet1/0/3 via 192.168.1.2 (73400320/7864320), GigabitEthernet1/0/4 P 10.30.80.0/24, 1 successors, FD is 2048000 via 192.168.3.2 (2048000/1392640), GigabitEthernet1/0/3 via 192.168.1.2 (66928640/1392640), GigabitEthernet1/0/4 P 172.16.2.0/30, 1 successors, FD is 2621440 via 192.168.3.2 (2621440/1966080), GigabitEthernet1/0/3 via 192.168.1.2 (66846720/1310720), GigabitEthernet1/0/4 P 10.10.30.0/24, 1 successors, FD is 163840 via Connected, Loopback30 P 10.20.60.0/24, 1 successors, FD is 8519680 via 192.168.3.2 (8519680/7864320), GigabitEthernet1/0/3 via 192.168.1.2 (73400320/7864320), GigabitEthernet1/0/4 P 192.168.1.0/30, 1 successors, FD is 66191360 via Connected, GigabitEthernet1/0/4 via 192.168.3.2 (3276800/2621440), GigabitEthernet1/0/3 P 10.20.40.0/24, 1 successors, FD is 8519680 via 192.168.3.2 (8519680/7864320), GigabitEthernet1/0/3 via 192.168.1.2 (73400320/7864320), GigabitEthernet1/0/4 P 10.10.20.0/24, 1 successors, FD is 163840 via Connected, Loopback20 P 10.30.90.0/24, 1 successors, FD is 2048000 via 192.168.3.2 (2048000/1392640), GigabitEthernet1/0/3 via 192.168.1.2 (66928640/1392640), GigabitEthernet1/0/4 P 172.16.4.0/30, 1 successors, FD is 1966080 via 192.168.3.2 (1966080/1310720), GigabitEthernet1/0/3 P 10.10.10.0/24, 1 successors, FD is 163840 via Connected, Loopback10
R1#show ip eigrp topology 10.20.40.0/24 EIGRP-IPv4 VR(LAB) Topology Entry for AS(100)/ID(192.168.3.1) for 10.20.40.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 8519680, RIB is 66560 Descriptor Blocks: 192.168.3.2 (GigabitEthernet1/0/3), from 192.168.3.2, Send flag is 0x0 Composite metric is (8519680/7864320), route is External Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 120000000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1 External data: AS number of route is 0 External protocol is IS-IS, external metric is 20 Administrator tag is 0 (0x00000000) 192.168.1.2 (GigabitEthernet1/0/4), from 192.168.1.2, Send flag is 0x0 Composite metric is (73400320/7864320), route is External Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 1110000000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1 External data: AS number of route is 0 External protocol is IS-IS, external metric is 20 Administrator tag is 0 (0x00000000) R1#traceroute 10.20.40.1 source loopback10 Type escape sequence to abort. Tracing the route to 10.20.40.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.3.2 1 msec 0 msec 0 msec 2 172.16.4.2 0 msec 0 msec 1 msec 3 172.16.6.2 1 msec 1 msec *
R1#show ip cef 10.20.40.1 10.20.40.0/24 nexthop 192.168.3.2 GigabitEthernet1/0/3
修改延遲是控制流量和改變整體網路行為的有用工具。延遲是基於路徑中每個網段的延遲而增長的累積值。還必須指出,鑑於頻寬可供其他協定計算使用,更改介面延遲引數是首選方法。但是,對延遲的更改僅在以下情況下有用:對於收到的所有路由,一條路徑優先於另一條路徑。
注意:選擇新的延遲值時請務必小心,您不希望將延遲增加至EIGRP不再將這些路由視為可行後繼路由的點。
在此案例中,會使用ACL來選取需要操縱的相關流量或首碼。ACL用於匹配這些字首,例如,新增下一個配置以操縱發往子網10.20.60.0/24和10.30.90.0/24的流量。
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#access-list 20 permit 10.20.60.0 0.0.0.255
R1(config)#access-list 30 permit 10.30.90.0 0.0.0.255
!
R1#show access-lists 20
Standard IP access list 20
10 permit 10.20.60.0, wildcard bits 0.0.0.255
R1#show access-lists 30
Standard IP access list 30
10 permit 10.30.90.0, wildcard bits 0.0.0.255
目的是修改特定字首的度量,但不影響所有其他EIGRP流量。此示例使用offset-list向R1入站方向的所選字首(10.20.60.0/24和10.30.90.0/24)的度量新增偏移。
其思想是在到達子網10.20.60.0/24(來自R1)時,優先使用通過介面Gi1/0/4通過R2的路徑,而在到達子網10.30.90.0/24(來自R1)時,優先使用通過介面Gi1/0/3通過R3的路徑。
此組態使用命令offset-list {ACL name|ACL number} {in|out} <offset> <interface>,如下所示:
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router eigrp LAB
R1(config-router)#address-family ipv4 unicast autonomous-system 100
R1(config-router-af)#topology base
R1(config-router-af-topology)#offset-list 20 in 200 GigabitEthernet1/0/3
R1(config-router-af-topology)#end
可以通過檢查RIB、轉發資訊庫(FIB)和EIGRP拓撲表來驗證配置結果。在接下來的輸出中,可以看到,應用到介面Gi1/0/3的偏移量影響了該特定字首的度量,換句話說,導致該路徑不可取:
R1#show ip route 10.20.60.0 Routing entry for 10.20.60.0/24 Known via "eigrp 100", distance 170, metric 66560, precedence routine (0), type external Redistributing via eigrp 100 Last update from 192.168.1.2 on GigabitEthernet1/0/4, 00:01:31 ago Routing Descriptor Blocks: * 192.168.1.2, from 192.168.1.2, 00:01:31 ago, via GigabitEthernet1/0/4 Route metric is 66560, traffic share count is 1 Total delay is 120 microseconds, minimum bandwidth is 1000000 Kbit Reliability 255/255, minimum MTU 1500 bytes Loading 1/255, Hops 2
R1#show ip cef 10.20.60.0 10.20.60.0/24 nexthop 192.168.1.2 GigabitEthernet1/0/4 R1#show ip eigrp topology 10.20.60.0/24 EIGRP-IPv4 VR(LAB) Topology Entry for AS(100)/ID(192.168.3.1) for 10.20.60.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 8519680, RIB is 66560 Descriptor Blocks: 192.168.1.2 (GigabitEthernet1/0/4), from 192.168.1.2, Send flag is 0x0 Composite metric is (8519680/7864320), route is External Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 120000000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1 External data: AS number of route is 0 External protocol is IS-IS, external metric is 20 Administrator tag is 0 (0x00000000) 192.168.3.2 (GigabitEthernet1/0/3), from 192.168.3.2, Send flag is 0x0 Composite metric is (8519880/7864520), route is External Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 120003052 picoseconds <--- Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1 External data: AS number of route is 0 External protocol is IS-IS, external metric is 20 Administrator tag is 0 (0x00000000)
對字首10.30.90.0/24完成了一個類似的過程,現在新增了偏移清單以優先使用通過介面Gi1/0/3的R3路徑(但將偏移應用於Gi1/0/4)。同樣,通過檢視RIB、FIB和EIGRP拓撲,可以看到所選字首的首選路徑是通過R3:
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router eigrp LAB
R1(config-router)#address-family ipv4 unicast autonomous-system 100
R1(config-router-af)#topology base
R1(config-router-af-topology)#offset-list 30 in 300 gigabitEthernet 1/0/4
R1(config-router-af-topology)#end
R1#show ip route 10.30.90.0
Routing entry for 10.30.90.0/24
Known via "eigrp 100", distance 90, metric 16000, precedence routine (0), type internal
Redistributing via eigrp 100
Last update from 192.168.3.2 on GigabitEthernet1/0/3, 00:00:25 ago
Routing Descriptor Blocks:
* 192.168.3.2, from 192.168.3.2, 00:00:25 ago, via GigabitEthernet1/0/3
Route metric is 16000, traffic share count is 1
Total delay is 21 microseconds, minimum bandwidth is 1000000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2
R1#show ip cef 10.30.90.0 10.30.90.0/24 nexthop 192.168.3.2 GigabitEthernet1/0/3
R1#show ip eigrp topology 10.30.90.0/24 EIGRP-IPv4 VR(LAB) Topology Entry for AS(100)/ID(192.168.3.1) for 10.30.90.0/24 State is Passive, Query origin flag is 1, 1 Successor(s), FD is 2048000, RIB is 16000 Descriptor Blocks: 192.168.3.2 (GigabitEthernet1/0/3), from 192.168.3.2, Send flag is 0x0 Composite metric is (2048000/1392640), route is Internal Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 21250000 picoseconds Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1 192.168.1.2 (GigabitEthernet1/0/4), from 192.168.1.2, Send flag is 0x0 Composite metric is (2048300/1392940), route is Internal Vector metric: Minimum bandwidth is 1000000 Kbit Total delay is 21254578 picoseconds <--- Reliability is 255/255 Load is 1/255 Minimum MTU is 1500 Hop count is 2 Originating router is 172.16.6.1
檢視show ip route eigrp命令,您可以確認配置成功,僅影響特定字首,並且所有其他路由保持完整。此外,運行traceroute可確認流量採用所需的路徑:
R1#show ip route eigrp Codes: L - local, C - connected, S - static, 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, m - OMP n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route H - NHRP, G - NHRP registered, g - NHRP registration summary o - ODR, P - periodic downloaded static route, l - LISP a - application route + - replicated route, % - next hop override, p - overrides from PfR & - replicated local route overrides by connected Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks D EX 10.20.40.0/24 [170/66560] via 192.168.3.2, 00:22:32, GigabitEthernet1/0/3 [170/66560] via 192.168.1.2, 00:22:32, GigabitEthernet1/0/4 D EX 10.20.50.0/24 [170/66560] via 192.168.3.2, 00:22:32, GigabitEthernet1/0/3 [170/66560] via 192.168.1.2, 00:22:32, GigabitEthernet1/0/4 D EX 10.20.60.0/24 [170/66560] via 192.168.1.2, 00:16:54, GigabitEthernet1/0/4 D 10.30.70.0/24 [90/16000] via 192.168.3.2, 00:22:32, GigabitEthernet1/0/3 [90/16000] via 192.168.1.2, 00:22:32, GigabitEthernet1/0/4 D 10.30.80.0/24 [90/16000] via 192.168.3.2, 00:22:32, GigabitEthernet1/0/3 [90/16000] via 192.168.1.2, 00:22:32, GigabitEthernet1/0/4 D 10.30.90.0/24 [90/16000] via 192.168.3.2, 00:04:56, GigabitEthernet1/0/3 172.16.0.0/30 is subnetted, 2 subnets D 172.16.2.0 [90/15360] via 192.168.1.2, 00:22:32, GigabitEthernet1/0/4 D 172.16.4.0 [90/15360] via 192.168.3.2, 00:22:32, GigabitEthernet1/0/3
R1#traceroute 10.20.60.1 source loop10 Type escape sequence to abort. Tracing the route to 10.20.60.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.1.2 1 msec 1 msec 0 msec <--- R2 2 172.16.2.2 1 msec 1 msec 0 msec 3 172.16.6.2 1 msec 1 msec * R1#traceroute 10.30.90.1 source loop10 Type escape sequence to abort. Tracing the route to 10.30.90.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.3.2 0 msec 1 msec 0 msec <--- R3 2 172.16.4.2 1 msec 1 msec *
在此案例中,路由總結用於優先使用一條路徑。EIGRP可以靈活地為每個介面配置總結路由,在本示例中,在R4上配置總結路由來總結10.30.x.x字首,並為10.20.x.x字首配置另一個字首。其思想是R4在介面GigabitEthernet1/0/1上通告彙總路由10.30.0.0/16,在介面GigabitEthernet1/0/2上通告彙總路由10.20.0.0/16,並利用此配置流量受最長匹配首選項的影響。這會導致從R1發往10.30.x.x子網的流量選擇通過R3的路徑,而發往子網10.20.x.x的流量選擇通過R2的路徑。配置如下圖所示:
R4#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router eigrp LAB
R4(config-router)#address-family ipv4 unicast autonomous-system 100
R4(config-router-af)#af-interface gigabitEthernet 1/0/1
R4(config-router-af-interface)#summary-address 10.30.0.0/16
R4(config-router-af-interface)#exit
R4(config-router-af)#af-interface gigabitEthernet 1/0/2
R4(config-router-af-interface)#summary-address 10.20.0.0/16
R4(config-router-af-interface)#end
R4#
現在,通過檢查R1的路由表,可以驗證存在通過介面GigabitEthernet1/0/3獲知的10.20.0.0/16的總結路由(連線到R3)和通過GigabitEthernet1/0/4獲知的總結路由10.30.0.0/16(連線到R2)。此配置的結果是,目的地為10.20.60.1的流量通過R2路由,目的地為10.30.90.1的流量通過R3路由。原因是R1優先使用仍通過其他介面獲知的最長匹配字首,並且可以通過FIB和traceroute輸出確認:
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 14 subnets, 3 masks
D 10.20.0.0/16 [90/66560] via 192.168.3.2, 00:00:16, GigabitEthernet1/0/3
D EX 10.20.40.0/24
[170/66560] via 192.168.1.2, 00:00:16, GigabitEthernet1/0/4
D EX 10.20.50.0/24
[170/66560] via 192.168.1.2, 00:00:16, GigabitEthernet1/0/4
D EX 10.20.60.0/24
[170/66560] via 192.168.1.2, 00:00:16, GigabitEthernet1/0/4
D 10.30.0.0/16 [90/16000] via 192.168.1.2, 00:00:44, GigabitEthernet1/0/4
D 10.30.70.0/24
[90/16000] via 192.168.3.2, 00:00:44, GigabitEthernet1/0/3
D 10.30.80.0/24
[90/16000] via 192.168.3.2, 00:00:44, GigabitEthernet1/0/3
D 10.30.90.0/24
[90/16000] via 192.168.3.2, 00:00:44, GigabitEthernet1/0/3
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 02:42:44, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 02:42:44, GigabitEthernet1/0/3
R1#show ip route 10.20.0.0
Routing entry for 10.20.0.0/16
Known via "eigrp 100", distance 90, metric 66560, precedence routine (0), type internal
Redistributing via eigrp 100
Last update from 192.168.3.2 on GigabitEthernet1/0/3, 00:12:07 ago
Routing Descriptor Blocks:
* 192.168.3.2, from 192.168.3.2, 00:12:07 ago, via GigabitEthernet1/0/3
Route metric is 66560, traffic share count is 1
Total delay is 120 microseconds, minimum bandwidth is 1000000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2
R1#show ip route 10.30.0.0
Routing entry for 10.30.0.0/16
Known via "eigrp 100", distance 90, metric 16000, precedence routine (0), type internal
Redistributing via eigrp 100
Last update from 192.168.1.2 on GigabitEthernet1/0/4, 00:12:50 ago
Routing Descriptor Blocks:
* 192.168.1.2, from 192.168.1.2, 00:12:50 ago, via GigabitEthernet1/0/4
Route metric is 16000, traffic share count is 1
Total delay is 21 microseconds, minimum bandwidth is 1000000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2
R1#show ip cef exact-route 10.10.10.1 10.20.60.1 10.10.10.1 -> 10.20.60.1 =>IP adj out of GigabitEthernet1/0/4, addr 192.168.1.2
R1#traceroute 10.20.60.1 source loop10 Type escape sequence to abort. Tracing the route to 10.20.60.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.1.2 1 msec 1 msec 0 msec <--- R2 2 172.16.2.2 1 msec 1 msec 0 msec 3 172.16.6.2 1 msec 1 msec * R1#show ip cef exact-route 10.10.10.1 10.30.90.1 10.10.10.1 -> 10.30.90.1 =>IP adj out of GigabitEthernet1/0/3, addr 192.168.3.2 R1#traceroute 10.30.90.1 source loop10 Type escape sequence to abort. Tracing the route to 10.30.90.1 VRF info: (vrf in name/id, vrf out name/id) 1 192.168.3.2 1 msec 0 msec 1 msec <--- R3 2 172.16.4.2 0 msec 1 msec *
在通告總結路由期間使用洩漏對映提供了一種靈活機制,以選擇性地通告更具體的路由,然後利用最長匹配來優先選擇期望的路徑。
在本例中,兩個介面(Gi1/0/1和Gi1/0/2)上均從R4通告總結路由10.0.0.0/8。我們來看一下組態:
R4#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#router eigrp LAB
R4(config-router)#address-family ipv4 unicast autonomous-system 100
R4(config-router-af)#af-interface GigabitEthernet1/0/1
R4(config-router-af-interface)#summary-address 10.0.0.0 255.0.0.0
R4(config-router-af-interface)#exit
R4(config-router-af)#af-interface GigabitEthernet1/0/2
R4(config-router-af-interface)#summary-address 10.0.0.0 255.0.0.0
R4(config-router-af-interface)#end
之前的配置反映在R1的路由表中,如下圖所示,但這仍會對R1的兩條路徑上的流量進行負載均衡:
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 7 subnets, 3 masks
D 10.0.0.0/8 [90/16000] via 192.168.3.2, 00:04:16, GigabitEthernet1/0/3 [90/16000] via 192.168.1.2, 00:04:16, GigabitEthernet1/0/4
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 03:50:08, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 03:50:08, GigabitEthernet1/0/3
但是,從R1到子網10.20.60.0/24和10.30.70.0/24的流量需要優先於GigabitEthernet1/0/4(連線到R2)。為實現此結果,可以在R4上配置一個洩漏對映,以洩漏更具體的字首,但保持總結就位。
R4#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#ip prefix-list LEAKED-PREFIXES permit 10.20.60.0/24
R4(config)#ip prefix-list LEAKED-PREFIXES permit 10.30.70.0/24
R4(config)#route-map LEAKED-PREFIXES R4(config-route-map)#match ip address prefix-list LEAKED-PREFIXES R4(config-route-map)#exit
R4(config)#router eigrp LAB
R4(config-router)#address-family ipv4 unicast autonomous-system 100
R4(config-router-af)#af-interface GigabitEthernet1/0/1
R4(config-router-af-interface)#summary-address 10.0.0.0 255.0.0.0 leak-map LEAKED-PREFIXES
R4(config-router-af-interface)#end
在應用先前的配置後,R1開始看到一個更具體的10.20.60.0/24和10.30.70.0/24條目,它們現在通過介面GigabitEthernet1/0/4獲知,如下所示:
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
D 10.0.0.0/8 [90/16000] via 192.168.3.2, 01:26:41, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 01:26:41, GigabitEthernet1/0/4
D EX 10.20.60.0/24 [170/66560] via 192.168.1.2, 00:01:29, GigabitEthernet1/0/4 D 10.30.70.0/24 [90/16000] via 192.168.1.2, 00:01:29, GigabitEthernet1/0/4
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 05:12:33, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 05:12:33, GigabitEthernet1/0/3
R1#show ip cef exact-route 10.10.10.1 10.20.60.1
10.10.10.1 -> 10.20.60.1 =>IP adj out of GigabitEthernet1/0/4, addr 192.168.1.2
R1#show ip cef exact-route 10.10.10.1 10.30.70.1
10.10.10.1 -> 10.30.70.1 =>IP adj out of GigabitEthernet1/0/4, addr 192.168.1.2
本示例的思路是修改字首10.30.90.0/24的AD,因此,發往它的流量可以通過R3路由。
注意:此方法也是影響EIGRP的另一種資源,但是,與使用Offset-List相比,此方法的優先順序較低。如果在同一台裝置上使用多個路由協定,請務必小心,因為此方法同樣會影響這些協定。
注意:此方法僅影響內部EIGRP路由,配置不會修改外部EIGRP路由的AD。
請注意,R1使用相同的度量從R2(192.168.1.2)和R3(192.168.3.2)學習路由10.30.90.0/24:
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
D EX 10.20.40.0/24
[170/66560] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D EX 10.20.50.0/24
[170/66560] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D EX 10.20.60.0/24
[170/66560] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D 10.30.70.0/24
[90/16000] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D 10.30.80.0/24
[90/16000] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D 10.30.90.0/24 [90/16000] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3 [90/16000] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 00:00:26, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 00:00:26, GigabitEthernet1/0/3
要完成更改,需要配置用於匹配所需子網的ACL,然後可以通過使用命令distance <route AD> <IP Source address> <Wildcard bits> <ACL>指定通告鄰居來修改字首的AD。
在本示例中,為了優先使用來自R3的通告,使用較低的AD值(85),使用萬用字元0.0.0.0新增R3 EIGRP鄰居(192.168.3.2)的IP地址,然後新增與字首匹配的ACL:
R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#access-list 30 permit 10.30.90.0 0.0.0.255 R1(config)#router eigrp LAB R1(config-router)#address-family ipv4 unicast autonomous-system 100 R1(config-router-af)#topology base R1(config-router-af-topology)#distance 85 192.168.3.2 0.0.0.0 30 R1(config-router-af-topology)#end
從R1的RIB和FIB輸出中可以看到此結果,其中10.30.90.0/24的路由條目將AD更改為85,而首選EIGRP鄰居是R3(192.168.3.2):
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
D EX 10.20.40.0/24
[170/66560] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D EX 10.20.50.0/24
[170/66560] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D EX 10.20.60.0/24
[170/66560] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
[170/66560] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D 10.30.70.0/24
[90/16000] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D 10.30.80.0/24
[90/16000] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
[90/16000] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D 10.30.90.0/24 [85/16000] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
172.16.0.0/30 is subnetted, 2 subnets
D 172.16.2.0 [90/15360] via 192.168.1.2, 00:00:14, GigabitEthernet1/0/4
D 172.16.4.0 [90/15360] via 192.168.3.2, 00:00:14, GigabitEthernet1/0/3
R1#show ip route 10.30.90.0
Routing entry for 10.30.90.0/24
Known via "eigrp 100", distance 85, metric 16000, precedence routine (0), type internal
Redistributing via eigrp 100
Last update from 192.168.3.2 on GigabitEthernet1/0/3, 00:00:31 ago
Routing Descriptor Blocks:
* 192.168.3.2, from 192.168.3.2, 00:00:31 ago, via GigabitEthernet1/0/3
Route metric is 16000, traffic share count is 1
Total delay is 21 microseconds, minimum bandwidth is 1000000 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 2
R1#show ip cef 10.30.90.0
10.30.90.0/24
nexthop 192.168.3.2 GigabitEthernet1/0/3
在本例中,我們的想法是通過過濾進入R1的某些路由或字首來選擇性地影響路徑選擇。
當目的地是下一子網10.30.70.0/24、10.30.80.0/24和10.20.40.0/24中的任意一個時,R1必須優先使用R2路徑。當目的地是子網10.30.90.0/24時,10.20.50.0/24和10.20.60.0/24 R1必須優先使用R3路徑。
為此,字首清單用於匹配所需的路由,並在EIGRP進程下配置分發清單以在入站方向應用路由過濾器,如下圖所示:
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip prefix-list R2-Preferred permit 10.30.70.0/24
R1(config)#ip prefix-list R2-Preferred permit 10.30.80.0/24
R1(config)#ip prefix-list R2-Preferred permit 10.20.40.0/24
R1(config)#
R1(config)#ip prefix-list R3-Preferred permit 10.30.90.0/24
R1(config)#ip prefix-list R3-Preferred permit 10.20.50.0/24
R1(config)#ip prefix-list R3-Preferred permit 10.20.60.0/24
R1(config)#router eigrp LAB
R1(config-router)#address-family ipv4 unicast autonomous-system 100
R1(config-router-af)#topology base
R1(config-router-af-topology)#distribute-list prefix R2-Preferred in GigabitEthernet1/0/4
R1(config-router-af-topology)#distribute-list prefix R3-Preferred in GigabitEthernet1/0/3
R1(config-router-af-topology)#end
注意:請注意,當使用ip prefix-list來匹配所需的路由時,應用distribute-list時需要「prefix」選項
註:使用偏移清單等方法之間的主要區別之一是,distribute-list阻止將不允許的字首插入RIB和EIGRP拓撲表。
結果是R1路由表顯示了所需的路徑選擇:
R1#show ip route eigrp
Codes: L - local, C - connected, S - static, 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, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
D EX 10.20.40.0/24
[170/66560] via 192.168.1.2, 00:00:12, GigabitEthernet1/0/4 <--- R2
D EX 10.20.50.0/24
[170/66560] via 192.168.3.2, 00:00:24, GigabitEthernet1/0/3 <--- R3
D EX 10.20.60.0/24
[170/66560] via 192.168.3.2, 00:00:24, GigabitEthernet1/0/3
D 10.30.70.0/24
[90/16000] via 192.168.1.2, 00:00:12, GigabitEthernet1/0/4
D 10.30.80.0/24
[90/16000] via 192.168.1.2, 00:00:12, GigabitEthernet1/0/4
D 10.30.90.0/24
[90/16000] via 192.168.3.2, 00:00:24, GigabitEthernet1/0/3
修訂 | 發佈日期 | 意見 |
---|---|---|
1.0 |
12-Jan-2024 |
初始版本 |