实验10: RIP

实验7-1 :  RIPV1

实验目的
通过本实验可以掌握:
1. 在路由器上启动RIPv1 路由进程
2. 启用参与路由协议的接口,并且通告网络
3. 理解路由表的含义
4. 查看和调试RIPv1 路由协议相关信息

实验拓扑

实验步骤
n     步骤1:配置路由器R2
router(config)#host R2
R2(config)#no ip do lo
R2(config)#int s1/0
R2(config-if)#ip add 192.168.12.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config)#router rip
R2(config-router)#version 1
R2(config-router)#network 2.0.0.0
R2(config-router)#network 192.168.12.0
R2(config-router)#passive-interface lo0

n     步骤2:配置路由器R1
router(config)#host R1
R1(config)#no ip do lo
R1(config)#int s1/0
R1(config-if)#ip add 192.168.12.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no sh
R1(config)#int s1/1
R1(config-if)#ip add 192.168.13.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no sh

R1(config-if)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config)#router rip
R1(config-router)#version 1
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.13.0
R1(config-router)#passive-interface lo0
        
n     步骤3:配置路由器R3
router(config)#host R3
R3(config)#no ip do lo
R3(config)#int s1/0
R3(config-if)#ip add 192.168.13.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config)#router rip
R3(config-router)#version 1
R3(config-router)#network 3.3.3.0
R3(config-router)#network 192.168.13.0
R3(config-router)#passive-interface lo0

实验调试

n     R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/24 is subnetted, 1 subnets
C    1.1.1.0 is directly connected, Loopback0
C    192.168.13.0/24 is directly connected, Serial1/1
R    2.0.0.0/8 [120/1] via 192.168.12.2, 00:00:08, Serial1/0
R    3.0.0.0/8 [120/1] via 192.168.13.3, 00:00:08, Serial1/1

n    R1#debug ip rip

RIP protocol debugging is on
*Mar  1 00:39:09.591: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (192.168.13.1)
*Mar  1 00:39:09.595: RIP: build update entries
*Mar  1 00:39:09.595:   network 1.0.0.0 metric 1
*Mar  1 00:39:09.599:   network 2.0.0.0 metric 1
*Mar  1 00:39:09.599:   network 192.168.12.0 metric 1
*Mar  1 00:39:17.423: RIP: received v1 update from 192.168.13.3 on Serial1/1
*Mar  1 00:39:17.427:      3.0.0.0 in 1 hops
*Mar  1 00:39:19.327: RIP: received v1 update from 192.168.12.2 on Serial1/0
*Mar  1 00:39:19.331:      2.0.0.0 in 1 hops
*Mar  1 00:39:22.967: RIP: sending v1 update to 255.255.255.255 via Serial1/0 (192.168.12.1)
*Mar  1 00:39:39.011: RIP: sending v1 update to 255.255.255.255 via Serial1/1 (192.168.13.1)

【测试】
R2(config)#router rip
R2(config-router)#passive-interface s1/0
R2#debug ip rip
查看R2能否接收到来自R1的rip更新通告
R1#debug ip rip
查看R1能否接收到来自s1/0的rip更新通告
R2(config)#router rip
R2(config-router)#neighbor 192.168.12.1
R1#debug ip rip
查看R1能否接收到来自s1/0的rip更新通告

【提示】
被动接口只能接收路由更新,不能以广播或组播方式发送更新,但是可以以单播的方式发送更新,配置单播更新的命令如下:

R2(config)#router rip
R2(config-router)#passive-interface s1/0
R2(config-router)#neighbor 192.168.12.1

实验7-2   RIPV2

实验目的
通过本实验可以掌握:

(1)在路由器上启动RIPv2 路由进程
(2)启用参与路由协议的接口,并且通告网络
(3)auto-summary 的开启和关闭
(4)查看和调试RIPv2 路由协议相关信息

实验拓扑

实验步骤
n    路由器R2的主要配置
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 2.2.2.0
R2(config-router)#network 192.168.12.0

n    路由器R1的主要配置
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.13.0
R1(config-router)#network 1.1.1.0

n    路由器R3的主要配置
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.13.0
R3(config-router)#network 3.3.3.0

实验调试
n       R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, Serial1/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
C    192.168.13.0/24 is directly connected, Serial1/1
     2.0.0.0/24 is subnetted, 1 subnets
R       2.2.2.0 [120/1] via 192.168.12.2, 00:00:28, Serial1/0
     3.0.0.0/24 is subnetted, 1 subnets
R       3.3.3.0 [120/1] via 192.168.13.3, 00:00:07, Serial1/1

以上输出表明路由器R1 学到了2条RIP 路由,其中路由条目”R  3.3.3.0 [120/1] via 192.168.13.3, 00:00:07, Serial1/1”含义如下:
n    R:路由条目是通过RIP 路由协议学习来的;
n    3.3.3.0/24:目的网络;
n    120:RIP 路由协议的默认管理距离;
n    1: 度量值,从路由器R1 到达网络3.3.3.0/24 的度量值为1 跳;
n    192.168.13.3:下一跳地址;
n    00:00:07:距离下一次更新还有23(30-7)秒;
n    Serial1/0:接收该路由条目的本路由器的接口
【提示】可以看到auto-summary关闭后,通过RIPv2学到的不再是汇总到major-net的路由

n     R1#show ip protocol             //查看路由器协议配置和统计信息
  Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 24 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             2     2                                    
    Serial1/1             2     2                                    
    Loopback0             2     2                                    
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.12.0
    192.168.13.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.13.3         120      00:00:04
    192.168.12.2         120      00:00:27
     Distance: (default is 120)
   
 Routing Protocol is "rip"
//路由器上运行的路由协议是RIP

Outgoing update filter list for all interfaces is not set
//在出方向上没有设置过滤列表

Incoming update filter list for all interfaces is not set
//在入方向上没有设置过滤列表

Sending updates every 30 seconds, next due in 24 seconds
//更新周期是30 秒,距离下次更新还有24 秒
//为了防止更新同步,RIP 会以15%的误差发送更新,即实际发送更新的周期的范围是25.5-30 秒。

Invalid after 180 seconds, hold down 180, flushed after 240
//invalid after:路由条目在180 秒没有收到更新,则被标记为无效
//hold down:抑制计时器的时间为180 秒
//flushed after:路由条目如果在240 秒还没有收到更新,则从路由表中删除此路由条目

Redistributing: rip
//只运行RIP 协议,没有其它的协议重分布进来

Default version control: send version 2, receive version 2
//默认发送版本2的路由更新,接收本版2 的路由更新

Interface Send Recv Triggered RIP Key-chain
Serial1/0   2   2
Serial1/1   2   2
Loopback0   2   2
//以上三行显示了运行RIP 协议的接口,以及可以接收和发送的RIP 路由更新的版本RIPv2

【提示】 默认情况下只接收和发送版本2 的路由更新,可以通过命令“ip rip send version”和“ip rip receive version”来控制在路由器接口上接收和发送的版本,例如在s1/0 接口上接收版本1 和2 的路由更新,但是只发送版本2 的路由更新,配置如下:
R1(config-if)#ip rip send version 2
R1(config-if)#ip rip receive version 1 2

Automatic network summarization is not in effect
//RIP 路由协议关闭自动汇总功能
Maximum path: 4
//RIP 路由协议可以支持4 条等价路径,最大为6 条

【提示】可以通过下面的命令来修改RIP 路由协议支持等价路径的条数:
R1(config-router)#maximum-paths number-paths
Routing for Networks:
 1.0.0.0
 192.168.12.0
 192.168.13.0
//以上三行表明RIP 通告的网络
Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.13.3         120      00:00:04
    192.168.12.2         120      00:00:27
//以上三行表明路由信息源,其中:
//gateway:学习路由信息的路由器的接口地址,也就是下一跳地址
//distance:管理距离
//last update:更新发生在多长时间以前
Distance: (default is 120)
//默认管理距离是120

实验7-3 : RIPV2 认证和触发更新

实验目的
通过本实验可以掌握:

(1)RIPv2 明文认证的配置和匹配原则
(2)RIPv2 MD5 认证的配置和匹配原则
(3)RIPv2 触发更新

实验拓扑

实验步骤
n    步骤1:配置路由器R2
R2(config)#key chain test //配置钥匙链
R2(config-keychain)#key 1 //配置KEY ID
R2(config-keychain-key)#key-string cisco //配置KEY ID 的密匙
R2(config)#interface s1/0
R2(config-if)#ip rip authentication mode md5   
//启用认证,认证模式为密文,默认认证模式是明文,所以也可以不用指定
R2(config-if)#ip rip authentication key-chain test //在接口上调用钥匙链
R2(config-if)#ip rip triggered //在接口上启用触发更新
n    步骤2:配置路由器R1
R1(config)#key chain test
R1(config-keychain)#key 1
R1(config-keychain-key)#key-string cisco
R1(config)#interface s1/0
R1(config-if)#ip rip authentication mode md5
R1(config-if)#ip rip authentication key-chain test
R1(config-if)#ip rip triggered
R1(config-if)#interface s1/1
R1(config-if)#ip rip authentication mode md5
R1(config-if)#ip rip authentication key-chain test
R1(config-if)#ip rip triggered
n    步骤3:配置路由器R3
R3(config)#key chain test
R3(config-keychain)#key 1
R3(config-keychain-key)#key-string cisco
R3(config)#interface s1/1
R3(config-if)#ip rip authentication mode md5
R3(config-if)#ip rip authentication key-chain test
R3(config-if)#ip rip triggered

实验调试
(1)R1#show ip protocol
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 23 seconds
  Invalid after 180 seconds, hold down 0, flushed after 240
 // 由于触发更新,hold down 计时器自动为0
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    Serial1/0             2     2          Yes       test            
    Serial1/1             2     2          Yes       test            
    Loopback0           2     2                                    
//以上两行表明s1/0 和s1/1 接口启用了认证和触发更新
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    192.168.12.0
    192.168.13.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.13.3         120      00:02:03
    192.168.12.2         120      00:03:16
  Distance: (default is 120)
        
(2)R1#debug ip rip
RIP protocol debugging is on
R1#clear ip route *
*Mar  1 01:15:11.099: RIP: sending triggered request on Serial1/0 to 224.0.0.9
*Mar  1 01:15:11.115: RIP: sending triggered request on Serial1/1 to 224.0.0.9
*Mar  1 01:15:11.119: RIP: sending request on Loopback0 to 224.0.0.9
*Mar  1 01:15:11.143: RIP: send v2 triggered flush update to 192.168.12.2 on Serial1/0 with no route
*Mar  1 01:15:11.143: RIP: start retransmit timer of 192.168.12.2
*Mar  1 01:15:11.143: RIP: send v2 triggered flush update to 192.168.13.3 on Serial1/1 with no route
*Mar  1 01:15:11.143: RIP: start retransmit timer of 192.168.13.3
*Mar  1 01:15:11.187: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.191: RIP: received v2 triggered update from 192.168.12.2 on Serial1/0
*Mar  1 01:15:11.191: RIP: sending v2 ack to 192.168.12.2 via Serial1/0 (192.168.12.1),
     flush, seq# 5
*Mar  1 01:15:11.199:      2.2.2.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:15:11.207: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.211: RIP: received v2 triggered update from 192.168.12.2 on Serial1/0
*Mar  1 01:15:11.211: RIP: sending v2 ack to 192.168.12.2 via Serial1/0 (192.168.12.1),
     flush, seq# 6
*Mar  1 01:15:11.231:      2.2.2.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:15:11.235: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.235: RIP: received v2 triggered ack from 192.168.12.2 on Serial1/0
     flush seq# 4
*Mar  1 01:15:11.239: RIP: send v2 triggered update to 192.168.12.2 on Serial1/0
*Mar  1 01:15:11.243: RIP: build update entries
*Mar  1 01:15:11.243:   route 37: 1.1.1.0/24 metric 1, tag 0
*Mar  1 01:15:11.247:   route 39: 192.168.13.0/24 metric 1, tag 0
*Mar  1 01:15:11.247: RIP: Update contains 2 routes, start 37, end 43
*Mar  1 01:15:11.251: RIP: start retransmit timer of 192.168.12.2
*Mar  1 01:15:11.279: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.283: RIP: received v2 triggered update from 192.168.13.3 on Serial1/1
*Mar  1 01:15:11.287: RIP: sending v2 ack to 192.168.13.3 via Serial1/1 (192.168.13.1),
     flush, seq# 5
*Mar  1 01:15:11.291:      3.3.3.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:15:11.295: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.299: RIP: received v2 triggered update from 192.168.13.3 on Serial1/1
*Mar  1 01:15:11.303: RIP: sending v2 ack to 192.168.13.3 via Serial1/1 (192.168.13.1),
     flush, seq# 6
*Mar  1 01:15:11.307:      3.3.3.0/24 via 0.0.0.0 in 1 hops
*Mar  1 01:15:11.311: RIP: received packet with MD5 authentication
*Mar  1 01:15:11.311: RIP: received v2 triggered ack from 192.168.13.3 on Serial1/1
     flush seq# 3
【提示】 从上面的输出可以看出,在R1 上,虽然我们打开了debug ip rip,但是由于采用触发更新,所以并没有看到每30 秒更新一次的信息,而是清除了路由表这件事件触发了路由更新。而且所有的更新中都有“triggered”的字样,同时在接收的更新中带有“MD5 authentication”的字样,证明接口s1/0 和s1/1 启用了触发更新和密文认证
(3) R1#show ip rip database
1.0.0.0/8    auto-summary
1.1.1.0/24    directly connected, Loopback0
2.0.0.0/8    auto-summary
2.2.2.0/24  
[1] via 192.168.12.2, 00:14:59 (permanent), Serial1/0
   * Triggered Routes:
- [1] via 192.168.12.2, Serial1/0
3.0.0.0/8    auto-summary
3.3.3.0/24
    [1] via 192.168.13.3, 00:14:59 (permanent), Serial1/1
   * Triggered Routes:
     - [1] via 192.168.13.3, Serial1/1
192.168.12.0/24    auto-summary
192.168.12.0/24    directly connected, Serial1/0
192.168.13.0/24    auto-summary
192.168.13.0/24    directly connected, Serial1/1
以上输出进一步说明了在s1/0 和s1/1 启用了触发更新。

(4) R1#show run | begin router rip
 router rip
 version 2
 timers basic 30 180 0 240
//由于触发更新,在配置中自动加入上面一行,且hold down 计时器被设置为0
 network 1.0.0.0
 network 192.168.12.0
 network 192.168.13.0
 no auto-summary

时间: 2024-08-11 22:06:08

实验10: RIP的相关文章

Cisco PT模拟实验(10) 路由器的基本配置

Cisco PT模拟实验(10) 路由器的基本配置 实验目的: 掌握路由器几种常用配置方法 熟悉路由器不同的命令行操作模式 掌提路由器的基本配置命令 实验背景: 作为网络管理员,你第一次在设备机房对路由器进行了初次配置后,希望以后在办公室或出差时也可以对设备进行远程管理,现要在路由器上做适当配置. 技术原理: 路由器:一种用于连接因特网中各局域网.广域网,负责分组转发.路由选择的三层网络互联设备.根据信道的情况自动选择和设定路由,以最佳路径,按前后顺序发送信号. 与二层交换机的最大区别,体现在其

实验10(1)

;实验10 ;1.显示字符串 ;表示要用到前面的,8,3数据好麻烦,但是最后还是用了, ;不知道push,pop这么多寄存器干嘛,可能是因为题目要求 ;要保存子程序中要用到的寄存器吧~ assume cs:code,ds:data data segment db 'Welcome to masm!',0 data ends code segment start : mov dh,8 mov dl,3 mov cl,2 mov ax,data mov ds,ax ;定义数据段 mov si,0 m

实验10(2)

;实验10 ;解决除法溢出的问题 assume cs:code , ss:stack stack segment dd 0,0,0,0 stack ends code segment start : mov ax,stack mov ss,ax mov sp,16 ;定义栈段 MOV ax,4240h mov dx,000fh mov cx,0ah call divdw mov ax,4c00h int 21h divdw: push bx MOV bx,ax;保存低位数据 mov ax,dx

思科企业基础架构CCIE全系实验:RIP协议

第5章从本章开始,我们将进入到正式的路由协议,在TCP/IP协议栈中,最重要和应用最广泛的几个路由协议有:RIP协议.EIGRP协议(思科私有).OSPF协议和BGP协议,我们将在今后几部分中一一为大家讲解.当然这些都是CCIE认证考试的重要组成部分,而且路由是一切应用的基础 乾颐堂安德RIP协议 本章要点? RIP理论基础和场景需求? 实验拓扑和需求描述? RIP实验步骤5.1 RIP理论基础和场景需求RIP即路由信息协议,是最早的用于生产环境的TCP/IP协议栈的动态路由协议.相对静态来讲,

实验11 RIP路由协议基本配置

[实验名称] RIP路由协议基本配置. [实验目的] 掌握在路由器上如何配置RIP路由协议. [背景描述] 假设在校园网在地理上分为2个区域,每个区域内分别有一台路由器连接了2个子网,需要将两台路由器通过以太网链路连接在一起并进行适当的配置,以实现这4个子网之间的互联互通.为了在未来每个校园区域扩充子网数量的时候,管理员不需要同时更改路由器的配置,计划使用RIP路由协议实现子网之间的互通. [需求分析]  两台路由器通过快速以太网端口连接在一起,每个路由器上设置2个Loopback端口模拟子网,

CISCO PVST+配置和结果验证 per vlan spanning tree(51cto 实验10)

1. 实验线路连接图使用Cisco Packet Tracer6.0 构建拓扑结构图 2. 实验内容(1) 参阅教材中内容,完成PVST+的配置内容.(2) 在各台交换机上使用show spanning-tree vlan 10 和show spanning-tree vlan 20 命令,查看根桥信息.各端口角色和各端口状态.(3) 绘制VLAN10 的生成树图,标明各台Switch 的桥ID.根桥.根端口.指定端口.替代端口以及各个端口的状态.(4) 绘制VLAN20 的生成树图,标明各台S

60、IPv6配置实验之RIP

1.实验拓扑 2.基础配置 R1配置 interface Serial0/0 ipv6 address 2000:12::1/64 R2配置 interface Serial0/0 ipv6 address 2000:12::2/64 interface Serial0/1 ipv6 address 2000:23::2/64 R3配置 interface Serial0/0 ipv6 address 2000:34::3/64 interface Serial0/1 ipv6 address

王爽 汇编 实验10.1

一.实验要求 二.代码实现 1 assume cs:code,ds:data 2 3 data segment 4 db 'welcome to masm!',0 5 data ends 6 7 code segment 8 start: mov dh,8 ;定义行(0-24) 9 mov dl,3 ;定义列(0-79) 10 mov cl,2 ;定义颜色 11 mov ax,data 12 mov ds,ax 13 mov si,0 ;指向字符串的首地址 14 call show_str ;调

王爽汇编第三版实验10

1. 显示字符串 1 assume cs:code 2 3 data segment 4 db 'Welcome to masm!',0 5 data ends 6 7 stack segment 8 db 16 dup (0) 9 stack ends 10 11 code segment 12 start: 13 mov dh,8 14 mov dl,3 15 mov cl,2 16 mov ax,data 17 mov ds,ax 18 mov si,0 19 call show_str