为什么要使用路由重分发
- 格式:docx
- 大小:14.59 KB
- 文档页数:2
RIP与OSPF的路由重分发实验目的:1、掌握RIP与OSPF的重发布配置。
2、理解OSPF的E1与E2类型的路由。
实验拓扑图实验步骤及要求:1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。
2、配置R1与R2的OSPF路由协议和R2与R3的RIP路由协议。
R1(config)#router ospf 1R1(config-router)#network 172.16.255.0 0.0.0.3 area 0R1(config-router)#network 172.16.1.0 0.0.0.255 area 0R1(config-router)#network 172.16.2.0 0.0.0.255 area 0R2(config)#router ospf 1R2(config-router)#network 172.16.255.0 0.0.0.3 area 0R2(config-router)#exitR2(config)#router ripR2(config-router)#network 192.168.255.0R3(config)#router ripR3(config-router)#network 192.168.255.0R3(config-router)#network 192.168.1.0R3(config-router)#network 192.168.2.03、查看R1、R2和R3的路由表R1#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - 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 - ODRP - periodic downloaded static routeGateway of last resort is not set172.16.0.0/16 is variably subnetted, 3 subnets, 2 masksC 172.16.255.0/30 is directly connected, FastEthernet0/0C 172.16.1.0/24 is directly connected, Loopback0C 172.16.2.0/24 is directly connected, Loopback1R2#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - 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 - ODRP - periodic downloaded static routeGateway of last resort is not set172.16.0.0/16 is variably subnetted, 3 subnets, 2 masksC 172.16.255.0/30 is directly connected, FastEthernet0/1O 172.16.1.1/32 [110/2] via 172.16.255.1, 00:03:33, FastEthernet0/1O 172.16.2.1/32 [110/2] via 172.16.255.1, 00:03:33, FastEthernet0/1从R1学习到的OSPF网络路由C 192.168.255.0/24 is directly connected, FastEthernet0/0R 192.168.1.0/24 [120/1] via 192.168.255.1, 00:00:25, FastEthernet0/0R 192.168.2.0/24 [120/1] via 192.168.255.1, 00:00:25, FastEthernet0/0从R3学习到的RIP网络路由R3#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - 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 - ODRP - periodic downloaded static routeGateway of last resort is not setC 192.168.255.0/24 is directly connected, FastEthernet0/1C 192.168.1.0/24 is directly connected, Loopback0C 192.168.2.0/24 is directly connected, Loopback14、根据show ip route命令可以看出,只有R2路由才可以学习到整个网络的完整路由。
路由重分发工作原理路由重分发工作原理网络协议有很多种,例如isis、rip、ospf、bgp等,在大型公司中经常会出现网络设备之间运行多种网络协议的情况,各种网络协议之间如果不进行一定的配置那么设备之间是不能进行互通信息的,在这种情况下就出现了路由重分发技术,路由重分发的作用就是为了实现多种路由协议之间的协同工作。
路由重分发的工作原理:通过在各种路由协议的配置中添加一定的配置使将路由协议广播到另外的路由协议中,让各个路由协议都能检测到运行其他的路由协议的网段,从而实现数据的传输。
路由重分发技术需要用到redistribute命令rip协议的redistribute命令redistribute protocol 【metric metric-value】【match internal | external nssa-external type】【route-map map-tag】protocol:路由重分发的源路由协议 metric metric-value:设置路由重分发的度量值(1···6),没有将使用default-metric命令设置的metric值 match internal | external nssa-external type:设置重分发路由的条件,只适合重分发的源路由协议是ospf route-map map-tag应用路由图进行重分发ospf协议的redistribute命令 redistribute protocol 【subnets】【metric metric-value】【metric-type{1 | 2}】【tag tag-value】【route-map map-tag】protocol:路由重分发的源路由协议subnets:设置是否重分发子网metric metric-value:设置路由重分发的度量值(1···16777214),没有将使用default-metric命令设置的metric值metric metric-type:设置重分发的路由度量类型,默认值为2 tag tag-value:设置重分发的路由的tag(0···2147483647)默认为0 route-map map-tag应用路由图进行重分发重分发到ospf中的时候,除了直连路由和默认路由外,其他重分发的路由的默认的度量值是20,默认度量值类型是2,且默认不重分发子网。
本课程大纲:1.为什么要重分发?2.如何重分发?3.几个重要的命令:passive-interface,distribute-list,route-map,distance,D HCP路由重分布:将一种路由选择协议获悉的网络告知另一种路由选择协议,以便网络中每台工作站能到达其他的任何一台工作站,这一过程被称为重分布。
重分布原则:路由必须位于路由选择表中才能被重分发在重分发时设定种子metric协议 Seed MetricRIP 无限大必须手工指定EIGRP 无限大也必须手工指定OSPF 20 如果重分布进来的是BGP的话,Metric是1,这是个特例IS-IS 0BGP 携带原来的Metric值R1(config-router)#default-metric 1 使用此命令来设定种子metric值从无类别路由器向有类别路由器重分发协议的时候,仅在掩码相同的接口通告。
为什么要重分发?1.重分发进RIP命令:redistribute 【其他路由协议】 metric 1 R1(config-router)#redistribute static (可不加Metric,默认=1)重分布进RIP时注意,必须指定度量值,或者用default-metric命令设置种子度量值(RIP默认种子度量值无限大),只有重分布静态时不用制定metric 值。
如果同时用metric和default-metric命令指定度量值,则metric优先。
2.重分发进OSPF默认Metric值为20,默认类型是O E2,默认情况下子网不通告命令:redistribute 【其他路由协议】 subnets 3.重分发进EIGRP重分发以后的管理距离是170命令:redistribute 【其他路由协议】 metric 1000 100 255 1 1500R1(config-router)#redistribute connected (不加Metric也可)(根据直连接口的不同计算Metric)R1(config-router)#redistribute static (不加Metric也可)(根据下一跳接口计算Metric)4.重分发进IS-IS默认属于Level 2,默认Metric值为0命令:redistribute 【其他路由协议】注意:BGP重分布进IGP时会造成些问题,原则上不推荐这样做。
一、实验拓扑图:AucklandSanJose3Singapore 192.168.224.1/30S1/2192.168.240.2/30S1/2 S1/0192.168.224.2/30S1/1192.168.240.1/30 Engineers Lo0 192.168.232.1/24T1 1.544Mbps19.2Kpbs RIP v2Managers Lo1 192.168.236.1/24Lo0 192.168.5.1/24二、实验目的1、在实验中应用到高级路由功能来操作路由更新,这些特性包括分发列表,默认路由,被动接口和路由重分布。
2、掌握高级路由特性来控制路由更新。
三、实验要求1、公司的SanJose3和Singapore 之间的网络使用的RIPV2动态路由协议。
2、在SanJose3上面连接了一个stub network 192.168.5.1/24,为了减少流量,过滤RIPv2更新流量在整个192.168.5.1/24网络发送。
3、在Singapore 有Engineers 和Managers 部门,Managers 网络并不想被SanJose3所学习到。
4、有一条非常慢的19.2Kpbs 的链路连接Singapore 和Auckland ,为了减少这条链路的 流量,我们要禁止动态路由更新通过这条链路5、在满足上述条件的情况下,实现全网互通。
四、实验步骤1、按照拓扑图中IP ,配置好路由器接口的 IP 地址,但是不要配置RIPv2协议,使用CDP 协议检测相邻设备的连通性。
配置如下:Router(config)#hostname SanJose3SanJose3(config)#line c 0SanJose3(config-line)#exec-timeout 0 0SanJose3(config-line)#logging synchronousSanJose3(config)#no ip domain-lookupSanJose3(config)#interface s1/2SanJose3(config-if)#ip address 192.168.224.1 255.255.255.252SanJose3(config-if)#no shutdownSanJose3(config)#interface loopback 0SanJose3(config-if)#ip address 192.168.5.1 255.255.255.0Router(config)#hostname AucklandAuckland (config)#interface s1/2Auckland (config-if)#ip address 192.168.240.2 255.255.255.252Auckland (config-if)#no shutdownAuckland (config)#interface loopback 0Auckland (config-if)#ip address 192.168.248.1 255.255.255.0Router(config)#hostname SingaporeSingapore(config)#interface loopback 0Singapore(config-if)#ip address 192.168.232.1 255.255.255.0Singapore(config-if)#description EngineersSingapore(config)#interface loopback 1Singapore(config-if)#ip address 192.168.236.1 255.255.255.0Singapore(config-if)#description ManagerSingapore(config)#interface s1/0Singapore(config-if)#ip address 192.168.224.2 255.255.255.252Singapore(config-if)#no shutdownSingapore(config)#interface s1/1Singapore(config-if)#ip address 192.168.240.1 255.255.255.252Singapore(config-if)#no shutdown配置完成后使用CDP 协议检查相邻设备的连通性,如下2、在SanJose3上,配置RIPv2协议通告物理直连的网络,配置如下:SanJose3(config)#router ripSanJose3(config-router)#version 2SanJose3(config-router)#network 192.168.224.0SanJose3(config-router)#network 192.168.5.0因为192.158.5.0是一个stub network,这个网络里没有路由器或者主机需要RIPv2协议的更新。
路由重分发的基本概念在计算机网络中,路由器是用于转发网络数据包的设备。
路由器根据目的地地址将数据包从一个网络接口转发到另一个网络接口,以便将数据从源主机传输到目标主机。
如果网络结构发生改变或者某个路径出现故障,路由器就需要重新分发路由信息,以便确保数据能够正确地到达目标主机。
下面是路由重分发的基本概念。
路由重分发是指将新的路由信息通知给其它路由器,以便它们能够将数据包转发到正确的目标。
当网络拓扑发生改变时,例如有一条链路故障或者新增了一条链路,路由重分发就需要被执行。
在路由重分发的过程中,路由器会发送路由更新消息给其它路由器,以便让它们更新它们的路由表。
这样,当一个数据包到达网络时,路由器就可以根据最新的路由表将其正确地转发到目标主机。
路由器可以采用不同的路由协议来执行路由重分发。
常用的路由协议包括距离向量路由协议和链路状态路由协议。
距离向量路由协议根据最短距离确定最佳路径,并向其它路由器发送这些路径的距离信息。
当一条路径不可用时,路由器会从其它可能的路径中选择一个最佳路径,然后向其它路由器发送更新消息。
链路状态路由协议则根据网络中各链路的状态动态计算出路由信息。
当网络结构发生改变时,路由器会重新计算路由信息并通知其它路由器。
在执行路由重分发之前,路由器通常会先删除旧的路由信息。
这样可以避免新的路由信息和旧的路由信息冲突,导致数据包被错误地转发。
当路由重分发完成后,路由器会重新建立路由信息表。
新的路由表将包含最新的路由信息,以便将数据包正确地转发到目标主机。
总之,路由重分发是计算机网络中维护路由信息的重要过程。
它可以确保数据包能够正确地到达目标主机,同时避免了路由信息的冲突。
在实际应用中,路由重分发的频率对网络的性能有重要影响。
如果路由重分发太频繁,会导致网络负载过大,从而降低网络的吞吐量。
因此,在设计网络拓扑时,需要仔细考虑路由重分发的频率,并采取相应的措施来保证网络的高效稳定运行。
OSPF多进程之间的路由重发布1、实验拓扑如下图:R1R4R3 R2Area 00spf 10Area 0Ospf 1002、实验目的:1、实现R2与R3之间互相访问时的数据分流。
R2访问R3的3.3.3.3/32时走R1,R2访问R3的30.30.30.30/32时走R4。
R3访问R2的2.2.2.2/32时走R1,R3访问R2的20.20.20.20/32时走R1。
2、实现线路的冗余备份。
当R1链路故障时数据可以走R4,当R4链路故障时数据可以走R1。
实现链路的冗余备份。
3、理解并掌握route-map在控制路由方面的应用。
3、实验配置文档R1配置:config terint f0/0ip add 10.0.0.1 255.255.255.252no shutint f1/0ip add 10.0.0.5 255.255.255.252no shutint lo 0ip add 1.1.1.1 255.255.255.255endwriteconfig terrouter ospf 10router-id 1.1.1.1network 10.0.0.0 0.0.0.3 area 0redistribute ospf 100 metric-type 1 subnets route-map ospf100_to_ospf10 distribute-list deny_ospf100 inendconfig terrouter ospf 100router-id 1.1.1.1network 10.0.0.4 0.0.0.3 area 0redistribute ospf 10 metric-type 1 subnets route-map ospf10_to_ospf100 distribute-list deny_ospf10 inendwriteip access-list standard deny_ospf10deny 2.2.2.2 0.0.0.0deny 20.20.20.20 0.0.0.0permit anyip access-list standard deny_ospf100deny 3.3.3.3 0.0.0.0deny 30.30.30.30 0.0.0.0permit anyaccess-list 10 permit 2.2.2.2 0.0.0.0access-list 11 permit 3.3.3.3 0.0.0.0access-list 20 permit 20.20.20.20 0.0.0.0access-list 21 permit 30.30.30.30 0.0.0.0route-map ospf100_to_ospf10 permit 10match ip address 11set metric 100route-map ospf100_to_ospf10 permit 20match ip address 21set metric 200route-map ospf10_to_ospf100 permit 10match ip address 10set metric 100route-map ospf10_to_ospf100 permit 20match ip address 20set metric 200R4配置:config terint f0/0ip add 172.16.0.1 255.255.255.252no shutint f1/0ip add 172.16.0.5 255.255.255.252no shutint lo 0ip add 4.4.4.4 255.255.255.255endwriteconfig terrouter ospf 10router-id 4.4.4.4network 172.16.0.4 0.0.0.3 area 0redistribute ospf 100 metric-type 1 subnets route-map ospf100_to_ospf10 distribute-list deny_ospf100 inendconfig terrouter ospf 100router-id 4.4.4.4network 172.16.0.0 0.0.0.3 area 0redistribute ospf 10 metric-type 1 subnets route-map ospf10_to_ospf100 distribute-list deny_ospf10 inendwriteip access-list standard deny_ospf10deny 2.2.2.2 0.0.0.0deny 20.20.20.20 0.0.0.0permit anyip access-list standard deny_ospf100deny 3.3.3.3 0.0.0.0deny 30.30.30.30 0.0.0.0permit anyaccess-list 10 permit 2.2.2.2 0.0.0.0access-list 11 permit 3.3.3.3 0.0.0.0access-list 20 permit 20.20.20.20 0.0.0.0access-list 21 permit 30.30.30.30 0.0.0.0route-map ospf100_to_ospf10 permit 10 match ip address 11set metric 200route-map ospf100_to_ospf10 permit 20 match ip address 21set metric 100route-map ospf10_to_ospf100 permit 10 match ip address 10set metric 200route-map ospf10_to_ospf100 permit 20 match ip address 20set metric 100R2的配置:config terint f0/0ip add 10.0.0.2 255.255.255.252no shutint f1/0ip add 172.16.0.6 255.255.255.252no shutint lo 0ip add 2.2.2.2 255.255.255.255int lo 1ip add 20.20.20.20 255.255.255.255 endwriteconfig terrouter ospf 10router-id 2.2.2.2network 172.16.0.4 0.0.0.3 area 0 network 10.0.0.0 0.0.0.3 area 0 network 2.2.2.2 0.0.0.0 area 0network 20.20.20.20 0.0.0.0 area 0endwriteR3的配置:config terint f0/0ip add 10.0.0.6 255.255.255.252no shutint f1/0ip add 172.16.0.2 255.255.255.252no shutint lo 0ip add 3.3.3.3 255.255.255.255int lo 1ip add 30.30.30.30 255.255.255.255endwriteconfig termrouter ospf 100router-id 3.3.3.3network 172.16.0.0 0.0.0.3 area 0network 10.0.0.4 0.0.0.3 area 0network 3.3.3.3 0.0.0.0 area 0network 30.30.30.30 0.0.0.0 area 0endwrite4、实验测试1、在R2上show ip route查看结果,可以看出实现了数据分流。
路由重分布概念
路由重分布是指在不同路由协议之间共享路由信息的过程。
为了在同一个网络中有效地支持多种路由协议,需要在不同的路由协议之间进行路由信息的交换。
这个过程将一种路由协议获悉的路由信息告知给另一种路由协议,从而实现在不同的路由协议之间路由信息的共享。
在执行路由重分布时,需要注意一些关键问题。
首先,应避免在同一个网络中同时使用两个不同的路由协议,除非在网络之间有明显的界限。
其次,如果有多台路由器作为重分布点,应使用单项重分布以避免回环和收敛问题,并在不需要接收外部路由的路由器上使用默认路由。
此外,在单边界的情况下,可以使用双向重分布,但如果没有任何机制来防止路由回环,则不要在一个多边界的网络中使用双向重分布。
在进行路由重分布时,还需要考虑度量标准和管理距离。
种子度量值是在路由生分布时定义的,它是一条通过外部重分布进来的路由的初始度量值。
同时,由于不同路由协议的度量标准不同,需要进行协议标准的转换以实现兼容性。
总之,路由重分布是实现多个路由协议在同一个网络中协同工作的关键技术之一。
通过在不同路由协议之间进行路由信息的共享和转换,可以实现更加高效和可靠的路由选择和网络通信。
路由重分发技术一、路由重分发介绍1、两个协议之间相互学习路由条目2、可以省掉不必要的麻烦二、路由重分发之间相互采用用的什么1、OSPF:开销2、EIGRP:度量3、RIP:跳数4、Static(静态):直接重分发三、重分发配置命令1、将OSPF重分发进RIP①router rip :进入RIP进程②redistribute ospf 100(进程号) metric 1(跳数) :为OSPF路由指定跳数2、将RIP重分发到OSPF①router ospf 100 :进入OSPF进程②redistribute rip metric 100(开销) subnets :为RIP路由指定开销3、将OSPF重分发到EIGRP①router eigrp 100 :进入EIGRP进程②redistribute ospf 100 metric 10000 1000 255 1 1500 :为OSPF路由指定度量(带) (延) (可) (负) (M)4、将静态重分发进OSPF①router ospf 100 :进入OSPF进程②redistribute static subnets :将静态重分发到OSPF在OSPF中重分发不加Subnets重分到OSPF里的路由都是主类网络。
5、将直连重分发进RIP①router rip :进入RIP进程②redistribute connected :将直连重分发进RIP6、另一种重分发路由方式①router ospf 100 :进入OSPF进程②redistribute eigrp 100 :将EIGRP重分发进OSPF(OSPF默认cost:20)③default-metric 100(开销) :指定重分发的metric(度量)四、查看重分发配置命令1、show runnning-config |section router eigrp :查看EIGRP的重分发配置2、show runnning-config |section router ospf :查看OSPF的重分发配置3、show runnning-config |section router rip :查看RIP的重分发配置。
为什么要使用路由重分发?
什么要使用路由重分发?
在大型的企业中,可能在同一网内使用到多种路由协议,为了实现多种路由协议之间能够相互配合、协同工作,可以在路由器之间使用路由重分发(route redistribution)将其学习到的一种路由协议的路由通过另一种路由协议广播出去,这样网络的所有部分都可以连通了。
为了实现重分发,路由器必须同时运行多种路由协议,这样,每种路由协议才可以取路由表中的所有或部分其他协议的路由来进行广播。
在路由重分发的过程中要注意每个类型的路由协议的metric值。
一般环境中路由重分发有以下几种情况:
rip和eigrp之间路由重分发;
rip和ospf之间的路由重分发;
rip和isis之间的路由重分发;
eigrp和ospf之间的路由重分发;
eigrp和isis之间的路由重分发;
ospf和isis之间的路由重分发;
igrp和eigrp之间的路由重分发。
今天我们就来配置这几种路由重分发。
试验拓扑图都使用如下拓扑:
配置主机名、配置接口IP等基本步骤省略。
一.rip和eigrp之间路由重分发
假设R1上运行的是rip路由协议;R3上运行的是eigrp路由协议
在rip和eigrp之间配置路由重分发时要注意:
rip的度量值为跳数,本例中我们只有两跳。
Eigrp的度量值为带宽、延迟、可靠、负载最大传输单元。
r2(config)#router rip 把eigrp重分发到rip中
r2(config-router)#redistribute eigrp 100 metric 2
r2(config-router)#exit
r2(config)#router eigrp 100 把rip重分发到eigrp中
r2(config-router)#redistribute rip metric 1544 20000 255 1 1500
r2(config-router)#exit
二、rip和ospf之间的路由重分发
假设R1上运行的是rip路由协议;R3上运行的是ospf路由协议
在rip和ospf之间配置路由重分发时要注意:
Rip的度量值为跳数
Ospf有缺省的度量值,默认为20,可以不配置。
r2(config)#router rip 把ospf重分发到rip中
r2(config-router)#redistribute ospf 1 metric 2
r2(config-router)#exit
r2(config)#router ospf 1 把rip重分发到ospf中
r2(config-router)#redistribute rip metric 100
三、rip和isis之间的路由重分发
假设R1上运行的是rip路由协议;R3上运行的是isis路由协议
在rip和isis之间配置路由重分发时要注意:
Rip的度量值为跳数
Isis要注意isis类型,当把其他路由协议重分发到isis中时,必须使用level-2
r2(config)#router rip 把isis重分发到rip中
r2(config-router)#redistribute isis metric 2
r2(config-router)#exit
r2(config)#router isis 把rip重分发到isis中
r2(config-router)#redistribute rip metric 0 metric-type internal level-2
四.eigrp和ospf之间的路由重分发
假设R1上运行的是eigrp路由协议;R3上运行的是ospf路由协议
Eigrp的度量值为带宽、延迟、可靠、负载最大传输单元。
Ospf有缺省的度量值,默认为20,可以不配置。
r2(config)#router eigrp 100 把ospf重分发到eigrp中
r2(config-router)#redistribute ospf 1 metric 1544 20000 255 1 1500
r2(config-router)#exit
r2(config)#router ospf 1 把eigrp重分发到ospf中
r2(config-router)#redistribute eigrp 100 metric 100
% Only classful networks will be redistributed
r2(config-router)#exit
五.eigrp和isis之间的路由重分发
假设R1上运行的是eigrp路由协议;R3上运行的是isis路由协议
Eigrp的度量值为带宽、延迟、可靠、负载最大传输单元。
Isis要注意isis类型,当把其他路由协议重分发到isis中时,必须使用level-2
r2(config)#router eigrp 100 把isis重分发到eigrp中
r2(config-router)#redistribute isis metric 1544 20000 255 1 1500 level-1-2
r2(config-router)#exit
r2(config)#router isis 把eigrp重分发到isis中
r2(config-router)#redistribute eigrp 100 metric 0 metric-type internal level-2
r2(config-router)#exit
六.ospf和isis之间的路由重分发
假设R1上运行的是ospf路由协议;R3上运行的是isis路由协议
Ospf有缺省的度量值,默认为20,可以不配置。
Isis要注意isis类型,当把其他路由协议重分发到isis中时,必须使用level-2
r2(config)#router ospf 1 把isis重分发到ospf中
r2(config-router)#redistribute isis metric 2 level-1-2
% Only classful networks will be redistributed
r2(config-router)#exit
r2(config)#router isis 把ospf重分发到isis中
r2(config-router)#redistribute ospf 1 metric 0 metric-type internal level-2
七.igrp和eigrp之间的路由重分发
因为Igrp和eigrp属于cisco私有的路由协议。
所以他们之间的路由重分发是自动配置的。
要是所有的路由协议之间的路由重分发都像igrp和eigrp那样该多好啊。
/computer/spks/wangluojishu/。