CiscoPacketTracer实验8开放式最短路径优先路由协议OSPF配置.docx
《CiscoPacketTracer实验8开放式最短路径优先路由协议OSPF配置.docx》由会员分享,可在线阅读,更多相关《CiscoPacketTracer实验8开放式最短路径优先路由协议OSPF配置.docx(9页珍藏版)》请在冰豆网上搜索。
CiscoPacketTracer实验8开放式最短路径优先路由协议OSPF配置
Cisco-Packet-Tracer实验8:
开放式最短路径优先路由协议OSPF-配置
实验8:
开放式最短路径优先路由协议OSPF配置
一、实验目的
1、练习OSPF动态路由协议的基本配置;
2、掌握了解OSPF路由协议原理
二、实验环境
packettracer5.0
三、OSPF协议介绍
OSPF(OpenShortestPathFirst开放式最短路径优先)是一个内部网关协议
(InteriorGatewayProtocol,简称IGP),用于在单一自治系统(autonomous
system,AS)内决策路由。
与RIP相对,OSPF是链路状态路由协议,而RIP是距
离向量路由协议
OSPF的主要特性如下:
适应范围——支持各种规模的网络,最多可支持几千台路由器。
快速收敛——在网络的拓扑结构发生变化后立即发送更新报文,使这一变化
在自治系统中同步。
无自环——OSPF根据收集到的链路状态用最短路径树算法计算路由,从算法上本身保证了不会生成自环路由。
OSPF把一个大型网络分割成多个小型网络的能力被称为分层路由,这些被
分割出来的小型网络就称为“区域”(Area)。
由于区域内部路由器仅与同区域的
路由器交换LSA(链路状态广播)信息,这样LSA报文数量及链路状态信息库表项都会极大减少,SPF(ShortestPathFirst最短路径优先算法)计算速度因此得到提高。
多区域的OSPF必须存在一个主干区域,主干区域负责收集非主干区域发出的汇总路由信息,并将这些信息返还给到各区域。
OSPF区域不能随意划分,应该合理地选择区域边界,使不同区域之间的通
信量最小。
但在实际应用中区域的划分往往并不是根据通信模式而是根据地理或
政治因素来完成的。
在OSPF多区域网络中,路由器可以按不同的需要同时成为以下四种路由器
中的几种:
1.内部路由器:
所有端口在同一区域的路由器,维护一个链路状态数据库。
2.主干路由器:
具有连接主干区域端口的路由器。
3.区域边界路由器(ABR):
具有连接多区域端口的路由器,一般作为一个区域的出口。
ABR为每一个所连接的区域建立链路状态数据库,负责将所连接区域的路由摘要信息发送到主干区域,而主干区域上的ABR则负责将这些信息发送到各个区域。
4.自治域系统边界路由器(ASBR):
至少拥有一个连接外部自治域网络(如非OSPF的网络)端口的路由器,负
责将非OSPF网络信息传入OSPF网络。
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
Router(config-if)#
Router(config-if)#exit
Router(config)#interfaceSerial1/0//配置端口
Router(config-if)#ipaddress192.168.0.1255.255.255.0
Router(config-if)#clockrate64000
Router(config-if)#noshutdown
Router(config-if)#
%LINK-5-CHANGED:
InterfaceSerial1/0,changedstatetoup
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceSerial1/0,changedstatetoup
Router(config-if)#routeospf1//启用OSPF协议,ID号为1
Router(config-router)#network192.168.0.00.0.0.255area0//发布网络
Router(config-router)#network172.16.0.00.0.0.255area0
Router(config-router)#exit
Router(config)#copyrunning-configstart
Router(config)#copyrunning-configstartup-
Router(config)#copyrunning-configstartup-c
Router(config)#exit
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Router#copyrun
Router#copyrunning-configs
Router#copyrunning-configstartup-config//写入启动文件
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
Router6:
Router>enable
Router#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#interfaceFastEthernet0/0
Router(config-if)#ipaddress172.17.0.1255.255.255.0
Router(config-if)#noshutdown
%LINK-5-CHANGED:
InterfaceFastEthernet0/0,changedstatetoup
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
Router(config-if)#exit
Router(config)#interfaceSerial1/0
Router(config-if)#ipaddress192.168.0.2255.255.255.0
Router(config-if)#
%LINK-5-CHANGED:
InterfaceSerial1/0,changedstatetoupnoshutdown
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceSerial1/0,changedstatetoup
Router(config-if)#exit
Router(config)#interfaceSerial1/1
Router(config-if)#ipaddress192.168.1.1255.255.255.0
Router(config-if)#clockrate64000
Router(config-if)#noshutdown
Router(config-if)#
%LINK-5-CHANGED:
InterfaceSerial1/1,changedstatetoup
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceSerial1/1,changedstatetoup
Router(config-if)#routerospf1
Router(config-router)#network192.168.0.00.0.0.255area0
Router(config-router)#network192.168.1.00.0.0.255area0
Router(config-router)#network172.17.0.00.0.0.255area0
Router(config-router)#exit
Router(config)#ex
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Router#copy
Router#copyr
Router#copyrunning-configstartup-config
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
Router#
00:
13:
29:
%OSPF-5-ADJCHG:
Process1,Nbr192.168.2.1onSerial1/1fromLOADINGto
FULL,LoadingDone
Router3:
Router>enable
Router#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#interfaceFastEthernet0/0
Router(config-if)#ipaddress172.18.0.1255.255.255.0
Router(config-if)#noshutdown
%LINK-5-CHANGED:
InterfaceFastEthernet0/0,changedstatetoup
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
Router(config-if)#exit
Router(config)#interfaceSerial1/0
Router(config-if)#ipaddress192.168.1.2255.255.255.0
Router(config-if)#
%LINK-5-CHANGED:
InterfaceSerial1/0,changedstatetoupnoshutdown
Router(config-if)#exit
Router(config)#interfaceSerial1/1
Router(config-if)#ipaddress192.168.2.1255.255.255.0
Router(config-if)#clockrate64000
Router(config-if)#noshutdown
Router(config-if)#
%LINK-5-CHANGED:
InterfaceSerial1/1,changedstatetoup
Router(config-if)#exit
Router(config)#routeospf1Router(config-router)#network192.168.1.00.0.0.255area0
Router(config-router)#network192.168.1.
00:
13:
29:
%OSPF-5-ADJCHG:
Process1,Nbr192.168.1.1onSerial1/0fromLOADINGto
FULL,LoadingDone00.0.0.255area0
Router(config-router)#network192.168.2.00.0.0.255area0
Router(config-router)#network172.18.0.00.0.0.255area0
Router(config-router)#exit
Router(config)#ex
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Router#copyr
Router#copyrunning-configs
Router#copyrunning-configstartup-config
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
Router4:
Router>enable
Router#configureterminal
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.
Router(config)#interfaceFastEthernet0/0
Router(config-if)#ipaddress10.1.1.1255.255.255.0
Router(config-if)#noshutdown
%LINK-5-CHANGED:
InterfaceFastEthernet0/0,changedstatetoup
%LINEPROTO-5-UPDOWN:
LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
Router(config-if)#exit
Router(config)#interfaceSerial1/0
Router(config-if)#ipaddress192.168.2.2255.255.255.0
Router(config-if)#ex
Router(config)#routerospf1
Router(config-router)#network192.168.2.00.0.0.255area0
Router(config-router)#network10.1.1.00.0.0.255area0
Router(config-router)#ex
Router(config)#ex
%SYS-5-CONFIG_I:
Configuredfromconsolebyconsole
Router#copyr
Router#copyrunning-configs
Router#copyrunning-configstartup-config
Destinationfilename[startup-config]?
Buildingconfiguration...
[OK]
2、校验、诊断(鉴于篇幅,以下命令均在router6上调试)
showipprotocol查看路由器中所启用的路由计算协议:
showipospf:
showipospfneighbor
showipospfdatabase
debugipospfevents开启诊断,nodebugipospfevents关闭诊断
完成上述配置之后,为所有网段内的计算机配置正确的Ip地址,并且人一
台计算机可以ping通所有的计算机或路由器