ciscoIP路由分解实验.docx

上传人:李医生 文档编号:11034583 上传时间:2021-06-19 格式:DOCX 页数:9 大小:19.40KB
返回 下载 相关 举报
ciscoIP路由分解实验.docx_第1页
第1页 / 共9页
ciscoIP路由分解实验.docx_第2页
第2页 / 共9页
ciscoIP路由分解实验.docx_第3页
第3页 / 共9页
ciscoIP路由分解实验.docx_第4页
第4页 / 共9页
ciscoIP路由分解实验.docx_第5页
第5页 / 共9页
点击查看更多>>
资源描述

《ciscoIP路由分解实验.docx》由会员分享,可在线阅读,更多相关《ciscoIP路由分解实验.docx(9页珍藏版)》请在三一文库上搜索。

1、cisco IP路由 分解实验1. 在路由表中查找特定的路由条目Routershow ip route 172.25.100.15Routing entry for 172.25.100.0/24Known via ospf 55, distance 110, metric 11, type inter areaRedistributing via ospf 55Last update from 172.25.1.1 on Ethernet0, 2d12h agoRouting Descriptor Blocks:* 172.25.1.1, from 172.25.1.1, 2d12h ago

2、, via Ethernet0 Route metric is 11, traffic share count is 1注释路由器在路由表中查找路由条目的原则是最长匹配,所以例子中虽然查找的是172.25.200.15但是由于没有这条特定的路由,显示的结果是最长匹配的172.15.100.0/24。如果没有任何一条匹配只能使用缺省路由,会出现下面信息Router show ip route 172.15.101.5% Network not in table注意的是这里都是无类路由,如果有类的就不一样了2. 在路由表中查找相同类型的路由条目Router show ip route static

3、192.168.1.0/32 is subnetted, 1 subnetsS192.168.1.1 1/0 via 172.25.1.4还有一个更有用的命令Router show ip route summaryIP routing table name is Default-IP-Routing-Table(0)Route SourceNetworksSubnetsOverheadMemory (bytes)connected03328432static1064144ospf5513256576Intra-area: 1 Inter-area: 2 External-1: 1 Extern

4、al-2: 0NSSA External-1: 0 NSSA External-2: 0internal22328Total466483480注释通过显示路由表的统计情况来了解当前路由器的路由条目,也可以用来以后的比对3. 配置静态路由Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#ip route 10.35.15.5 255.255.255.255 Ethernet0( permanent选项可以使此条目一直存在于路由表中,而不管下一跳的可达

5、性)Router(config)#ip route 172.16.0.0 255.255.0.0 10.35.6.1 2Router(config)#endRouter#( permanent )也可以给路由条目打上标签Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#ip route 172.16.0.0 255.255.0.0 10.35.6.1 2 tag 36291Router(config)#endRouter#注释在类似以太网这种多路访

6、问的网络中建议使用下一跳为地址而不是接口。正常情况下路由器对静态路由的下一跳有效性的检查是一分钟,在以对此时间进行调整Router(config)#iproutestatic12.3(10)以后增加了下面的命令可adjust-time30。对静态路由打tag用于路由再发布时的区分4. 当动态路由出问题的时候使用静态路由作为备份Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#ip route 10.0.0.0 255.0.0.0 172.16.1.

7、1 190(下一跳也可以触发一个拨号接口)Router(config)#endRouter#注释通过调整管理距离的方式来进行路由备份,不过要注意的是管理距离只适合在相同路由的情况下,路由条目的最长匹配是第一位的。另外在不同厂商设备互联的时候,调整管理距离一定要设置合理。5. 根据源地址的不同选择不同的路径Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#access-list 1 permit 10.15.35.0 0.0.0.255Router(

8、config)#access-list 2 permit 10.15.36.0 0.0.0.255Router(config)#interface Ethernet0Router(config-if)#ip address 10.15.22.7 255.255.255.0Router(config-if)#ip policy route-map EngineersRouter(config-if)#ip route-cache policyRouter(config-if)#exitRouter(config)#route-map Engineers permit 10Router(confi

9、g-route-map)#match ip address 1Router(config-route-map)#set ip next-hop 10.15.27.1Router(config-route-map)#exitRouter(config)#route-map Engineers permit 20Router(config-route-map)#match ip address 2Router(config-route-map)#set interface Ethernet1Router(config-route-map)#endRouter#注释缺省情况下route map的最后

10、一句都是deny all,这样不符合route map规则的数据包都会按照正常的路由表进行转发。set ip next-hop verify-availability命令提供了对下一跳的验证, 不过是基于CDP的,所以如果使用此命令需要打开CDP,最好同时调整时长,毕竟缺省是180 秒。在使用策略路由时会在排错时增加难度,因为缺省对于本路由器发出的数据包可以绕过route map这样会造成错觉。6. 根据不同的应用来选择不同的路径Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z

11、.Router(config)#access-list 101 deny tcp 10.15.25.0 0.0.0.255 any eq wwwRouter(config)#access-list 101 permit tcp any any eq wwwRouter(config)#interface Ethernet0Router(config-if)#ip address 10.15.22.7 255.255.255.0Router(config-if)#ip policy route-map WebsurfersRouter(config-if)#ip route-cache poli

12、cyRouter(config-if)#exitRouter(config)#route-map Websurfers permit 10Router(config-route-map)#match ip address 101Router(config-route-map)#set ip next-hop 10.15.27.1Router(config-route-map)#exitRouter(config)#route-map Websurfers permit 20Router(config-route-map)#set ip default next-hop 10.15.26.1Ro

13、uter(config-route-map)#endRouter#对于本设备的发出的数据包也使用策略路由Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#ip local policy route-map dlswtrafficRouter(config)#access-list 103 permit tcp any any eq 2065Router(config)#access-list 103 permit tcp any eq 2065 a

14、nyRouter(config)#route-map dlswtraffic permit 10Router(config-route-map)#match ip address 103Router(config-route-map)#set ip next-hop 10.15.27.3Router(config-route-map)#endRouter#注释正常情况下如果所有定义的下一跳都不存在的情况下会使用路由表来查询,如果路由表没有此定义会使用缺省路由,这时候你可以使用set ip default next-hop来定义一个不同的缺省路由7. 检查所应用的策略路由Routershow i

15、p policyInterfacelocalEthernet0Serial0Routershow route-mapRoute mapdlswtrafficWebsurfersHigh-priorityroute-map High-priority, permit, sequence 10Match clauses:ip address (access-lists): 101Set clauses:ip next-hop 10.15.27.1Policy routing matches: 0 packets, 0 bytesroute-map Websurfers, permit, seque

16、nce 10Match clauses:ip address (access-lists): 102Set clauses:ip next-hop 10.15.27.1Policy routing matches: 0 packets, 0 bytesroute-map Websurfers, permit, sequence 20Match clauses:Set clauses:ip default next-hop 10.15.26.1Policy routing matches: 4 packets, 531 bytesroute-map dlswtraffic, permit, se

17、quence 10Match clauses:ip address (access-lists): 103Set clauses:ip next-hop 10.15.27.3Policy routing matches: 5 packets, 500 bytes注释也可以通过show access-list 103命令看到更多的匹配信息8. 调整学到的外部网络的缺省管理距离Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#router ripRou

18、ter(config-route)#network 192.168.15.0Router(config-route)#distance 15 192.168.15.1 0.0.0.0Router(config-route)#distance 200 192.168.15.0 0.0.0.255Router(config-route)#distance 255Router(config-route)#endRouter#Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Route

19、r(config)#router eigrp 111Router(config-route)#network 192.168.16.0Router(config-route)#distance eigrp 55 200Router(config-route)#endRouter#Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#router ospf 66Router(config-route)#distance ospf inter-area 1

20、15Router(config-route)#distance ospf intra-area 105Router(config-route)#distance ospf external 125Router(config-route)#endRouter#Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#router bgp 65520Router(config-route)#distance bgp 115 220 50Router(confi

21、g-route)#endRouter#注释管理距离只是针对自己的,通过调整这些外部路由的管理距离来调整自己路由表的结构9. 限制路由器到达同一目的地的路径数目Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#router ospf 65510Router(config-router)#maximum-paths 2Router(config-router)#endRouter#IOS 12.2T以后对 BGP增加了下面的命令Router#confi

22、gure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#router bgp 65511Router(config-router)#maximum-paths 2Router(config-router)#maximum-paths ibgp 3Router(config-router)#endRouter#注释 缺省情况下静态路由可以有 6 条冗余,BGP只有一条最佳路径, 其他路由协议为 4 条。使用上述命令在 12.3(2)T 之前可以调整最大为 6 条, 12.3(2)

23、T 之后可以最大为 16 条10. 在某个端口当掉等情况下才启用特定的静态路由Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#track 10 interface Serial0/0 line-protocolRouter(config-track)#delay down 5 up 30Router(config-track)#exitRouter(config)#ip route 192.168.10.0 255.255.255.0 10.3.

24、12.26 track 10 Router(config)#endRouter#Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#track 11 ip route 10.2.95.0 255.255.255.0 reachabilityRouter(config-track)#delay down 5 up 5Router(config-track)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 10.3

25、.12.26 track 11Router(config)#endRouter#Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Router(config)#track 12 list boolean andRouter(config-track)#object 10 notRouter(config-track)#object 11Router(config-track)#exitRouter(config)#ip route 192.168.13.0 255.255.25

26、5.0 10.3.12.26 track 12Router(config)#endRouter#注释从 12.3T 和 12.4 以后开始IOS 提供了一种track的特性,可以定义跟踪不同的状态。可以使用show track命令来查看跟踪的状态。跟踪状态也可以进行组合,使用and or 逻辑运算或者百分比,权重等增加灵活度,很好玩,不过别把自己绕进去了5.12.路由表变动统计提问通过路由表变动的统计来衡量路由表的稳定性回答Router#configure terminalEnter configuration commands, one per line.End with CNTL/Z.Ro

27、uter(config)#ip route profileRouter(config)#endRouter#Router#show ip route profileIP routing table change statistics:Frequency of changes in a 5 second sampling interval-Change/Fwd-pathPrefixNexthopPathcountPrefixintervalchangeaddchangechangerefresh-0327327335335331144001222001300000411001.Router#注释 12.0就有的一个老命令,但估计很少有人使用,这个统计也是够难懂的,简单的说最理想的情况就是第一行数目很大,其他行都是0。统计方法是每3 秒一个间隔,在这个间隔内如果有1 次路由表变化就累计一次,多次变化就累计多次。但这个命令还是有一些缺点,一就是不能清掉老的数据,必须通过no ip route profile,然后ip route profile来清除,还有就是这里只是统计结果,没有办法确定是哪条路由出的问题

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1