当前位置:文档之家› 3种动态路由协议

3种动态路由协议

RIP EIGRP和OSPF重分布Cisco默认的几种路由协议的AD如下:1.直连接口:02.静态路由:1(例外:使用接口来代替下1跳地址的时候它会被认为是直连接口)3.EIGRP汇总路由:54.External(外部) BGP:205.EIGRP:906.IGRP:1007.OSPF:1108.IS-IS:1159.RIP:12010.EGP:14011.External(外部) EIGRP:17012.Internal(内部) BGP:20013.未知:255做重分布时的各路由协议的默认metric值1、往RIP里做时,metric值默认infinity.所以要人工指定metric值,注意不要超过RIP中最大16跳.2、往OSPF里做时,metric值默认是20,metric-type 是2默认不发布子网.3、往EIGRP里做时,metric值默认是infinity,人工指metric值时包括:带宽,延迟,可靠度,负载,MTU.(注:可靠度=255时最大,负载=1时最小,MTU=1500,一般来说这三个值都设成这样.而且在配置metric值时的顺序就是这样的顺序.)如:Paige(config-router)#redistribute ospf 1 metric 10000 100 255 1 15004、往IS-IS里做时,Router的默认类型是level-2的,并且metric值为0,在做重分布时,如果网络中只有一个IS-IS进程时,可以不写IS-IS的tag,而其他的路由协议,如EIGRP后面必须跟上进程号.注:metric-type类型为由于OSPF的外部路由分为类型1:--外部路径成本+数据包在OSPF网络所经过各链路成本类型2:--外部路径成本,即ASBR上的默认设置问题:在向EIGRP中重分布时,必须指定默认管理距离吗?为何只在OSPF向EIGRP重分布时distance eigrp 90 150??答:在默认时EIGRP的内部管理距离是90,外部路由管理距离是170,命令“distance eigrp 90 150”只是修改了外部管理距离R1(config)#int loo0R1(config-if)#ip add 1.1.1.1 255.255.255.0R1(config-if)#int s2/0R1(config-if)#ip add 192.168.12.1 255.255.255.0R1(config-if)#no shR1(config-if)#exitR1(config)#R1(config)#R1(config)#router ripR1(config-router)#version 2R1(config-router)#net 192.168.12.0R1(config-router)#net 1.0.0.0R1(config-router)#no net 1.0.0.0R1(config-router)#no auto-summaryR1(config-router)#redistribute static metric 3R1(config-router)#exitR1(config)#ip route 0.0.0.0 0.0.0.0 s 2/1-------配置默认路由,观查R2上的路由表R1(config)#exitR1(config)#int s2/1R1(config-if)#no shR1(config-if)#exitR1(config)#R1(config)#R1(config)#^ZR1#ping 4.4.4.4Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 76/118/176 msR1#sh 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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial2/01.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback03.0.0.0/24 is subnetted, 1 subnetsR 3.3.3.0 [120/4] via 192.168.12.2, 00:00:03, Serial2/0-----从R2上重分布进来的,注意度量值与R2上相符4.0.0.0/32 is subnetted, 1 subnetsR 4.4.4.4 [120/4] via 192.168.12.2, 00:00:03, Serial2/0R 192.168.23.0/24 [120/4] via 192.168.12.2, 00:00:03, Serial2/0-----从R2上重分布进来的R 192.168.34.0/24 [120/4] via 192.168.12.2, 00:00:03, Serial2/0-----从R2上重分布进来的R1#//////////////////////////R2(config)#int loo0R2(config-if)#ip add 2.2.2.2 255.255.255.0R2(config-if)#no shR2(config-if)#int s2/0R2(config-if)#ip add 192.168.12.2 255.255.255.0R2(config-if)#no shR2(config-if)#int s2/1R2(config-if)#ip add 192.168.23.2 255.255.255.0R2(config-if)#no shR2(config-if)#exitR2(config)#R2(config)#router eigrp 1R2(config-router)#no auto-summaryR2(config-router)#redistribute rip metric 1000 100 255 1 1500R2(config-router)#router ripR2(config-router)#version 2R2(config-router)#no auR2(config-router)#net 192.168.12.0R2(config-router)#redistribute eigrp 1R2(config-router)#default-metric 4R2(config-router)#router eigrp 1R2(config-router)#net 192.168.23.0R2(config-router)#exitR2(config)#R2(config)#^ZR2#sh 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 2 E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is not setC 192.168.12.0/24 is directly connected, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback03.0.0.0/24 is subnetted, 1 subnetsD 3.3.3.0 [90/2297856] via 192.168.23.3, 00:19:12, Serial2/14.0.0.0/32 is subnetted, 1 subnetsD EX 4.4.4.4 [170/3097600] via 192.168.23.3, 00:16:34, Serial2/1C 192.168.23.0/24 is directly connected, Serial2/1D EX 192.168.34.0/24 [170/3097600] via 192.168.23.3, 00:18:50, Serial2/1R2#-------没有发现R1上的默认路由////////////////////////////R3(config)#int loo0R3(config-if)#ip add 3.3.3.3 255.255.255.0R3(config-if)#int s2/1R3(config-if)#ip add 192.168.23.3 255.255.255.0R3(config-if)#no shR3(config-if)#int s2/0R3(config-if)#ip add 192.168.34.3 255.255.255.0R3(config-if)#no shR3(config-if)#exitR3(config)#R3(config)#router eigrp 1R3(config-router)#no auR3(config-router)#net 3.3.3.0 0.0.0.255R3(config-router)#net 192.168.23.0R3(config-router)#redistribute ospf 1 metric 1000 100 255 1 1500R3(config-router)#distance eigrp 90 150------配置EIGRP默认管理距离,有何用处?不配置会怎样?为何只在OSPF向EIGRP重分布时R3(config-router)#router ospf 1R3(config-router)#router-id 3.3.3.3R3(config-router)#net 192.168.34.0 0.0.0.255 a 0R3(config-router)#redistribute eigrp 1 metric 30 metric-type 1 subnetsR3(config-router)#default-information originate always ----------注入默认路由,注意R4上的路由表R3(config-router)#exitR3(config)#R3(config)#^ZR3#R3#sh 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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not setD EX 192.168.12.0/24 [150/3097600] via 192.168.23.2, 00:19:23, Serial2/13.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback04.0.0.0/32 is subnetted, 1 subnetsO 4.4.4.4 [110/65] via 192.168.34.4, 00:16:43, Serial2/0C 192.168.23.0/24 is directly connected, Serial2/1C 192.168.34.0/24 is directly connected, Serial2/0R3#sh ip protocolsRouting Protocol is "eigrp 1"Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setDefault networks flagged in outgoing updatesDefault networks accepted from incoming updatesEIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0EIGRP maximum hopcount 100EIGRP maximum metric variance 1Redistributing: eigrp 1, ospf 1 (internal, external 1 & 2, nssa-external 1 & 2)EIGRP NSF-aware route hold timer is 240sAutomatic network summarization is not in effectMaximum path: 4Routing for Networks:3.3.3.0/24192.168.23.0Routing Information Sources:Gateway Distance Last Update192.168.23.2 90 00:19:37Distance: internal 90 external 150Routing Protocol is "ospf 1"Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRouter ID 3.3.3.3It is an autonomous system boundary routerRedistributing External Routes from,eigrp 1 with metric mapped to 30, includes subnets in redistribution Number of areas in this router is 1. 1 normal 0 stub 0 nssaMaximum path: 4Routing for Networks:192.168.34.0 0.0.0.255 area 0Routing Information Sources:Gateway Distance Last Update4.4.4.4 110 00:17:00Distance: (default is 110)R3#////////////////////////////R4(config)#int loo0R4(config-if)#ip add 4.4.4.4 255.255.255.0R4(config-if)#int s2/0R4(config-if)#ip add 192.168.34.4 255.255.255.0R4(config-if)#no shR4(config-if)#exitR4(config)#R4(config)#router ospf 1R4(config-router)#router-id 4.4.4.4R4(config-router)#net 4.4.4.0 0.0.0.255 a 0R4(config-router)#net 192.168.34.0 0.0.0.255 a 0R4(config-router)#exitR4(config)#exitR4#ping 192.168.12.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 76/106/152 msR4#sh 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, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is 192.168.34.3 to network 0.0.0.0O E1 192.168.12.0/24 [110/94] via 192.168.34.3, 00:16:49, Serial2/03.0.0.0/24 is subnetted, 1 subnetsO E1 3.3.3.0 [110/94] via 192.168.34.3, 00:16:49, Serial2/04.0.0.0/24 is subnetted, 1 subnetsC 4.4.4.0 is directly connected, Loopback0O E1 192.168.23.0/24 [110/94] via 192.168.34.3, 00:16:49, Serial2/0C 192.168.34.0/24 is directly connected, Serial2/0O*E2 0.0.0.0/0 [110/1] via 192.168.34.3, 00:16:49, Serial2/0------学习到了R3上的默认路由R4#。

相关主题