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

相关推荐
.生产的驴11 分钟前
Docker 部署Nexus仓库 搭建Maven私服仓库 公司内部仓库
java·运维·数据库·spring·docker·容器·maven
cwywsx19 分钟前
Linux:进程控制2
linux·运维·算法
熙曦Sakura20 分钟前
【Linux网络】 HTTP cookie与session
linux·网络·http
南棱笑笑生23 分钟前
20250512给NanoPi NEO core开发板在Ubuntu core20.04系统下重新编译boot.img
linux·运维·ubuntu
yyy00020036 分钟前
BGP联邦实验
网络
为美好的生活献上中指1 小时前
java每日精进 5.11【WebSocket】
java·javascript·css·网络·sql·websocket·网络协议
三天不学习1 小时前
如何配置光猫+路由器实现外网IP访问内部网络?
网络·tcp/ip·智能路由器
愚润求学2 小时前
【Linux】基础 IO(一)
linux·运维·服务器·开发语言·c++·笔记
what_20182 小时前
分布式链路跟踪
java·运维·分布式
EasyDSS3 小时前
AI智能分析网关V4助力工厂/工地/车间/能源矿山场景玩手机行为精准检测与安全生产智能化监管
网络·人工智能