实验4:动态路由RIP实验
一.实验内容
1.学习路由器的动态路由(包括Rip协议和OSPF协议)
2.实现VLAN通信
二.实验工具
软件:思科Cisco Packet Tracer模拟工具
三.实验步骤
1.按照下图拓补结构配置网络:
2..配置信息:
2.1路由器的基本配置
Router0>en
Router0#conf t
Router0(config)#int f0/0
Router0(config-if)#ip address 10.1.1.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config)#int s0/3/0
Router0(config-if)#clock rate 64000
Router0(config-if)#ip address 192.168.0.1 255.255.255.0
Router0(config-if)#no shutdown
Router0(config-if)#exit
Router0(config)#
Router1>en
Router1#conf t
Router1(config)#int f0/0
Router1(config-if)#ip address 10.2.1.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config)#int s0/2/0
Router1(config-if)#clock rate 64000
Router1(config-if)#ip address 192.168.0.2 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#int s0/2/1
Router1(config-if)#clock rate 64000
Router1(config-if)#ip address 192.168.1.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#exit
Router1(config)#
Router2>en
Router2#conf t
Router2(config)#int f0/0
Router2(config-if)#ip address 10.3.1.1 255.255.255.0
Router2(config-if)#no shutdown
Router2(config)#int s0/3/0
Router2(config-if)#clock rate 64000
Router2(config-if)#ip address 192.168.1.2 255.255.255.0
Router2(config-if)#no shutdown
Router2(config-if)#exit
Router2(config)#
2.2RIP路由协议配置
Router0>en
Router0#conf t
Router0(config)#router rip
Router0(config-router)#version 2
Router0(config-router)#no auto-summary //关闭自动汇总功能
Router0(config-router)#network 10.1.1.0
Router0(config-router)#network 192.168.0.0
Router0(config-router)#exit
Router1>en
Router1#conf t
Router1(config)#router rip
Router1(config-router)#version 2
Router1(config-router)#no auto-summary
Router1(config-router)#network 10.2.1.0
Router1(config-router)#network 192.168.0.0
Router1(config-router)#network 192.168.1.0
Router1(config-router)#exit
Router2>en
Router2#conf t
Router2(config)#router rip
Router2(config-router)#version 2
Router2(config-router)#no auto-summary
Router2(config-router)#network 10.3.1.0
Router2(config-router)#network 192.168.1.0
Router2(config-router)#exit
2.3RIP路由协议的排错与诊断
Router0#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
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 10.0.0.0/8 [120/1] via 192.168.0.2, 00:00:09, Serial0/3/0
C 10.1.1.0/24 is directly connected, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Serial0/3/0
R 192.168.1.0/24 [120/1] via 192.168.0.2, 00:00:09, Serial0/3/0
Router0#
Router1>en
Router1#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
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
R 10.0.0.0/8 [120/1] via 192.168.1.2, 00:00:12, Serial0/2/1
R 10.1.1.0/24 [120/1] via 192.168.0.1, 00:00:04, Serial0/2/0
C 10.2.1.0/24 is directly connected, FastEthernet0/0
C 192.168.0.0/24 is directly connected, Serial0/2/0
C 192.168.1.0/24 is directly connected, Serial0/2/1
Router1#
Router1#show ip rip database
10.0.0.0/8 auto-summary
10.0.0.0/8
[1] via 192.168.1.2, 00:00:14, Serial0/2/1
10.1.1.0/24 auto-summary
10.1.1.0/24
[1] via 192.168.0.1, 00:00:06, Serial0/2/0
10.2.1.0/24 auto-summary
10.2.1.0/24 directly connected, FastEthernet0/0
192.168.0.0/24 auto-summary
192.168.0.0/24 directly connected, Serial0/2/0
192.168.1.0/24 auto-summary
192.168.1.0/24 directly connected, Serial0/2/1
Router1#
2.4.交换机的配置
交换机是傻瓜式的,无须配置。
2.5.PC机的配置
PC机的IP地址和子网掩码按拓扑图所示配置。注意:PC上必须配置网关,否则无法进行路由,网关就是交换机接路由器那个端口的IP地址。
|
IP 地址 |
子网掩码 |
网关 |
PC0 |
10.1.1.3 |
255.255.255.0 |
10.1.1.1 |
PC1 |
10.1.1.4 |
255.255.255.0 |
10.1.1.1 |
PC2 |
10.2.1.3 |
255.255.255.0 |
10.2.1.1 |
PC3 |
10.2.1.4 |
255.255.255.0 |
10.2.1.1 |
PC4 |
10.3.1.3 |
255.255.255.0 |
10.3.1.1 |
PC5 |
10.3.1.4 |
255.255.255.0 |
10.3.1.1 |
3.不同网段互ping检查连通性
四.实验结果
本实验结果使用不同主机的发报来印证连接情况,结果如下: