配置使用RIPv2
实验目的
学会配置RIP版本2路由协议
预配置
第一步 配置所有接口
R1路由器
R1(config)#interface s1/2
R1(config-if)#no shutdown
R1(config-if)#ip address 192.168.0.1
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#interface loopback 0
R1(config-if)#ip address
R1(config-if)#interface loopback 1
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#end
R2路由器
R2(config)#interface s2/1
R2(config-if)#no shutdown
R2(config-if)#ip a
00:21:55: %LINK-3-UPDOWN: Interface Serial2/1, changed state to up
R2(config-if)#ip adde
00:21:56: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/1, changed state to up
R2(config-if)#ip address 192.168.0.2 255.255.255.0
R2(config-if)#interface loopback 1
R2(config-if)#ip address 172.16.2.2 255.255.255.0
R2(config-if)#interface loopback 0
R2(config-if)#ip address
R2(config-if)#end
实验过程
第一步 在R1和R2上配置RIPv2
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network
R1(config-router)#network 192.168.0.1
R1(config-router)#network 172.16.1.1
R1(config-router)#exit
R1(config)#
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.0.2
R2(config-router)#network 172.16.2.2
R2(config-router)#network
R2(config-router)#end
R2#
第二步 查看RIP协议运行情况
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
Incoming update filter list for all interfaces is
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Key-chain
Serial1/2 2 2
Loopback0 2 2
Loopback1 2 2
Routing for Networks:
172.16.0.0
192.168.0.0
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 120)
开启debug
00:41:25: RIP: sending v2 update to 224.0.0.9 via Serial1/2 (192.168.0.1)
00:41:25:
00:41:25: 172.16.0.0/16 ->
00:41:25: RIP: sending v2 update to 224.0.0.9 via Loopback0 (
00:41:25:
00:41:25: 172.16.0.0/16 ->
00:41:25: 192.168.0.0/24 ->
00:41:25: RIP: sending v2 update to 224.0.0.9 via Loopback1 (172.16.1.1)
00:41:25: 172.16.0.0/16 ->
00:41:25:
00:41:25:
00:41:25: 192.168.0.0/24 ->
00:41:25: RIP: ignored v2 packet from
00:41:25: RIP: ignored v2 packet from 172.16.1.1 (sourced from one of our addresses)
R1#
00:41:32: RIP: received v2 update from 192.168.0.2 on Serial1/2
00:41:32:
00:41:32: 172.16.0.0/16 ->
可以看到RIPv2 使用组播地址224.0.0.9来发送更新!
注:另一种配置RIPv2的方法
在接口下:ip rip send version 2
ip rip receive version 2
第三步 查看路由表
R1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O -
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, * - candidate default
U - per-user static route, o - ODR
T - traffic engineered route
Gateway of last resort is not set
C
R
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
R 172.16.0.0/16 [120/1] via 192.168.0.2, 00:00:23, Serial1/2
C 172.16.1.0/24 is directly connected, Loopback1
C 192.168.0.0/24 is directly connected, Serial1/2