OSPF综合实验报告
版权声明:原创作品,如需转载,请与作者联系。否则将追究法律责任。 |
1.1 实验任务
在网络中为路由器配置Loopback地址,组建OSPF的Stubby区域、主干区域和NSSA区域,配置虚链路和RIP路由协议。
1.2 实验环境和网络拓扑
![]() 1.3 完成标准
(1) 按照拓扑图要求连接路由器,在R1和R2间配置Stu区域,在R2和R3间配置虚链路,在R3和R4 间配置主干区,在R4和R5间配置NSSA区域,在R5和R6间配置RIP路由。
(2) 检查路由表,所有路由器间都能通信。
2.详细操作步骤
Step 1: 配置路由器
路由器R1配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R1
R1(config)#interface loopback 0 //配置Loopback地址
R1(config-if)#ip address
R1(config-if)#interface f0/0 //配置端口IP
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
*Dec 8 21:22:42.559: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec 8 21:22:43.559: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config)#interface f0/0
R1(config-if)#duplex full //设置端口全双工模式
R1(config-if)#exit
R1(config)#router ospf 1 //配置进程为1的OSPF
R1(config-router)#network 192.168.10.0
R1(config-router)#area 1 stub //配置区域1为末梢区域
R1(config-router)#exit
*Dec 8 21:31:14.959: %OSPF-5-ADJCHG: Process 1, Nbr
R1(config)#exit
路由器R2配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R2
R2(config)#interface loopback 0 //配置Loopback地址
R2(config-if)#ip address
R2(config-if)#interface f1/1 //配置端口IP
R2(config-if)#ip address 192.168.10.2 255.255.255.0
R2(config-if)#no shut
*Dec 8 21:23:38.195: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec 8 21:23:39.195: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R2(config-if)#interface f0/0 //配置端口IP
R2(config-if)#ip address 192.168.20.1 255.255.255.0
R2(config-if)#no shut
*Dec 8 21:24:06.279: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec 8 21:24:07.279: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#duplex full //设置端口全双工模式
R2(config-if)#exit
R2(config)#router ospf 2 //配置进程为2的OSPF
R2(config-router)#network 192.168.10.0
R2(config-router)#area 1 stub //配置区域1为末梢区域
*Dec 8 21:31:14.311: %OSPF-5-ADJCHG: Process 2, Nbr
from LOADING to FULL, Loading Done
R2(config-router)#network 192.168.20.0
R2(config-router)#exit
*Dec 8 21:32:22.555: %OSPF-5-ADJCHG: Process 2, Nbr
R2(config)#router ospf 2
R2(config-router)#area 2 virtual-link
R2(config-router)#exit
*Dec 8 21:38:31.471: %OSPF-5-ADJCHG: Process 2, Nbr
R2(config)#exit
路由器R3配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R3
R3(config)#interface loopback 0 //配置Loopback地址
R3(config-if)#ip address
R3(config-if)#interface f1/1 //配置端口IP
R3(config-if)#ip address 192.168.20.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#interface f0/0 //配置端口IP
R3(config-if)#ip address 192.168.30.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#
*Dec 8 21:26:20.175: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec 8 21:26:21.175: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#duplex full //设置端口全双工模式
R3(config-if)#exit
R3(config)#router ospf 3 //配置进程为3的OSPF
R3(config-router)#network 192.168.20.0
*Dec 8 21:32:22.947: %OSPF-5-ADJCHG: Process 3, Nbr
R3(config-router)#network 192.168.30.0
R3(config-router)#exit
*Dec 8 21:33:11.855: %OSPF-5-ADJCHG: Process 3, Nbr
*Dec 8 21:37:51.639: %OSPF-4-ERRRCV: Received invalid packet: mismatch area ID, from backbone area must be virtual-link but not found from 192.168.20.1, FastEthernet1/1
R3(config)#router ospf 3
R3(config-router)#area 2 virtual-link
R3(config-router)#exit
路由器R4配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R4
R4(config)#interface loopback 0 //配置Loopback地址
R4(config-if)#ip address
R4(config-if)#interface f1/1 //配置端口IP
R4(config-if)#ip address 192.168.30.2 255.255.255.0
R4(config-if)#no shut
*Dec 8 21:27:10.603: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec 8 21:27:11.603: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R4(config-if)#interface f0/0 //配置端口IP
R4(config-if)#ip address 192.168.40.1 255.255.255.0
R4(config-if)#no shut
*Dec 8 21:27:30.795: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec 8 21:27:31.795: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R4(config-if)#duplex full //设置端口全双工模式
R4(config-if)#exit
R4(config)#router ospf 4 //配置进程为4的OSPF
R4(config-router)#network 192.168.30.0
*Dec 8 21:33:12.371: %OSPF-5-ADJCHG: Process 4, Nbr
R4(config-router)#network 192.168.40.0
R4(config-router)#area 3 nssa //配置区域3为NSSA区域
R4(config-router)#exit
*Dec 8 21:34:29.371: %OSPF-5-ADJCHG: Process 4, Nbr
R4(config)#exit
路由器R5配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R5
R5(config)#interface loopback 0 //配置Loopback地址
R5(config-if)#ip address
R5(config-if)#interface f1/1 //配置端口IP
R5(config-if)#ip address 192.168.40.2 255.255.255.0
R5(config-if)#no shut
R5(config-if)#
*Dec 8 21:28:23.147: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec 8 21:28:24.147: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R5(config-if)#interface f0/0 //配置端口IP
R5(config-if)#ip address 192.168.50.1 255.255.255.0
R5(config-if)#no shut
R5(config-if)#
*Dec 8 21:28:40.935: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Dec 8 21:28:41.935: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R5(config-if)#duplex full //设置端口全双工模式
R5(config-if)#exit
R5(config)#router ospf 5 //配置进程为5的OSPF
R5(config-router)#network 192.168.40.0
R5(config-router)#area 3 nssa //配置区域3为NSSA区域
*Dec 8 21:34:29.667: %OSPF-5-ADJCHG: Process 5, Nbr
R5(config-router)#exit
R5(config)#router rip //配置RIP路由协议
R5(config-router)#version 2 //版本2
R5(config-router)#network 192.168.50.0 //路由到R5所在网段
R5(config-router)#redistribute ospf 5 metric 10 //重分发进程5的OSPF度量值10
R5(config-router)#exit
R5(config)#router ospf 5
R5(config-router)#redistribute rip subnets //重分发RIP路由所有子网
R5(config-router)#exit
R5(config)#exit
路由器R6配置如下:
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R6
R6(config)#interface loopback 0 //配置Loopback地址
R6(config-if)#ip address
R6(config-if)#interface f1/1 //配置端口IP
R6(config-if)#ip address 192.168.50.2 255.255.255.0
R6(config-if)#no shut
R6(config-if)#exit
*Dec 8 21:29:31.367: %LINK-3-UPDOWN: Interface FastEthernet1/1, changed state to up
*Dec 8 21:29:32.367: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/1, changed state to up
R6(config)#router rip //配置RIP路由协议
R6(config-router)#version 2 //版本2
R6(config-router)#network 192.168.50.0 //路由到R5所在网段
R6(config-router)#network
R6(config-router)#exit
Step 2: 检查各路由器上的路由表
路由器R1路由表显示如下:
C
//
O IA 192.168.30.0/24 [110/3] via 192.168.10.2, 00:00:31, FastEthernet0/0
//OSPF Inter-Area 区域内192.168.30.0/24网段 [路径110/代价3]通过192.168.10.2 时间31秒,端口F0/0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
//192.168.10.0/24网段直连,端口F0/0
O IA 192.168.40.0/24 [110/4] via 192.168.10.2, 00:00:31, FastEthernet0/0
//OSPF Inter-Area 区域内192.168.40.0/24 网段[路径110/代价4]通过192.168.10.2 时间31秒端口F0/0
O IA 192.168.20.0/24 [110/2] via 192.168.10.2, 00:01:21, FastEthernet0/0
//OSPF Inter-Area 区域内192.168.20.0/24网段 [路径110/代价2]通过192.168.10.2 时间21秒端口F0/0
O*I
//OSPF 候选默认 Inter-Area 区域内
路由器R2路由表显示如下:
C
O 192.168.30.0/24 [110/2] via 192.168.20.2, 00:00:45, FastEthernet0/0
C 192.168.10.0/24 is directly connected, FastEthernet1/1
O IA 192.168.40.0/24 [110/3] via 192.168.20.2, 00:00:45, FastEthernet0/0
O E2
//OSPF External Type 2 外部路径类型2
C 192.168.20.0/24 is directly connected, FastEthernet0/0
O E2 192.168.50.0/24 [110/20] via 192.168.20.2, 00:00:45, FastEthernet0/0
//OSPF External Type 2 外部路径类型2 192.168.50.0/24网段[路径110/代价20]通过192.168.20.2 时间45秒,端口F0/0
路由器R3路由表显示如下:
C
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O IA 192.168.10.0/24 [110/2] via 192.168.20.1, 00:00:51, FastEthernet1/1
O IA 192.168.40.0/24 [110/2] via 192.168.30.2, 00:00:51, FastEthernet0/0
O E2
C 192.168.20.0/24 is directly connected, FastEthernet1/1
O E2 192.168.50.0/24 [110/20] via 192.168.30.2, 00:00:41, FastEthernet0/0
路由器R4路由表显示如下:
C 192.168.30.0/24 is directly connected, FastEthernet1/1
C
O IA 192.168.10.0/24 [110/3] via 192.168.30.1, 00:00:58, FastEthernet1/1
C 192.168.40.0/24 is directly connected, FastEthernet0/0
O N2
//OSPF NSSA External Type 2 非纯末梢区域外部路径类型2
O IA 192.168.20.0/24 [110/2] via 192.168.30.1, 00:00:58, FastEthernet1/1
O N2 192.168.50.0/24 [110/20] via 192.168.40.2, 00:00:58, FastEthernet0/0
//OSPF NSSA External Type 2 非纯末梢区域外部路径类型2 192.168.50.0/24网段[路径110/代价20]通过192.168.40.2 时间58秒,端口F0/0
路由器R5路由表显示如下:
O IA 192.168.30.0/24 [110/2] via 192.168.40.1, 00:03:46, FastEthernet1/1
C
O IA 192.168.10.0/24 [110/4] via 192.168.40.1, 00:01:04, FastEthernet1/1
C 192.168.40.0/24 is directly connected, FastEthernet1/1
R
//RI
O IA 192.168.20.0/24 [110/3] via 192.168.40.1, 00:03:46, FastEthernet1/1
C 192.168.50.0/24 is directly connected, FastEthernet0/0
路由器R6路由表显示如下:
R 192.168.30.0/24 [120/10] via 192.168.50.1, 00:00:12, FastEthernet1/1
R 192.168.10.0/24 [120/10] via 192.168.50.1, 00:00:12, FastEthernet1/1
R 192.168.40.0/24 [120/10] via 192.168.50.1, 00:00:12, FastEthernet1/1
C
R 192.168.20.0/24 [120/10] via 192.168.50.1, 00:00:12, FastEthernet1/1
C 192.168.50.0/24 is directly connected, FastEthernet1/1
Step 3: 连通性检查
正向R1连通性检查:
R1#ping 192.168.10.2
//R2区域1端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:
//正在发送5个100字节ICMP网间控制报文协议回应到192.168.10.2,超时2秒
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/57/116 ms
//成功率为100分之一百 (5.5),往返 最小/平均/最大 = 28/57/116 毫秒
R1#ping 192.168.20.1
//R2区域2端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/58/120 ms
R1#ping 192.168.20.2
//R3区域2端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/99/168 ms
R1#ping 192.168.30.1
//R3区域0端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/99/136 ms
R1#ping 192.168.30.2
//R4区域0端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/112/168 ms
R1#ping 192.168.40.1
//R4区域3端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 64/114/152 ms
R1#ping 192.168.40.2
//R5区域3端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 124/164/248 ms
R1#ping 192.168.50.1
//R5 RIP端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.50.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 140/180/264 ms
R1#ping 192.168.50.2
//R6 RIP端口
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.50.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 156/224/308 ms
反向R6连通性检查:
R6#ping 192.168.50.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.50.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/68/140 ms
R6#ping 192.168.40.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/68/152 ms
R6#ping 192.168.40.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/96/168 ms
R6#ping 192.168.30.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/89/184 ms
R6#ping 192.168.30.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 76/130/200 ms
R6#ping 192.168.20.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/136/208 ms
R6#ping 192.168.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 124/173/232 ms
R6#ping 192.168.10.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 144/198/276 ms
R6#ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 156/198/260 ms
3.实验总结
l 非纯末梢网络NSSA (Not-So-Stubby Area) 允许外部路由通告到OSPF |


