【实验名称】 动态路由配置(RIP V2配置)。 【实验目的】 掌握在路由器上配置RIP V2。
【技术原理】 RIP(Routing Information Protocols,路由信息协议)是应用较早、使用较普遍的IGP(Interior Gateway Protocol,内部网关协议),适用于小型同类网络,是典型的距离矢量(distance-vector)协议。
RIP协议跳数做为衡量路径开销的,RIP协议里规定最大跳数为15。 RIP协议有两个版本RIPv1和RIPv2。
RIPv1属于有类路由协议,不支持VLSM(变长子网掩码),RIPv1是以广播的形式进行路由信息的更新的;更新周期为30秒。
RIPv2属于无类路由协议,支持VLSM(变长子网掩码),RIPv2是以组播的形式进行路由信息的更新的,组播地址是224.0.0.9。RIPv2还支持基于端口的认证,提高网络的安全性。 【实现功能】
实现网络的互连互通,从而实现信息的共享和传递。 【实验设备】
路由器3台,交换机3台,PC6台,连线若干 【实验拓扑】
一. 实验要求
按照上述网络拓扑图和实验指导进行配置,并对所有主机和路由其端口的IP地址进行设置,然后进行动态路由的设置,测试各子网之间的连通性。查看各路由器的路由表,应能看到所有5个子网。
二. 实验指导
1、各路由器的路由配置如下
Router0的配置 Router>en Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/0
Router(config-if)#ip address 192.168.5.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#int s2/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#clock rate 64000 !DCE端配置时钟频率 Router(config-if)#no shutdown Router(config-if)#exit
Router(config)#route rip !配置RIP路由协议
Router(config-router)#network 192.168.1.0 !声明路由器的直连网络 Router(config-router)#network 192.168.5.0
Router(config-router)#version 2 ! RIP版本为RIPv2 Router(config-router)#exit Router(config)#exit
Router#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
C 192.168.1.0/24 is directly connected, Serial2/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:07, Serial2/0 R 192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:07, Serial2/0 R 192.168.4.0/24 [120/1] via 192.168.1.2, 00:00:07, Serial2/0 C 192.168.5.0/24 is directly connected, FastEthernet0/0 Router#
Router1的配置 Router>en Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int s2/0
Router(config-if)#ip add 192.168.1.2 255.255.255.0 Router(config-if)#no shutdown
Router(config-if)#
Router(config-if)#int f0/0
Router(config-if)#ip add 192.168.4.1 255.255.255.0 Router(config-if)#no shutdown Router(config)#int s3/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0 Router(config-if)#clock rate 64000 Router(config-if)#no shutdown Router(config-if)#exit
Router(config)#route rip
Router(config-router)#network 192.168.1.0 Router(config-router)#network 192.168.4.0 Router(config-router)#network 192.168.2.0 Router(config-router)#version 2 Router(config-router)#exit Router(config)#exit
Router#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
C 192.168.1.0/24 is directly connected, Serial2/0 C 192.168.2.0/24 is directly connected, Serial3/0
R 192.168.3.0/24 [120/1] via 192.168.2.2, 00:00:20, Serial3/0 C 192.168.4.0/24 is directly connected, FastEthernet0/0
R 192.168.5.0/24 [120/1] via 192.168.1.1, 00:00:12, Serial2/0 Router#
Router2的配置 Router>en Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int s2/0
Router(config-if)#ip add 192.168.2.2 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#int f0/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#no shutdown Router(config-if)#exit Router(config)#route rip
Router(config-router)#network 192.168.2.0 Router(config-router)#network 192.168.3.0 Router(config-router)#version 2 Router(config-router)#exit Router(config)#exit Router#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
R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:15, Serial2/0 C 192.168.2.0/24 is directly connected, Serial2/0
C 192.168.3.0/24 is directly connected, FastEthernet0/0
R 192.168.4.0/24 [120/1] via 192.168.2.1, 00:00:15, Serial2/0 R 192.168.5.0/24 [120/2] via 192.168.2.1, 00:00:15, Serial2/0
2、PC机的配置略,但要注意
PC0、PC1的网关为192.168.5.1,网络地址为192.168.5.0 PC2、PC31的网关为192.168.4.1,网络地址为192.168.4.0 PC4、PC5的网关为192.168.3.1,网络地址为192.168.3.0
3、 测试
利用PING测试,任意两台PC之间均能连通。
因篇幅问题不能全部显示,请点此查看更多更全内容