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

相关推荐
hakesashou6 分钟前
Python中常用的函数介绍
java·网络·python
C++忠实粉丝17 分钟前
计算机网络socket编程(4)_TCP socket API 详解
网络·数据结构·c++·网络协议·tcp/ip·计算机网络·算法
九州ip动态18 分钟前
做网络推广及游戏注册为什么要换IP
网络·tcp/ip·游戏
Estar.Lee22 分钟前
时间操作[取当前北京时间]免费API接口教程
android·网络·后端·网络协议·tcp/ip
蝶开三月24 分钟前
php:使用socket函数创建WebSocket服务
网络·websocket·网络协议·php·socket
G丶AEOM37 分钟前
SSL/TLS,SSL,TLS分别是什么
网络·网络协议·网络安全
烦躁的大鼻嘎38 分钟前
【Linux】深入理解GCC/G++编译流程及库文件管理
linux·运维·服务器
乐大师38 分钟前
Deepin登录后提示“解锁登陆密钥环里的密码不匹配”
运维·服务器
儒道易行41 分钟前
【DVWA】RCE远程命令执行实战
网络·安全·网络安全
ac.char1 小时前
在 Ubuntu 上安装 Yarn 环境
linux·运维·服务器·ubuntu