策略路由与前缀列表实验.doc_第1页
策略路由与前缀列表实验.doc_第2页
策略路由与前缀列表实验.doc_第3页
策略路由与前缀列表实验.doc_第4页
策略路由与前缀列表实验.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

实验十一 策略路由和前缀列表的配置一、实验目的通过本实验掌握以下内容:(1)用route-map 定义路由策略(2)在接口下应用路由策略(3)基于源IP 地址的策略路由的调试(4)基于报文大小的策略路由的调试(5)前缀列表的配置二、实验内容实验任务一 基于源IP地址的策略路由(PBR)实验拓扑实验步骤及配置命令1. R1、R2和R3的配置R1(config)#interface f0/0R1(config-if)#ip address 192.1.1.3 255.255.255.0R1(config)#interface serial 1/0R1(config-if)#ip address 150.1.1.1 255.255.255.0R1(config-if)#no shutdownR1(config)#interface serial 1/1R1(config-if)#ip address 151.1.1.1 255.255.255.0R1(config-if)#no shutdownR1(config)#router ripR1(config-router)#network 192.1.1.0R1(config-router)#network 150.1.0.0R1(config-router)#network 151.1.0.0R1(config-router)#exitR2(config)#interface s0/1R2(config-if)#ip address 150.1.1.2 255.255.255.0R2(config-if)#no shutdown R2(config-if)#clock rate 64000R2(config-if)#exitR2(config)#interface s0/2R2(config-if)#ip address 151.1.1.2 255.255.255.0R2(config-if)#clock rate 64000R2(config-if)#no shutdown R2(config-if)#exitR2(config)#interface loopback 0R2(config-if)#ip address 152.1.1.1 255.255.255.0R2(config-if)#exitR2(config)#router ripR2(config-router)#network 150.1.0.0R2(config-router)#network 151.1.0.0R2(config-router)#network 152.1.0.0R2(config)#do wr R3(config)#interface f1/0R3(config-if)#ip address 192.1.1.1 255.255.255.0R3(config-if)#ip address 192.1.1.2 255.255.255.0 secondary 2. R1(config)#access-list 1 permit 192.1.1.1 0.0.0.0R1(config)#access-list 2 permit 192.1.1.2 0.0.0.0定义两台服务器的IPR1(config)#route-map lab1 permit 10R1(config-route-map)#match ip address 1R1(config-route-map)#set ip next-hop 150.1.1.2R1(config-route-map)#exitRoute Map表lab1的第一条语句,服务器192.1.1.1的数据经过下一跳地址是150.1.1.2即s0/1发送,条件语句嵌套ACL1R1(config)#route-map lab1 permit 20R1(config-route-map)#match ip address 2R1(config-route-map)#set ip next-hop 151.1.1.2R1(config-route-map)#exitRoute Map表lab1的第二条语句,服务器192.1.1.2的数据经过下一跳地址是151.1.1.2即s0/2发送,条件语句嵌套ACL2R1(config)#interface f 0/0R1(config-if)#ip policy route-map lab1在f 0/0接口上应用名字是lab1的Route Map表R1(config)#ip local policy route-map lab1要求路由器本身产生的数据包也接受策略路由的管理2. 测试扩展的traceroute 命令R3#traceroute ipTarget IP address: 152.1.1.1Source address: 192.1.1.1Numeric display n: Timeout in seconds 3: Probe count 3: Minimum Time to Live 1: Maximum Time to Live 30: Port Number 33434: Loose, Strict, Record, Timestamp, Verbosenone: Type escape sequence to abort.Tracing the route to 152.1.1.1 1 150.1.1.2 56 msec * 72 msecR3#traceroute ipTarget IP address: 152.1.1.1Source address: 192.1.1.2Numeric display n: Timeout in seconds 3: Probe count 3: Minimum Time to Live 1: Maximum Time to Live 30: Port Number 33434: Loose, Strict, Record, Timestamp, Verbosenone: Type escape sequence to abort.Tracing the route to 152.1.1.1 1 151.1.1.2 56 msec * 52 msec另一种测试源IP地址的策略路由使用debug ip policy命令来监视策略路由R1#debug ip policy Policy routing debugging is onR3#ping Protocol ip: Target IP address: 152.1.1.1Repeat count 5: Datagram size 100: Timeout in seconds 2:Extended commands n: ySource address or interface: 192.1.1.1Type of service 0: Set DF bit in IP header? no: Validate reply data? no: Data pattern 0xABCD: Loose, Strict, Record, Timestamp, Verbosenone: Sweep range of sizes n: Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 152.1.1.1, timeout is 2 seconds:Packet sent with a source address of 192.1.1.1 !Success rate is 100 percent (5/5), round-trip min/avg/max = 4/51/128 ms这样路由器R1会输出debug ip policy监视所得的结果,截图该命令显示定义的所有路由策略及路由策略匹配的情况。R1#show route-map 查看定义的所有路由策略及路由策略匹配的情况R1#show ip policy 查看策略路由及作用的接口实验任务二 基于报文大小的策略路由(PBR)实验拓扑同上本实验设计如下:在路由器R1 的f0/0 接口应用IP 策略路由CCNP,使得对大小为64-100字节的数据包设置出接口为s1/0;大小为101-1000 字节的数据包设置出接口为s1/1,所有其它的数据包正常转发,整个网络运行EIGRP 路由协议。请自己按照实际拓扑的描述设计实验模拟拓扑实验参考命令步骤1:先去掉上一个任务中R1的策略路由的相关配置R1(config)#no ip local policy route-map lab1R1(config)#interface f 0/0R1(config-if)#no ip policy route-map lab1R1(config)#no route-map lab1R1(config)#no access-list 1R1(config)#no access-list 2步骤2:配置路由器R1R1(config)#route-map CCNP permit 10R1(config-route-map)#match length 64 100R1(config-route-map)#set interface s1/0R1(config)#route-map CCNP permit 20R1(config-route-map)#match length 101 1000R1(config-route-map)#set interface s1/1R1(config)#interface f0/0R1(config-if)#ip policy route-map CCNPR1(config)#router eigrp 1R1(config-router)#no auto-summaryR1(config-router)#network 10.1.1.0 255.255.255.0R1(config-router)#network 192.168.12.0R1(config-router)#network 192.168.21.0实验调试(1)执行扩展ping 命令,数据包的长度为90,源地址为192.1.1.1(路由器R3 的以太口地址):R3#pingProtocol ip:Target IP address: 152.1.1.1Repeat count 5: 1Datagram size 100: 90Timeout in seconds 2:Extended commands n: ySource address or interface: 192.1.1.1Type of service 0:Set DF bit in IP header? no:Validate reply data? no:Data pattern 0xABCD:Loose, Strict, Record, Timestamp, Verbosenone:Sweep range of sizes n:Type escape sequence to abort.路由器R1 上显示调试信息,仔细分析其含义。R1#debug ip policy(2)执行扩展ping 命令,数据包的长度为300, 源地址为192.1.1.1R3#ping(3)执行扩展ping 命令,数据包的长度为1200, 源地址为192.1.1.1R3#ping(4) show route-map 该命令显示定义的所有路由策略及路由策略匹配的情况。(5) show ip policy 查看策略路由及作用的接口实验任务三 使用前缀列表实现下图所示功能。实验拓扑路由器R1和R3环回接口的子网掩码都是24位。实验内容及步骤1. 配置三台路由器的IP地址2. 配置路由协议3. 配置路由重分发4. 查看R1和R3路由表的信息,截图。-5.在R2上配置前缀列表ip prefix-list pfx1 permit 10.0.0.0/14 ge 24 le 24ip prefix-list pfx2 permit 10.8.0.0/14 ge 24思考还有没有其它前缀列表匹配命令6.在R2上配置路由映射表,引用前缀列表route-map into_ospf permit 10match ip address prefix-list pfx1route-map into_rip permit 10match ip address prefix-list pfx27.在R2上进行重分发时调用路由映射表,进行路由过滤。router ospf 1redistribute rip subnets route-map into_ospfrouter rip redistribute ospf 1 metric 5 route-map into_rip8. 查看R1和R3路由表的信息,截图。9.在R2上查看前缀列表信息show ip prefix-list show ip prefix-list detail思考:写出下面前缀列表匹配的命令,前缀列表名称自己拟定。1. 匹配所有路由ip prefix-list xu permit 0.0.0.0/0 le 322. 匹配默认路由ip prefix-l

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论