此产品的文档集力求使用非歧视性语言。在本文档集中,非歧视性语言是指不隐含针对年龄、残障、性别、种族身份、族群身份、性取向、社会经济地位和交叉性的歧视的语言。由于产品软件的用户界面中使用的硬编码语言、基于 RFP 文档使用的语言或引用的第三方产品使用的语言,文档中可能无法确保完全使用非歧视性语言。 深入了解思科如何使用包容性语言。
思科采用人工翻译与机器翻译相结合的方式将此文档翻译成不同语言,希望全球的用户都能通过各自的语言得到支持性的内容。 请注意:即使是最好的机器翻译,其准确度也不及专业翻译人员的水平。 Cisco Systems, Inc. 对于翻译的准确性不承担任何责任,并建议您总是参考英文原始文档(已提供链接)。
本文档介绍如何将路由协议(连接路由或静态路由)重分发到另一个动态路由协议中。
本文档没有任何特定的要求。
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
有关文档规则的详细信息,请参阅 Cisco 技术提示规则。
当必须重新分发单个路由协议时,可以考虑通过多个协议路由进行分发。当公司合并、多个部门由多个网络管理员管理以及多供应商环境时,使用多协议路由。网络设计的一部分是运行不同的路由协议。在任何情况下,当您拥有多协议环境时,重分发都是必要的。
路由协议特性(例如度量、管理距离、有类和无类功能)的差异可能影响再分配。要成功进行再分配,必须考虑这些差异。
当您将一个协议再分配到另一个时,切记每个协议权值在再分配中都扮演很重要的角色。每个协议都使用不同的度量。例如,路由信息协议(RIP)度量基于跳数。内部网关路由协议(IGRP)和增强型内部网关路由协议(EIGRP)都使用基于带宽、延迟、可靠性、负载和最大传输单位(MTU)的复合度量,其中带宽和延迟是默认使用的唯一参数。重分发路由时,必须为接收的路由可以理解的协议定义度量。重分发路由时,有两种方法可以定义度量。
OSPF和RIP拓扑
1.您只能定义该特定重分发的度量:
router rip redistribute static metric 1 redistribute ospf 1 metric 1
2.对于所有重分发,您可以使用与默认度量相同的度量(使用 default-metric 命令可以保存您的工作量,因为它无需为每个重分发分别定义度量):
router rip redistribute static redistribute ospf 1 default-metric 1
如果路由器运行多个路由协议,并且获取到使用两个路由协议到达同一目的地的路由,则必须选择哪个路由作为最佳路由?每个协议都使用自己的度量类型来确定最佳路由。不能比较具有不同度量类型的路由。使用管理距离可以解决此问题。管理距离将分配给路由来源,以便从最首选来源选择的路由可以成为最佳路径。有关管理距离和路由选择的更多信息,请参阅 Cisco 路由器的路由选择。
管理距离有助于在不同路由协议中选择路由,但它们可能引起重分配问题。这些问题可能体现为路由环路、收敛问题或低效率路由。请参见下图,其中显示拓扑和可能问题的说明。
潜在问题的拓扑
在上一个拓扑示例中,如果R1运行RIP,并且R2和R5都运行RIP和IGRP并将RIP重分布到IGRP,则可能存在问题。例如,R2和R5都通过RIP从R1获知网络192.168.1.0。此知识再分配到 IGRP 中。 R2通过R3获知网络192.168.1.0,R5通过IGRP从R4获知该网络。IGRP 比 RIP 的管理距离短(100 比 120);因此,IGRP路由用于路由表中。在这种情况下,可能会产生一个路由环路。即使使用了水平分割或有助于防止路由环路的其他功能,仍存在收敛问题。
如果R2和R5也将IGRP重分发到RIP(这是相互重分发),并且网络192.168.1.0没有直接连接到R1(R1从它上游的另一台路由器获知),则可能存在问题,即R1可以从R2或R5获知网络,其度量优于从原始源。
注意:路由再分配机制是 Cisco 路由器的专有特性。Cisco 路由器上的再分配规则指明:被重新分配的路由显示在路由表中。路由存在于路由拓扑或数据库中的条件并不充足。具有较低管理距离(AD)的路由始终会安装到路由表中。例如,如果静态路由再分配到R5上的IGRP,而IGRP又按顺序被再分配到同一路由器(R5)上的RIP中,则该静态路由并不能再分配到RIP,因为它根本没进入IGRP路由表。这是因为静态路由值为 1 的 AD,而 IGRP 路由有值为 100 的 AD,并且静态路由安装在路由表里。要在R5上将静态路由重分布到IGRP中,您需要在router rip命令下使用redistribute static命令。
按照路由协议,当某个 network 语句包括连接接口子网时,RIP、IGRP 和 EIGRP 的默认行为将通告直接连接路由。有两种方法可获得已连接的路由:
Router#conf t Router(config)#ip route 10.0.77.0 255.255.255.0 ethernet 0/0 Router(config)#end Router#show ip route static 10.0.0.0/24 is subnetted, 1 subnets S 10.0.77.0 is directly connected, Ethernet0/0
在包含(或“涵盖”)任意这些类型连接的路由的 EIGRP、RIP 或 IGRP 下配置的 network 命令含有通告的子网。
例如,如果接口的地址为10.0.23.1,掩码为255.255.255.0,则子网10.0.23.0/24为已连接的路由,并且当配置了network语句时,这些路由协议可以通告它:
router rip | igrp # | eigrp # network 10.0.0.0
10.0.77.0/24 这个静态路由也由这些路由协议进行通告,因为它是连接路由并被 network 语句“覆盖”。
有关详细信息,请参阅本文档的避免重分发引起的问题部分。
此输出显示重新分发静态、开放最短路径优先(OSPF)、RIP和中间系统到中间系统(IS-IS)路由的IGRP/EIGRP路由器。
router igrp/eigrp 1 network 10.10.108.0 redistribute static redistribute ospf 1 redistribute rip redistribute isis default-metric 10000 100 255 1 1500
IGRP和EIGRP在重新分发其他协议时需要五个度量:分别是带宽、延迟、可靠性、负载和 MTU。下表列出了IGRP度量的示例。
量度 |
价值 |
带宽 |
单位为千位每秒;以太网为 10000 |
延迟 |
单位为十微秒;对于以太网,该值为 100 x 10 微秒 = 1 毫秒 |
可靠性 |
255 对应于 100% 可靠性 |
负载 |
链路上的有效负载以0到255之间的数字表示(255是100%负载) |
MTU |
路径的最小 MTU;通常与以太网接口相等,即 1500 字节 |
如果在进程之间使用再分配,则可以在同一个路由器上运行多个 IGRP 和 EIGRP 进程。例如,IGRP1 和 IGRP2 可在同一个路由器上运行。但是,您不需要在同一路由器上运行两个相同协议的进程,这会占用路由器的内存和CPU。将IGRP/EIGRP重分配到另一个IGRP/EIGRP进程不需要任何度量转换,因此不需要定义度量或将default-metric命令与重分配一起使用。
重分发的静态路由优先于汇总路由,因为静态路由的管理距离为1,而EIGRP汇总路由的管理距离为5。当使用重新分发静态路由时,会出现这种情况 redistribute static
命令,并且EIGRP进程具有默认路由。
此输出显示重新分发静态、RIP、IGRP、EIGRP和IS-IS路由的OSPF路由器。
router ospf 1 network 10.10.108.0 0.0.255.255 area 0 redistribute static metric 200 subnets redistribute rip metric 200 subnets redistribute igrp 1 metric 100 subnets redistribute eigrp 1 metric 100 subnets redistribute isis metric 10 subnets
OSPF权值是基于链路的位/秒单位的108/带宽的成本值。例如,以太网的OSPF开销为10:108/107 = 10
注意:如果未指定度量,则OSPF在重分发来自所有协议的路由时会将默认值设为20,边界网关协议(BGP)路由除外,其度量为1。
当存在子网划分的主网络时,需要使用关键字sub-netted将协议重分发到OSPF。 如果没有此关键字,OSPF只会重分发未划分子网的主网。
可以在同一个路由器上运行多个 OSPF 进程。这很少需要,而且会占用路由器内存和CPU。
将一个OSPF进程重分布到另一个OSPF进程时,无需定义度量或使用default-metric命令。
注意:本文档的原则适用于 RIP I 和 II 版本。
此输出显示重新分发静态、IGRP、EIGRP、OSPF和IS-IS路由的RIP路由器:
router rip network 10.10.108.0 redistribute static redistribute igrp 1 redistribute eigrp 1 redistribute ospf 1 redistribute isis default-metric 1
RIP度量由跳数组成,最大有效度量为15。大于15的则视为无穷大;您可以使用 16 来表示在 RIP 中使用无限度量。将协议重新分发到RIP时,Cisco建议您使用低度量,如1。高度量,如10,会进一步限制RIP。如果为重分发的路由定义度量为10,则这些路由只会通告到相隔最多5跳的路由器,此时度量(跳数)会超过15。如果定义度量为1,则会使路由在RIP域中传输最大跳数。但是,如果存在多个重分发点,并且路由器从重分发点获取的网络度量比从原始源获取的度量更好,这会增加路由环路的可能性。因此,您必须确保度量不是太高(防止路由通告到所有路由器),也不是太低(当有多个重分发点时,会导致路由环路)。
此配置示例说明如何通过路由映射在RIP中重分发除最后网关选用网关外的静态路由。
以下是此示例的初始配置:
router rip version 2 network 10.0.0.0 default-information originate no auto-summary ! ip forward-protocol nd ip route 0.0.0.0 0.0.0.0 10.32.32.3 ip route 10.32.42.211 255.255.255.255 192.168.0.102 ip route 10.98.0.0 255.255.255.0 10.32.32.1 ip route 10.99.0.0 255.255.255.0 10.32.32.1 ip route 10.99.99.0 255.255.255.252 10.32.32.5 ip route 10.129.103.128 255.255.255.240 10.32.31.1 ip route 172.16.231.0 255.255.255.0 10.32.32.5
ip route 172.16.28.0 255.255.252.0 10.32.32.5
ip route 192.168.248.0 255.255.255.0 10.32.32.5
ip route 192.168.0.43 255.255.255.0 10.32.32.5
ip route 192.168.0.103 255.255.255.0 10.32.32.5
要创建此配置,请执行以下操作:
1.创建访问列表以匹配需要重新分发的所有网络:
Router#show access-lists 10 Standard IP access list 10 10 permit 10.32.42.211 20 permit 10.98.0.0, wildcard bits 0.0.0.255 30 permit 10.99.0.0, wildcard bits 0.0.0.255 40 permit 10.129.103.128, wildcard bits 0.0.0.15 50 permit 172.16.231.0, wildcard bits 0.0.0.255< 60 permit 172.16.28.0, wildcard bits 0.0.3.255 70 permit 192.168.248.0, wildcard bits 0.0.0.255 80 permit 192.168.0.43, wildcard bits 0.0.0.255
90 permit 192.168.0.103, wildcard bits 0.0.0.255
2.在路由映射中调用此访问列表。
Route-map TEST Match ip address 10
3.使用路由映射在RIP中重分布,并从RIP过程中删除default information originate命令。
Router RIP version 2 network 10.0.0.0 redistribute static route-map TEST no auto-summary
此输出显示重新分发静态、RIP、IGRP、EIGRP和OSPF路由的IS-IS路由器。
router isis network 49.1234.1111.1111.1111.00 redistribute static redistribute rip metric 20 redistribute igrp 1 metric 20 redistribute eigrp 1 metric 20 redistribute ospf 1 metric 20
IS-IS度量必须介于1和63之间。IS-IS中没有默认度量选项。必须为每个协议定义一个度量,如上一个示例所示。如果没有为重分发到IS-IS的路由指定度量,则默认使用度量值0。
将连接的网络直接重分布到路由协议中并不常见,因此本文档中的任何示例都没有显示这种做法。然而,必须注意的是,可以直接和间接地做到这一点。要直接再分配已连接的路由,请使用 redistribute connected router 配置命令。在这种情况下,还必须定义度量。您还可以间接将连接的路由重分布到路由协议中,如本示例所示:
重分布连接的路由器
在图例中,路由器B有两个快速以太网接口。FastEthernet 0/0位于网络10.1.1.0/24中,而FastEthernet 0/1位于网络10.1.1.0/24中。路由器B使用路由器A运行EIGRP,使用路由器C运行OSPF。路由器B在EIGRP和OSPF进程之间相互重分配。以下是路由器B的配置信息:
interface FastEthernet0/0 ip address 10.1.1.4 255.255.255.0 interface FastEthernet0/ ip address 10.1.10.4 255.255.255.0 router eigrp 7 redistribute ospf 7 metric 10000 100 255 1 1500 network 10.1.1.0 0.0.0.255 auto-summary no eigrp log-neighbor-changes ! router ospf 7 log-adjacency-changes redistribute eigrp 7 subnets network 10.1.1.0 0.0.0.255 area 0
路由器B的路由表显示:
routerB#show ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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
Gateway of last resort is not set
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/1
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, FastEthernet0/0
从之前的配置和路由表中可以注意到以下三点:
路由器A和C的路由表:
routerA#show ip route Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route, o - ODR Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, FastEthernet0 10.0.0.0/24 is subnetted, 1 subnets D EX 10.1.1.0 [170/284160] via 10.1.1.4, 00:07:26, FastEthernet0 routerC#show ip route Codes: C - connected, S - static, I - IGRP, 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, E - EGP i - IS-IS, 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 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, FastEthernet1 O E2
10.1.1.0 [110/20] via 10.1.10.4, 00:07:32, FastEthernet1
路由器A通过EIGRP获知了网络10.1.1.0/24,该路由显示为外部路由,因为它从OSPF重分发到EIGRP。路由器C通过OSPF获知了网络10.1.1.0/24,将其作为外部路由,因为它已从EIGRP重分发到OSPF。尽管路由器B不会重分布连接的网络,但它会通告网络10.1.1.0/24,这是重分布到OSPF中的EIGRP进程的一部分。同样地,路由器 B 通告网络 10.1.1.0/24,这是重新分配到 EIGRP 的 OSPF 进程的一部分。
有关重分发到OSPF的已连接路由的详细信息,请参阅将已连接网络重分发到OSPF。
注意:默认情况下,当发出redistribute bgp命令时,只有EBGP获知的信息是重分发到内部网关协议(IGP)的候选信息。在router bgp 命令下配置 bgp redistribute-internal命令之前,内部BGP(iBGP)路由不会重分发到IGP。但是,当IBGP路由重分发到IGP时,必须采取预防措施以避免自治系统内的环路。
“管理距离”部分描述重分发如何潜在地引起问题,例如最佳路由的下一个拓扑、路由环路或收敛缓慢。如果您从不在路由进程X中通告最初收到的信息,则可以避免这些问题。
R2和R5相互重分发
在本拓扑示例中,R2和R5处于相互重分发状态。RIP重分发到IGRP,而IGRP重分发到RIP,如下面的配置所示。
router igrp 7 network 172.16.0.181 redistribute rip metric 1 1 1 1 1 router rip network 172.16.0.0 redistribute igrp 7 metric 2
router igrp 7 network 172.16.0.181 redistribute rip metric 1 1 1 1 1 router rip network 172.16.0.0 redistribute igrp 7 metric 2
在之前的配置示例中,您可能会遇到前面描述的任何问题。为了避免出现这种情况,您可以过滤路由更新:
router igrp 7 network 172.16.0.181 redistribute rip metric 1 1 1 1 1 distribute-list 1 in s1 router rip network 172.16.0.0 redistribute igrp 7 metric 2 access-list 1 deny 192.168.1.0 access-list 1 permit any
router igrp 7 network 172.16.0.181 redistribute rip metric 1 1 1 1 1 distribute-list 1 in s1 router rip network 172.16.0.0 redistribute igrp 7 metric 2 access-list 1 deny 192.168.1.0 access-list 1 permit any
如上例所示,添加到配置中的分发列表会过滤进入路由器串行1接口的所有IGRP更新。如果访问控制列表 1 允许更新中的路由,路由器将在更新中接纳它们;否则就不会。在本例中,路由器被告知,它们不能通过串行接口1上收到的IGRP更新来获知网络192.168.1.0。因此,这些路由器所具有的关于网络 192.168.1.0 的全部知识均通过 RIP 从 R1 获取。
并且记住在这种情况下无需使用与 RIP 程序相同的过滤策略,因为 RIP 比 IGRP 的管理距离更远。如果源自IGRP域的路由通过RIP反馈给R2和R5,则IGRP路由仍然优先。
IGRP优先
上例中的拓扑显示了避免问题重分布的另一种方法。此方法更可取。此方法使用路由映射为各个路由设置标记。然后可以根据标记再分配路由进程。请注意,基于标签的重新分发不能用于RIP第1版或IGRP。
上一个拓扑中可能会遇到以下问题:
下一个配置示例显示如何使用 setting
然后根据标记重新分配。
router eigrp 7 network 172.16.0.181 redistribute rip route-map rip_to_eigrp metric 1 1 1 1 1
!--- Redistributes RIP routes that are
!--- permitted by the route-map rip_to_eigrp
router rip
version 2
network 172.16.0.0
redistribute eigrp 7 route-map eigrp_to_rip metric 2
!--- Redistributes EIGRP routes and set the tags
!--- according to the eigrp_to_rip route-map route-map rip_to_eigrp deny 10 match tag 88
route−map rip_to_eigrp deny 10 match tag 88
!--- Route-map statement to deny any routes that have a tag of "88"
!--- from being redistributed into EIGRP
!--- Notice the routes tagged with "88" must be the EIGRP
!--- routes that are redistributed into RIPv2
route-map rip_to_eigrp permit 20
set tag 77
!--- Route-map statement to set the tag
!--- on RIPv2 routes redistributed into EIGRP to "77"
route-map eigrp_to_rip deny 10
match tag 77
!--- Route-map statement to deny any routes that have a
!--- tag of "77" from being redistributed into RIPv2
!--- Notice the routes tagged with "77" must be the RIPv2
!--- routes that are redistributed into EIGRP
route-map eigrp_to_rip permit 20 s
et tag 88
!--- Route-map statement to set the tag on EIGRP
!--- routes redistributed into RIPv2 to "88"
router eigrp 7 network 172.16.0.181 redistribute rip route-map rip_to_eigrp metric 1 1 1 1 1 !--- Redistributes RIPv2 routes that are permitted !--- by the route-map rip_to_eigrp router rip version 2 network 172.16.0.0 redistribute eigrp 7 route-map eigrp_to_rip metric 2 !--- Redistributes EIGRP routes and sets the tags !--- according to the eigrp_to_rip route-map route-map rip_to_eigrp deny 10 match tag 88 !--- Route-map statement to deny any routes that have a tag !--- of "88" from being redistributed into EIGRP !--- Notice the routes tagged with "88" must be the EIGRP routes !--- that are redistributed into RIPv2 route-map rip_to_eigrp permit 20 set tag 77 !--- Route-map statement to set the tag on rip routes !--- redistributed into EIGRP to "77" route-map eigrp_to_rip deny 10 match tag 77 !--- Route-map statement to deny any routes that have a tag !--- of "77" from being redistributed into RIPv2 !--- Notice the routes tagged with "77" must be the RIPv2 routes !--- that are redistributed into EIGRP route-map eigrp_to_rip permit 20 set tag 88 !--- Route-map statement to set the tag on EIGRP routes !--- redistributed into RIPv2 to "88"
在前面的示例配置完成后,您可以查看路由表中的某些特定路由,了解标记已设置。R3和R1上的特定路由的show ip route命令的输出如下:
R3#show ip route 172.16.10.8 Routing entry for 172.16.10.8/30 Known via "eigrp 7", distance 170, metric 2560512256 Tag 77, type external Redistributing via eigrp 7 Last update from 172.16.2.10 on Serial0, 00:07:22 ago Routing Descriptor Blocks: * 172.16.2.10, from 172.16.2.10, 00:07:22 ago, via Serial0
Route metric is 2560512256, traffic share count is 1
Total delay is 20010 microseconds, minimum bandwidth is 1 Kbit
Reliability 1/255, minimum MTU 1 bytes
Loading 1/255, Hops 1
R1#show ip route 172.16.2.4
Routing entry for 172.16.0.181/16
Known via "rip", distance 120, metric 2
Tag 88
Redistributing via rip
Last update from 172.16.10.50 on Serial0, 00:00:15 ago
Routing Descriptor Blocks:
* 172.16.10.50, from 172.16.10.50, 00:00:15 ago, via Serial0
Route metric is 2, traffic share count is 1
EIGRP 使用五个不同变量计算度量。但是,重分发的路由没有这些参数,这会导致路由出现异常 setting
.最佳实践是在重新分发路由时设置默认度量。依据 setting
默认度量可以提高EIGRP的性能。对于 EIGRP,可以使用此命令输入默认值:
Router(config-router)#default-metric 10000 100 255 100 1500
在同一路由协议的不同进程之间也可以进行再分配。下一个配置是一个重分发策略的示例,该策略用于重分发在同一路由器或多个路由器上运行的两个EIGRP进程:
router eigrp 3 redistribute eigrp 5 route-map to_eigrp_3 default-metric 10000 100 255 1 1500 !--- Redistributes EIGRP 5 into EIGRP 3, setting the tags !--- according to the route map "to_eigrp_3" router eigrp 5 redistribute eigrp 3 route-map to_eigrp_5 default-metric 10000 100 255 1 1500 !--- Redistributes EIGRP 3 into EIGRP 5 !--- Routes with tag 33 can not be redistributed !--- due to route map "to_eigrp_5" !--- Though the default-metric command is not required
!--- when redistributing between different EIGRP processes, !--- you can use it optionally as shown in the previous example to advertise
!--- the routes with specific values for calculating the metric. route-map to_eigrp_3 deny 10 match tag 55 !--- Route-map statement used to deny any routes that have a tag !--- of "55" from being redistributed into EIGRP 3 !--- Notice the routes tagged with "55" must be the EIGRP 3 routes !--- that are redistributed into EIGRP 5 route-map to_eigrp_3 permit 20 set tag 33 !--- Route-map statement used to set the tag on routes !--- redistributed from EIGRP 5 to EIGRP 3 to "33" route-map to_eigrp_5 deny 10 match tag 33 !--- Route-map statement used to deny any routes that have a tag !--- of "33" from being redistributed into EIGRP 5 !--- Notice the routes tagged with "33" must be the EIGRP 5 routes !--- that are redistributed into EIGRP 3 route-map to_eigrp_5 permit 20 set tag 55 !--- Route-map statement used to set the tag on routes !--- redistributed from EIGRP 3 to EIGRP 5 to "55"
本文档提供了几种过滤路由的策略。但是,也可以使用其他有效的策略。
在示例4中,您有两个路由器,一个是运行BGP协议的高端路由器,另一个是运行RIP协议的低端路由器。当您将BGP路由重分发到RIP时,可能会丢失一些数据包。
通常不推荐将 BGP 再分配到 RIP 协议中,iBGP、OSPF 和 EIGRP 等协议是可扩展的协议,具有很多可用选项。
如果遇到这种情况,即在 BGP 到 RIP 之间进行再分配且某些数据包丢失,您可能必须对 RIP 进程配置下面的命令:
Router(Config)#router rip Router(Config-router)# input-queue 1024
注意:如果高端路由器以高速向低速路由器发送,而低速路由器无法以高速接收,请考虑使用input-queue命令。配置此命令有助于防止路由表中的信息丢失。
重分布静态路由
本示例说明如何将静态路由重分布到RIP路由协议中。根据拓扑示例,我们有三台路由器(R1、R2和R3)。R1和R2在接口Fast Ethernet 0/0上配置了RIP。R1具有到达路由器R3的Lo 0接口(IP地址10.10.10.10/32)的静态路由。此静态路由在RIP路由协议中重分布。路由器R3配置了默认路由R3# ip route 0.0.0.0 0.0.0.0 FastEthernet 0/0。
R1(config)# ip route 10.10.10.10 255.255.255.255 10.13.13.3 R1(config)# router rip R1(config-router) redistribute static metric 10
在路由器R2上,通过show ip route命令显示路由10.10.10.10:
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.12/24 is directly connected, FastEthernet0/0
10.0.0.3/32 is subnetted, 1 subnets
R 10.10.10.10 [120/10] via 192.168.12.1, 00:00:07, FastEthernet0/0
要重分布单个静态路由,请使用路由映射选择需要重分布的静态路由。
Router(config)#access-list 1 permit <network no> <mask> Router(config)#route-map <route-map name> permit 10 Router(config-route-map)#match ip address access list number Router(config)#router eigrp <As number> Router(config-router)#redistribute static route-map <map-name> metric <value>
版本 | 发布日期 | 备注 |
---|---|---|
1.0 |
14-Nov-2001 |
初始版本 |