设为首页收藏本站language→→ 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 958|回复: 7
收起左侧

[分享] 路由重分布解析

[复制链接]
 成长值: 59065
发表于 2018-1-19 08:47:37 | 显示全部楼层 |阅读模式
本帖最后由 小乔 于 2018-1-19 08:54 编辑

简介
使用路由协议通告以某些其他方式了解,例如由另一个路由协议,静态路由或者已连接路由的路由,呼叫再分配。虽然公司希望在整个 IP 互联网络中运行单个路由协议,但由于多种原因多协议路由仍然相当普遍,例如,公司合并、由多个网络管理员管理的多个部门,以及多厂商环境等。运行不同的路由协议通常是网络设计的一部分。总之,多协议环境使再分配成为必然。
路由协议特性(例如度量、管理距离、有类和无类功能)的差异可能影响再分配。要成功进行再分配,必须考虑这些差异。
度量值
当您将一个协议再分配到另一个时,切记每个协议权值在再分配中都扮演很重要的角色。每个协议都使用不同的度量。例如,路由信息协议(RIP)权值根据跳次计数计算,但内部网关路由协议(IGRP)和增强的内部网关路由协议(EIGRP)使用的是根据带宽、延迟、可靠性、负荷和最大传输单元(MTU)计算的综合权值,其中只有带宽和延迟参数是默认值。当路由再分配时,您必须定义接收协议可以理解的权值。再分配路由时,可以使用两种方法来定义度量。
您只能为该特定的再分配定义度量:
router ripredistribute static metric 1redistribute ospf 1 metric 1
或者,可以为所有再分配选择同样的权值作为默认值(由于使用 default-metric 命令消除了逐一定义再分配权值的过程,因此节省了工作量)。
router ripredistribute staticredistribute ospf 1default-metric 1
管理距离
如果路由器运行了一个以上的路由协议,并且使用两个路由协议发现目的地相同的路由,则应选择那个作为最佳路由?每个协议都使用自己的度量类型来确定最佳路由。不能比较具有不同度量类型的路由。使用管理距离可以解决此问题。管理距离被分配到路由源,以便优先源的路由将被选择为最佳路径。
管理距离有助于在不同路由协议中选择路由,但它们可能引起重分配问题。这些问题可能体现为路由环路、收敛问题或低效率路由。下面是可能问题的拓扑和说明。
在上述拓扑结构中,如果 R1 运行 RIP,而 R2 和 R5 均同时运行 RIP 和 IGRP,并且再分配 RIP 到 IGRP 中,则会产生潜在问题。例如,R2 和 R5 均使用 RIP 从 R2 获知 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 的默认行为将通告直接连接路由。有两种方法可获得已连接的路由:
  • 接口配置有 IP 地址和掩码,该对应子网视为连接的路由。
  • 只配置流出接口,而不配置下一跳 IP 的静态路由,这也被视为连接的路由。

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 语句“覆盖”。

再分配配置的语法与示例IGRP 和 EIGRP
此输出显示再分布静态、开放最短路径优先(OSPF)、RIP和中间系统对中间系统(IS-IS)路由的IGRP/EIGRP路由器。
router igrp/eigrp 1
network 131.108.0.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。当在 EIGRP 进程下使用 redistribute static 再分配静态路由,并且 EIGRP 进程有一个默认路由时,将出现这种情况。
OSPF
此输出显示的是 OSPF 路由器再分配静态、RIP、IGRP、EIGRP 和 IS-IS 路由。
router ospf 1 network 131.108.0.0 0.0.255.255 area 0 redistribute static metric 200 subnetsredistribute 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 :7 108 /10 = 10
注意: 如果没有指定权值,当再分配来自所有协议的路由时(权值为1的边界网关协议(BGP)路由外),OSPF设置默认值为20。
当具有已进行子网划分的主网时,您需要使用关键字子网,重分配协议到 OSPF。如果不使用这个关键字,OSPF 将只再分配没有划分子网的主网。
可以在同一个路由器上运行多个 OSPF 进程。然而,很少需要运行相同协议的多个程序,并且可以消耗路由器的内存和CPU。
重新分配一个 OSPF 程序到另一个 OSPF 程序,您不需要定义权值或者使用 default-metric 命令。
RIP
注意: 本文档的原则适用于 RIP I 和 II 版本。
此输出显示的是 RIP 路由器再分配静态、IGRP、EIGRP、OSPF 和 IS-IS 路由。
router rip
network 131.108.0.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的最后一站网关
此配置是再分布除了最后网关手段网关的静态路由示例在RIP的通过routemap。
此示例的初始配置:
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.192.192.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 67.129.103.128 255.255.255.240 10.32.31.1
ip route 156.55.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 199.43.0.0 255.255.255.0 10.32.32.5
ip route 204.103.0.0 255.255.255.0 10.32.32.5
完成这些步骤为了配置此:
创建access-list为了匹配需要重新分配的所有网络
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 67.129.103.128, wildcard bits 0.0.0.15
    50 permit 156.55.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 199.43.0.0, wildcard bits 0.0.0.255
    90 permit 204.103.0.0, wildcard bits 0.0.0.255
呼叫此access-list在route-map。
Route-map TEST
Match ip address 10
重新分配在RIP使用route-map在并且取消默认信息产生从RIP进程的命令。
Router RIP
version 2
network 10.0.0.0
redistribute static route-map TEST
no auto-summary
IS-IS
此输出显示的是 IS-IS 路由器再分配静态、RIP、IGRP、EIGRP 和 OSPF 路由。
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 中没有 default-metric 选项 — 您应该为每个协议定义权值,如以上示例所示。如果没有为重分配到 IS-IS 的路由指定权值,则度量值默认为 0。
已连接路由
把直接连接网络重分配到路由协议,并不是常见做法,因此上述所有示例中都没有显示。然而,重要的是注意它能够直接和间接执行。要直接再分配已连接的路由,请使用 redistribute connected router 配置命令。在这种情况下,您还应定义度量。您也可以间接将已连接的路由再分配到路由协议中,如本示例所示。
在本示例中,路由器 B 有两个快速以太网接口。快速以太网 0/0 位于网络 10.1.1.0 /24 中,而 快速以太网 0/1 位于网络 20.1.1.0 /24 中。路由器 B 和路由器 A 一起运行 EIGRP,和路由器 C 一起运行 OSPF。路由器 B 因此在 EIGRP 和 OSPF 程序路由器间进行相互再分配。下面是路由器 B 的相关配置信息:

路由器 B
interface FastEthernet0/0
ip address 10.1.1.4 255.255.255.0

interface FastEthernet0/1
ip address 20.1.1.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 20.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
     20.0.0.0/24 is subnetted, 1 subnets
C       20.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
在上面的配置和路由表中,有三件事需要注意:
  • 所述的网络以直接连接的网络形式存在于路由器 B 的路由表中。
  • 网络 10.1.1.0/24 是 EIGRP 进程的一部分,网络 20.1.1.0/24 是 OSPF 进程的一部分。
  • 路由器 B 在 EIGRP 和 OSPF 之间进行双向再分配。

下面是路由器 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
     20.0.0.0/24 is subnetted, 1 subnets
D EX    20.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
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, FastEthernet1
O E2    10.1.1.0 [110/20] via 20.1.1.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,是 EIGRP 进程重分配到 OSPF 的一部分。同样地,路由器 B 通告网络 20.1.1.0/24,这是重新分配到 EIGRP 的 OSPF 进程的一部分。

注意: 默认情况下,当发出 redistibute bgp 命令时,只有 EBGP 获知的信息才被候选再分配到 IGP 中。只有在 router bgp 命令下配置 bgp redistribute-internal 命令之后,才会将 IBGP 路由再分配到 IGP 中。在将 IBGP 路由再分配到 IGP 中时,必须采取预防措施以免在自治系统内产生环路。
避免再分布引起的问题
“管理距离“部分说明了再分配可能引起的潜在问题,例如不理想的路由、路由循环或者缓慢的聚合。避免这些类型的问题确实非常简单 — 就是绝不把最初源自路由进程 x 的信息通告回路由进程 x。
示例 1
在上一个拓扑里, R2和R5完成相互再分配。RIP重新分配到IGRP,并且IGRP重新分配到RIP,因为此配置显示。
R2 :
router igrp 7
network 181.16.0.0

redistribute rip metric 1 1 1 1 1

router rip
network 178.1.0.0
redistribute igrp 7 metric 2
R5:
router igrp 7
network 181.16.0.0

redistribute rip metric 1 1 1 1 1

router rip
network 178.1.0.0
redistribute igrp 7 metric 2
使用先前配置您有在任何的可能性以前描述的问题。为避免出现这些问题,您可以按以下操作过滤路由更新:
R2 :
router igrp 7
network 181.16.0.0
redistribute rip metric 1 1 1 1 1
distribute-list 1 in s1
router rip
network 178.1.0.0
redistribute igrp 7 metric 2
access-list 1 deny 192.168.1.0
access-list 1 permit any
R5:
router igrp 7
network 181.16.0.0
redistribute rip metric 1 1 1 1 1
distribute-list 1 in s1
router rip
network 178.1.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 路由仍将占有优先权。
示例 2
使用拓扑如上所述,另一个方法,是有时更加更可取的,避免再分配问题可以被展示。此方法使用路由映射为各个路由设置标记。然后可以根据标记再分配路由进程。注意基于标记的再分配不可与 RIP 版本 1 或 IGRP 结合使用。
您能遇到在上一个拓扑里的其中一问题如下:
R1 将网络 192.168.1.0 通告给 R2。然后将 R2 再分配给 EIGRP。R5 通过 EIGRP 发现网络并将其再分配给 RIPv2。根据 R5 为 RIPv2 路由设置的度量,R6 可能希望采用不太忙的路由,通过 R5 而不是通过 R1 到达网络。以下配置有助于防止这种情况,方法是根据标记设置标记,然后重新分配。
R2 :
router eigrp 7
network 181.16.0.0
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 178.1.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 statement to deny any routes that have a tag of "88"


!--- from being redistributed into EIGRP
  

!--- Notice the routes tagged with "88" should 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" should 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"

R5:
router eigrp 7
network 181.16.0.0
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 178.1.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" should 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" should 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 178.1.10.8
Routing entry for 178.1.10.8/30
  Known via "eigrp 7", distance 170, metric 2560512256
  Tag 77, type external
  Redistributing via eigrp 7
  Last update from 181.16.2.10 on Serial0, 00:07:22 ago
  Routing Descriptor Blocks:
  * 181.16.2.10, from 181.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 181.16.2.4
Routing entry for 181.16.0.0/16
  Known via "rip", distance 120, metric 2
  Tag 88
  Redistributing via rip
  Last update from 178.1.10.5 on Serial0, 00:00:15 ago
  Routing Descriptor Blocks:
  * 178.1.10.5, from 178.1.10.5, 00:00:15 ago, via Serial0
      Route metric is 2, traffic share count is 1
EIGRP 使用五个不同变量计算度量。但是,再分配的路由没有这些参数,因而会导致路由的设置不统一。最佳实践是在再分配路由时设置默认度量。通过设置默认度量,可以改进 EIGRP 的性能。对于 EIGRP,可以使用此命令输入默认值:
Router(config-router)#default-metric 10000 100 255 100 1500
示例 3
在同一路由协议的不同进程之间也可以进行再分配。以下配置示例说明了用于再分配运行于同一路由器或多个路由器上的两个 EIGRP 进程的再分配策略。
outer 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 will 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 above 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" should 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" should 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 命令。配置此命令有助于防止路由表中信息的丢失。
示例5
此示例说明再分布静态路由到RIP路由协议。根据拓扑,我们有三路由器(R1、R2和R3)。R1和R2有在快速以太网接口配置的RIP 0/0。R1有到达的静态路由Lo0接口(IP地址3.3.3.3/32)路由器R3。此静态路由在RIP路由协议再分布。路由器R3配置与默认路由R3- ip route 0.0.0.0 0.0.0.0 FastEthernet0/0。
R1(config)# ip route 3.3.3.3 255.255.255.255 10.13.13.3
R1(config)# router rip
R1(config-router) redistribute static metric 10
在路由器R2上,路由3.3.3.3能通过show ip route命令被看到:
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.12.12.0/24 is directly connected, FastEthernet0/0
     3.0.0.0/32 is subnetted, 1 subnets
R      3.3.3.3 [120/10] via 192.12.12.1, 00:00:07, FastEthernet0/0
如何再分配单个静态路由
要再分配单个静态路由,请使用 route-map 选择需要再分配的静态路由。
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>

发表于 2018-1-19 19:32:39 | 显示全部楼层
太精彩了,赞
5# 2018-1-19 19:32:39 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2018-1-25 09:47:41 | 显示全部楼层
刚好这个地方一直搞不清楚区别,谢谢乔帮主。
6# 2018-1-25 09:47:41 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2019-5-17 11:01:44 | 显示全部楼层
R2 通过 R3 获知网络 192.168.1.0,而 R5 则使用 IGRP 从 R4 获知该网络。
这句话是不是应该是R3通过R2获知网络192.168.1.0呢?
7# 2019-5-17 11:01:44 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2020-2-2 21:16:56 | 显示全部楼层
dddddddddd
8# 2020-2-2 21:16:56 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2024-4-19 17:01 , Processed in 0.065691 second(s), 8 queries , Redis On.  

  Powered by Discuz!

  © 2001-2024 HH010.COM

快速回复 返回顶部 返回列表