OSFP协议配置实验

实验目的:

(1)理解OSPF;

(2)掌握OSPF的配置方法;

(3)掌握查看OSPF协议的相关信息。

实验器材:

Cisco packet

实验内容:

实验步骤:

(1)布置拓扑:

(2)成功布置拓扑:

(3)配置主机IP地址:
  1. 路由器配置:

路由器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

  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协议的理论认识,还增强了实际操作能力和问题解决能力。这些经验和体会将对未来的网络学习和实践大有裨益。

相关推荐
乌托邦的逃亡者1 小时前
Docker的/var/lib/docker/目录占用100%的处理方法
运维·docker·容器
ldj20201 小时前
Jenkins 流水线配置
运维·jenkins
古希腊数通小白(ip在学)4 小时前
stp拓扑变化分类
运维·服务器·网络·智能路由器
12点一刻6 小时前
搭建自动化工作流:探寻解放双手的有效方案(2)
运维·人工智能·自动化·deepseek
未来之窗软件服务6 小时前
东方仙盟AI数据中间件使用教程:开启数据交互与自动化应用新时代——仙盟创梦IDE
运维·人工智能·自动化·仙盟创梦ide·东方仙盟·阿雪技术观
o不ok!7 小时前
Linux面试问题-软件测试
linux·运维·服务器
宇钶宇夕10 小时前
SIMATIC S7-1200的以太网通信能力:协议与资源详细解析
运维·服务器·数据库·程序人生·自动化
杰夫贾维斯10 小时前
CentOS Linux 8 的系统部署 Qwen2.5-7B -Instruct-AWQ
linux·运维·人工智能·机器学习·centos
CodeWithMe11 小时前
【Note】Linux Kernel 实时技术深入:详解 PREEMPT_RT 与 Xenomai
linux·运维·服务器