本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本檔案說明透過影響不同的增強型內部閘道路由通訊協定(EIGRP)功能來建立偏好路徑的程式。
思科建議您瞭解以下主題:
本檔案所述內容不限於特定軟體和硬體版本,不過,本檔案中的資訊是根據以下軟體和硬體版本所建立:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
EIGRP路徑選擇可能透過處理協定用於確定到達目的地的最佳路徑的各種度量而受到影響。EIGRP根據不同的度量計算到達目的地的最佳路徑,路徑選擇過程包括評估這些度量以確定最佳路由。EIGRP度量包括頻寬、延遲、負載、可靠性和最大傳輸單元(MTU)。瞭解這些度量及其重要性有助於網路管理員根據特定要求或網路條件修改EIGRP路徑選擇。預設情況下,根據不同的度量值,EIGRP僅使用通往目標網路的路徑上的最小頻寬和總延遲來計算路由度量。此外,頻寬和延遲度量是根據介面上配置的靜態值確定的,這些靜態值來自沿路徑到達目的地的裝置,換言之,這兩個引數不是動態測量的。
除度量處理外,還可以使用路由過濾來影響EIGRP中的路徑選擇。路由過濾包括控制允許或拒絕進入或退出路由器路由表的資訊。過濾路由的原因多種多樣,包括最佳化路由表或管理網路流量。EIGRP中與路由過濾相關的部分關鍵功能包括:分發清單、字首清單、路由對映和洩漏對映。這些機製為控制路由資訊提供了一種強大而靈活的方法,網路管理員可以使用這些方法定製EIGRP路由表以滿足特定條件並提高網路效率。
在路由協定的動態環境中,管理員經常會發現自己需要定製路由決策以符合特定的網路要求並最佳化流量。這包括利用各種技術和配置來影響路由器做出路徑選擇決策的方式。以下示例提供了不同的替代方案,管理員可以採用策略配置來控制EIGRP路徑選擇。
1.透過修改延遲度量來影響路徑選擇
透過調整路由器介面上的延遲度量,管理員可以透過影響鏈路上的此特定引數來影響路由決策。這種細微的操作可以引導流量根據更改的延遲值選擇首選路徑。
2. 使用offset-list影響路徑選取
使用偏移清單可以對特定字首的度量進行選擇性修改,從而提供一種目標方法來影響特定介面上的路徑選擇。此機制用於增加透過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,
現在,我們修改並增加千兆乙太網介面1/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完成了一個類似的過程,現在增加了offset-list以首選透過介面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 *
在通告總結路由期間使用洩漏對映提供了一種靈活機制,可有選擇地通告更具體的路由,然後利用最長匹配來首選期望的路徑。
在本示例中,彙總路由10.0.0.0/8從兩個介面(Gi1/0/1和Gi1/0/2)上的R4通告。讓我們來看看配置:
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鄰居的IP地址(192.168.3.2),然後增加與字首匹配的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」選項
注意:使用offset-list等方法之間的主要區別之一是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 |
初始版本 |