Cisco策略路由的概念原理配置实例
策略路由配置详解
![策略路由配置详解](https://img.taocdn.com/s3/m/aed2e3024afe04a1b171de89.png)
38策略路由配置理解策略路由策略路由概述策略路由〔PBR:Policy-Based Routing〕提供了一种比基于目的地址进展路由转发更加灵敏的数据包路由转发机制。
策略路由可以根据IP/IPv6报文源地址、目的地址、端口、报文长度等内容灵敏地进展路由选择。
现有用户网络,常常会出现使用到多个ISP〔Internet Server Provider,Internet效劳提供商〕资源的情形,不同ISP申请到的带宽不一;同时,同一用户环境中需要对重点用户资源保证等目的,对这局部用户不可以再根据普通路由表进展转发,需要有选择的进展数据报文的转发控制,因此,策略路由技术即可以保证ISP资源的充分利用,又可以很好的满足这种灵敏、多样的应用。
IP/IPv6策略路由只会对接口接收的报文进展策略路由,而对于从该接口转发出去的报文不受策略路由的控制;一个接口应用策略路由后,将对该接口接收到的所有包进展检查,不符合路由图任何策略的数据包将按照普通的路由转发进展处理,符合路由图中某个策略的数据包就按照该策略中定义的操作进展转发。
一般情况下,策略路由的优先级高于普通路由,可以对IP/IPv6报文根据定义的策略转发;即数据报文先按照IP/IPv6策略路由进展转发,假如没有匹配任意一个的策略路由条件,那么再按照普通路由进展转发。
用户也可以配置策略路由的优先级比普通路由低,接口上收到的IP/IPv6报文那么先进展普通路由的转发,假如无法匹配普通路由,再进展策略路由转发。
用户可以根据实际情况配置设备转发形式,如选择负载平衡或者冗余备份形式,前者设置的多个下一跳会进展负载平衡,还可以设定负载分担的比重;后者是应用多个下一跳处于冗余形式,即前面优先生效,只有前面的下一跳无效时,后面次优的下一跳才会生效。
用户可以同时配置多个下一跳信息。
策略路由可以分为两种类型:一、对接口收到的IP报文进展策略路由。
该类型的策略路由只会对从接口接收的报文进展策略路由,而对于从该接口转发出去的报文不受策略路由的控制;二、对本设备发出的IP报文进展策略路由。
路由策略典型配置举例与故障排除
![路由策略典型配置举例与故障排除](https://img.taocdn.com/s3/m/2cdfea7f82c4bb4cf7ec4afe04a1b0717fd5b3ef.png)
路由策略导致网络连接不稳定
如果路由策略导致网络连接不稳定,可能是由于策略 本身存在性能问题,或者网络环境发生变化但路由策 略未及时调整等原因。
首先,需要检查路由策略的代码是否存在性能问题, 例如循环语句、过于复杂的算法等。其次,需要确认 当前的网络环境是否与路由策略相匹配,例如是否需 要更改路由策略的地址段或端口范围。此外,还需要 对网络环境进行监控和分析,找出可能影响路由策略 性能的其他因素。
路由策略无法正确识别源/目的地址
如果路由策略无法正确识别源地址或目的地 址,很可能是由于地址掩码设置不正确或地 址类型选择不当等原因。
首先,需要检查地址掩码的设置是否正确, 掩码位数是否与网络环境相匹配。其次,需 要确认地址类型是否选择恰当,例如是否需 要将私有地址转换为公网地址。此外,还需 要检查路由策略是否添加了其他过滤条件,
根据网络状态、应用需求和用户行为等因素进行自动优化和调整。
03
多路径路由的应用
多路径路由是一种可以利用多种路径进行数据传输的技术,可以提供更
高的可靠性和容错能力。未来,多路径路由的应用将会越来越广泛。
THANKS
感谢观看
03
CATALOGUE
故障排除
路由策略无法正常工作
当路由策略无法正常工作时,可能存在以下几种情况:策略本身存在错误、配置过程中出现失误、网 络环境发生变化等。
首先,需要检查路由策略的代码是否正确,是否存在语法错误、逻辑错误等问题。其次,需要核对配 置过程中的各项参数是否正确,包括源地址、目的地址、端口号等。最后,需要确认当前的网络环境 是否与路由策略相匹配,例如是否需要更改路由策略的地址段或端口范围。
路由策略的故障排除
当网络出现故障时,需要分析故障原因,并根据路由策略 的配置逐一排查,确定故障点并进行修复。
Cisco交换机做策略路由
![Cisco交换机做策略路由](https://img.taocdn.com/s3/m/b606db11f12d2af90342e61d.png)
Cisco交换机做策略路由Cisco交换机做策略路由阅读:980次时间:2011-07-12 20:29:23字体:[大中小]以节约成本、合理利用现有设备为原则,笔者制定了一个解决方案:利用MikroTikRouterOS,改造了几台办公淘汰下来的普通PC做成软路由,分担原来防火墙的流量来共同承担网络的出口任务,在三层交换机上做策略路由实现数据的不同流向,从而达到分流的目的。
关于软路由(ROS)的安装配置等问题本文不做阐述,本文主要针对策略路由的实现及做策略路由时碰到的问题及优化进行详细阐述。
策略路由中所谓策略的制定依赖于访问控制列表(ACL),因此策略路由中策略的制定是方便而又灵活的,可以满足不同方面的需求。
这样,在vlan201接口下符合access-list100的数据就被转发到以10.10.3.2为内网接口的软路由上了,从而实现了分流。
关键词:策略路由,分流,ACL,软路由0 .引言校园网是高校信息化建设的基础设施,也是教学管理信息化现代化的必要平台。
随着笔者所在学院的发展、网络应用的不断增加,原来的网络日益无法满足需求。
后虽升级了网络核心三层交换机,但购买于早期的出口防火墙,因性能有限,越来越成为校园网络的瓶颈。
升级网络出口设备当然是解决这一瓶颈比较好的方法,但一款高性能的路由器或防火墙往往价格不菲,而且还可能存在单点失效问题,不能完全解决问题。
为此,以节约成本、合理利用现有设备为原则,笔者制定了一个解决方案:利用MikroTik RouterOS,改造了几台办公淘汰下来的普通PC做成软路由,分担原来防火墙的流量来共同承担网络的出口任务,在三层交换机上做策略路由实现数据的不同流向,从而达到分流的目的。
关于软路由(ROS)的安装配置等问题本文不做阐述,本文主要针对策略路由的实现及做策略路由时碰到的问题及优化进行详细阐述。
1.策略路由简介策略路由是一种比利用目标网络进行路由更加灵活的数据包路由转发机制,策略路由的优先级别高于普通路由。
思科CCNP认证PBR策略路由与BGP协议详解
![思科CCNP认证PBR策略路由与BGP协议详解](https://img.taocdn.com/s3/m/69a1953c443610661ed9ad51f01dc281e53a56c4.png)
思科CCNP认证PBR策略路由与BGP协议详解本⽂讲述了思科CCNP认证PBR策略路由与BGP协议。
分享给⼤家供⼤家参考,具体如下:PBR——策略路由定义:通过流量策略来执⾏选路的⼀种转发⼿段。
控制层⾯——给路由的转发做指导数据层⾯——在路由表中找到路由的出接⼝或者下⼀跳传统的路由表转发只能通过数据的⽬标地址做策略。
策略路由可以根据源地址、⽬的地址、源端⼝、⽬的端⼝、协议、TOS等流量特征来做决策提供路由——灵活性⾼,但速度慢,需要⼀个⼀个抓,操作相对⿇烦。
路由表与策略路由的关系:策略路由是先于路由表执⾏的,策略路由没有捕获的流量依然会去执⾏路由表。
两种配置:1:接⼝下配置access-list 100 permit ip host 1.1.1.1 any //⽤ACL捕获流量route-map pbr permit 10 //定义route-mapnatch ip address 10 //调⽤被ACL捕获的流量set ip next-hop 10.1.1.1 //设置下⼀跳int f0/1ip policy route-map pbr //接⼝下调⽤只能捕获该接⼝的⼊接⼝流量做策略(不能处理本路由器产⽣的流量)。
2:全局配置access-list 100 permit ip host 1.1.1.1 any //⽤ACL捕获流量route-map pbr permit 10 //定义route-mapmatch ip address 10 //调⽤被ACL捕获的流量set ip next-hop 10.1.1.1 //设置下⼀跳ip local policy route-map pbr能够捕获所有接⼝⼊接⼝流量以及本路由器产⽣的流量(源地址是本路由器地址)3:策略路由的冗余设置route-map pbr permit 10match ip address 1ip next-hop verify-availability 10.1.24.2 1 track 1 //track 成功则本条⽣效,track失败则执⾏下⼀条set语句track ip next-hop 10.1.34.3track 1 ip sla 1 //定义⼀个track监控sla的探测结果ip sla 1 //定义⼀个slaip icmp-echo 10.1.12.1 source-ip 10.4.4.4 //设置其探针ip sla schedule 1 life forever start-time now //设置sla 1的执⾏时间4:default 语句在route-map的set ip default这个位置输⼊,定义被捕获的流量为先查路由表。
思科Cisco策略路由与路由策略实例详解
![思科Cisco策略路由与路由策略实例详解](https://img.taocdn.com/s3/m/dfa7c91303020740be1e650e52ea551810a6c9c9.png)
思科Cisco策略路由与路由策略实例详解本⽂讲述了思科Cisco策略路由与路由策略。
分享给⼤家供⼤家参考,具体如下:⼀、策略路由1. 路由策略与策略路由2. 策略路由的特点3.策略路由的配置3.1 接⼝下配置3.2 全局配置3.3 策略路由的冗余设置3.4 default语句3.5 为流量打ToS标记⼆、路由策略1.抓取流量的列表1.1 ACL访问控制列表1.2 prefix-list前缀列表2. 路由策略⼯具2.1 distribute-list分发列表2.2 route-map路由镜像2.3 OSPF filter-list⼀、策略路由1. 路由策略与策略路由路由策略是对路由信息本⾝的参数进⾏修改、控制等,最终影响路由表的⽣成,说⽩了路由策略就是告诉设备怎么学,⼀般与BGP结合使⽤⽐较多。
策略路由PBR,策略基于路由重点在路由,就是通过策略控制数据包的转发⽅向。
也有⼈把策略路由称之为⼀个复杂的静态路由。
⼀般来讲,策略路由是先于路由表执⾏的。
即设备在转发报⽂时,⾸先将报⽂与策略路由的匹配规则进⾏⽐较。
若符合匹配条件,则按策略路由进⾏转发;如果报⽂⽆法匹配策略路由的条件,再按照普通路由进⾏转发。
策略路由在转化层⾯不如路由表。
原因是匹配的东西过多,底层芯⽚处理⽀持有限。
使⽤原则是能不⽤就不⽤。
如果出现⾮⽬的地址的转发策略,果断⽤。
2. 策略路由的特点传统的路由表转发只能通过数据的⽬标地址做决策;策略路由可以根据源地址、⽬的地址、源端⼝、⽬的端⼝、协议、TOS等流量特征来做策略提供路由,灵活性⾼。
为QoS服务。
使⽤route-map及策略路由可以根据数据包的特征修改其相关QoS项,进⾏为QoS服务。
负载均衡。
使⽤策略路由可以设置数据包的⾏为,⽐如下⼀跳、下⼀接⼝等,这样在存在多条链路的情况下,可以根据数据包的应⽤不同⽽使⽤不同的链路,进⽽提供⾼效的负载均衡能⼒。
策略路由PBR默认只对穿越流量⽣效,不能处理本路由器产⽣流量3.策略路由的配置3.1 接⼝下配置接⼝下只能捕获该接⼝的⼊接⼝流量做策略(不能处理本路由器产⽣流量)R1(config)#access-list 100 permit ip host 1.1.1.1 any //⽤ACL捕获流量R1(config)#route-map pbr permit 10 //定义route-mapR1(config-route-map)#match ip add 100 //调⽤被ACL捕获的流量R1(config-route-map)#set ip next-hop 10.1.1.1 //设置下⼀跳R1(config-route-map)#exitR1(config)#int f0/0R1(config-if)#ip policy route-map pbr //接⼝下调⽤3.2 全局配置能够捕获所有⼊接⼝流量以及本路由器产⽣的流量(源地址是本路由器流量)R1(config)#access-list 100 permit ip host 1.1.1.1 any //⽤ACL捕获流量R1(config)#route-map pbr permit 10 //定义route-mapR1(config-route-map)#match ip add 100 //调⽤被ACL捕获的流量R1(config-route-map)#set ip next-hop 10.1.1.1 //设置下⼀跳R1(config-route-map)#exitR1(config)#ip local policy route-map pbr //全局下调⽤3.3 策略路由的冗余设置R1(config)#route-map PBR permit 10R1(config-route-map)#set ip next-hop verify-availability 10.1.24.2 1 track 1 //设置track监控,若track监控成功,执⾏该语句;若失败,则转为执⾏下条语句R1(config-route-map)#set ip next-hop 10.1.34.3R1(config-route-map)#exitR1(config)#ip local policy route-map PBRR1(config)#track 1 ip sla 1 //定义⼀个track监控 sla的探测结果R1(config-track)#ip sla 1 //定义⼀个slaR1(config-ip-sla)#icmp-echo 10.1.12.1 source-ip 10.4.4.4 //设置其探针R1(config)#ip sla schedule 1 life forever start-time now //设置sla 1的执⾏时间3.4 default语句在route-map的set ip default这个位置输⼊,定义为被捕获的流量先查路由表,如果能精确匹配(如果抓的为10.5.5.5,路由表中有10.5.5.5/24这不叫精确匹配;如果10.5.5.5/32则叫精确匹配)就执⾏路由表;如果不能则执⾏策略路由。
Cisco路由器QoS配置实例详解
![Cisco路由器QoS配置实例详解](https://img.taocdn.com/s3/m/56c27ce8b8f67c1cfad6b82f.png)
QoS---CQ(定制队列)学习CQ(定制队列)的配置;本实验首先用ACL定义一些流量。
然后再将这些流量进行先后排队,最后将排好队的流量策略应用到接口上1 过滤流量R2(config)#access-list 101 permit ospf any anyR2(config)#access-list 101 permit eigrp any anyR2(config)#access-list 102 permit ip any 192.168.0.1 0.0.0.0R2(config)#access-list 102 permit ip host 192.168.0.1 anyR2(config)#access-list 103 permit tcp any host 192.168.0.1 eq 23R2(config)#access-list 103 permit tcp any host 192.168.0.1 eq 21R2(config)#access-list 103 permit tcp any host 192.168.0.1 eq 20R2(config)#access-list 104 permit udp any lt 200 any lt 200R2(config)#access-list 104 permit tcp any range 135 139 any range 135 139R2(config)#access-list 105 permit udp any range 16333 35252 any range 16333 352522 队列排序R2(config)#queue-list 1 protocol ip 1 list 101 //将与List101匹配的流量排在第一位R2(config)#queue-list 1 protocol ip 2 list 102R2(config)#queue-list 1 protocol ip 3 list 103R2(config)#queue-list 1 protocol ip 4 list 104R2(config)#queue-list 1 protocol ip 5 list 1053 将CQ应用到接口R2(config)#int s0R2(config-if)#custom-queue-list 1 //将这个定制好的队列应用到接口上4 检验R2#sh queueing //查看队列Current fair queue configuration:Interface Discard Dynamic Reserved Link Prioritythreshold queues queues queues queuesBRI0 64 16 0 8 1BRI0:1 64 16 0 8 1BRI0:2 64 16 0 8 1Serial1 64 256 0 8 1Current DLCI priority queue configuration:Current priority queue configuration:Current custom queue configuration:List Queue Args1 1 protocol ip list 1011 2 protocol ip list 1021 3 protocol ip list 1031 4 protocol ip list 1041 5 protocol ip list 105QoS---PQ11 将udp协议的16333端口至35252端口都设为低优先级2 将rip设为高优先级R1(config)#priority-list 1 protocol ip low list 100 //建立优先级列表1,将与access-list 100匹配的流量设为低优先级R1(config)#access-list 100 permit udp any range 16333 35252 any range 16333 35252 //range命令是设定一个端口范围R1(config)#priority-list 1 protocol ip high udp ripR1(config)#int s0R1(config-if)#priority-group 1 //将优先级列表1应用到接口S0上2 验证R1#sh queueingCurrent fair queue configuration:Interface Discard Dynamic Reservedthreshold queue count queue countSerial1 64 256 0Current priority queue configuration:List Queue Args1 low protocol ip list-1001 high protocol ip udp port ripR1#sh ip int s0Serial0 is administratively down, line protocol is downInternet protocol processing disabledR1#sh int s0Serial0 is administratively down, line protocol is downHardware is HD64570MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation HDLC, loopback not setKeepalive set (10 sec)Last input never, output 01:37:44, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 159 Queueing strategy: priority-list 1Output queue (queue priority: size/max/drops):high: 0/20/0, medium: 0/40/0, normal: 0/60/159, low: 0/80/05 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec0 packets put, 52588119 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort0 packets, 52588444 bytes, 0 underruns0 output errors, 0 collisions, 2 interface resets0 output buffer failures, 0 output buffers swapped out6 carrier transitionsDCD=down DSR=down DTR=down RTS=down CTS=downQoS----PQ21 将主机192.168.0.1设为最高优先级2 将192.168.0.0/24网段下的其他主机设为中等优先级3 将所有http流量设为普通优先级4 将所有ftp流量设为低优先级配置如下:R1(config)#priority-list 2 protocol ip high list 2 //建立优先级列表2 ,将与access-list 2匹配的流量定为高优先级R1(config)#access-list 2 permit 192.168.0.1 0.0.0.0R1(config)#priority-list 2 protocol ip medium list 3R1(config)#access-list 3 deny 192.168.0.1 0.0.0.0R1(config)#access-list 3 permit 192.168.0.0 0.0.0.255R1(config)#priority-list 2 protocol ip normal tcp wwwR1(config)#priority-list 2 protocol ip low tcp ftpR1(config)#priority-list 2 protocol ip low tcp ftp-dataR1(config)#int s1R1(config-if)#priority-group 2 //在接口S1上应用该优先级列表R1#sh queueing //查看队列Current fair queue configuration:Current priority queue configuration:List Queue Args2 high protocol ip list 22 medium protocol ip list 32 normal protocol ip tcp port www2 low protocol ip tcp port ftp2 low protocol ip tcp port ftp-dataQoS---CBWFQ(基于类分配带宽)CBWFQ(基于类分配带宽)基本配置实验要求:给上一个实验所定义的3种流量,QQ,SMTP,FTP分配不同的带宽1 定义流量(直接调用上一个实验的配置)R4(config)#class-map QQR4(config-cmap)#match access-group name QQ//匹配一个名为QQ的命名ACLR4(config-cmap)#exiR4(config)#ip access-list extended QQR4(config-ext-nacl)#permit ip any 61.172.240.0 0.0.0.255R4(config-ext-nacl)#permit udp any any eq 4000R4(config-ext-nacl)#permit udp any any eq 8000R4(config-ext-nacl)#exiR4(config)#class-map smtpR4(config-cmap)#match access-group 100R4(config-cmap)#exiR4(config)#access-list 100 permit tcp any any eq smtpR4(config)#class-map ftpR4(config-cmap)#match access-group 101R4(config-cmap)#exiR4(config)#access-list 101 permit tcp any any eq 20R4(config)#access-list 101 permit tcp any any eq 212 定义策略R4(config)#policy-map CBWFQR4(config-pmap)#class QQR4(config-pmap-c)#bandwidth percent 5 //为类型为QQ的流量分配百分之五的带宽R4(config-pmap)#class smtpR4(config-pmap-c)#bandwidth percent 25R4(config-pmap)#class ftpR4(config-pmap-c)#bandwidth percent 20R4(config-pmap-c)#exi3 应用到接口上R4(config)#int s0R4(config-if)#service-policy output CBWFQ4 验证R4#sh policy-map//查看策略Policy Map wyClass QQpolice cir 10000 bc 1500conform-action dropexceed-action dropClass smtppolice cir 10000 bc 1500conform-action dropexceed-action dropClass ftppolice cir 10000 bc 1500conform-action dropexceed-action dropPolicy Map CBWFQClass QQBandwidth 5 (%) Max Threshold 64 (packets) Class smtpBandwidth 25 (%) Max Threshold 64 (packets) Class ftpBandwidth 20 (%) Max Threshold 64 (packets)。
Cisco路由器静态RIP和策略路由配置系列之八RIP路由配置基础
![Cisco路由器静态RIP和策略路由配置系列之八RIP路由配置基础](https://img.taocdn.com/s3/m/f076731052d380eb62946d1b.png)
RIP路由配置基础RIP(Routing Information Protocol,路由信息协议)是一种动态路由协议,通常是用于小到中型TCP/IP网络中,是一个使用距离矢量计算路由的可靠协议。
但动态路由协议不是仅RIP一种,本书后面介绍的OSPF、EIGRP、IS-IS和BGP等。
在此先简单了解一下路由协议的分类。
动态路由协议可分为内部网关协议IGP(Interior Gateway Protocol)和外部网关协议EGP (Exterior Gateway Protocol);按照所执行的算法,动态路由协议可分为距离失量路由协议(Distance Vector)、链路状态路由协议(Link State),以及思科公司开发的混合型路由协【经验之谈】动态路由与静态路由最大的不同就是,动态路由无需手动配置一跳跳的路由,且可在网络通信流量或者网络拓扑结构发生变化时能自动调整路由路径,实现持续路由服务,而无需管理员手动调整。
而且动态路由的改变会与网络中的其他路由器共享。
这就使得路由的配置更加简单,只需要把各路由器上所连接的网络向邻居路由器宣告即可,然后再由邻居路由器向它的其他邻居路由进行宣告,一级级地传递下去,就使得整个网络中的每台路由器都有对应动态路由网络中到达所连接的所有网络的路由。
这就是为什么动态路由配置(无论是本章介绍的RIP动态路由,还是OSPF、EIGRP、BGP、IS-IS等动态路由)最基本的配置就是创建一个对应动态路由协议的进程,然后把各路由器所连接的网络通过network 命令进行宣告。
对于可以划分区域的动态路由(如OSPF、EIGRP、IS-IS等)还需要创建所需的区域。
基本的配置就这么简单,根本无需为到达每个外部网络或者外部网络中的主机配置专门的路由。
这也是本篇中你看到的每个动态路由协议基本配置过程都很简单,并没有复杂的路由创建过程的根本原因RIP路由更新和度量计算RIP协议使用UDP数据包来交换路由信息的。
思科路由器配置命令详解及实例
![思科路由器配置命令详解及实例](https://img.taocdn.com/s3/m/acda4891d0f34693daef5ef7ba0d4a7302766c21.png)
思科路由器配置命令详解及实例思科路由器配置命令详解及实例一、路由器基本配置1.1 登录路由器为了配置和管理思科路由器,您需要登录到路由器的控制台或通过远程登录方式。
使用以下命令登录路由器,并进行必要的身份验证:```Router> enableRouterconfigure terminalEnter configuration commands, one per line: End with TL/Z:Router(config)hostname [路由器名称]Router(config)enable secret [密码]Router(config)line console 0Router(config-line)password [密码]Router(config-line)logging synchronousRouter(config-line)exitRouter(config)line vty 0 4Router(config-line)password [密码]Router(config-line)logging synchronous```1.2 配置接口接下来,您需要配置路由器的接口,以便与其他网络设备进行通信。
使用以下命令配置接口:```Router(config)interface [接口类型] [接口编号]Router(config-if)ip address [IP地址] [子网掩码]Router(config-if)no shutdownRouter(config-if)exit```二、路由配置2.1 静态路由静态路由是手动配置的路由项,将特定的网络目的地与下一跳路由器关联起来。
以下是配置静态路由的示例命令:```Router(config)ip route [目的网络] [子网掩码] [下一跳地址]```2.2 动态路由动态路由是通过路由协议动态学习并自动更新的路由项。
思科配置案例
![思科配置案例](https://img.taocdn.com/s3/m/3cfe896f59fb770bf78a6529647d27284b7337aa.png)
思科配置案例在网络设备配置中,思科设备是非常常见的一种品牌,其配置方法也是网络工程师必备的技能之一。
下面我们就以一个思科路由器的配置案例来介绍一下思科设备的配置方法。
首先,我们需要登录到思科路由器的控制台界面。
一般情况下,我们可以通过串口连接或者网络连接的方式登录到路由器的控制台。
在控制台界面登录后,我们需要进入特权模式,输入enable命令并输入特权级别密码,进入特权模式后,我们就可以进行路由器的配置了。
接下来,我们需要进入全局配置模式,输入configure terminal命令,进入全局配置模式后,我们可以进行路由器的各项配置。
首先,我们可以配置路由器的主机名,输入hostname命令,后面跟上我们想要设置的主机名,比如“Router1”。
然后,我们可以配置路由器的管理IP地址,输入interface命令,后面跟上我们要配置的接口,比如“GigabitEthernet0/0”,然后输入ip address命令,后面跟上IP地址和子网掩码,比如“192.168.1.1 255.255.255.0”。
接着,我们可以配置路由器的静态路由,输入ip route命令,后面跟上目的网络和下一跳地址,比如“0.0.0.0 0.0.0.0 192.168.1.254”。
此外,我们还可以配置路由器的动态路由,比如OSPF或者EIGRP协议,来实现路由器之间的动态路由学习和交换。
最后,我们可以配置路由器的密码,比如Telnet登录密码、Enable密码等,以提高路由器的安全性。
在配置完成后,我们可以通过show命令来查看我们所配置的路由器信息,比如show ip interface brief、show running-config等命令来查看路由器的接口信息和当前的配置信息。
最后,我们可以通过write命令来保存我们的配置,使其永久生效。
以上就是一个简单的思科路由器配置案例,通过这个案例,我们可以了解到思科设备的基本配置方法,希望对大家有所帮助。
Cisco路由器配置实例(经典)
![Cisco路由器配置实例(经典)](https://img.taocdn.com/s3/m/a4a57c35aaea998fcc220e95.png)
实训报告实训一路由基本配置1、实验目的:路由器基本配置及ip设置2、拓扑结构图Router0 fa0/0: 192.168.11.1Fa0/1:192.168.1.1Router1 fa0/0: 192.168.11.2Fa0/1:192.168.2.1Znn1:192.168.1.2Znn2:192.168.2.23、实验步骤Router1Router>en 用户模式进入特权模式Router#conf t 特权模式进入全局模式Enter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn1 改名字为rznn1rznn1(config)#int fa0/0 进入fa0/0端口rznn1(config-if)#ip add 192.168.11.1 255.255.255.0 设置ip地址rznn1(config-if)#no sh 激活rznn1(config)#int fa0/1rznn1(config-if)#ip add 192.168.1.1 255.255.255.0rznn1(config-if)#no shrznn1(config-if)#exitrznn1(config)#exitrznn1#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn1#conf trznn1(config)#enable secret password 222 设置密文rznn1#show ip interface b 显示Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down downrouter 2outer>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host rznn2rznn2(config)#int fa0/0rznn2(config-if)#ip add 192.168.11.2 255.255.255.0rznn2(config-if)#no shrznn2(config)#int fa0/1rznn2(config-if)#ip add 192.168.2.1 255.255.255.0rznn2(config-if)#no shRznn2#copy running-config startup-config 保存Destination filename [startup-config]? startup-configrznn2(config-if)#exitrznn2(config)#exitrznn2#conf trznn2(config)#enable secret 222rznn2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up up FastEthernet0/1 192.168.2.1 YES manual up upVlan1 unassigned YES manual administratively down down实训二1、远程登录、密码设置及验证为路由器开设telnet端口,PC机可以远程登陆到Rznn3(Router 1)拓扑结构图Router0:192.168.1.1Pc:192.168.1.2步骤rznn3>rznn3>enrznn3#conf tEnter configuration commands, one per line. End with CNTL/Z.rznn3(config)#no ip domain lookuprznn3(config)#line cons 0rznn3(config-line)#password znnrznn3(config-line)#loginrznn3(config-line)#no exec-trznn3(config-line)#logg syncrznn3(config-line)#exitrznn3(config)#int fa0/0rznn3(config-if)#ip add 192.168.1.1 255.255.255.0rznn3(config-if)#no shrznn3(config-if)#exitrznn3(config)#line vty 0 4 打通五个端口rznn3(config-line)#password cisco 设置密码rznn3(config-line)#login 保存rznn3(config-line)#exit4、测试:实训三命令组1、目的:八条命令(no ip domain lookup\line cons 0\password\login\no exec-t\logg sync\show version\reload\copy running-config startup-config)\show cdp neighbors)2、拓扑结构图Router0 fa0/0: 192.168.11.1Router1 fa0/0: 192.168.11.23、步骤rznn1#conf tEnter configuration commands, one per line. End with CNTL/Z.1、rznn1(config)#no ip domain lookup 取消域名查找转换2、rznn1(config)#line cons 0 打开cons 0端口3、rznn1(config-line)#password znn 设置密码为znnrznn1(config-line)#login 保存rznn1(config-line)#no exec-t 设置永不超时4、rznn1(config-line)#logg sync 产生日志5、rznn1#show version 显示思科路由系统版本信息Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)Technical Support: /techsupportCopyright (c) 1986-2007 by Cisco Systems, Inc.Compiled Wed 18-Jul-07 06:21 by pt_rel_team6、rznn1#show cdp neighbors 查看路由器连接的相邻路由器的相关信息Capability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDrznn2 Fas 0/0 139 R C2800 Fas 0/07、rznn1#copy running-config startup-config 保存刚才指令Destination filename [startup-config]? startup-configBuilding configuration...[OK]8、rznn1#reload 重启路由器Proceed with reload? [confirm]System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)Copyright (c) 2000 by cisco Systems, Inc.cisco 2811 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memorySelf decompressing the image :########################################################################## [OK] Restricted Rights Legendrznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up upVlan1 unassigned YES manual administratively down down9、rznn1(config-if)#ip add 192.168.3.1 255.255.255.0 重置ip地址rznn1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.3.1 YES manual up up FastEthernet0/1 192.168.1.1 YES manual up up Vlan1 unassigned YES manual administratively down down实训四发现协议1、实训目的通过发现协议显示路由器相邻路由的端口信息2、拓扑结构Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、步骤R1路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#r1(config-if)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.1 YES manual up down FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR2 路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#conf tEnter configuration commands, one per line. End with CNTL/Z.r2(config)#int fa0/0r2(config-if)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upr2(config-if)#exitr2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoler2#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.11.2 YES manual up upFastEthernet0/1 192.168.12.1 YES manual up down Vlan1 unassigned YES manual administratively down downR3路由器Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downR1发现邻居r1#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 165 R C2800 Fas 0/0R2发现邻居r2#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr1 Fas 0/0 176 R C1841 Fas 0/0r3 Fas 0/1 130 R C1841 Fas 0/0R3发现邻居r3#show cdp neighborsCapability Codes: R - Router, T - Trans Bridge, B - Source Route BridgeS - Switch, H - Host, I - IGMP, r - Repeater, P - PhoneDevice ID Local Intrfce Holdtme Capability Platform Port IDr2 Fas 0/0 166 R C2800 Fas 0/14、总结show 命令(1)show ip interface b (显示端口ip信息)(2)show version (显示ios版本信息)(3)show running-config (显示刚才使用的命令配置信息)(4)show cdp neighbors (显示发现邻居直连设备信息)(5)show interface (显示所有端口详细信息)实训五静态路由1、实验目的:将不同网段的网络配通(ip route)Ip route语法:ip route 目标地址子网掩码相邻路由器接口地址Show ip route2、试验拓扑:Router0:192.168.11.1Router1:fa0/0 192.168.11.2Fa0/1 192.168.12.1Router2:192.168.12.23、实验步骤:Router1Router>enRouter#conf tRouter(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upr1(config-if)#exitr1(config)#exitr1#show ip interface bInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 192.168.11.1 YES manual up downFastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr1#%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r1#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 0 percent (0/5)r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2r1(config)#exitr1#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 = 31/31/32 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:.....Success rate is 0 percent (0/5)r1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 47/62/78 msr1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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.11.0/24 is directly connected, FastEthernet0/0S 192.168.12.0/24 [1/0] via 192.168.11.2Router3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no sh%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up r3(config-if)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip interface bInterface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.12.2 YES manual up up FastEthernet0/1 unassigned YES manual administratively down downVlan1 unassigned YES manual administratively down downr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 192.168.11.0 255.255.255.0 192.168.12.1r3(config)#exitr3#ping 192.168.11.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msr3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msr3#show ip routeCodes: C - connected, S - static, I - IGRP, 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 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 setS 192.168.11.0/24 [1/0] via 192.168.12.1C 192.168.12.0/24 is directly connected, FastEthernet0/04、默认路由Route 1r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 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 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r1#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 = 16/28/31 msr1#ping 192.168.12.2Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 msRoute 3r1>enr1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#no ip route 192.168.12.0 255.255.255.0 192.168.11.2%No matching route to deleter1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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.11.0/24 is directly connected, FastEthernet0/0r1#conf tEnter configuration commands, one per line. End with CNTL/Z.r1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2r1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoler1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2r3#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms实训六动态路由RIP 协议1、实验目的使用配置动态路由启动Rip协议使用到的命令(router rip/network/show ip protocols/show ip route)2、实验拓扑R1 fa0/0 192.168.11.1R2 fa0/0 192.168.11.2fa0/1 192.168.12.1R3 fa0/0 192.168.12.23、实验步骤R1Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#router ripr1(config-router)#network 192.168.11.0r1(config-router)#exitr1(config)#exitr1#%SYS-5-CONFIG_I: Configured from console by consoleR2Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r2r2(config)#int fa0/0r2(config-if)#ip add 192.168.11.2 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#int fa0/1r2(config-if)#ip add 192.168.12.1 255.255.255.0r2(config-if)#no shr2(config-if)#exitr2(config)#router ripr2(config-router)#network 192.168.11.0r2(config-router)#network 192.168.12.0r2(config-router)#exitr2(config)#exitr2#R3Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#host r3r3(config)#int fa0/0r3(config-if)#ip add 192.168.12.2 255.255.255.0r3(config-if)#no shr3(config-if)#exitr3(config)#router ripr3(config-router)#network 192.168.12.0r3(config-router)#exitr3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by console4、实验测试R1r1#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 10 secondsInvalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not set Redistributing: ripDefault version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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.11.0/24 is directly connected, FastEthernet0/0R 192.168.12.0/24 [120/1] via 192.168.11.2, 00:00:24, FastEthernet0/0 r1#ping 192.168.12.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.12.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 msR2r2#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 21 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1FastEthernet0/1 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.11.0192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r2#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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.11.0/24 is directly connected, FastEthernet0/0C 192.168.12.0/24 is directly connected, FastEthernet0/1R3r3#show ip protocolsRouting Protocol is "rip"Sending updates every 30 seconds, next due in 15 secondsInvalid after 180 seconds, hold down 180, flushed after 240Outgoing update filter list for all interfaces is not setIncoming update filter list for all interfaces is not setRedistributing: ripDefault version control: send version 1, receive any versionInterface Send Recv Triggered RIP Key-chain FastEthernet0/0 1 2 1Automatic network summarization is in effectMaximum path: 4Routing for Networks:192.168.12.0Passive Interface(s):Routing Information Sources:Gateway Distance Last UpdateDistance: (default is 120)r3#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 setR 192.168.11.0/24 [120/1] via 192.168.12.1, 00:00:04, FastEthernet0/0 C 192.168.12.0/24 is directly connected, FastEthernet0/0r3#ping 192.168.11.0Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.0, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 31/31/32 ms实训七负载平衡试训目的实现负载平衡实训拓扑R1 fa0/0 192.168.11.1R2 eth0/0/0 192.168.11.2Fa0/0 192.168.12.1Fa0/0 192.168.13.1R3 fa0/0 192.168.12.2Fa0/1 192.168.14.1R4 fa0/0 192.168.13.2Fa0/1 192.168.15.1R5 fa0/0 192.168.14.2Fa0/1 192.168.15.2实训步骤(R1 )r1>enR1#conf tR1(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.2R1(config)#exitr1#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.11.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, FastEthernet0/0S* 0.0.0.0/0 [1/0] via 192.168.11.2(R2)r2>enr2(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.2r2(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.2r2(config)#exitr2#%SYS-5-CONFIG_I: Configured from console by consoles% Ambiguous command: "s"r2#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.12.2 to network 0.0.0.0C 192.168.11.0/24 is directly connected, Ethernet0/0/0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.13.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.2[1/0] via 192.168.13.2(R3)r3>enr3#conf tEnter configuration commands, one per line. End with CNTL/Z.r3(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1r3(config)#exitr3#%SYS-5-CONFIG_I: Configured from console by consoler3#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.12.1 to network 0.0.0.0C 192.168.12.0/24 is directly connected, FastEthernet0/0C 192.168.14.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.12.1(R4)r4>enr4#conf tEnter configuration commands, one per line. End with CNTL/Z.r4(config)#ip route 0.0.0.0 0.0.0.0 192.168.13.1r4(config)#exitr4#%SYS-5-CONFIG_I: Configured from console by consoler4#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.13.1 to network 0.0.0.0C 192.168.13.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.13.1(R5)r5>enr5#conf tEnter configuration commands, one per line. End with CNTL/Z.r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.14.1r5(config)#ip route 0.0.0.0 0.0.0.0 192.168.15.1r5(config)#exitr5#%SYS-5-CONFIG_I: Configured from console by consoler5#show ip routeCodes: C - connected, S - static, I - IGRP, 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 2, E - EGPi - 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 192.168.14.1 to network 0.0.0.0C 192.168.14.0/24 is directly connected, FastEthernet0/0C 192.168.15.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.14.1[1/0] via 192.168.15.1实训测试(R1)r1#ping 192.168.14.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.14.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 62/84/94 ms (R5)r5#ping 192.168.11.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds: Success rate is 100 percent (5/5), round-trip min/avg/max = 79/91/94 ms实训八DHCP 协议配置实训目的全网配通实训拓扑Fa0/0 192.168.11.1Fa0/1 192.168.12.1实训步骤Router>enRouter#conf tEnter configuration commands, one per line. End with CNTL/Z.Router(config)#host r1r1(config)#int fa0/0r1(config-if)#ip add 192.168.11.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#int fa0/1r1(config-if)#ip add 192.168.12.1 255.255.255.0r1(config-if)#no shr1(config-if)#exitr1(config)#ip dhcp pool znn //配置一个根地址池znnr1(dhcp-config)#network 192.168.11.0 255.255.255.0 //为所有客户机动态分配的地址段r1(dhcp-config)#default-router 192.168.11.1 //为客户机配置默认的网关r1(dhcp-config)#dns-server 192.168.11.1 //为客户机配置DNS服务器r1(dhcp-config)#exitr1(config)#ip dhcp pool znn1r1(dhcp-config)#network 192.168.12.0 255.255.255.0r1(dhcp-config)#default-router 192.168.12.1r1(dhcp-config)#dns-server 192.168.12.1r1(dhcp-config)#exit。
CISCO路由器配置命令详解及实例
![CISCO路由器配置命令详解及实例](https://img.taocdn.com/s3/m/b1accc73f78a6529647d53d5.png)
CISCO路由器配置命令详解及实例目录CISCO路由器配置命令详解及实例................................................................................................ 第一章:路由器配置基础.................................................................................................................一、基本设置方式.....................................................................................................................二、命令状态.............................................................................................................................三、设置对话过程.....................................................................................................................四、常用命令.............................................................................................................................五、配置IP寻址 .......................................................................................................................六、配置静态路由..................................................................................................................... 第二章:广域网协议设置.................................................................................................................一、HDLC..................................................................................................................................二、PPP......................................................................................................................................三、.............................................................................................................................................四、Frame Relay ........................................................................................................................五. Cisco765M通过ISDN拨号上263.....................................................................................六、PSTN................................................................................................................................... 第三章:路由协议设置.....................................................................................................................一、RIP协议 .............................................................................................................................三、OSPF协议 ..........................................................................................................................四、重新分配路由.....................................................................................................................五、IPX协议设置 ..................................................................................................................... 第四章?:服务质量及访问控制.......................................................................................................一、协议优先级设置.................................................................................................................二、队列定制.............................................................................................................................三、访问控制............................................................................................................................. 第五章:虚拟局域网(VLAN)路由..............................................................................................一、虚拟局域网(VLAN)...........................................................................................................二、交换机间链路(ISL)协议...............................................................................................三、虚拟局域网(VLAN)路由实例...................................................................................... 第六章:知识参考.............................................................................................................................一、路由器初始化.....................................................................................................................二、IP分配................................................................................................................................第一章:路由器配置基础一、基本设置方式一般来说,可以用5种方式来设置路由器:1.Console口接终端或运行终端仿真软件的微机;2.AUX口接MODEM,通过电话线与远方的终端或运行终端仿真软件的微机相连;3.通过Ethernet上的TFTP服务器;4.通过Ethernet上的TELNET程序;5.通过Ethernet上的SNMP网管工作站。
配置策略路由实验
![配置策略路由实验](https://img.taocdn.com/s3/m/a0f914c8bb0d4a7302768e9951e79b8968026804.png)
路由策略的应用场景
1 2
多出口路由
将数据包根据最佳路径或优先级路由到不同的 出口,实现负载均衡或备份。
访问控制
根据路由策略,对特定网络或应用程序进行访 问控制,防止非法访问或攻击。
3
网络隔离
通过路由策略将不同的网络隔离,以保护敏感 数据或避免网络故障影响到其他网络。
实验目的和内容
掌握路由策略的配置方法和步骤;
实验目的
旨在探究策略路由在多出口网络环境下的应用, 并分析其性能和优化方案。
实验成果
成功地实现了多个路由策略的配置和验证,在不 同场景下获得了显著的性能提升。
路由策略的进一步应用
应用场景
策略路由适用于多出口网络环境,如企业网、校园网等,可根 据实际需求进行广泛应用。
优化方向
可以考虑进一步优化策略路由的算法和参数配置,提高路由策 略的性能和稳定性。
03
技术发展
随着网络技术的不断进步,未来将会 有更多新型路由协议和算法出现,为 网络性能的提升带来更多可能性。
ANKS
谢谢您的观看
理解路由策略对网络性能和安全的影响,并能够根据 实际应用场景进行优化配置;
根据实际需求配置合理的路由策略; 通过实验验证路由策略的正确性和有效性。
02
实验环境与设备
网络拓扑结构
实验设备
3台PC、1台路由器、1台交换机
网络拓扑
PC1、PC2分别连接至交换机,交换机连接至路由器,路由器连接至Internet
提出改进意见
根据实验结果和讨论,提出相应的改进意见,如优化路由协议、增加限速等措施来提高路由策略的性能和稳定 性。
05
总结与展望
总结实验过程与成果
实验环境
思科Cisco策略路由(policyroute)详细介绍
![思科Cisco策略路由(policyroute)详细介绍](https://img.taocdn.com/s3/m/af81bfd55ebfc77da26925c52cc58bd6318693d3.png)
思科Cisco策略路由(policyroute)详细介绍注:PBR以前是CISCO⽤来丢弃报⽂的⼀个主要⼿段。
⽐如:设置set interface null 0,按CISCO说法这样会⽐ACL的deny要节省⼀些开销。
这⾥我提醒:interface null 0no ip unreachable //加⼊这个命令这样避免因为丢弃⼤量的报⽂⽽导致很多ICMP的不可达消息返回。
三层设备在转发数据包时⼀般都基于数据包的⽬的地址(⽬的⽹络进⾏转发),那么策略路由有什么特点呢?1、可以不仅仅依据⽬的地址转发数据包,它可以基于源地址、数据应⽤、数据包长度等。
这样转发数据包更灵活。
2、为QoS服务。
使⽤route-map及策略路由可以根据数据包的特征修改其相关QoS项,进⾏为QoS服务。
3、负载平衡。
使⽤策略路由可以设置数据包的⾏为,⽐如下⼀跳、下⼀接⼝等,这样在存在多条链路的情况下,可以根据数据包的应⽤不同⽽使⽤不同的链路,进⽽提供⾼效的负载平衡能⼒。
策略路由影响的只是本地的⾏为,所以可能会引起“不对称路由”形式的流量。
⽐如⼀个单位有两条上⾏链路A与B,该单位想把所有HTTP流量分担到A 链路,FTP流量分担到B链路,这是没有问题的,但在其上⾏设备上,⽆法保证下⾏的HTTP流量分担到A链路,FTP流量分担到B链路。
策略路由⼀般针对的是接⼝⼊(in)⽅向的数据包,但也可在启⽤相关配置的情况下对本地所发出的数据包也进⾏策略路由。
本⽂就策略路由的以下四个⽅⾯做相关讲解:1、启⽤策略路由2、启⽤Fast-Switched PBR3、启⽤Local PBR4、启⽤CEF-Switched PBR启⽤策略路由:开始配置route-map。
使⽤route-map map-tag [permit | deny] [sequence-number]进⼊route-map的配置模式。
使⽤match语句定义感兴趣的流量,如果不定义则指全部流量。
策略路由的配置详解和实例
![策略路由的配置详解和实例](https://img.taocdn.com/s3/m/65515bfae109581b6bd97f19227916888486b976.png)
策略路由的配置详解和实例Routemap和ACL很类似,它可以用于路由的再发布和策略路由,还经常使用在BGP中.策略路由(policyroute)实际上是复杂的静态路由,静态路由是基于数据包的目标地址并转发到指定的下一跳路由器,策略路由还利用和扩展IPACL链接,这样就可以提供更多功能的过滤和分类。
策略路由配置实例:ROUTEA:Verion11.2Noerviceudp-mall-erverNoervicetcp-mall-erverHotnamerouterAInterfaceethernet0Ipaddre192.1.1.1255.255.255.0econdaryIpaddre192.1.1.2255.255.255.0econdaryIpaddre192.1.1.3255.255.255.0econdaryIpaddre192.1.1.10255.255.255.0Ippolicyroute-maplab1//策略路由应用于E0口interfaceerial0ipaddr150.1.1.1255.255.255.0interfaceerial1ipaddr151.1.1.1255.255.255.0routerripnetwork192.1.1.0network150.1.0.0network151.1.0.0iplocalpolicyroute-maplab1//使路由器策略路由本地产生报文noipclaleacce-lit1permit192.1.1.1acce-lit2permit192.1.1.2route-maplab1permit10//定义策略路由图名称:LAB1,10为序号,用来标明被匹配的路由顺序。
Matchipaddre1//匹配地址为访问列表1Setinterfaceerial0//匹配下一跳为S0Route-maplab1permit20Matchipaddre2Setinterfaceerial1Linecon0Lineau某0Linevty04LoginEnd路由器B为标准配置略。
路由策略典型配置举例与故障排除
![路由策略典型配置举例与故障排除](https://img.taocdn.com/s3/m/bb930a6f59fb770bf78a6529647d27284a733779.png)
IDC的路由策略优化
总结词
IDC通过优化路由策略可以提高网络流量、 减少时延、避免拥塞等问题。
详细描述
IDC是提供高性能计算和存储服务的场所, 其路由策略优化对于提高服务质量至关重要 。通过合理的路由策略配置,可以实现数据 的高速转发、负载均衡、容错等功能。同时 ,还可以根据业务需求和网络状况灵活调整
要点二
详细描述
首先,需要检查路由策略的配置是否正确,包括策略的语 法、接口的配置、路由的指向等。其次,需要确认网络接 口是否正常工作,可以通过ping命令测试网络连接。接着 ,检查网络协议是否正常运行,包括IP协议、ARP协议等 。最后,检查路由表是否正确配置,确保路由策略的路由 条目正确添加。
路由策略无法正确选择路径
路由策略导致网络通信故障
总结词
当路由策略导致网络通信故障时,可能是由于路由策略 配置错误、网络设备故障或网络拓扑结构问题等。
详细描述
首先,需要检查路由策略的配置是否正确,包括策略的 指向、接口的配置等。其次,检查网络设备的故障,包 括交换机、路由器等设备的故障。接着,检查网络拓扑 结构是否存在问题,例如环路、广播风暴等问题。最后 ,检查网络通信协议是否正常工作,例如TCP/IP协议是 否存在问题。
详细描述
在进行按照源地址路由策略配置时,首先需要确定源地址的范围,并根据源地 址的不同将其引导至不同的目标地址。例如,可以将来自特定IP网段的数据流 引导至一台特定的路由器或网络交换机。
按照目的地址进行路由策略配置
总结词
通过目的地址进行路由策略配置,可以将数据流从特定的目标地址引导至特定的 源地址。
路由策略,以满足不同用户的需求。
05 总结与展望
路由策略的重要性和优势
配置策略路由实验
![配置策略路由实验](https://img.taocdn.com/s3/m/4010ac5a9a6648d7c1c708a1284ac850ad0204ae.png)
实验总结
配置策略路由的重要 性
通过本次实验,我们深刻认识到配置 策略路由对于提高网络性能、增强网 络安全性以及实现业务需求的重要性 。
实验中遇到的问题及 解决方案
在实验过程中,我们遇到了一些问题 ,如路由环路、性能瓶颈等,但通过 相应的技术手段成功地解决了这些问 题。
实验经验教训
我们总结了一些经验教训,如在配置 策略路由时应充分考虑网络拓扑结构 、路由协议选择以及数据流向等因素 。
策略路由的应用场景
企业网络
企业可以根据业务需求,配置策略路由,确保关 键业务的数据流能够得到优先处理,提高企业生 产效率。
云数据中心
云数据中心通过配置策略路由,可以优化数据传 输路径,提高数据传输速度,确保云服务的可用 性和可靠性。
大型ISP网络
大型ISP可以根据地域、网络拓扑结构和客户的需 求,配置策略路由,提高网络性能和用户体验。
05
实验分析与总结
实验分析
策略路由的配置过程
在本实验中,我们通过分析网络拓扑结构、规划IP地址、配置路由器和交换机等步骤,成功地实现了策略路由的配置。
路由协议的运行机制
我们分析了各种路由协议(如RIP、OSPF和BGP)的运行机制,以及它们在策略路由中的重要作用。
数据包流转与路由选择
我们还深入研究了数据包如何在路由器之间流转,以及策略路由如何根据配置的规则对数据包进行路由选择。
EIGRP (Enhanced Interior Gateway Routing Protocol):一种增强版的IGRP协 议,是Cisco专有的路由协议,它结合了链路状态和距离向量两种路由算法的优 点。
路由表
路由表是路由器用来进行路由决策的关键数据结构,它保存 了前往各个网络的最优路径。
CISCO交换机策略路由配置说明
![CISCO交换机策略路由配置说明](https://img.taocdn.com/s3/m/2d2a83a668dc5022aaea998fcc22bcd126ff42b7.png)
Configuring Policy-Based RoutingYou can use policy-based routing (PBR) to configure a defined policy for traffic flows. By using PBR, you can have more control over routing by reducing the reliance on routes derived from routing protocols. PBR can specify and implement routing policies that allow or deny paths based on:•Identity of a particular end system•Application•ProtocolYou can use PBR to provide equal-access and source-sensitive routing, routing based on interactive versus batch traffic, or routing based on dedicated links. For example, you could transfer stock records to a corporate office on a high-bandwidth, high-cost link for a short time while transmitting routine application data such as e-mail over a low-bandwidth, low-cost link.With PBR, you classif y traffic using access control lists (ACLs) and then make traffic go through a different path. PBR is applied to incoming packets. All packets received on an interface with PBR enabled are passed through route maps. Based on the criteria defined in the route maps, packets are forwarded (routed) to the appropriate next hop.•If packets do not match any route map statements, all set clauses are applied.•If a statement is marked as permit and the packets do not match any route-map statements, the packets are sent through the normal forwarding channels, and destination-based routing is performed.•For PBR, route-map statements marked as deny are not supported.For more information about configuring route maps, see the "Using Route Maps to Redistribute Routing Information" section.You can use standard IP ACLs to specify match criteria for a source address or extended IP ACLs to specify match criteria based on an application, a protocol type, or an end station. The process proceeds through the route map until a match is found. If no match is found, normaldestination-based routing occurs. There is an implicit deny at the end of the list of match statements.If match clauses are satisfied, you can use a set clause to specify the IP addresses identifying the next hop router in the path.For details about PBR commands and keywords, see the Cisco IOS IP Command Reference, Volume 2 of 3: Routing Protocols, Release 12.2. For a list of PBR commands that are visible but not supported by the switch, see Appendix C, "Unsupported Commands inCisco IOS Release 12.2(35)SE,"Note This software release does not support PBR when processing IPv4 and IPv6 traffic.PBR Configuration GuidelinesBefore configuring PBR, you should be aware of this information:•To use PBR, you must have the IP services image installed on the switch.•Multicast traffic is not policy-routed. PBR applies to only to unicast traffic.•You can enable PBR on a routed port or an SVI.•The switch does not support route-map deny statements for PBR.•You can apply a policy route map to an EtherChannel port channel in Layer 3 mode, but you cannot apply a policy route map to a physical interface that is a member of the EtherChannel. If you try to do so, the command is rejected. When a policy route map is applied to a physical interface, that interface cannot become a member of an EtherChannel.•You can define a maximum of 246 IP policy route maps on the switch.•You can define a maximum of 512 access control entries (ACEs) for PBR on the switch.•When configuring match criteria in a route map, follow these guidelines:–Do not match ACLs that permit packets destined for a local address. PBR would forward these packets, which could cause ping or Telnet failure or route protocol flapping.–Do not match ACLs with deny ACEs. Packets that match a deny ACE are sent to the CPU, which could cause high CPU utilization.•To use PBR, you must first enable the routing template by using the sdm prefer routing global configuration command. PBR is not supported with the VLAN or default template. For more information on the SDM templates, see Chapter 7, "Configuring SDM Templates."•VRF and PBR are mutually exclusive on a switch interface. You cannot enable VRF when PBR is enabled on an interface. In contrast, you cannot enable PBR when VRF is enabled on an interface.•The number of TCAM entries used by PBR depends on the route map itself, the ACLs used, and the order of the ACLs and route-map entries.•Policy-based routing based on packet length, TOS, set interface, set default next hop, or set default interface are not supported. Policy maps with no valid set actions or with set action set to Don't Fragment are not supported.•Beginning with Cisco IOS Release 12.2(35)SE, the switch supports quality of service (QoS) DSCP and IP precedence matching in PBR route maps with these limitations:–You cannot apply QoS DSCP mutation maps and PBR route maps to the same interface.–You cannot configure DSCP transparency and PBR DSCP route maps on the same switch.–When you configure PBR with QoS DSCP, you can set QoS to be enabled (by entering the mls qos global configuration command) or disabled (by entering the no mls qos command). When QoS is enabled, to ensure that the DSCP value of the traffic is unchanged, you should configure DSCP trust state on the port where traffic enters the switch by entering the mls qos trust dscp interface configuration command. If the trust state is not DSCP, by default all nontrusted traffic would have the DSCP value marked to 0.Enabling PBRBy default, PBR is disabled on the switch. To enable PBR, you must create a route map that specifies the match criteria and the resulting action if all of the match clauses are met. Then, you must enable PBR for that route map on an interface. All packets arriving on the specified interface matching the match clauses are subject to PBR.PBR can be fast-switched or implemented at speeds that do not slow down the switch.Fast-switched PBR supports most match and set commands. PBR must be enabled before you enable fast-switched PBR. Fast-switched PBR is disabled by default.Packets that are generated by the switch, or local packets, are not normally policy-routed. When you globally enable local PBR on the switch, all packets that originate on the switch are subject to local PBR. Local PBR is disabled by default.Note To enable PBR, the switch must be running the IP services image.Beginning in privileged EX EC mode, follow these steps to configure PBR:•••Use the no route-map map-tag global configuration command or the no match or no setroute-map configuration commands to delete an entry. Use the no ip policy route-map map-tag interface configuration command to disable PBR on an interface. Use the no ip route-cache policyinterface configuration command to disable fast-switching PBR. Use the no ip local policy route-map map-tag global configuration command to disable policy-based routing on packets originating on the switch.。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
C i s c o策略路由的概念原理配置实例集团标准化办公室:[VV986T-J682P28-JP266L8-68PNN]策略路由1策略路由概述普通路由的概念普通路由转发基于路由表进行报文的转发;路由表的建立直联路由、主机路由;静态配置路由条目;动态路由协议学习生成;查看命令——show ip route对于同一目的网段,可能存在多条distance不等的路由条目策略路由的概念1.2.1 策略路由所谓策略路由,顾名思义,即是根据一定的策略进行报文转发,因此策略路由是一种比目的路由更灵活的路由机制。
在路由器转发一个数据报文时,首先根据配置的规则对报文进行过滤,匹配成功则按照一定的转发策略进行报文转发。
这种规则可以是基于标准和扩展访问控制列表,也可以基于报文的长度;而转发策略则是控制报文按照指定的策略路由表进行转发,也可以修改报文的IP优先字段。
因此,策略路由是对传统IP路由机制的有效增强。
策略路由能满足基于源IP地址、目的IP址、协议字段,甚至于TCP、UDP 的源、目的端口等多种组合进行选路。
简单点来说,只要IPstandard/extended ACL 能设置的,都可以做为策略路由的匹配规则进行转发。
策略路由(Policy Route)是指在决定一个IP包的下一跳转发地址或是下一跳缺省IP地址时,不是简单的根据目的IP地址决定,而是综合考虑多种因素来决定。
如可以根据DSCP字段、源和目的端口号,源IP地址等来为数据包选择路径。
策略路由可以在一定程度上实现流量工程,使不同服务质量的流或者不同性质的数据(语音、FTP)走不同的路径。
基于策略的路由为网络管理者提供了比传统路由协议对报文的转发和存储更强的控制能力。
传统上,路由器用从路由协议派生出来的路由表,根据目的地址进行报文的转发。
基于策略的路由比传统路由能力更强,使用更灵活,它使网络管理者不仅能够根据目的地址而且能够根据协议类型、报文大小、应用或I P源地址来选择转发路径。
策略可以定义为通过多路由器的负载平衡或根据总流量在各线上进行报文转发的服务质量(Q o S )。
本交换机所支持的策略路由是与QOS的流分类标准相结合的。
针对简单流分类和复杂流分类,可以根据到来的数据包的匹配的以下特征,来设定策略路由:优先级VLAN ID源/目的MAC地址源/目的的IP地址(包括IP MASK部分)TCP/UDP源/目的端口号IP优先级DSCP的优先级IP的协议类型字段可以对匹配以上特征的流,设定以下两种策略路由:下一跳I P 地址: 这条配置命令标示了那些符合匹配语句的输出报文将进行下一跳I P 地址。
下一跳缺省I P 地址: 这条配置命令设定缺省的下一跳。
如果路由表中没有明确的路径,则路由器使用缺省的下一跳。
这个过程经常应用于在两个不同的服务提供商之间进行负载平衡。
当使用这条命令时,也是首先用路由表进行路由。
如果路由表中没有明确的路径,则路由器根据制定的策略使用缺省值。
策略路由使网络管理者能根据它提供的机制指定一个报文采取的具体路径。
而在当今高性能的网络中,这种选择的自由性是很需要的。
需要明确策略路由是设置在接收报文接口而不是发送接口。
当在接收报文的接口设定了策略路由后,交换机在该接口,检测到来的数据报文,当检测到有匹配相应流分类特征的数据数据报文经过时,就查找相应的策略路由表项,按照策略路由表项所指定的下一跳IP地址或是缺省路由IP 地址,来选择转发路径。
策略路由功能是与流分类和流策略紧密相关的,关于流分类和流策略的基本配置命令见QOS配置部分。
1.2.2 路由策略路由策略通过路由策略控制路由的接收、发布、引入的方法,实现对路由的优化2 策略路由的实现原理策略路由的好处基于源的路由可以使不同的用户选择不同的ISP通过设置IP Precedence或Tos来实现QOS实现负载均衡策略路由的流程使用Route-map来配置策略路由的流程策略路由只对入口数据包有效。
应用策略路由,必须要指定策略路由使用的路由映射,并且要创建路由映射。
一个路由映射由很多条策略组成,每个策略都定义了1个或多个的匹配规则和对应操作。
一个接口应用策略路由后,将对该接口接收到的所有包进行检查,不符合路由映射任何策略的数据包将按照通常的路由转发进行处理,符合路由映射中某个策略的数据包就按照该策略中定义的操作进行处理。
策略路由对报文的发送接口、下一跳的配置是基于多转发表实现的。
策略路由的处理流程2.3.1 流模式和逐包模式流模式第一个包查路由转发表,如果存在路由,将该路由项以source、dest、tos、入接口等索引放置到cache中,以后同样的流就可以直接查cache 对于低端路由器,所有操作由CPU+内存处理对于中高端设备,一般由NP 和Asic芯片完成处理逐包模式每个包都进行查表后才进行转发2.3.2 流模式流程图2.3.2 路由器流模式及逐包模式切换命令ip route-cache policy 开启快速交换策略路由就是流模式no ip route-cache policy 关闭该功能就是逐包模式Route-map原理与执行2.4.1 Route-map概念route-map是由一组match字句和set字句构成,他实际上是访问控制列表的一个超集。
当需做策略路由的报文匹配route-map中的match字句定义的规则时,将按照set字句的配置决定该报文的路由方式,包括设置报文的优先权字段,设置报文的下一跳,设置报文的发送接口2.4.2 理解Route-map类似于复杂的Access-list自顶向下地处理,一旦有一条匹配,则立刻结束route-map查找Route-map每个条目都被赋予编号,可以任意地插入或删除条目当使用策略路由时,首先定义重分布路由映射,一个路由映射可以由很多策略组成,策略按序号大小排列,只要符合了前面策略,就退出路由映射的执行。
由于路由映射中每个策略都有其编号,故可以方便的插入或删除。
2.4.3 Route-map 的执行语句route-map test permit 10match x y zmatch aset bset croute-map test permit 20match qset rdeny all(系统隐含)If (x or y or z) and athen set (b and c)else if qthen set relse set nothingroute-map-name给路由图定义一个便于记忆的名字。
redistribute 路由进程配置命令是通过该名字引用路由图的。
一个路由图可以定义多个路由图策略,一个路由图策略对应一个序号。
permit(可选)如果定义了permit关键字,又符合match定义的匹配规则。
则set命令对重分布路由进行控制;对于策略路由,set命令将对数据包转发进行控制。
并退出路由图的操作。
如果定义了permit关键字,而不符合match定义的匹配规则。
则将进入第二个路由图策略进行操作。
直到最终执行了set命令。
deny(可选)如果定义了deny关键字,又符合match定义的匹配规则。
则不会执行任何操作,该路由图策略不允许进行路由重分布或策略路由,而且退出路由图操作。
如果定义了deny关键字,而不符合match定义的匹配规则。
则将进入下一个路由图策略进行操作。
直到最终执行了set命令。
sequence-number路由图策略对应的序号。
低序号的策略优先得到使用,因此需要注意序号的设置。
3 策略路由的规划设计策略路由的适用环境多出口情况下——校园网(internet网、教育网);——企业网(双出口上网);旁路组网需要修改报文TOS、dscp;策略路由的配置3.2.1 路由器基本配置3.2.1.1 路由器配置步骤1)定义重分布路由图,一个路由图可以由好多策略组成,策略按序号大小排列,只要符合了前面策略,就退出路由图的执行;Router(config)#route-map route-map-name [permit | deny] sequence 定义路由图Router(config)#no route-map route-map-name {[permit | deny] sequence} 删除路由图2)定义路由图每个策略的匹配规则或条件;定义匹配规则,只有符合规则的数据包才进行策略路由,如果没有配置匹配规则,则所有数据包都符合规则。
要定义策略的匹配规则,在路由图配置模式中执行以下Route(config-route-map)#match ip address access-list-number匹配访问列表中的地址Route(config-route-map)#match length min-length max-length匹配数据包大小范围3)定义满足匹配规则后,路由器对符合规则的数据包进行IP优先值和下一跳的设置。
要定义匹配规则后的操作,在路由图配置模式中执行以下命令:Router(config-route-map)#set default interface interface-type interface-number设置数据包的输出接口,Router(config-route-map)#set ip default next-hop ip-address设置数据包的下一跳IP地址,Router(config-route-map)#set ip next-hop ip-address设置数据包的下一跳IP地址Router(config-route-map)#set ip precedence{precedence| critical | flash | flash-override |immediate | internet | network | priority |routine}设置数据包IP优先值set ip next-hop和set ip default next-hop命令十分类似,但是操作的顺序完全不同。
set ip next-hop命令使得路由器首先检查策略路由,不符合策略后使用路由表进行数据包转发处理;set ip default next-hop命令使得路由器首先检查路由表,若发现没有明确路由则使用策略路由进行数据包转发处理。
IP数据包报头优先值的设置,网络流量大时,优先值高的流量可以得到优先处理。
缺省情况下,RGNOS是不对IP报头的优先值进行修改的,会保持其原有的值。
在应用策略路由时,可以对IP报头的优先值进行设置。
当这些携带一定优先值的数据包到达其它路由器时,如果该路由器启用了队列机制,优先值高的数据包会得到优先处理,其服务质量就得到了保证。