本產品的文件集力求使用無偏見用語。針對本文件集的目的,無偏見係定義為未根據年齡、身心障礙、性別、種族身分、民族身分、性別傾向、社會經濟地位及交織性表示歧視的用語。由於本產品軟體使用者介面中硬式編碼的語言、根據 RFP 文件使用的語言,或引用第三方產品的語言,因此本文件中可能會出現例外狀況。深入瞭解思科如何使用包容性用語。
思科已使用電腦和人工技術翻譯本文件,讓全世界的使用者能夠以自己的語言理解支援內容。請注意,即使是最佳機器翻譯,也不如專業譯者翻譯的內容準確。Cisco Systems, Inc. 對這些翻譯的準確度概不負責,並建議一律查看原始英文文件(提供連結)。
本文檔介紹如何在增強型內部網關路由協定(EIGRP)中配置預設路由。
Cisco建議您瞭解EIGRP。
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
在EIGRP中通告預設路由時可以使用以下方法,如本文所述:
1.使用預設路由和重分發
2.使用摘要地址
路由器R1、R2和R3配置了EIGRP,且R3和R4之間沒有運行EIGRP。
!
router eigrp 1 network 192.168.12.0
!
R1#show ip route
Codes: 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
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
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
D 192.168.23.0/24 [90/30720] via 192.168.12.2, 00:10:27, FastEthernet0/0
! router eigrp 1 network 192.168.12.0 network 192.168.23.0
!
R2#show ip route
Codes: 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
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
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
C 192.168.23.0/24 is directly connected, FastEthernet0/1
! router eigrp 1 network 192.168.23.0
!
R3#show ip route
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
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
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override
Gateway of last resort is not set
D 192.168.12.0/24
[90/28416] via 192.168.23.2, 00:05:16, GigabitEthernet0/0/1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.23.3/32 is directly connected, GigabitEthernet0/0/1
192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.34.0/24 is directly connected, Serial0/2/0
L 192.168.34.3/32 is directly connected, Serial0/2/0
此方法描述如何使用靜態預設路由通告EIGRP中的預設路由:
R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.34.4
R3#show ip route 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 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 o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override Gateway of last resort is 192.168.34.4 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 192.168.34.4 D 192.168.12.0/24 [90/28416] via 192.168.23.2, 00:59:18, GigabitEthernet0/0/1 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/1 L 192.168.23.3/32 is directly connected, GigabitEthernet0/0/1 192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.34.0/24 is directly connected, Serial0/2/0 L 192.168.34.3/32 is directly connected, Serial0/2/0
附註:在這種情況下,不能在EIGRP中使用network語句來通告0.0.0.0,因為它不是直接連線的。
靜態路由的重新分發在EIGRP下完成,如下所示:
R3(config)#router eigrp 1 R3(config-router)#redistribute static metric 100000 1000 255 1 1500
使用本節內容,確認您的組態是否正常運作。
R1#show ip route Codes: 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 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 o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.12.2 to network 0.0.0.0 C 192.168.12.0/24 is directly connected, FastEthernet0/0 D 192.168.23.0/24 [90/30720] via 192.168.12.2, 00:14:01, FastEthernet0/0 D*EX 0.0.0.0/0 [170/286720] via 192.168.12.2, 00:00:39, FastEthernet0/0
R2#show ip route Codes: 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 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 o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.23.3 to network 0.0.0.0 C 192.168.12.0/24 is directly connected, FastEthernet0/0 C 192.168.23.0/24 is directly connected, FastEthernet0/1 D*EX 0.0.0.0/0 [170/284160] via 192.168.23.3, 00:04:44, FastEthernet0/1
此方法使用EIGRP的彙總規則,如圖所示。
!
R3(config)#interface gigabitEthernet 0/0/1 R3(config-if)#ip summary-address eigrp 1 0.0.0.0 0.0.0.0
!
使用本節內容,確認您的組態是否正常運作。
R3#show ip route 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 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 o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP a - application route + - replicated route, % - next hop override Gateway of last resort is 0.0.0.0 to network 0.0.0.0 D* 0.0.0.0/0 is a summary, 00:00:06, Null0 D 192.168.12.0/24 [90/28416] via 192.168.23.2, 00:15:54, GigabitEthernet0/0/1 192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/1 L 192.168.23.3/32 is directly connected, GigabitEthernet0/0/1 192.168.34.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.34.0/24 is directly connected, Serial0/2/0 L 192.168.34.3/32 is directly connected, Serial0/2/0
R1和R2的路由表現在顯示從EIGRP獲知的預設路由:
R1#show ip route Codes: 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 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 o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.12.2 to network 0.0.0.0 C 192.168.12.0/24 is directly connected, FastEthernet0/0 D 192.168.23.0/24 [90/30720] via 192.168.12.2, 00:17:50, FastEthernet0/0 D* 0.0.0.0/0 [90/30976] via 192.168.12.2, 00:01:30, FastEthernet0/0
R2#show ip route Codes: 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 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 o - ODR, P - periodic downloaded static route Gateway of last resort is 192.168.23.3 to network 0.0.0.0 C 192.168.12.0/24 is directly connected, FastEthernet0/0 C 192.168.23.0/24 is directly connected, FastEthernet0/1 D* 0.0.0.0/0 [90/28416] via 192.168.23.3, 00:03:50, FastEthernet0/1
目前尚無適用於此組態的具體疑難排解資訊。