您好,欢迎访问三七文档
本文为大家介绍一个OSPF路由协议最基本的应用案例。此案例描述了如何通过OSPF协议调通网络连接,属于OSPF协议的基本设置。牵涉到的知识包括:如何在思科的路由器中开启OSPF进程,如何把本地的网络地址发布到OSPF里面,如何设置OSPF的区域,如何查看OSPF路由信息等。网络初学者掌握这些OSPF基础知识和设置方法,对学习和理解OSPF路由协议会有帮助。一、组网结构及需求某企业总部在北京,有3个分公司,分别在上海、长沙和广州,总部使用一台思科7200路由器,分公司使用思科3825路由器,3个分公司租用运营商的专线与总部互联。网络拓扑如下所示:北京总部的地址段是:10.10.1.0/24上海分公司的地址段是:10.10.2.0/24长沙分公司的地址段是:10.10.3.0/24广州分公司的地址段是:10.10.4.0/24要求在北京总公司的3个分公司的路由器上运行OSPF协议,调通上述四个地址段的网络连接。本文来自:二、设置步骤1、北京公司路由器:1)设置各接口的IP地址及封装类型,广域网接口的封装统一采用PPP。interfaceFastEthernet0/0ipaddress10.10.1.1255.255.255.0duplexauto!interfaceSerial1/0descriptiontoSHANGHAIipaddress192.168.1.1255.255.255.252encapsulationpppserialrestart-delay0!interfaceSerial1/1descriptiontoCHANGSHAipaddress192.168.2.1255.255.255.252encapsulationpppserialrestart-delay0!interfaceSerial1/2descriptiontoGUANGZHOUipaddress192.168.3.1255.255.255.252encapsulationpppserialrestart-delay02)配置OSPF路由协议的数据routerospf1/*开启OSPF进程1*/log-adjacency-changesnetwork10.10.1.00.0.0.255area0/*北京总公司网段10.10.1.0/24宣告到OSPF区域0*/network192.168.1.00.0.0.3area0/*与上海分公司互联的网段192.168.1.0/30宣告到OSPF区域0*/network192.168.2.00.0.0.3area0/*与长沙分公司互联的网段192.168.2.0/30宣告到OSPF区域0*/network192.168.3.00.0.0.3area0/*与广州分公司互联的网段192.168.2.0/30宣告到OSPF区域0*/本文来自:、上海分公司路由器1)设置各接口的IP地址及封装类型,广域网接口的封装统一采用PPP。interfaceSerial0/0descriptiontoBEIJINGipaddress192.168.1.2255.255.255.252encapsulationpppserialrestart-delay0nodce-terminal-timing-enableinterfaceFastEthernet1/0ipaddress10.10.2.1255.255.255.0duplexautospeedauto2)配置OSPF路由协议的数据routerospf1/*开启OSPF进程1*/log-adjacency-changesnetwork10.10.2.00.0.0.255area0/*上海分公司网段10.10.2.0/24宣告到OSPF区域0*/network192.168.1.00.0.0.3area0/*与北京总公司互联的网段192.168.1.0/30宣告到OSPF区域0*/3、长沙分公司路由器1)设置各接口的IP地址及封装类型,广域网接口的封装统一采用PPP。interfaceSerial0/0descriptiontoBEIJINGipaddress192.168.2.2255.255.255.252encapsulationpppserialrestart-delay0nodce-terminal-timing-enableinterfaceFastEthernet1/0ipaddress10.10.3.1255.255.255.0duplexautospeedauto2)配置OSPF路由协议的数据routerospf1log-adjacency-changesnetwork10.10.3.00.0.0.255area0network192.168.2.00.0.0.3area04、广州分公司路由器1)设置各接口的IP地址及封装类型,广域网接口的封装统一采用PPP。interfaceSerial0/0descriptiontoBEIJINGipaddress192.168.3.2255.255.255.252encapsulationpppserialrestart-delay0nodce-terminal-timing-enableinterfaceFastEthernet1/0ipaddress10.10.4.1255.255.255.0duplexautospeedauto2)配置OSPF路由协议的数据routerospf1log-adjacency-changesnetwork10.10.4.00.0.0.255area0network192.168.3.00.0.0.3area0本文来自:三、验证配置是否生效验证数据配置是否生效可以查看各台路由器的路由表,是否已经有去往各个分公司的路由条目,并且这些路由条目都是通过OSPF路由协议学习到的。配置正确,路由表应显示如下:1、北京路由器的路由表路由条目前面的“O”代表此路由是通过OSPF路由协议学习到的,“C”代表此路由是本地接口的直连路由。BEIJING#shiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset10.0.0.0/24issubnetted,4subnetsC10.10.1.0isdirectlyconnected,FastEthernet0/0O10.10.2.0[110/65]via192.168.1.2,00:05:44,Serial1/0O10.10.3.0[110/65]via192.168.2.2,00:05:44,Serial1/1O10.10.4.0[110/65]via192.168.3.2,00:05:44,Serial1/2192.168.1.0/24isvariablysubnetted,2subnets,2masksC192.168.1.0/30isdirectlyconnected,Serial1/0C192.168.1.2/32isdirectlyconnected,Serial1/0192.168.2.0/24isvariablysubnetted,2subnets,2masksC192.168.2.2/32isdirectlyconnected,Serial1/1C192.168.2.0/30isdirectlyconnected,Serial1/1192.168.3.0/24isvariablysubnetted,2subnets,2masksC192.168.3.2/32isdirectlyconnected,Serial1/2C192.168.3.0/30isdirectlyconnected,Serial1/22、上海路由器的路由表SHANGHAI#shiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset10.0.0.0/24issubnetted,4subnetsO10.10.1.0[110/65]via192.168.1.1,00:04:09,Serial0/0C10.10.2.0isdirectlyconnected,FastEthernet1/0O10.10.3.0[110/129]via192.168.1.1,00:04:09,Serial0/0O10.10.4.0[110/129]via192.168.1.1,00:04:09,Serial0/0192.168.1.0/24isvariablysubnetted,2subnets,2masksC192.168.1.1/32isdirectlyconnected,Serial0/0C192.168.1.0/30isdirectlyconnected,Serial0/0192.168.2.0/30issubnetted,1subnetsO192.168.2.0[110/128]via192.168.1.1,00:04:09,Serial0/0192.168.3.0/30issubnetted,1subnetsO192.168.3.0[110/128]via192.168.1.1,00:04:09,Serial0/03、长沙路由器的路由表CHANGSHA#shiprouteCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA-OSPFinterareaN1-OSPFNSSAexternaltype1,N2-OSPFNSSAexternaltype2E1-OSPFexternaltype1,E2-OSPFexternaltype2i-IS-IS,su-IS-ISsummary,L1-IS-ISlevel-1,L2-IS-ISlevel-2ia-IS-ISinterarea,*-candidatedefault,U-per-userstaticrouteo-ODR,P-periodicdownloadedstaticrouteGatewayoflastresortisnotset10.0.0.0/24issubnetted,4subnetsO10.10.1.0[110/65]via192.168.2.1,00:03:15,Serial0/0O1
本文标题:ospf简单配置
链接地址:https://www.777doc.com/doc-4529270 .html