OSPF综合实验大全_第1页
OSPF综合实验大全_第2页
OSPF综合实验大全_第3页
OSPF综合实验大全_第4页
OSPF综合实验大全_第5页
已阅读5页,还剩29页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

...wd......wd......wd...OSPF综合实验大全OSPF实验1:基本的OSPF配置实验级别:Assistant实验拓扑:实验步骤:1.首先在3台路由器上配置物理接口,并且使用ping命令确保物理链路的畅通。2.在路由器上配置loopback接口:R1(config)#intloopback0R1(config-if)#ipadd1.1.1.1255.255.255.0R2(config)#intloopback0R2(config-if)#ipadd2.2.2.2255.255.255.0R3(config)#intloopback0R3(config-if)#ipadd3.3.3.3255.255.255.0路由器的RID是路由器接口的最高的IP地址,当有环回口存在是,路由器将使用环回口的最高IP地址作为起RID,从而保证RID的稳定。3.在3台路由器上分别启动ospf进程,并且宣告直连接口的网络。R1(config)#routerospf10R1(config-router)#network192.168.1.00.0.0.255area0R1(config-router)#network1.1.1.00.0.0.255area0R1(config-router)#network192.168.3.0.0.0.255area0ospf的进程号只有本地意义,既在不同路由器上的进程号可以不一样。但是为了日后维护的方便,一般启用一样的进程号。ospf使用反向掩码。Area0表示骨干区域,在设计ospf网络时,所有的非骨干区域都需要和骨干区域直连!R2,R3的配置和R1类似,这里省略。不同的是我们在R2和R3上不宣告各自的环回口。*Aug1317:58:51.411:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/0fromLOADINGtoFULL,LoadingDone配置完毕后,我们可以看到邻居关系已经到达FULL状态。

4.在R1上查看路由表,可以看到以下信息:R1#showiprouteCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0O192.168.2.0/24[110/65]via192.168.1.2,00:03:42,Serial1/0C192.168.3.0/24isdirectlyconnected,FastEthernet0/我们看到R1学到了192.168.2.0/24这个网段的路由。后面的数字[110/65],分别表示OSPF的管理距离〔AD〕和路由的Metric值OSPF的Metric值是由cost值逐跳累加的。Cost=100Mb/带宽值。5.在R1上showipospfneighbor、showipospfinterfaceR1#showipospfneighborNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/BDR00:00:34192.168.3.3FastEthernet0/02.2.2.20FULL/-00:00:32192.168.1.2Serial1/0我们看到R1和R3选取了DR和BDR,而R1和R2没有选取。在ospf的五种网络类型中。Point-to-Point,Point-to-Multipoint(播送与非播送)这三种网络类型不选取DR与BDR;Broadcast,NBMA选取DR与BDR。R1#showipospfinterfaceFastEthernet0/0isup,lineprotocolisupInternetAddress192.168.3.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:1TransmitDelayis1sec,StateDR,Priority1DesignatedRouter(ID)1.1.1.1,Interfaceaddress192.168.3.1BackupDesignatedrouter(ID)3.3.3.3,Interfaceaddress192.168.3.3Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5oob-resynctimeout40Helloduein00:00:03Index3/3,floodqueuelength0Next0x0(0)/0x0(0)Lastfloodscanlengthis1,maximumis1Lastfloodscantimeis0msec,maximumis0msecNeighborCountis1,Adjacentneighborcountis1Adjacentwithneighbor3.3.3.3(BackupDesignatedRouter)Suppresshellofor0neighbor(s)Serial1/0isup,lineprotocolisupInternetAddress192.168.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypePOINT_TO_POINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5oob-resynctimeout40Helloduein00:00:02Index1/1,floodqueuelength0Next0x0(0)/0x0(0)Lastfloodscanlengthis1,maximumis1Lastfloodscantimeis4msec,maximumis4msecNeighborCountis1,Adjacentneighborcountis1Adjacentwithneighbor2.2.2.2Suppresshellofor0neighbor(s)Loopback0isup,lineprotocolisupInternetAddress1.1.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeLOOPBACK,Cost:1LoopbackinterfaceistreatedasastubHost在这里我们看到环回口的网络网络类型是Loopback,这是一种特殊的网络类型,只针对环回口存在。我们到R2上看看路由表:R2#showiprouteCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/32issubnetted,1subnetsO1.1.1.1[110/65]via192.168.1.1,00:12:34,Serial1/02.0.0.0/24issubnetted,1subnetsC2.2.2.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0C192.168.2.0/24isdirectlyconnected,Serial1/1O192.168.3.0/24[110/65]via192.168.1.1,00:12:34,Serial1/0[110/65]via192.168.2.3,00:12:34,Serial1/1R2的路由表显示来自环回口的路由,掩码为/32,既我们所说的“主机路由〞。在实际应用中,环回口以32位的居多,用作ospf的管理接口。但是如果你想让环回口模拟一个网段,我们可以通过以下配置来消除。R1(config)#intloopback0R1(config-if)#ipospfnetworkpoint-to-point环回口只能配置成point-to-point这种类型,不可以配置成其它的类型。回到R2查看路由表:R2#showiprouteCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsO1.1.1.0[110/65]via192.168.1.1,00:00:24,Serial1/02.0.0.0/24issubnetted,1subnetsC2.2.2.0isdirectlyconnected,Loopback0C192.168.1.0/24isdirectlyconnected,Serial1/0C192.168.2.0/24isdirectlyconnected,Serial1/1O192.168.3.0/24[110/65]via192.168.1.1,00:00:24,Serial1/0[110/65]via192.168.2.3,00:00:24,Serial1/1我们看到主机路由没有了,取而代之的是一个/24的网段。本文出自“盖如鹤的步徒〞博客,请务必保存此出处://gairuhe.blog.51cto/77728/38127OSPF实验2:DR/BDR的选取实验级别:Professional情况一:我们都知道OSPF选取DR的过程是首先比较优先级,在优先级一样的情况下选择RID较高的为DR,但是我屡次实验后发现在很多时候DR并非RID最高的路由器,这是什么原因呢在翻阅了卷一有关OSPFDR选取的介绍时,发现了这么一句话:“在一个多址网络上,最先初始化启动的两台具有DR选取资格的路由器将成为DR和BDR路由器。〞这是我总结了非最高RID而成为DR的实验,发现这些路由器都是我在进展OSPF配置的时候首先启动ospf的路由器,那会不会是因为这些路由器首先启动了OSPF,然后把自己设置为DR导致其他路由器启动OSPF后就不再进展DR的选取了呢于是我做了下面的这个实验。实验的topo很简单,我就不画了,就是两台路由器通过fa0/0口相连接。

R1:

conft

hoR1

intlo0

ipadd1.1.1.1255.255.255.0

intfa0/0

ipadd172.1.1.1255.255.255.0

nosh

routerospf10

net172.1.1.10.0.0.0a0R2:

conft

hoR2

intlo0

ipadd2.2.2.2255.255.255.0

intfa0/0

ipadd172.1.1.2255.255.255.0

noshR1启动ospf进程后,我们在R2上暂时先不开启ospf,在R1上发现了以下信息:R1#shoipospfint

FastEthernet0/0isup,lineprotocolisupInternetAddress172.1.1.1/24,Area0ProcessID10,RouterID1.1.1.1,NetworkTypeBROADCAST,Cost:1

TransmitDelayis1sec,StateDR,Priority1DesignatedRouter(ID)1.1.1.1,Interfaceaddress172.1.1.1

Nobackupdesignatedrouteronthisnetwork

Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5

oob-resynctimeout40

Helloduein00:00:01

Index1/1,floodqueuelength0

Next0x0(0)/0x0(0)

Lastfloodscanlengthis0,maximumis0

Lastfloodscantimeis0msec,maximumis0msec

NeighborCountis0,Adjacentneighborcountis0Suppresshellofor0neighbor(s)我们看到R1已经把自己设定为DR了,按照OSPF的规则,新参加的路由器即使RID比DR高,也不会替换DR。这就说明了为什么在有些时候DR并非RID最高的路由器。当然这个实验也顺便验证了ospf中DR选取完毕后,除非DR路由器出现故障,否则就是有更高优先级或者RID的路由器进入OSPF进程,也是无法改变DR的。既DR是不可以抢夺的!情况二〔本实验参照了ITAA实验室Netfish的实验〕:ospf中有一个WaitTimer计时器,在这个计时器所限定的时间内起来的OSPF可以视为同时起机。TCP/IP卷1第292页对于这个时间间隔是这样定义的:WaitTimer:在开场选举DR和BDR之间,路由器等待邻居路由器的Hello数据包通告DR和BDR的时长。长度就是RouterDeadInterval的时间。本实验拓扑与情况一一样,不同的地方在于当我们在R1上启动OSPF后,迅速〔一定要迅速,非常迅速!40s之内〕在R2上也启动ospf,通过debug信息可以看到以下情况:R1#debugipospfadj

OSPFadjacencyeventsdebuggingison

R1#debugipospfev

OSPFeventsdebuggingison*Aug1400:56:19.047:OSPF:InterfaceFastEthernet0/0goingUp

*Aug1400:56:19.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:19.551:OSPF:BuildrouterLSAforarea0,routerID1.1.1.1,seq0x80000001

*Aug1400:56:19.555:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:19.555:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:29.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:29.451:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:29.455:OSPF:2WayCommunicationto2.2.2.2onFastEthernet0/0,state2WAY

*Aug1400:56:29.455:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:39.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:39.427:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:39.427:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:49.051:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:49.447:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:49.447:OSPF:Endofhelloprocessing

R1(config-router)#

*Aug1400:56:59.051:OSPF:endofWaitoninterfaceFastEthernet0/0*Aug1400:56:59.051:OSPF:DR/BDRelectiononFastEthernet0/0

*Aug1400:56:59.051:OSPF:ElectBDR2.2.2.2

*Aug1400:56:59.055:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.055:DR:2.2.2.2(Id)BDR:2.2.2.2(Id)

*Aug1400:56:59.055:OSPF:SendDBDto2.2.2.2onFastEthernet0/0seq0x826opt0x52flag0x7len32

*Aug1400:56:59.059:OSPF:Sendhelloto224.0.0.5area0onFastEthernet0/0from172.1.1.1

*Aug1400:56:59.459:OSPF:Rcvhellofrom2.2.2.2area0fromFastEthernet0/0172.1.1.2

*Aug1400:56:59.463:OSPF:NeighborchangeEventoninterfaceFastEthernet0/0

*Aug1400:56:59.463:OSPF:DR/BDRelectiononFastEthernet0/0

*Aug1400:56:59.463:OSPF:ElectBDR1.1.1.1

*Aug1400:56:59.467:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.467:OSPF:ElectBDR1.1.1.1

*Aug1400:56:59.467:OSPF:ElectDR2.2.2.2

*Aug1400:56:59.471:DR:2.2.2.2(Id)BDR:1.1.1.1(Id)这个时候我们发现两个路由器进展了DR/BDR的选取,并且结论和书上介绍的完全一致。从Debug信息的时间上来看,从启动OSPF进程到开场选举DR和DBR的时间间隔是40秒,在这个时间段内,无论R1还是R2并没有选举DR和DBR。在RFC2328中对这个时间间隔的定义如下:

WaitTimer

Asingleshottimerthatcausestheinterfacetoexitthe

Waitingstate,andasaconsequenceselectaDesignatedRouter

onthenetwork.ThelengthofthetimerisRouterDeadInterval

seconds.因为在播送链路中的RouterDeadInterval是40秒,所以我们看到的这个时间间隔为40秒。结论:并不是先启动OSPF进程的路由器就是DR,而是有一个时间间隔让路由器来等待其他路由器,在这个时间间隔内,路由器相互监听Hello包中的DR和DBR字段中的信息,并且服从优先级原则,可以这样认为——选举是公平的。实际情况:在实际的网络中,即使是40秒内同时起进程的情况也少见;实际情况下是率先启用ospf进程的路由器就很有可能成为DR,第二个启动的就很有可能成为BDR,考虑到路由器故障或者重启等情况,实际的运行效果是:“活〞得最久的路由器成为DR〔比多长时间不重起〕.OSPF实验3:OSPFoverNBMA下的五种网络类型实验等级:Professional实验拓扑:实验基本配置:1.首先将R1配置成为帧中继交换机:frame-relayswitching!interfaceSerial1/0noipaddressencapsulationframe-relayclockrate64000frame-relaylmi-typeansiframe-relayintf-typedceframe-relayroute101interfaceSerial1/1102!interfaceSerial1/1noipaddressencapsulationframe-relayclockrate64000frame-relaylmi-typeansiframe-relayintf-typedceframe-relayroute102interfaceSerial1/01012.R2和R3的基本配置:R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress12.1.1.2255.255.255.0encapsulationframe-relayserialrestart-delay0frame-relaymapip12.1.1.3101broadcastnoframe-relayinverse-arp!routerospf10router-id2.2.2.2log-adjacency-changesnetwork2.2.2.00.0.0.255area0network12.1.1.00.0.0.255area0R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceSerial1/1ipaddress12.1.1.3255.255.255.0encapsulationframe-relayserialrestart-delay0frame-relaymapip12.1.1.2102broadcastnoframe-relayinverse-arp!routerospf10router-id3.3.3.3log-adjacency-changesnetwork3.3.3.00.0.0.255area0network12.1.1.00.0.0.255area0Type1----Non_Broadcast〔默认〕我们在R2上showipospfneighbor,发现没有邻居。说明在这种情况下邻居需要手动配置!配置如下:R2:R2(config)#routerospf10R2(config-router)#neighbor12.1.1.3R3:R3(config)#routerospf10R3(config-router)#neighbor12.1.1.2此时在R2上查看邻居:R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/DR00:01:4612.1.1.3Serial1/0发现邻居已经形成并且有DR与BDR的选举!在R2上查看接口R2#showipospfinterfaceSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypeNON_BROADCAST,Cost:64TransmitDelayis1sec,StateBDR,Priority1DesignatedRouter(ID)3.3.3.3,Interfaceaddress12.1.1.3BackupDesignatedrouter(ID)2.2.2.2,Interfaceaddress12.1.1.2FlushtimerforoldDRLSAduein00:01:40Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5在这种网络类型中,hello的间隔是30s。翻开debug信息,我们可以看到在这种网络类型中,OSPF的数据包是单播传送的。R2#*Aug1414:52:52.819:OSPF:Sendhelloto12.1.1.3area0onSerial1/0from12.1.1.2R2#*Aug1414:52:57.087:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1414:52:57.091:OSPF:EndofhelloprocessingType2----Broadcast首先去掉刚刚手动配置的邻居关系:R2(config)#routerospf10R2(config-router)#noneighbor12.1.1.3R3(config)#routerospf10R3(config-router)#noneighbor12.1.1.2将R2和R3接口的网络类型改成broadcastR2(config-router)#ints1/0R2(config-if)#ipospfnetworkbroadcastR3(config-router)#ints1/1R3(config-if)#ipospfnetworkbroadcast一会我们就看到了如下信息R3#*Aug1414:59:52.823:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone这说明了在这种网络类型下是不需要手动配置邻居关系的!R2#showipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.31FULL/DR00:00:3912.1.1.3Serial1/0有DR与BDR的选举。R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypeBROADCAST,Cost:64TransmitDelayis1sec,StateBDR,Priority1DesignatedRouter(ID)3.3.3.3,Interfaceaddress12.1.1.3BackupDesignatedrouter(ID)2.2.2.2,Interfaceaddress12.1.1.2Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Hello时间间隔为10s。R2#*Aug1415:02:20.443:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2*Aug1415:02:20.959:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:02:20.963:OSPF:Endofhelloprocessing使用224.0.0.5这个组播地址传送数据包。Type3----Point-to-Point将R2,R3接口的网络类型改成Point-to-PointR2(config-if)#ipospfnetpoint-to-pointR3(config-if)#ipospfnetpoint-to-point很快我们就可以看到如下信息R3(config-if)#*Aug1415:06:07.559:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone说明这种网络类型也不需要手动指定邻居R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:00:3712.1.1.3Serial1/0没有DR/BDR的选举R2#shipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_POINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Hello时间间隔为10sR2#*Aug1415:08:25.311:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2R2#*Aug1415:08:30.259:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:08:30.263:OSPF:Endofhelloprocessing同样也是使用224.0.0.5这个组播地址传送数据。Type4----Point-to-Multipoint将接口改为Point-to-MultipointR2(config-if)#ipospfnetworkpoint-to-multipointR3(config-if)#ipospfnetworkpoint-to-multipoint*Aug1415:10:51.739:%OSPF-5-ADJCHG:Process10,Nbr2.2.2.2onSerial1/1fromLOADINGtoFULL,LoadingDone同样也不需要手动指定邻居R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:01:4812.1.1.3Serial1/0没有DR和BDR的选举R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_MULTIPOINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_MULTIPOINT,Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5Hello时间间隔为30sR2#*Aug1415:12:49.759:OSPF:Sendhelloto224.0.0.5area0onSerial1/0from12.1.1.2R2#*Aug1415:12:57.443:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:12:57.447:OSPF:Endofhelloprocessing以224.0.0.5这个组播地址发送数据Type5----Point-to-Multipoint〔Non_Broadcast〕改变接口类型为Point-to-Multipoint(Non_Broadcast)R2(config-if)#ipospfnetworkpoint-to-multipointnon-broadcastR3(config-if)#ipospfnetworkpoint-to-multipointnon-broadcast这个时候邻居没有被自动发现。我们在R2上手动指定邻居R2(config-if)#routerospf10R2(config-router)#neighbor12.1.1.3R2(config-router)#*Aug1415:18:38.955:%OSPF-5-ADJCHG:Process10,Nbr3.3.3.3onSerial1/0fromLOADINGtoFULL,LoadingDone邻居只要在一边指定即可。说明在这种网络类型下邻居需要手动指定。R2#shoipospfneiNeighborIDPriStateDeadTimeAddressInterface3.3.3.30FULL/-00:01:5712.1.1.3Serial1/0同样没有DR和BDR的选取R2#shoipospfintSerial1/0isup,lineprotocolisupInternetAddress12.1.1.2/24,Area0ProcessID10,RouterID2.2.2.2,NetworkTypePOINT_TO_MULTIPOINT,Cost:64TransmitDelayis1sec,StatePOINT_TO_MULTIPOINT,Timerintervalsconfigured,Hello30,Dead120,Wait120,Retransmit5Hello时间间隔为30sR2#*Aug1415:21:03.099:OSPF:Sendhelloto12.1.1.3area0onSerial1/0from12.1.1.2*Aug1415:21:03.295:OSPF:Rcvhellofrom3.3.3.3area0fromSerial1/012.1.1.3*Aug1415:21:03.299:OSPF:Endofhelloprocessing使用单播传送OSPF数据。总结:在NBMA网络下5种网络类型具体情况如下表所示:网络类型邻居自动发现有无DR选举Hello间隔传输方式Non_broadcast否有30s单播Broadcast是有10s组播Point-to-Point是无10s组播Point-to-Multipoint是无30s组播Point-to-Multipoint(非播送)否无30s单播本文出自“盖如鹤的步徒〞博客,请务必保存此出处://gairuhe.blog.51cto/77728/38241OSPF实验4:虚链路实验等级:Professional实验拓扑:实验分析:上面这个网络的设计在OSPF中是比较失败的,因为OSPF建议所有的非骨干区域都和骨干区域直连。上面这个网络的设计将会导致Area2的数据和Area0无法通信。为了解决这个问题,一种方法可以在R3和R1上增加一条物理链路。还有一种过渡的方法就是使用虚链路。实验基本配置:R1:interfaceLoopback0ipaddress1.1.1.1255.255.255.0ipospfnetworkpoint-to-point!interfaceSerial1/0ipaddress10.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id1.1.1.1log-adjacency-changesnetwork10.1.1.00.0.0.255area0R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress10.1.1.2255.255.255.0serialrestart-delay0!interfaceSerial1/1ipaddress11.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id2.2.2.2log-adjacency-changesnetwork10.1.1.00.0.0.255area0network11.1.1.00.0.0.255area1R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceSerial1/0ipaddress11.1.1.2255.255.255.0serialrestart-delay0!routerospf10router-id3.3.3.3log-adjacency-changesnetwork3.3.3.00.0.0.255area2network11.1.1.00.0.0.255area1我们在R1上查看路由表,发现没有R3的Loopback接口路由:R1#shoiprouCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:04:50,Serial1/0为了让R1学习到R3的路由,我们配置虚链路。虚链路的配置:虚链路必须配置在ABR上,在这个网络中ABR是R2和R3。虚链路的配置使用的命令是areatransit-area-idvirtual-linkrouter-id。我们现在在R2和R3上进展配置。R2(config)#routerospf10R2(config-router)#area1virtual-link3.3.3.3R3(config)#routerospf10R3(config-router)#area1virtual-link2.2.2.2等虚链路起来后,我们查看其状态:R2#shoipospfvirtual-linksVirtualLinkOSPF_VL0torouter3.3.3.3isupRunasdemandcircuitDoNotAgeLSAallowed.Transitarea1,viainterfaceSerial1/1,Costofusing64TransmitDelayis1sec,StatePOINT_TO_POINT,Timerintervalsconfigured,Hello10,Dead40,Wait40,Retransmit5Helloduein00:00:05AdjacencyStateFULL(Hellosuppressed)Index2/3,retransmissionqueuelength0,numberofretransmission1First0x0(0)/0x0(0)Next0x0(0)/0x0(0)Lastretransmissionscanlengthis1,maximumis1Lastretransmissionscantimeis0msec,maximumis0msec在上面的信息中我们可以看到。虚链路在逻辑上是等同于一条物理的按需链路,既只有在两端路由器的配置有变动的时候才进展更新,并且使用的是不老化〔DoNotAge〕LSA,既虚链路是无须Hello包控制的。R1#shoiprouCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback03.0.0.0/32issubnetted,1subnetsOIA3.3.3.3[110/129]via10.1.1.2,00:03:02,Serial1/010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:03:02,Serial1/0这时看到R1已经学习到了R3环回口的路由。Metric值为129,虚链路的Metric等同于所经过的全部链路开销之和,在这个网络中,Metric=1〔Loopback〕+64+64=129。在R1上查看OSPF数据库:R1#showipospfdatabaseOSPFRouterwithID(1.1.1.1)(ProcessID10)RouterLinkStates(Area0)LinkIDADVRouterAgeSeq#ChecksumLinkcount1.1.1.11.1.1.17970x800000020x00B9C022.2.2.22.2.2.23690x800000040x00DD2933.3.3.33.3.3.36(DNA)0x800000020x008B351SummaryNetLinkStates(Area0)LinkIDADVRouterAgeSeq#Checksum3.3.3.33.3.3.312(DNA)0x800000010x00AE7511.1.1.02.2.2.27890x800000010x0029BE11.1.1.03.3.3.312(DNA)0x800000010x000BD8这里的〔DNA〕就是DoNotAge。总结:虚链路被看成网络设计失败的一种补救手段,它不仅可以让没有和骨干区域直连的非骨干区域在逻辑上建立一条链路,还可以连接两个别离的骨干区域。但是由于虚链路的配置会造成日后维护和排错的困难。所以在进展网络设计的时候,不能将虚链路考虑进去。本文出自“盖如鹤的步徒〞博客,请务必保存此出处://gairuhe.blog.51cto/77728/38402OSPF实验7:OSPF特殊区域实验级别:Professional实验拓扑:实验说明:R2为ABR和ASBR,R3在NSSA实验时会成为ASBR。在做这个实验之前,首先我们要了解一下OSPFLSA的类型。见下表:类型代码类型名称描述1路由器LSA每台路由器都会产生,在区域内泛洪2网络LSADR产生,在区域内泛洪3网络汇总LSAABR始发,在整个OSPF域中泛洪4ASBR汇总LSAABR始发,在整个OSPF域中泛洪5AS外部LSAASBR始发,在整个OSPF域中泛洪6组成员LSA标识OSPF组播中的组成员,不做讨论7NSSA外部LSAASBR始发,8外部属性LSA没有实现9OpaqueLSA〔本地链路范围〕

用于MPLS流量工程,不做讨论10OpaqueLSA〔本地区域范围〕11OpaqueLSA〔AS范围〕在一个OSPF的普通区域,会存在LSA1,LSA2,LSA3,LSA4,LSA5这些LSA,并且数量很多。我们可以通过OSPF的特殊区域的配置让某些区域减少LSA数目和路由表的条目。基本配置:R1:interfaceLoopback0ipaddress1.1.1.1255.255.255.0ipospfnetworkpoint-to-point!interfaceSerial1/0ipaddress10.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id1.1.1.1log-adjacency-changesnetwork1.1.1.00.0.0.255area0network10.1.1.00.0.0.255area0R2:interfaceLoopback0ipaddress2.2.2.2255.255.255.0!interfaceSerial1/0ipaddress10.1.1.2255.255.255.0serialrestart-delay0!interfaceSerial1/1ipaddress11.1.1.1255.255.255.0serialrestart-delay0!routerospf10router-id2.2.2.2log-adjacency-changesredistributeconnectedsubnetsnetwork10.1.1.00.0.0.255area0network11.1.1.00.0.0.255area1R3:interfaceLoopback0ipaddress3.3.3.3255.255.255.0!interfaceFastEthernet0/0noipaddressshutdownduplexhalf!interfaceSerial1/0ipaddress11.1.1.2255.255.255.0serialrestart-delay0!routerospf10router-id3.3.3.3log-adjacency-changesnetwork11.1.1.00.0.0.255area1在R1和R3上查看路由表:R1#shoiprouCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsC1.1.1.0isdirectlyconnected,Loopback02.0.0.0/24issubnetted,1subnetsOE22.2.2.0[110/20]via10.1.1.2,00:03:00,Serial1/010.0.0.0/24issubnetted,1subnetsC10.1.1.0isdirectlyconnected,Serial1/011.0.0.0/24issubnetted,1subnetsOIA11.1.1.0[110/128]via10.1.1.2,00:03:00,Serial1/0R3#shoiprouCodes: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-periodicdownloadedstaticrouteGatewayoflastresortisnotset1.0.0.0/24issubnetted,1subnetsOIA1.1.1.0[110/129]via11.1.1.1,00:02:51,Serial1/02.0.0.0/24issubnetted,1subnetsOE22.2.2.0[110/20]via11.1.1.1,00:02:51,Serial1/03.0.0.0/24issubnetted,1subnetsC3.3.3.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsOIA10.1.1.0[110/128]via11.1.1.1,00:02:51,Serial1/011.0.0.0/24issubnetted,1subnetsC11.1.1.0isdirectlyconnected,Serial1/0OE2的路由是通过LSA5传播,OIA的路由是通过LSA3来传播。1.StubArea我们观察拓扑,发现Area1不管去外部的那个目的网络,都必须通过ABRR2进展转发。在这种情况下,Area1可以配置成StubArea。StubArea可以阻止LSA5,,并且处在区域边界的ABR将会通过LSA3发送一个默认路由给StubArea。处在StubArea内的所有路由器都必须配置成为StubArea。首先查看R3的OSPF数据库R3#shoipospfdaOSPFRouterwithID(3.3.3.3)(ProcessID10)RouterLinkStates(Area1)LinkIDADVRouterAgeSeq#ChecksumLinkcount2.2.2.22.2.2.290x800000070x00309C13.3.3.33.3.3.310x800000060x00451E2SummaryNetLinkStates(Area1)LinkIDADVRouterAgeSeq#Checksum0.0.0.02.2.2.21990x800000010x0075C01.1.1.02.2.2.290x800000030x00B13D10.1.1.02.2.2.290x800000030x0032B4Type-5ASExternalLinkStatesLinkIDADVRouterAgeSeq#ChecksumTag2.2.2.02.2.2.28420x800000010x00632F0通过以下配置可以将Area1配置成为StubArea。R2(config)#routerospf10R2(config-router)#area1stubR3(config)#routerospf10R3(config-router)#area1stub在R3上查看路由表:R3#shoiprouCodes: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-periodicdownloadedstaticrouteGatewayoflastresortis11.1.1.1tonetwork0.0.0.01.0.0.0/24issubnetted,1subnetsOIA1.1.1.0[110/129]via11.1.1.1,00:00:16,Serial1/03.0.0.0/24issubnetted,1subnetsC3.3.3.0isdirectlyconnected,Loopback010.0.0.0/24issubnetted,1subnetsOIA10.1.1.0[110/128]via11.1.1.1,00:00:16,Serial1/011.0.0.0/24issubnetted,1subnetsC11.1.1.0isdirectlyconnected,Serial1/0O*IA0.0.0.0/0[110/65]via11.1.1.1,00:00:16,Serial1/0发现原来的OE2路由没有了,取代了1条默认路由O*IA0.0.0.0/0[110/65]〔通过LSA3通告〕在看R3的OSPF数据库R3#shoipospfdaOSPFRouterwithID(3.3.3.3)(ProcessID10)RouterLinkStates(Area1)LinkIDADVRouterAgeSeq#ChecksumLinkcount2.2.2.22.2.2.270x8000000A0x00BEA623.3.3.33.3.3.360x800000080x005F042SummaryNetLinkStates(Area1)LinkIDADVRouterAgeSeq#Checksum0.0.0.02.2.2.2120x800000010x0075C01.1.1.02.2.2.2120x800000040x00CD2210.1.1.02.2.2.2120x800000040x004E9此时已经没有Type-5ASExternalLinkStates的LSA了。2.TotallyStubArea对于本实验的Area1来说,其实域间路由OIA也是不需要的。我们可以将Area1配置成为TotallyStubArea,从而来阻止LSA3和LSA4在这个区域的传播,出了通告缺省路由的那一条类型3的LSA。TotallyStubArea的配置也很简单,只需要在ABR上将其配置成为totallystubarea,并且这个区域的所有路由器配置成为stubarea就可以了。在这个实验中,我们在上面已经将R3配置成stubarea,只要在R2上配置area1成为TotallyStubArea即可。R2(config-router)#area1stubno-summary在R3上查看路由表和数据库R3#shoiprouCodes:C-connected,S-static,R-RIP,M-mobile,B-BGPD-EIGRP,EX-EIGRPexternal,O-OSPF,IA

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论