实验九、路由器RIP-2 配置
一、 实验目的
1. 掌握动态路由的配置方法
2. 理解RIP-2 协议的工作过程
3. 理解RIP-2 对变长子网掩码的支持
二、 应用环境
1. 在不连续的变长子网掩码环境中,RIP-1 的自动汇总会得出错误的路由
2. RIP-2 可以关闭自动汇总,从而得出正确的路由
3. 尽量不要分配不连续的子网
4. 在路由器较多的环境里,手工配置静态路由给管理员带来大的工作负担
5. 在不太稳定的网络环境里,手工修改表不现实
三、 实验设备
1. DCR-1751 三台
2. CR-V35FC 一条
3. CR-V35MT 一条
四、 实验拓扑
五、 实验要求
配置表
Router-A Router-B Router-C
S1/1(DCE) 192.168.1.1/24 S/1/0(DTE) 192.168.1.2/24 F0/0 192.168.2.2/24
F0/0 172.16.3.1/24 F0/0 192.168.2.1/24 E1/0 172.16.4.1/24
六、 实验步骤
第一步:参照实验三,按照上表配置所有接口的IP 地址,保证所有接口全部是up 状态,测试连通性
第二步:配置ROUTER-A 的RIP-1
Router-A_config#router rip
Router-A_config_rip# network 192.168.1.0
Router-A_config_rip#network 172.16.3.0 255.255.255.0 !在RIP-1 里掩码是没有意义的
Router-A_config_rip#^Z
第三步:查看ROUTER-A 的路由表
Router-A# sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 172.16.3.0/24 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, Serial1/1
第四步:配置ROUTER-B 的RIP-1 协议
Router-B_config#router rip
Router-B_config_rip#network 192.168.1.0
Router-B_config_rip#network 192.168.2.0
Router-B_config_rip#^Z
第五步:查看ROUTER-B 上的路由表
Router-B#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
R 172.16.0.0/16 [120,1] via 192.168.1.1(on Serial1/0) !注意是有类的地址
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
第六步:配置路由器C 的 RIP-1 协议
Router-C_config#router rip
Router-C_config_rip#net 192.168.2.0
Router-C_config_rip#net 172.16.4.0 255.255.255.0 ! RIP-1 是有类的路由协议
Router-C_config_rip#^Z
第七步:再次查看路由器B 的路由表Router-B#show ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
R 172.16.0.0/16 [120,1] via 192.168.1.1(on Serial1/0)
[120,1] via 192.168.2.2(on FastEthernet0/0)
!由于有类路由的自动汇总,出现了错误的路由
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0
第八步:在所有路由器上配置RIP-2 协议并关闭自动汇总
Router-C_config#router rip
Router-C_config#version 2 !指明为版本2
Router-C_config# no auto-summary !关闭自动汇总
Router-B_config#router rip
Router-B_config_rip#version 2
Router-B_config_rip#no auto-summary
Router-A_config#router rip
Router-A_config_rip#version 2
Router-A_config_rip#no auto-summary
第九步:再次查看所有的路由表
B 的路由表
Router-B#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
R 172.16.0.0/16 [120,16] via 192.168.2.2(on FastEthernet0/0)
R 172.16.3.0/24 [120,1] via 192.168.1.1(on Serial1/0) !正确的路由
R 172.16.4.0/24 [120,1] via 192.168.2.2(on FastEthernet0/0)
C 192.168.1.0/24 is directly connected, Serial1/0
C 192.168.2.0/24 is directly connected, FastEthernet0/0 A 的路由表
Router-A#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP, BC - BGP connected
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
DHCP - DHCP type
VRF ID: 0
C 172.16.3.0/24 is directly connected, FastEthernet0/0
R 172.16.4.0/24 [120,2] via 192.168.1.2(on Serial1/1) !正确的路由
C 192.168.1.0/24 is directly connected, Serial1/1
R 192.168.2.0/24 [120,1] via 192.168.1.2(on Serial1/1)
Router-C#sh ip route
Codes: C - connected, S - static, R - RIP, B - BGP
D - DEIGRP, DEX - external DEIGRP, O - OSPF, OIA - OSPF inter area
ON1 - OSPF NSSA external type 1, ON2 - OSPF NSSA external type 2
OE1 - OSPF external type 1, OE2 - OSPF external type 2
R 172.16.3.0/24 [120,2] via 192.168.2.1(on FastEthernet0/0)
C 172.16.4.0/24 is directly connected, Ethernet1/0
R 192.168.1.0/24 [120,1] via 192.168.2.1(on FastEthernet0/0)
C 192.168.2.0/24 is directly connected, FastEthernet0/0
!注意到所有网段都学习到了正确掩码的路由
转载于:https://blog.51cto.com/lorna8023/402411