RIP(Routing Inormation Protocol)是应用最早的内部网关协议,适合小型网络,是典型的距离矢量路由协议。目前,RIP协议有RIPv1和RIPv2版本,版本1是有类路由协议,版本2是无类路由协议。
【实验目的】
.熟悉动态网络拓扑结构;
.部署RIPv1的动态路由协议;
.理解RIPv1协议的工作原理;
.掌握RIPv1协议的各种配置及查看命令;
.掌握RIPv1协议的相关参数的修改方法;
【实验拓扑】
【设备参数】
设备 | 接口 | IP地址 | 质网掩码 | 默认网关 |
R1 | S1/0 | 192.168.12.1 | 255.255.255.0 | N/A |
S2/0 | 192.168.13.1 | 255.255.255.0 | N/A | |
Loopback0 | 192.168.1.1 | 255.255.255.0 | N/A | |
R2 | S1/0 | 192.168.12.2 | 255.255.255.0 | N/A |
S2/0 | 192.168.23.2 | 255.255.255.0 | N/A | |
Loopback0 | 192.168.2.2 | 255.255.255.0 | N/A | |
R3 | S1/0 | 192.168.23.3 | 255.255.255.0 | N/A |
S2/0 | 192.168.13.3 | 255.255.255.0 | N/A | |
Loopback0 | 192.168.3.3 | 255.255.255.0 | N/A |
一、配置IP接口
R1配置
[R1]interface Serial 1/0 //进入接口
[R1-Serial1/0]ip address 192.168.12.1 24 //配置IP地址
[R1-Serial1/0]undo shutdown //启用接口
[R1]interface Serial 2/0 //进入接口
[R1-Serial2/0]ip address 192.168.13.1 24 //配置IP地址
[R1-Serial2/0]undo shutdown //启用接口
[R1]interface LoopBack 0 //进入接口
[R1-LoopBack0]ip address 192.168.1.1 24 //配置IP地址
R2配置
[R2]interface Serial 1/0 //进入接口
[R2-Serial1/0]ip address 192.168.12.2 24 //配置IP地址
[R2-Serial1/0]undo shutdown //启用接口
[R2]interface Serial 2/0 //进入接口
[R2-Serial2/0]ip address 192.168.23.2 24 //配置IP地址
[R2-Serial2/0]undo shutdown //启用接口
[R2]interface LoopBack 0 //进入接口
[R2-LoopBack0]ip address 192.168.2.2 24 //配置IP地址
R3配置
[R3]interface Serial 1/0 //进入接口
[R3-Serial1/0]ip address 192.168.23.3 24 //配置IP地址
[R3-Serial1/0]undo shutdown //启用接口
[R3]interface Serial 2/0 //进入接口
[R3-Serial2/0]ip address 192.168.13.3 24 //配置IP地址
[R3-Serial2/0]undo shutdown //启用接口
[R3]interface LoopBack 0 //进入接口
[R3-LoopBack0]ip address 192.168.3.3 24 //配置IP地址
二、 配置RIPv1
RIPv1配置
R1
[R1]rip //进入rip视图
[R1-rip-1]network 192.168.12.0 //宣告网段
[R1-rip-1]network 192.168.13.0 //宣告网段
[R1-rip-1]network 192.168.1.0 //宣告网段
RIPv1配置
R2
[R2]rip //进入rip视图
[R2-rip-1]network 192.168.12.0 //宣告网段
[R2-rip-1]network 192.168.23.0 //宣告网段
[R2-rip-1]network 192.168.2.0 //宣告网段
RIPv1配置
R3
[R3]rip //进入rip视图
[R3-rip-1]network 192.168.13.0 //宣告网段
[R3-rip-1]network 192.168.23.0 //宣告网段
[R3-rip-1]network 192.168.3.0 //宣告网段
三、查看路由表
R1路由表
[AR1]display ip routing-table
Destinations : 25 Routes : 26
Destination/Mask Proto Pre Cost NextHop Interface
192.168.1.0/32 Direct 0 0 192.168.1.1 Loop0
192.168.1.1/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.255/32 Direct 0 0 192.168.1.1 Loop0
192.168.2.0/24 RIP 100 1 192.168.12.2 Ser1/0
192.168.3.0/24 RIP 100 1 192.168.13.3 Ser2/0
192.168.12.0/24 Direct 0 0 192.168.12.1 Ser1/0
192.168.12.0/32 Direct 0 0 192.168.12.1 Ser1/0
192.168.23.0/24 RIP 100 1 192.168.12.2 Ser1/0
R2路由表
[AR2]display ip routing-table
Destinations : 25 Routes : 26
Destination/Mask Proto Pre Cost NextHop Interface
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 RIP 100 1 192.168.12.1 Ser1/0
192.168.2.255/32 Direct 0 0 192.168.2.2 Loop0
192.168.3.0/24 RIP 100 1 192.168.23.3 Ser2/0
192.168.12.255/32 Direct 0 0 192.168.12.2 Ser1/0
192.168.13.0/24 RIP 100 1 192.168.12.1 Ser1/0
R3路由表
[AR3]display ip routing-table
Destinations : 25 Routes : 26
Destination/Mask Proto Pre Cost NextHop Interface
127.255.255.255/32 Direct 0 0 127.0.0.1 InLoop0
192.168.1.0/24 RIP 100 1 192.168.13.1 Ser2/0
192.168.2.0/24 RIP 100 1 192.168.23.2 Ser1/0
192.168.3.255/32 Direct 0 0 192.168.3.3 Loop0
192.168.12.0/24 RIP 100 1 192.168.13.1 Ser2/0
四、查看RIP信息
查看rip协议
[R1]display rip
Public VPN-instance name:
RIP process: 1
RIP version: 1
Preference: 100
Checkzero: Enabled
Default cost: 0
Summary: Enabled
Host routes: Enabled
Maximum number of load balanced routes: 32
Update time : 30 secs Timeout time : 180 secs
Suppress time : 120 secs Garbage-collect time : 120 secs
Update output delay: 20(ms) Output count: 3
TRIP retransmit time: 5(s) Retransmit count: 36
Graceful-restart interval: 60 secs
Triggered Interval : 5 50 200
BFD: Disabled
Silent interfaces: None
Default routes: Disabled
Verify-source: Enabled
Networks:
192.168.1.0 192.168.12.0
192.168.13.0
Configured peers: None
五、查看RIP数据库
[R1]display rip 1 database
192.168.1.0/24, auto-summary
192.168.1.0/24, cost 0, nexthop 192.168.1.1, RIP-interface
192.168.2.0/24, auto-summary
192.168.2.0/24, cost 1, nexthop 192.168.12.2
192.168.3.0/24, auto-summary
192.168.3.0/24, cost 1, nexthop 192.168.13.3
192.168.12.0/24, auto-summary
192.168.12.0/24, cost 0, nexthop 192.168.12.1, RIP-interface
192.168.13.0/24, auto-summary
192.168.13.0/24, cost 0, nexthop 192.168.13.1, RIP-interface
192.168.23.0/24, auto-summary
192.168.23.0/24, cost 1, nexthop 192.168.12.2
192.168.23.0/24, cost 1, nexthop 192.168.13.3
六、其他RIP命令
<R1>reset rip 1 process //重启进程
<R1>display rip 1 interface Serial 1/0 //查看接口信息
<R1>display rip 1 route //查看指定rip进程的路由信息以及每条路由相关的定时器的值
[R1-rip-1]preference 120 //设置优先级默认为100
[R1-rip-1]timers ? //调整4个定时器的值
garbage-collect Garbage-collect timer
suppress Suppress timer
timeout Timeout timer
update Update timer