首页 电脑网络 电脑知识 正文

Cisco路由协议RIP v2 (一)

Cisco路由协议RIP v2 (一) 这个没重复啊、我弄过的那个是RIP Version1、这是RIP Version2,写成一篇文章的话太长、就分开写了。 *注:本文章是用来供广大网友学习
                                               Cisco路由协议RIP v2 (一)

这个没重复啊、我弄过的那个是RIP Version1、这是RIP Version2,写成一篇文章的话太长、就分开写了。
 
*注:本文章是用来供广大网友学习的、里面有些会提到一些网络专业用语、或者英文缩写。网络初学者如果看不懂的我们可以共同学习,共同探讨、有同学有看不懂的地方可以加本人QQ或者YY来探讨。(QQ:914560310、YY:283755973)“//”后不是命令输出、是说明。
 
*在这里纠正下在“RIP v1(一)”中说的一个问题、
Cisco路由协议RIP v2 (一)
那次说到RIP v1跟RIP v2的区别时说的RIP v2的组播地址是222.0.0.9在这里纠正下 其实应该是224.0.0.9、在写这个RIP v2的时候我看了下、可能是一紧张写错了、呵呵、希望大家见谅、别记错了哈、
 
在这里再简单介绍写RIP v2:
 
-发送路由更新时携带子网掩码,属于无类路由协议
-发送路由更新时,目标地址为组播地址:224.0.0.9
-支持VLSM(可变长子网掩码)和CIDR(无类别域间路由选择)
 
*我们利用一个小实验来进行更好的学习RIP v2(基本配置):

Cisco路由协议RIP v2 (一)
首先我们先把IP跟loopback口配置好、然后我们进入实验:
 
R1(config)#router rip                                                      //启动RIP路由协议。
R1(config-router)#version 2                                            //启动RIP 版本2。
R1(config-router)#no auto-summary                               //关闭手动汇总(默认是开启的)。
R1(config-router)#network 1.0.0.0
R1(config-router)#network 192.168.12.0
R1(config-router)#
 
这里是拿R1来举例、把其他路由器也按照这种方式配置、R4上的loopback口通告RIP协议的时候这样通告(network 4.0.0.0)然后进行实验调试。
 
R1#show ip route                                      //查看路由表。
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - 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 - ODR
       P - periodic downloaded static route
 
Gateway of last resort is not set
 
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     4.0.0.0/24 is subnetted, 1 subnets
R       4.4.4.0 [120/3] via 192.168.12.2, 00:00:01, Serial0/3/0
C    192.168.12.0/24 is directly connected, Serial0/3/0
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:01, Serial0/3/0
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:01, Serial0/3/0
R1#
 
通过: R       4.4.4.0 [120/3] via 192.168.12.2, 00:00:01, Serial0/3/0
 
可以看出RIP Version2 在通告网络时是携带子网信息的、
——————————————————————————————————————
R1#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds, next due in 18 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 2, receive 2          
//RIPv2 在默认情况下只接收和发送版本2 的路由更新。
*可以通过命令”ip rip send version”和”ip rip receive version”来控制在路由器接口上接收和发送的版本。例如,在s0/3/0接口上接收版本1和版本2的路由更新,但是只发送版本2的路由更新,配置如下
//R1(config)#interface s0/3/0
R1(config-if)#ip rip send version 2
R1(config-if)#ip rip receive version 1 2    //
 
  Interface             Send  Recv  Triggered RIP  Key-chain
  Loopback0             2     2    
  Serial0/3/0           2     2    
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
       1.0.0.0
       192.168.12.0
Passive Interface(s):
Routing Information Sources:
       Gateway         Distance      Last Update
       192.168.12.2         120      00:00:16
Distance: (default is 120)
R1#
————————————————————————————————————
*下面我们说RIPv2手工汇总:

Cisco路由协议RIP v2 (一)
R1、R2、R3的配置跟上面的实验一样、这次我们主要利用R4来说手工汇总。R4配置如下:
*(由于在Cisco Packet 软件中手工汇总这个东西有些命令不能在中实现、所以本次实验我采用的是”小凡模拟器2.83”其实没什么差别、端口上可能会看着有点不一样、这是写的s0/3/0小凡上的是s0/0这个问题不用纠结、呵呵模块的问题、在这提醒下大家、)
 
R4#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#network 192.168.34.0
R4(config-router)#network 4.0.0.0             //通告所有的loopback口
R4(config-router)#exit
 
这一步的时候我们没有进行手工汇总、然后我们进入R1查看下路由表:
 
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, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     4.0.0.0/24 is subnetted, 4 subnets
R       4.4.0.0 [120/3] via 192.168.12.2, 00:00:18, Serial0/0
R       4.4.1.0 [120/3] via 192.168.12.2, 00:00:18, Serial0/0
R       4.4.2.0 [120/3] via 192.168.12.2, 00:00:18, Serial0/0
R       4.4.3.0 [120/3] via 192.168.12.2, 00:00:18, Serial0/0
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:18, Serial0/0
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:18, Serial0/0
R1#
 
这个时候R4上的4个loopback口是都出现在了路由表中、然后我们做下路由汇总在看路由表的状态、
 
R4(config)#interface s0/0
R4(config-if)#ip summary-address rip 4.4.0.0 255.255.252.0    //手工汇总。
R4(config-if)#
 
*( 如果想取消路由汇总的话就在命令前加上”no” 例:no ip summary-address rip 4.4.0.0 255.255.252.0 同样,如果在配置中我们想取消哪个命令重新配置的话就在命令前加no 就行)
 
然后我们查看下R1上的路由表:
 
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, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
     4.0.0.0/22 is subnetted, 1 subnets
R       4.4.0.0 [120/3] via 192.168.12.2, 00:00:08, Serial0/0
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:08, Serial0/0
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:08, Serial0/0
R1#
以上输出表明R1收到了路由汇总、同样R2、R3也会收到。
——————————————————————————————————————
 
**现在将路由器R4上4个环回接口Lo0~LO3的地址分别修改为192.168.96.4/24,192.168.97.4/24,192.168.98.4/24和192.168.99.4/24,在s0/0/0接口下还能够实现路由汇总吗?
其实是不能的、
 
我配置下证实下R4的配置如下:
R4#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#no auto-summary
R4(config-router)#net 192.168.96.0                          //通告loopback口
R4(config-router)#net 192.168.97.0
R4(config-router)#net 192.168.98.0
R4(config-router)#net 192.168.99.0
R4(config-router)#exit
R4(config)#inter s0/0
R4(config-if)#ip summary-address rip 192.168.96.0 255.255.252.0
  Summary mask must be greater or equal to major net
R4(config-if)#
以上输出路由器提示是汇总失败:“ Summary mask must be greater or equal to major net
”这句显示的提示信息表明汇总后的掩码升序必须要大于或等主类网络的掩码长度,因为”22<24”,所以不能汇总。
* 所以,RIPv2 不支持CIDR 汇总,但是可以传递CIDR 汇总。
解决方案如下:
R4(config)#ip route 192.168.96.0 255.255.252.0 null 0   //用静态路由发布被汇总的路由“0”的一个名字、如果再有需要的话就可以写1、2、3、之类的。
R4(config)#router rip
R4(config-router)#version 2
R4(config-router)#redistribute static                           //将静态路由重分布到RIP网络中
R4(config-router)#no net 192.168.96.0                      //取消loopback口的网络通告。
R4(config-router)#no net 192.168.97.0
R4(config-router)#no net 192.168.98.0
R4(config-router)#no net 192.168.99.0
R4(config-router)#
 
然后我们去R1上查看路由表:
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, Serial0/0
     1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
R    192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:00, Serial0/0
R    192.168.34.0/24 [120/2] via 192.168.12.2, 00:00:00, Serial0/0
R    192.168.96.0/22 [120/3] via 192.168.12.2, 00:00:00, Serial0/0
R1#
通过这个实验的以上输出表示RIP Version2是可以传递CIDR汇总信息的。


           新的一年 2013.祝福各位网络读者能有新的收获。让自己的计算机水平更上一层楼~
                                                                                                                  在这里祝福大家新年快乐~
                                                                                                                                              红黑联盟Up~
(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)

本文转载自互联网,如有侵权,联系删除

本文地址:https://www.peigen.net/post/10744.html

相关推荐

板栗怎么私信主播?

板栗直播可以看直播,想必有一些用户已经知道,如果遇见自己喜欢的主播,我们该怎么私信主播呢?为此,小编特意查询资料,把板栗如何私信主播的方法分享给大家。 1)打开板栗,点击打开要私信的直播,接着点击左上...

电脑知识 2024-11-30 0 147

e兼职APP怎么进行身份认证?

e兼职app下载最靠谱的大学生兼职,帮助大学生提升技能,借用靠谱企业的力量培育大学生的社会经验与专业技能,最快5秒内找到心仪的兼职,大众点评最好的兼职软件。不过这么好用的软件,在使用前需要进行身份验证...

电脑知识 2024-11-30 0 150

口碑农场邀请码怎么获取

口碑农场是口碑app中新增加的一个玩法。口碑农场邀请码怎么获取?想要获得口碑农场的邀请码,具体该怎么操作?下面就是口碑农场邀请码获取教程,一起来看一下。...

电脑知识 2024-11-30 0 142

伙星app怎么更换主页封面?

伙星是一款关于相机相关的应用,能够让用户来制作各种好玩的、搞笑的照片,并且还有着许许多多的特效,能够让你看到很多很好玩的内容,除了这些,用户可以在里面进行拍照和漂流瓶交友等,那么在伙星app中要怎么更...

电脑知识 2024-11-30 0 127

会声会影怎么添加背景音乐?

会声会影2018是一款强大的照片|图片|视频制作、剪辑软件,具有多种的视频编辑功能和制作动画效果。但是如果想要让自己制作的视频有意思,背景音乐一定少不了,下面,小编就为大家介绍下会声会影添加背景音乐方...

电脑知识 2024-11-30 0 144

如何制作高质量的PPT?

如何制作高质量的PPT?不管是对于一个学生、老师还是上班族Word、PPT、表格这三个办公软件都是必修的技能了。我们如何将这些做得优秀?如何脱衣而出?所以呀今天我们就先来讨论一下如何制作PPT。如果...

电脑知识 2024-11-30 0 132

感谢您的支持