实验目的:
(1)理解OSPF;
(2)掌握OSPF的配置方法;
(3)掌握查看OSPF协议的相关信息。
实验器材:
Cisco packet
实验内容:
实验步骤:
(1)布置拓扑:
(2)成功布置拓扑:
(3)配置主机IP地址:
- 路由器配置:
路由器R0:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.10.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip address 192.168.20.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#int s0/3/0
Router(config-if)#ip address 192.168.50.1 255.255.255.0
Router(config-if)#no shutdown
路由器R1:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.30.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip address 192.168.40.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int s0/3/0
Router(config-if)#ip address 192.168.60.1 255.255.255.0
Router(config-if)#no shutdown
路由器R2:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.190.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#int g0/1
Router(config-if)#ip address 192.168.90.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#int s0/2/0
Router(config-if)#ip address 192.168.50.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#int s0/2/1
Router(config-if)#ip address 192.168.60.2 255.255.255.0
Router(config-if)#no shutdown
路由器R3:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.190.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int g0/1
Router(config-if)#ip address 192.168.200.1 255.255.255.0
Router(config-if)#no shutdown
路由器R4:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#ip address 192.168.90.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#int g0/1
Router(config-if)#ip address 192.168.100.1 255.255.255.0
Router(config-if)#no shutdown
(5)封装OSPF协议
路由器R0:
Router(config)#route ospf ?
<1-65535> Process ID
Router(config)#route ospf 1
Router(config-router)#network 192.168.10.0 0.0.0.255 area 0
Router(config-router)#network 192.168.20.0 0.0.0.255 area 0
Router(config-router)#network 192.168.50.0 0.0.0.255 area 0
路由器R1:
Router(config)#route ospf 1
Router(config-router)#network 192.168.30.0 0.0.0.255 area 0
Router(config-router)#network 192.168.40.0 0.0.0.255 area 0
Router(config-router)#network 192.168.60.0 0.0.0.255 area 0
路由器R2:
Router(config)#route ospf 1
Router(config-router)#network 192.168.50.0 0.0.0.255 area 0
Router(config-router)#network 192.168.60.0 0.0.0.255 area 0
Router(config-router)#network 192.168.90.0 0.0.0.255 area 0
Router(config-router)#network 192.168.190.0 0.0.0.255 area 0
6.使用主机PC0ping主机PC1,2,5,6
C:\>ping 192.168.20.11
Pinging 192.168.20.11 with 32 bytes of data:
Request timed out.
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127
Reply from 192.168.20.11: bytes=32 time<1ms TTL=127
Ping statistics for 192.168.20.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\>ping 192.168.100.11
Pinging 192.168.100.11 with 32 bytes of data:
Reply from 192.168.10.1: Destination host unreachable.
Reply from 192.168.10.1: Destination host unreachable.
Reply from 192.168.10.1: Destination host unreachable.
Reply from 192.168.10.1: Destination host unreachable.
Ping statistics for 192.168.100.11:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
C:\>ping 192.168.200.11
Pinging 192.168.200.11 with 32 bytes of data:
Reply from 192.168.10.1: Destination host unreachable.
Request timed out.
Reply from 192.168.10.1: Destination host unreachable.
Reply from 192.168.10.1: Destination host unreachable.
Ping statistics for 192.168.200.11:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
(7)配置静态路由:
路由器4:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.0.0 255.255.0.0 192.168.90.1
路由器3:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.0.0 255.255.0.0 192.168.190.1
- 验证主机联通:
主机PC0ping主机PC5,4
C:\>ping 192.168.200.11
Pinging 192.168.200.11 with 32 bytes of data:
Reply from 192.168.200.11: bytes=32 time=1ms TTL=125
Reply from 192.168.200.11: bytes=32 time=1ms TTL=125
Reply from 192.168.200.11: bytes=32 time=3ms TTL=125
Reply from 192.168.200.11: bytes=32 time=3ms TTL=125
Ping statistics for 192.168.200.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 3ms, Average = 2ms
C:\>ping 192.168.100.11
Pinging 192.168.100.11 with 32 bytes of data:
Request timed out.
Reply from 192.168.100.11: bytes=32 time=3ms TTL=125
Reply from 192.168.100.11: bytes=32 time=4ms TTL=125
Reply from 192.168.100.11: bytes=32 time=7ms TTL=125
Ping statistics for 192.168.100.11:
Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
Minimum = 3ms, Maximum = 7ms, Average = 4ms
实验结果(附数据和图表):
实验结果分析及结论:
结果分析:OSPF协议可以实现全网的通信,能够在大规模的网络环境中提供有效的路由服务,其配置需要精确的规划。配置了多个路由器之间的OSPF协议,确保了它们之间能够互相学习路由信息,并正确地传递给主机,也可以实现不同区域间的路由传递,保证网络的连通性和效率。
实验心得体会和建议:
通过OSFP协议配置的实验,理解了OSPF协议的重要性,增加实践操作的经验积累,培养了故障排查的能力,与此同时,也掌握多种路由协议。
学会了如何设置路由器参数,如路由器ID、接口IP地址、区域号等,以及如何调试和监控网络,使用ping命令和其他工具来排查网络故障,确保通信的可靠性。模拟环境中进行实验的同时,尝试将所学知识应用到真实网络环境中,以增强实践经验。
通过这次实验,不仅提高了对OSPF协议的理论认识,还增强了实际操作能力和问题解决能力。这些经验和体会将对未来的网络学习和实践大有裨益。