当前位置:文档之家› RIP(距离矢量协议)

RIP(距离矢量协议)

RIP协议 基本特征 ★路由信息协议(Routing Information Protocol) ★标准的距离矢量协议 ★以跳数为单位 ★只适合于小型网络 ★路由更新是周期性的 ★两种数据包:请求包、更新包 ★默认下是30s更新整个路由表,通过UDP520端口更新。(更新时间有15% 左右的偏差,一般在25.5~30s之间) ★版本:default(默认版本)、v1、v2 ★Rip协议没有邻居表,不知道其邻居位置 (若网络很大,则收敛很慢, 因此,有可能产生环路) ★解决环路的措施: 1)水平分割 (针对接口来说的) 2)毒性逆转 (跳数<=15) 3)跳数 4)触发更新 (只更新变化部分的内容) 5)时间抑制 ★v1和v2版本的共同点: 都是距离矢量协议; 都以跳数为度量值(<=15,16跳代表网络不可达); 都是周期性更新路由表; 管理距离(路由的可靠程度)都是120; 都支持触发更新; 都支持等价的负载均衡(默认是4条,最多支持6条);

★CDP协议(Cisco Discover Protocols) —>思科专有协议 (只有cdp可以看到别人的接口信息,其余的都只能看到自己的接口) ★ 被动接口 含义:如果一个接口被配成被动接口,则这个接口只接收路由,不发送路由; 如果要发送,可以使用单播的方式发送; R1(config-router)#passive-interface 接口 ★ 默认版本或V1传递子网掩码 (示例2) 在默认版本或V1汇总中,需要注意的问题: * 汇总的本质是在网络边界进行汇总,其内部网络还是可以传递子网掩码的; * rip的汇总是在接口上进行汇总的; RIP路由自动汇总,就是当子网路由穿越有类网络边界时,将自动汇总成有类网络路由。RIPv1和RIPv2缺省情况下将进行路由自动汇总。 ★ V2可以把自动汇总(auto-summary)关闭,但在V1中不可以。 (示例3) 1)人工汇总可以更加精确的汇总,只存在无类中,有类中不存在; 在要汇总的接口上打“ip summary-address rip IP地址” (此法只适合汇总后的掩码大于主类地址的掩码) 2)#ip route 汇总IP地址 255.255.255.0 null 0 (人工静态路由汇总) (此法适合与汇总后掩码比主类地址小) ★ Rip V2 认证: 若配了明文和md5,则md5会覆盖掉明文认证; >>明文认证: R1(config)#key chain R1 Word key chain name R1(config-keychain)#key 1 <0-2147483647> Key identifier R1(config-keychain-key)#key-string ccie 0 Specifies an UNENCRYPTED password will follow 7 Specifies a HIDDEN password will follow LINE The UNENCRYPTED (cleartext) user password * 配好之后,要在接口上调用 如果同一时间有多个key,则只发送最小key下的密码,到对方依次匹配下去。 >> MD5认证: 同一时间有多个key,则发送key的num和密码,并且只往下面找一跳。 * Rip V1和V2之间默认情况下不能通信,若使其通信则需要在接口上迫使它接收V2; 命令: R1(config-if)#ip rip receive version 1 2

常用命令: R1#show ip route IP (可以具体查看哪个接口) R1#show cdp neighbors(可以查看相邻路由器的信息) R1#ping 4.4.4.4 source lo0(代表ping命令从lo0接口ping出去的) 或R1#ping 4.4.4.4 source 1.1.1.1 R1#ping 4.4.4.4 source 1.1.1.1 repeat 100 size 100(重复100个ping包,控制包的大小为100) R1(config-router)#timers basic 60 360 180 480(定时器) R1(config-router)#version 1或2 (版本) R1(config-router)#maximum-paths ?(负载均衡) <1-6> Number of paths R1(config-router)#distance ?(管理距离) <1-255> Administrative distance

示例1: R1配置命令: R1#conf t R1(config)#int lo0 R1(config-if)#ip add 1.1.1.1 255.255.255.0 R1(config-if)#int e1/0 R1(config-if)#ip add 12.1.1.1 255.255.255.0 R1(config-if)#no shut R1(config)#router rip R1(config-router)#net 1.1.1.0 R1(config-router)#net 12.1.1.0 R1(config-router)#end

查看命令: R1#show ip route IP (可以具体查看哪个接口) R1#show cdp neighbors (可以查看相邻路由器的信息) Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater

Device ID Local Intrfce Holdtme Capability Platform Port ID R2 Eth 1/0 174 R S 3640 Eth 1/0

默认时,ping命令是离目的地最近的接口ping出去的; R1#ping 4.4.4.4 Type 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 = 44/60/64 ms

R1#ping 4.4.4.4 source lo0(代表ping命令从lo0接口ping出去的) 或R1#ping 4.4.4.4 source 1.1.1.1

Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: Packet sent with a source address of 1.1.1.1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 44/76/104 ms

R1#ping 4.4.4.4 source 1.1.1.1 repeat 100 size 100 (重复100个ping包,控制包的大小为100) Type escape sequence to abort. Sending 100, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: Packet sent with a source address of 1.1.1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Success rate is 100 percent (100/100), round-trip min/avg/max = 20/55/116 ms 另一种ping命令: R1#ping Protocol [ip]: 回车 Target IP address: 4.4.4.4(目标地址) Repeat count [5]: 100(重复次数) Datagram size [100]: 100(包大小) Timeout in seconds [2]: 回车(超时时间) Extended commands [n]: y Source address or interface: 1.1.1.1 Type of service [0]: 回车 Set DF bit in IP header? [no]: 回车 Validate reply data? [no]: 回车 Data pattern [0xABCD]: 回车 Loose, Strict, Record, Timestamp, Verbose[none]: 回车 Sweep range of sizes [n]: 回车 Type escape sequence to abort. Sending 100, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds: Packet sent with a source address of 1.1.1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Success rate is 100 percent (100/100), round-trip min/avg/max = 44/59/100 ms

R1#show ip protocols Routing Protocol is "rip" Sending updates every 30 seconds, next due in 11 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain

相关主题