Cisco Packet Tracer中配置RIP(RIPv1&RIPv2)

RIP协议简介:

RIP (Routing Information Protocol) 路由协议是一种相对古老,在小型以及同介质网络中得到了广泛应用的一种路由协议。RIP 采用距离向量算法,是一种距离向量协议。RIP在RFC 1058文档中定义。 RIP使用UDP报文交换路由信息,UDP端口号为520。若采用RIP协议,其网络内部所经过的链路数不能超过15,这使得RIP协议不适于大型网络。

RIP共有三个版本,RIPv1, RIPv2, RIPng,其中RIPV1和RIPV2是用在IPV4的网络环境里,RIPng是用在IPV6的网络环境里。

格式:network 直连网段

RIPv1和RIPv2的区别:

1.RIPv1是有类路由协议,RIPv2是无类路由协议。

2.RIPv1不能支持VLSM,RIPv2可以支持VLSM。

3.RIPv1没有认证的功能,RIPv2可以支持认证,并且有明文和MD5两种认证。

4.RIPv1没有手工汇总的功能,RIPv2可以在关闭自动汇总的前提下,进行手工汇总。

5.RIPv1是广播更新,RIPv2是组播更新。

6.RIPv1对路由没有标记的功能,RIPv2可以对路由打标记(tag),用于过滤和做策略。

7.RIPv1发送的updata最多可以携带25条路由条目,RIPv2在有认证的情况下最多只能携带24条路由。

8.RIPv1发送的updata包里面没有next-hop属性,RIPv2有next-hop属性,可以用与路由更新的重定。

https://gss0.baidu.com/94o3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=0c24fbee31a85edffad9f6257964251b/37d3d539b6003af38a924ede302ac65c1038b660.jpg

                                                                             ——百度

 

操作:

操作

添加三台路由器和四台主机

本实验的路由器使用了Serial(串口),因此需要在路由器中添加模块NM-4A/S,添加模块前

先关闭路由器电源,添加好后再开启电源。

 

为Router0添加模块NM-4A/S

找到 “Physical”

默认电源为开

单击电源关闭电源

拖入模块NM-4A/S

单击电源打开电源

为Router1和Router2完成同样的操作

 

 

PC0的IP为192.168.10.1,网关为192.168.10.254,与Router1的fa0/0接口连接

PC1的IP为192.168.20.1,网关为192.168.20.254,与Router1的fa0/1接口连接

PC2的IP为192.168.30.1,网关为192.168.30.254,与Router2的fa0/0接口连接

PC3的IP为192.168.40.1,网关为192.168.40.254,与Router1的fa0/1接口连接

 

Router1的s1/0端口与Router的s1/0端口连接

Router1的s1/1端口与Router的s1/1端口连接

 

Router2的s1/0端口与Router的s1/0端口连接

Router2的s1/1端口与Router的s1/1端口连接

 

分配IP

PC0

PC1

PC2

PC3

 

配置Router1

Router>enable

Router#configure terminal

Router(config)#hostname SA

SA(config)#interface fa0/0

SA(config-if)#ip address 192.168.10.254 255.255.255.0

SA(config-if)#shutdown

SA(config-if)#no shutdown

SA(config-if)#exit

SA(config)#interface fa0/1

SA(config-if)#ip address 192.168.20.254 255.255.255.0

SA(config-if)#shutdown

SA(config-if)#no shutdown

Router(config-if)#exit

Router(config)#interface s1/0

Router(config-if)#ip address 192.168.1.1 255.255.255.0

Router(config-if)#clock rate 38400     (设置时钟频率)

Router(config-if)#shutdown

Router(config-if)#no shutdown

Router(config-if)#exit

 

测试:

SA(config-if)#^Z    (Ctrl+Z组合键)

SA#show running-config

 

保存设置

Router#write

 

 

配置Router2

Router>enable

Router#configure terminal

SB(config)#hostname SB

SB(config)#int fa0/0

SB(config-if)#ip address 192.168.30.254 255.255.255.0

SB(config-if)#shutdown

SB(config-if)#no shutdown

SB(config-if)#exit

SB(config)#int fa0/1

SB(config-if)#ip address 192.168.40.254 255.255.255.0

SB(config-if)#shutdown

SB(config-if)#no shutdown

SB(config-if)#exit

SB(config)#interface s1/1

SB(config-if)#ip address 192.168.2.2 255.255.255.0

SB(config-if)#shutdown

SB(config-if)#no shutdown

 

测试

SB(config-if)#^Z

SB#show running-config

 

保存设置:

SB#write

 

 

配置Router0

Router>enable

Router#configure terminal

Router(config)#hostname SC

SC(config)#interface s1/0

SC(config-if)#ip address 192.168.1.2 255.255.255.0

SC(config-if)#shutdown

SC(config-if)#no shutdown

SC(config-if)#exit

SC(config)#interface s1/1

SC(config-if)#ip address 192.168.2.1 255.255.255.0

SC(config-if)#clock rate 38400

SC(config-if)#shutdown

SC(config-if)#no shutdown

 

测试:

SC(config)#^Z

SC#show running-config

 

保存设置:

SC#write

 

 

 

配置RIPv1

Router1

查看直连网段

SA>enable

SA#show ip route

(”C”开头的为直连网段)

启用RIP协议并宣告直连网段

SA#configure terminal

SA(config)#router rip

SA(config-router)#network 192.168.1.0

SA(config-router)#network 192.168.10.0

SA(config-router)#network 192.168.20.0

 

保存设置

SA(config-router)#^Z

SA#write

 

Router2

查看直连网段

SB>enable

SB#show ip route

(”C”开头的为直连网段)

启用RIP协议并宣告直连网段

SB#configure terminal

SB(config)#router rip

SB(config-router)#network 192.168.2.0

SB(config-router)#network 192.168.30.0

SB(config-router)#network 192.168.40.0

 

保存设置

SB(config-router)#^Z

SB#write

 

 

Router0

查看直连网段

SC>enable

SC#show ip route

(”C”开头的为直连网段)

启用RIP协议并宣告直连网段

SC#configure terminal

SC(config)#router rip

SC(config-router)#network

SC(config-router)#network 192.168.1.0

SC(config-router)#network 192.168.2.0

 

保存设置:

SC(config-router)#^Z

SC#write

 

 

查看启用RIP协议各路由器的路由信息表

SA>enable

SA#show ip route

Router 1

(“R”开头为通过RIP学习到的路由信息)

 

Router2

SB>enable

SB#show ip route

(“R”开头为通过RIP学习到的路由信息)

Router0

SC>enable

SC#show ip route

(“R”开头为通过RIP学习到的路由信息)

连通性测试:

用PC0 Ping PC1

用PC0 Ping PC2

用PC0 Ping PC3

RIPv1配置成功

 

使用debug ip rip命令显示发送和接收到的RIP路由选择更新

Router1

SA>enable

SA#debug ip rip

(从其中一则消息可以看出RIPv1使用广播更新)

 

停止显示发送和接收到的RIP路由选择更新

SA#no debug ip rip

 

 

配置RIPv2

换至RIPv2版本只需输入verson 2即可

Router1

SA>enable

SA#configure terminal

SA(config)#router rip

SA(config-router)#version 2

 

保存设置:

SA(config-router)#^Z

SA#write

 

Router2

SB>enable

SB#configure terminal

SB(config)#router rip

SB(config-router)#version 2

 

保存设置:

SB(config-router)#^Z

SB#write

 

Router0

SC>enable

SC#configure terminal

SC(config)#router rip

SC(config-router)#version 2

 

保存设置:

SC(config-router)#^Z

SC#write

 

使用debug ip rip命令显示发送和接收到的RIP路由选择更新

Router1

SA>enable

SA#debug ip rip

 

连通性测试

用PC0 Ping PC1

用PC0 Ping PC2

用PC0 Ping PC3

RIPv2配置成功

 

使用debug ip rip命令显示发送和接收到的RIP路由选择更新

Router1

SA>enable

SA#debug ip rip

 

(从其中一则消息可以看出RIPv2使用组播更新,数据包中带有子网掩码)

 

停止显示发送和接收到的RIP路由选择更新

SA#no debug ip rip

猜你喜欢

转载自blog.csdn.net/qq_41745698/article/details/83691935