此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 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
目前没有针对此配置的故障排除信息。