实验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

实验10: RIP的更多相关文章

  1. 实验10.3_数值显示拓展_dword型数转变为表示十进制数的字符串

    assume cs:code data segment db 10 dup (0) data ends code segment start : mov ax,4240H;F4240H=1000000 ...

  2. CCNA实验(3) -- RIP

    RIP协议分为版本1和版本2,均具备以下特征:1.是距离向量路由协议2.使用跳数(Hop Count)作为度量值3.默认路由更新周期为30秒4.管理距离(AD)为1205.支持触发更新6.最大跳数为1 ...

  3. CCNA实验(10) -- Access List

    使用包过滤技术在路由器上读取三层及四层报头的信息如源地址.目的地址.源端口.目的端口根据预先定义好的规则对包进行过滤 三种类型:1.标准ACL:表号范围1-99或1300-1999.仅对源IP地址进行 ...

  4. CCIE路由实验(10) -- IS-IS

    1.配置基本的集成IS-IS路由协议2.多区域的集成IS-IS配置3.IS-IS认证4.IS-IS路由泄露5.IS-IS汇总6.在IS-IS中手动产生一条默认路由7.IS-IS协议重分布8.用IS-I ...

  5. c++实验10 图的应用实验

    大体与上次实验相同,特点为图是邻接表存储结构 --博客后半部分有程序的所有代码-- 1.图邻接表存储结构表示及基本操作算法实现 所加载的库函数或常量定义及类的定义: #include "Se ...

  6. 实验10—— java读取歌词文件内容动画输出

    1.Read.java package cn.tedu.demo; import java.io.BufferedReader; import java.io.File; import java.io ...

  7. 嵌入式02 STM32 实验10 定时器中断

    优秀文章 https://blog.csdn.net/qq_38351824/article/details/82619734 一.STM32通用定时器(TIM2.TIM3.TIM4和TIM5共四个通 ...

  8. 【Python】【demo实验10】【练习实例】【打印斐波那契数列】

    斐波那契数列介绍: 斐波那契数列(Fibonacci sequence),又称黄金分割数列.因数学家列昂纳多·斐波那契(Leonardoda Fibonacci)以兔子繁殖为例子而引入,故又称为“兔子 ...

  9. CCNA CCNP CCIE所有实验名称完整版

    实验1:通过Console端口访问Cisco路由器  实验2:通过Telnet访问Cisco路由器  实验3:配置终端服务器  实验4:通过浏览器访问路由器  实验5:模式切换.上下文帮助及查看有关信 ...

随机推荐

  1. 【转载】CSS flex属性深入理解

    文章转载自 张鑫旭-鑫空间-鑫生活 http://www.zhangxinxu.com/ 原文链接:https://www.zhangxinxu.com/wordpress/2019/12/css-f ...

  2. Linux 学习笔记 5 文件的下载、压缩、解压、初步认识yum

    写在前面 上节我们通过简单的几组命令,已经完全的实现了文件的移动.删除.更名.以及复制,我们最常用的基本玩法,本节将带着大家学习压缩.解压的相关步骤. Linux 学习笔记 4 创建.复制.移动.文件 ...

  3. (推荐)linux用一键安装包

    linux一键安装包内置了XXD.apache, php, mysql这些应用程序,不需要再单独安装部署. 从7.3版本开始,linux一键安装包分为32位和64位两个包,请大家根据操作系统的情况下载 ...

  4. 用Django加PIL做一个证件照模板生成器网页

    最近在整理自己的简历,发现简历上面的ID照有些太老了,所以就准备重新准备一些证件照,刚好最近在弄自己的博客网站,想着直接做一个网页工具出来,直接生成证件照模板,这样还可以省去PS的麻烦.而且照片涉及到 ...

  5. Linux学习之路--shell学习

    shell基础知识 什么是Shell Shell是命令解释器(command interpreter),是Unix操作系统的用户接口,程序从用户接口得到输入信息,shell将用户程序及其输入翻译成操作 ...

  6. docker概述和基本命令

    命名空间 Docker使用一种称为namespaces提供隔离工作空间的技术来称为容器.当您运行容器时,Docker会为该容器创建一组 名称空间. 这些命名空间提供了一层隔离.容器的每个方面都在一个单 ...

  7. SpringBoot2 整合Nacos组件,环境搭建和入门案例详解

    本文源码:GitHub·点这里 || GitEE·点这里 一.Nacos基础简介 1.概念简介 Nacos 是构建以"服务"为中心的现代应用架构,如微服务范式.云原生范式等服务基础 ...

  8. 原生javascript 元素依次掉落及上升

    一.实现原理: ① 通过onoff开关,判断元素是往下走 还是往上走,并在每次清除定时器后,把onoff 设为 !onoff,以便下次点击做判断 ②move函数的运用 二.代码 <!DOCTYP ...

  9. CSS中使用文本阴影与元素阴影

    文本阴影介绍 在CSS中使用text-shadow属性设置文本阴影,该属性一共有4个属性值如:水平阴影.垂直阴影.(清晰度或模糊距离).阴影颜色. text-shadow属性值说明,在文本阴影实践中: ...

  10. kubernetes concepts -- Pod Lifecycle

    Pod Lifecycle This page describes the lifecycle of a Pod. Pod phase A Pod’s status field is a PodSta ...