其他分享
首页 > 其他分享> > 路由与交换 实验三 动态路由协议配置

路由与交换 实验三 动态路由协议配置

作者:互联网

**

实验三 动态路由协议配置

**
一、实验目的
⑴ 掌握动态协议分类、基本工作原理;
⑵ 掌握动态协议配置方法。
二、实验条件
Cisco2621 Router、PacketTrace仿真软件、具备Windows操作系统的PC机
三、实验原理及相关知识
动态协议配置方法
四、实验步骤
1. RIP路由协议配置
网络拓扑结构和IP设置如图。
在这里插入图片描述
在这里插入图片描述

1.1 配置RIP路由协议
⑴ 配置路由器Router1路由
Router>en
Router#config
Router(config)#hostname LabA
LabA(config)#route rip
LabA(config-router)#version 2
LabA(config-router)#net 222.23.10.0
LabA(config-router)#net 222.23.20.0
LabA(config-router)#ex
LabA(config)#ex

⑵ 配置路由器Router2路由
Router>en
Router#config
Router(config)#hostname LabB
LabB(config)#router rip
LabB(config-router)#version 2
LabB(config-router)#net 222.23.20.0
LabB(config-router)#net 222.23.30.0
LabB(config-router)#net 222.23.40.0
LabB(config-router)#ex
LabB(config)#ex

⑶ 配置路由器Router3路由
Router>en
Router#config
Router(config)#hostname LabC
LabC(config)#router rip
LabC(config-router)#version 2
LabC(config-router)#net 222.23.40.0
LabC(config-router)#net 222.23.50.0
LabC(config-router)#ex
LabC(config)#ex

⑷ 配置之后路由器Router1的路由信息
LabA#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 222.23.10.0/24 is directly connected, FastEthernet0/0
C 222.23.20.0/24 is directly connected, Serial0/0
R 222.23.30.0/24 [120/1] via 222.23.20.2, 00:00:18, Serial0/0
R 222.23.40.0/24 [120/1] via 222.23.20.2, 00:00:18, Serial0/0
R 222.23.50.0/24 [120/2] via 222.23.20.2, 00:00:18, Serial0/0

⑸ 配置之后路由器Router2的路由信息
LabB>en
LabB#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 222.23.10.0/24 [120/1] via 222.23.20.1, 00:00:07, Serial0/0
C 222.23.20.0/24 is directly connected, Serial0/0
C 222.23.30.0/24 is directly connected, FastEthernet0/0
C 222.23.40.0/24 is directly connected, Serial0/1
R 222.23.50.0/24 [120/1] via 222.23.40.2, 00:00:06, Serial0/1

⑹ 配置之后路由器Router3的路由信息
LabC>en
LabC#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 222.23.10.0/24 [120/2] via 222.23.40.1, 00:00:08, Serial0/1
R 222.23.20.0/24 [120/1] via 222.23.40.1, 00:00:08, Serial0/1
R 222.23.30.0/24 [120/1] via 222.23.40.1, 00:00:08, Serial0/1
C 222.23.40.0/24 is directly connected, Serial0/1
C 222.23.50.0/24 is directly connected, FastEthernet0/0

1.2 测试连通性
⑴ 路由器Lab_A ping路由器Lab_C
LabA>en
LabA#ping 222.23.40.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 222.23.40.2, timeout is 2 seconds:
!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/10/12 ms

⑵ 路由器Lab_C ping路由器Lab_A
LabC>en
LabC#ping 222.23.20.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 222.23.20.1, timeout is 2 seconds:
!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/11/13 ms

⑶ 在各主机间使用ping命令,测试主机间的连通性。
1)PC0-PC1:可以ping通
2)PC1-PC2:可以ping通
3)PC2-PC3:可以ping通
4)PC3-PC4:可以ping通

2. EIGRP路由协议配置
网络拓扑结构和IP设置如图。
在这里插入图片描述

2.1 配置EIGRP路由协议
⑴ 配置路由器Router1路由
Router#en
Router#config
Router(config)#hostname R1
R1(config)#router eigrp 200
R1(config-router)#net 10.1.1.0 0.0.0.255
R1(config-router)#net 172.16.0.0 0.0.0.255
R1(config-router)#net 202.66.102.64 0.0.0.31
R1(config-router)#no auto-summary
R1(config-router)#ex
R1(config)#ex

⑵ 配置路由器Router2路由
Router>en
Router#config
Router(config)#hostname R2
R2(config)#router eigrp 200
R2(config-router)#net 172.16.0.0 0.0.0.255
R2(config-router)#net 192.168.2.0 0.0.0.255
R2(config-router)#net 202.66.102.128 0.0.0.31
R2(config-router)#no auto-summary
R2(config-router)#ex
R2(config)#ex

⑶ 配置路由器Router3路由
Router>en
Router#config
Router(config)#hostname R3
R3(config)#router eigrp 200
R3(config-router)#net 202.66.102.192 0.0.0.31
R3(config-router)#net 202.66.102.128 0.0.0.31
R3(config-router)#net 202.66.102.64 0.0.0.31
R3(config-router)#no auto-summary
R3(config-router)#ex
R3(config)#ex

⑷ 配置之后路由器Router1的路由信息
R1>en
R1#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/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, FastEthernet0/0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Serial0/1
D 192.168.2.0/24 [90/2172416] via 172.16.0.2, 00:00:10, Serial0/1
202.66.102.0/27 is subnetted, 3 subnets
C 202.66.102.64 is directly connected, Serial0/2
D 202.66.102.128 [90/2681856] via 202.66.102.66, 00:00:10, Serial0/2
[90/2681856] via 172.16.0.2, 00:00:10, Serial0/1
D 202.66.102.192 [90/2172416] via 202.66.102.66, 00:00:10, Serial0/2

⑸ 配置之后路由器Router2的路由信息
R2>en
R2#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/24 is subnetted, 1 subnets

D 10.1.1.0 [90/2172416] via 172.16.0.1, 00:00:41, Serial0/1
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Serial0/1
C 192.168.2.0/24 is directly connected, FastEthernet0/0
202.66.102.0/27 is subnetted, 3 subnets
D 202.66.102.64 [90/2681856] via 172.16.0.1, 00:00:41, Serial0/1
C 202.66.102.128 is directly connected, Serial0/3
D 202.66.102.192 [90/2684416] via 172.16.0.1, 00:00:41, Serial0/1

⑹ 配置之后路由器Router3的路由信息
R3>en
R3#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/24 is subnetted, 1 subnets

D 10.1.1.0 [90/2172416] via 202.66.102.65, 00:01:17, Serial0/2
172.16.0.0/24 is subnetted, 1 subnets
D 172.16.0.0 [90/2681856] via 202.66.102.65, 00:01:17, Serial0/2
D 192.168.2.0/24 [90/2684416] via 202.66.102.65, 00:01:16, Serial0/2
202.66.102.0/27 is subnetted, 3 subnets
C 202.66.102.64 is directly connected, Serial0/2
C 202.66.102.128 is directly connected, Serial0/3
C 202.66.102.192 is directly connected, FastEthernet0/0
2.2 测试连通性
⑴ 路由器Router1 ping路由器Router3
R1#ping 202.66.102.66
在这里插入图片描述

R3#ping 202.66.102.65
在这里插入图片描述

(2) 在各主机间使用ping命令,测试主机间的连通性。
1)PC1-PC2:可以ping通

2)2)PC2-PC3:可以ping通
3)PC2 ping 服务器0:可以ping通

3. OSPF路由协议配置
网络拓扑结构和IP设置如图。
在这里插入图片描述

3.1 配置OSPF路由协议
⑴ 配置路由器Router1路由
Router>en
Router#config
Router(config)#hostname R1
R1(config)#router ospf 100
R1(config)#net 192.168.10.0 0.0.0.255 area 0
R1(config-router)#net 202.66.104.0 0.0.0.255 area 0
R1(config-router)#net 202.66.101.0 0.0.0.255 area 0
R1(config-router)#ex
R1(config)#ex

⑵ 配置路由器Router2路由
Router>en
Router#config
Router(config)#hostname R2
R2(config-if)#ex
R2(config)#router ospf 200
R2(config-router)#net 202.66.101.0 0.0.0.255 area 0
R2(config-router)#net 192.168.20.0 0.0.0.255 area 0
R2(config-router)#net 202.66.123.0 0.0.0.255 area 0
R2(config-router)#net 202.66.124.0 0.0.0.255 area 0
R2(config-router)#ex
R2(config)#ex

⑶ 配置路由器Router3路由
Router>en
Router#config
Router(config)#hostname R3
R3(config)#router ospf 300
R3(config-router)#net 202.66.123.0 0.0.0.255 area 0
R3(config-router)#net 202.64.134.0 0.0.0.255 area 0
R3(config-router)#net 192.168.30.0 0.0.0.255 area 0
R3(config-router)#ex
R3(config)#ex

⑷ 配置路由器Router4路由
Router>en
Router#config
Router(config)#hostname R4
R4(config)#router ospf 400
R4(config-router)#net 202.66.124.0 0.0.0.255 area 0
R4(config-router)#net 202.66.134.0 0.0.0.255 area 0
R4(config-router)#net 192.168.40.0 0.0.0.255 area 0
R4(config-router)#net 202.66.104.0 0.0.0.255 area 0
R4(config-router)#ex
R4(config)#ex

⑸ 配置之后路由器Router1的路由信息
R1>en
R1#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.10.0/24 is directly connected, FastEthernet0/0
O 192.168.20.0/24 [110/65] via 202.66.101.2, 00:00:08, Serial0/2
O 192.168.40.0/24 [110/65] via 202.66.104.2, 00:00:08, Serial0/0
C 202.66.101.0/24 is directly connected, Serial0/2
C 202.66.104.0/24 is directly connected, Serial0/0
O 202.66.123.0/24 [110/128] via 202.66.101.2, 00:00:08, Serial0/2
O 202.66.124.0/24 [110/128] via 202.66.101.2, 00:00:08, Serial0/2
[110/128] via 202.66.104.2, 00:00:08, Serial0/0
O 202.66.134.0/24 [110/128] via 202.66.104.2, 00:00:08, Serial0/0

⑹ 配置之后路由器Router2的路由信息
R2>en
R2#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

O 192.168.10.0/24 [110/65] via 202.66.101.1, 00:00:32, Serial0/2
C 192.168.20.0/24 is directly connected, FastEthernet0/0
O 192.168.30.0/24 [110/65] via 202.66.123.1, 00:00:32, Serial0/3
O 192.168.40.0/24 [110/65] via 202.66.124.2, 00:00:22, Serial0/1
O 202.64.134.0/24 [110/128] via 202.66.123.1, 00:00:32, Serial0/3
C 202.66.101.0/24 is directly connected, Serial0/2
O 202.66.104.0/24 [110/128] via 202.66.101.1, 00:00:32, Serial0/2
[110/128] via 202.66.124.2, 00:00:22, Serial0/1
C 202.66.123.0/24 is directly connected, Serial0/3
C 202.66.124.0/24 is directly connected, Serial0/1
O 202.66.134.0/24 [110/128] via 202.66.124.2, 00:00:22, Serial0/1

⑺ 配置之后路由器Router3的路由信息
R3>en
R3#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

O 192.168.10.0/24 [110/129] via 202.66.123.2, 00:01:07, Serial0/3
O 192.168.20.0/24 [110/65] via 202.66.123.2, 00:01:07, Serial0/3
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O 192.168.40.0/24 [110/129] via 202.66.123.2, 00:00:57, Serial0/3
C 202.64.134.0/24 is directly connected, Serial0/2
O 202.66.101.0/24 [110/128] via 202.66.123.2, 00:01:07, Serial0/3
O 202.66.104.0/24 [110/192] via 202.66.123.2, 00:01:07, Serial0/3
C 202.66.123.0/24 is directly connected, Serial0/3
O 202.66.124.0/24 [110/128] via 202.66.123.2, 00:01:07, Serial0/3
O 202.66.134.0/24 [110/192] via 202.66.123.2, 00:00:57, Serial0/3
⑻ 配置之后路由器Router4的路由信息
R4>en
R4#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

O 192.168.10.0/24 [110/65] via 202.66.104.1, 00:01:28, Serial0/0
O 192.168.20.0/24 [110/65] via 202.66.124.1, 00:01:28, Serial0/1
O 192.168.30.0/24 [110/129] via 202.66.124.1, 00:01:28, Serial0/1
C 192.168.40.0/24 is directly connected, FastEthernet0/0
O 202.64.134.0/24 [110/192] via 202.66.124.1, 00:01:28, Serial0/1
O 202.66.101.0/24 [110/128] via 202.66.104.1, 00:01:28, Serial0/0
[110/128] via 202.66.124.1, 00:01:28, Serial0/1
C 202.66.104.0/24 is directly connected, Serial0/0
O 202.66.123.0/24 [110/128] via 202.66.124.1, 00:01:28, Serial0/1
C 202.66.124.0/24 is directly connected, Serial0/1
C 202.66.134.0/24 is directly connected, Serial0/2

2.2 测试连通性
⑴ 路由器Router1 ping路由器Router3
R1#ping 202.66.123.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 202.66.123.1, timeout is 2 seconds:
!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 6/9/11 ms

⑵ 在各主机间使用ping命令,测试主机间的连通性。
①PC1-PC2:可以ping通
②PC2-PC3:可以ping通
③PC3-PC4:可以ping通
④PC4-PC1:可以ping通

五、思考题及其它
1)查看RIP的版本号用什么命令。

答:show ip protocol
2)EIGRP路由汇总有什么作用?
答:减轻路由器的路由压力,如果没汇总,就要为每个IP进行路由选择,汇总以后,就只要一条路由选择就够了。

3)下面那些是表示主机地址?那些是表示子网网络号?
①202.066.102.1/27 ②202.066.102.32/27
③202.066.102.97/27 ④202.066.102.160/27
⑤202.066.102.225/27

答:将ip地址转化为二进制与掩码进行相与运算,将结果再化为10进制,求得的目的地址与ip地址作比较 ,若相同为子网网络号,反之不相同为主机地址
例如①: 00000001
与 11100000
00000000
所以目的地址应该为202.66.102.0 所以①表示为主机地址
同理可得 主机地址有:①③⑤
子网网络号有:②④

标签:24,00,Serial0,202.66,OSPF,交换,动态,config,路由
来源: https://blog.csdn.net/qq_46074155/article/details/114900181