路由器动态路由协议单区域OSPFv2配置
- 格式:pptx
- 大小:517.65 KB
- 文档页数:21
将路由器连接起来如下图:接下来是为路由器添加模块(注意要关电添加):下面配置路由器A的接口IP:Router#Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inRouter(config)#interface seRouter(config)#interface serial 1/1Router(config-if)#ip adRouter(config-if)#ip address 192.168.1.1 255.255.255.0Router(config-if)#coRouter(config-if)#clRouter(config-if)#clock ?rate Configure serial interface clock speedRouter(config-if)#clock raRouter(config-if)#clock rate 64000Router(config-if)#no shRouter(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial1/1, changed state to downRouter(config-if)#%LINK-5-CHANGED: Interface Serial1/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up00:14:54: %OSPF-5-ADJCHG: Process 2, Nbr 10.10.11.1 on Serial1/1 from LOADING to FULL, Loading DoneRouter(config-if)#下面配置路由器B的接口IP:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inRouter(config)#interface se 1/0Router(config-if)#ip adRouter(config-if)#ip address 192.168.1.2 255.255.255.0Router(config-if)#no shRouter(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial1/0, changed state to upRouter(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up01:07:29: %OSPF-5-ADJCHG: Process 2, Nbr 10.10.10.1 on Serial1/0 from LOADING to FULL, Loading DoneRouter(config-if)#接下来进行路由器A环回接口的配置:Router>enRouter#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#inRouter(config)#interface loRouter(config)#interface loopback ?<0-2147483647> Loopback interface numberRouter(config)#interface loopback 0%LINK-5-CHANGED: Interface Loopback0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to upRouter(config-if)#ip adRouter(config-if)#ip address 10.10.10.1 255.255.255.0Router(config-if)#下一步进行路由器B环回接口的配置:Router>enRouter#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#in lo 0%LINK-5-CHANGED: Interface Loopback0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to upRouter(config-if)#ip add 10.10.11.1 255.255.255.0Router(config-if)#验证路由器A的接口配置:Router#sh interfaces loopback 0Loopback0 is up, line protocol is up (connected)Hardware is LoopbackInternet address is 10.10.10.1/24MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation LOOPBACK, loopback not setLast input never, output never, output hang neverLast clearing of "show interface" counters neverQueueing strategy: fifoOutput queue 0/0, 0 drops; input queue 0/75, 0 drops5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec0 packets input, 0 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 input packets with dribble condition detected0 packets output, 0 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers s outRouter#验证路由器B的接口配置:Router#sh interfaces loopback 0Loopback0 is up, line protocol is up (connected)Hardware is LoopbackInternet address is 10.10.11.1/24MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation LOOPBACK, loopback not setLast input never, output never, output hang neverLast clearing of "show interface" counters neverQueueing strategy: fifoOutput queue 0/0, 0 drops; input queue 0/75, 0 drops5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec0 packets input, 0 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 0 input packets with dribble condition detected0 packets output, 0 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 babbles, 0 late collision, 0 deferred0 lost carrier, 0 no carrier0 output buffer failures, 0 output buffers s outRouter#继续进行路由器A的OSPF的配置:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#roRouter(config)#router osfRouter(config)#router osRouter(config)#router ospf ?<1-65535> Process IDRouter(config)#router ospf 2Router(config-router)#netRouter(config-router)#network 10.10.10.0 0.0.0.255 arRouter(config-router)#network 10.10.10.0 0.0.0.255 area 0Router(config-router)#network 192.168.1.0 0.0.0.255 area 0Router(config-router)#继续进行路由器B的OSPF的配置:Router#configConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#roRouter(config)#router osRouter(config)#router ospf% Incomplete command.Router(config)#router ospf 2Router(config-router)#net 10.10.10.11 0.0.0.255 area 0Router(config-router)#net 192.168.1.0 0.0.0.255 area 0Router(config-router)#查看路由器A的路由表:Router#sh ip roCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 1 subnetsC 10.10.10.0 is directly connected, Loopback0C 192.168.1.0/24 is directly connected, Serial1/1Router#查看路由器B的路由表:Router#sh ip roCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/8 is variably subnetted, 2 subnets, 2 masksO 10.10.10.1/32 [110/782] via 192.168.1.1, 00:04:25, Serial1/0C 10.10.11.0/24 is directly connected, Loopback0C 192.168.1.0/24 is directly connected, Serial1/0路由器Aping路由器B:通。
ospf 单区域动态路由配置、复习 1静态路由的配置命令2、动态路由RIP 的配置过程router en ablenetwork 直连网络地址二、授新课OSPF 协议是典型的链路状态路由协议,与 RIP 协议对比,它主要是在路由器之间交换 有关自身直连链路的状态信息,这种信息被路由器一个接一个地传递下去,直到到达某一区 域(area)的边界,就不再继续。
一个区域内部的所有路由器原则上都可以得到关于区域内任何一个路由器的链路状态信 息,所以它们可以根据相同的信息得到相同区域的网络拓扑结构图,然后再根据这个图来进 一步计算到达任何一个区域中网络的最佳路径,使结果写入到自己的路由表。
如果只配置单区域的OSPF 协议,则必须使用area 0因为这是一个OSPF 的骨干区域。
当网络规模足够大,要配置其他区域时,OSPF 协议规定这些非骨干区域都要与 area 0直接连 通。
路由器上配置 OSPF 命令:router ospf 进程号network 直连网络地址子网掩码area 0例1:用OSPF 路由协议连通网络10 10.10 2/24 PC2 192 168 2 10Z24 •路由器配置命令序列如下:路由器R1: 路由器R2:PC1192.168 1 10/24 192 168/IF24f0/010.10.10.1/24例2:分别用3种路由配置方法(静态、RIP 、OSPF )连接网络(把配置命令记录在背面)F0/110.10.20 2/24、完成3只设备上的基本配置二、 在3台设备上配置静态路由,使 2台计算机PING 通。
三、 删除原配置的静态路由,然后使用 RIP 路由配置,仍使2台计算机PING 通四、 关闭RIP 路由,使用OSPF 路由配置,使2台计算机PING 通。
作业:把例1中配置OSPF 路由的过程写到作业本上,包括IP 地址的配置10 10 20 1/24FO/2 19216B 11/24Route 1FQ/QF0/010 10 10 2/24Route2 F0/1 192 1闘 2 "24 192 166 2 10/24192 168 1 10/24。
动态路由-----OSPF协议原理与单区域实验配置⼀.OSPF协议的介绍1.OSPF的概述OSPF(Open Shortest Path First)是⼀个内部⽹关协议(Interior Gateway Protocol,简称IGP)。
与RIP相对,OSPF是链路状态路协议,⽽RIP是距离向量路由协议。
链路是路由器接⼝的另⼀种说法,因此OSPF也称为接⼝状态路由协议。
OSPF通过路由器之间通告⽹络接⼝的状态来建⽴链路状态数据库,⽣成最短路径树,每个OSPF路由器使⽤这些最短路径构造路由表。
⽹络,OSPFv3⽤在⽹络。
可⽤于⼤型⽹络。
OSPF路由器收集其所在⽹络区域上各路由器的连接状态信息,即链路状态信息(Link-State),⽣成链路状态数据库(Link-State Database)。
路由器掌握了该区域上所有路由器的链路状态信息,也就等于了解了整个⽹络的拓扑状况。
OSPF路由器利⽤“最短路径优先算法(Shortest Path First, SPF)”,独⽴地计算出到达任意⽬的地的路由。
在OSPF协议下的路由器⼯作流程:2.OSPF的区域简介外部AS:⼀般来讲是运⾏另⼀个路由选择协议的区域,⽐如RIP,EIGRP等。
⾻⼲区域:Area 0,所有区域都必须(⼀般情况下)通过⾻⼲区域进⾏区域间的路由。
标准区域:同上,即最普通的区域。
末梢区域:Stub Area,不接收外部AS(AS代表同⼀路由协议下的路由区域)的路由信息。
完全末梢区域:Totally Stub Area,不接收外部AS的路由信息,同时也不接收本AS中其他Area的。
⾮纯末梢区域:NSSA(Not-So-Stub-Area),允许接收外部AS中以类型7的LSA发送的路由信息,并且ABR将类型7的LSA转换成类型5的LSA 在本AS内进⾏发送...3.OSPF的五种路由器DR:指定路由器,⼀个区域中的主路由器,当其他路由发数据给它时,指定路由器负责通知所有路由器。
单区域OSPF路由协议的配置-电脑资料1.拓扑图2.各路由器上配置完成后的 show runa.r1#show runBuilding configuration...Current configuration : 645 bytes!version 12.4no service timestamps log datetime msecno service timestamps debug datetime msec no service password-encryption!hostname r1!!interface Loopback0ip address 11.11.1.1 255.255.255.0!interface FastEthernet0/0ip address 172.16.123.1 255.255.255.0duplex autospeed auto!interface FastEthernet0/1ip address 10.10.1.254 255.255.255.0duplex autospeed auto!interface Vlan1no ip addressshutdown!router ospf 100log-adjacency-changesnetwork 172.16.123.1 0.0.0.0 area 0 network 10.10.1.254 0.0.0.0 area 0!ip classless!!line con 0line vty 0 4login!!end入内容b.r2#r2#show runBuilding configuration...Current configuration : 666 bytes!version 12.4no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption!hostname r2!!interface Loopback0ip address 22.22.2.2 255.255.255.0!interface FastEthernet0/0ip address 172.16.123.2 255.255.255.0 duplex autospeed auto!interface FastEthernet0/1ip address 10.10.2.254 255.255.255.0 duplex autospeed auto!interface Vlan1no ip addressshutdown!router ospf 100router-id 22.22.2.2log-adjacency-changesnetwork 172.16.123.2 0.0.0.0 area 0 network 10.10.2.254 0.0.0.0 area 0!ip classless!!line con 0line vty 0 4login!!endc.r3#r3#show runBuilding configuration...Current configuration : 645 bytes!version 12.4no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption!hostname r3!!interface Loopback0ip address 33.33.3.3 255.255.255.0!interface FastEthernet0/0ip address 172.16.123.3 255.255.255.0 duplex autospeed auto!interface FastEthernet0/1ip address 10.10.3.254 255.255.255.0duplex autospeed auto!interface Vlan1no ip addressshutdown!router ospf 100log-adjacency-changesnetwork 172.16.123.3 0.0.0.0 area 0network 10.10.3.254 0.0.0.0 area 0!ip classless!!line con 0line vty 0 4login!!end3.查看邻居表、拓扑表、路由表a.r1#show ip ospf neiNeighbor ID Pri State Dead Time Address Interface22.22.2.2 1 FULL/BDR 00:00:35 172.16.123.2 FastEthernet0/033.33.3.3 1 FULL/DROTHER 00:00:31 172.16.123.3 FastEthernet0/0r1#show ip ospf neiNeighbor ID Pri State Dead Time Address Interface22.22.2.2 1 FULL/BDR 00:00:30 172.16.123.2 FastEthernet0/033.33.3.3 1 FULL/DROTHER 00:00:36 172.16.123.3 FastEthernet0/0r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 3 subnetsC 10.10.1.0 is directly connected, FastEthernet0/1O 10.10.2.0 [110/2] via 172.16.123.2, 00:06:07, FastEthernet0/0O 10.10.3.0 [110/2] via 172.16.123.3, 00:05:57, FastEthernet0/011.0.0.0/24 is subnetted, 1 subnetsC 11.11.1.0 is directly connected, Loopback0172.16.0.0/24 is subnetted, 1 subnetsC 172.16.123.0 is directly connected, FastEthernet0/0r1#b.r2#show ip ospf neiNeighbor ID Pri State Dead Time Address Interface11.11.1.1 1 FULL/DR 00:00:38 172.16.123.1 FastEthernet0/033.33.3.3 1 FULL/DROTHER 00:00:31 172.16.123.3 FastEthernet0/0r2#show ip ospf dataOSPF Router with ID (22.22.2.2) (Process ID 100)Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count172.16.123.1 172.16.123.1 2475 0x80000003 0x0055f2 2172.16.123.2 172.16.123.2 1926 0x80000005 0x006ed2 2172.16.123.3 172.16.123.3 1651 0x80000007 0x0087b2 222.22.2.2 22.22.2.2 489 0x80000007 0x0063f0 211.11.1.1 11.11.1.1 489 0x80000007 0x003254 233.33.3.3 33.33.3.3 469 0x80000003 0x009c89 2Net Link States (Area 0)Link ID ADV Router Age Seq# Checksum172.16.123.1 11.11.1.1 469 0x80000004 0x00fd41r2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 3 subnetsO 10.10.1.0 [110/2] via 172.16.123.1, 00:07:57, FastEthernet0/0C 10.10.2.0 is directly connected, FastEthernet0/1O 10.10.3.0 [110/2] via 172.16.123.3, 00:07:47, FastEthernet0/022.0.0.0/24 is subnetted, 1 subnetsC 22.22.2.0 is directly connected, Loopback0172.16.0.0/24 is subnetted, 1 subnetsC 172.16.123.0 is directly connected, FastEthernet0/0r2#c.r3#show ip ospf neiNeighbor ID Pri State Dead Time Address Interface22.22.2.2 1 FULL/BDR 00:00:33 172.16.123.2 FastEthernet0/011.11.1.1 1 FULL/DR 00:00:37 172.16.123.1 FastEthernet0/0r3#show ip ospf dataOSPF Router with ID (33.33.3.3) (Process ID 100)Router Link States (Area 0)Link ID ADV Router Age Seq# Checksum Link count172.16.123.1 172.16.123.1 2546 0x80000003 0x0055f2 2172.16.123.2 172.16.123.2 1997 0x80000005 0x006ed2 2172.16.123.3 172.16.123.3 1722 0x80000007 0x0087b2 222.22.2.2 22.22.2.2 560 0x80000007 0x0063f0 211.11.1.1 11.11.1.1 560 0x80000007 0x003254 233.33.3.3 33.33.3.3 540 0x80000003 0x009c89 2Net Link States (Area 0)Link ID ADV Router Age Seq# Checksum172.16.123.1 11.11.1.1 540 0x80000004 0x00fd41r3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA externaltype 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 3 subnetsO 10.10.1.0 [110/2] via 172.16.123.1, 00:08:59, FastEthernet0/0O 10.10.2.0 [110/2] via 172.16.123.2, 00:08:59, FastEthernet0/0C 10.10.3.0 is directly connected, FastEthernet0/133.0.0.0/24 is subnetted, 1 subnetsC 33.33.3.0 is directly connected, Loopback0172.16.0.0/24 is subnetted, 1 subnetsC 172.16.123.0 is directly connected, FastEthernet0/0r3#备注:在Packet Tracer环境中,如开始没有配置router-id,之后才配置loopback 0 IP地址,loopback地址不会自动成为router-id,而需要保存配置后,用reload命令重启路由器,,电脑资料《单区域OSPF路由协议的配置》(https://www.)。
第13讲OSPF的基本配置2(单区域点到点及认证)p139知识回顾:1、ospf的配置步骤?2、ospf和rip1、rip2、eigrp的区别?教学目标1、在点到点上配置OSPF2、配置OSPF配置简单口令认证3、配置OSPF的MD5认证一、在点到点上配置OSPF在点到点上配置OSPF和在广播多路访问链路上配置OSPF步骤没有区别,只是在点到点上配置OSPF不需要进行DR的选择。
实例1:点到点上配置OSPF---p139拓扑图如下:基本配置如下:配置R1路由器:R1(config)#router ospf 1R1(config-router)#network 10.1.1.0 0.0.0.255 area 0R1(config-router)#network 12.12.12.0 0.0.0.255 area 0配置R2路由器:R2(config)#router ospf 1R2(config-router)#network 192.168.1.0 0.0.0.255 area 0R2(config-router)#network 12.12.12.0 0.0.0.255 area 0R2#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface21.21.21.1 0 FULL/ - 00:00:37 12.12.12.1 Serial0/0注意:FULL/ -表示在默认情况下不需要DR选择。
二、配置OSPF认证1、OSPF认证基本概念为了安全的原因,可以在ospf上启用认证。
OSPF数据包可以通过认证来防止有意或无意地引入有害路由信息影响。
认证的作用:增加网络安全性(推荐使用MD5)、对OSPF重新配置时,不同口令可以配置在新口令和旧口令的路由器上,防止它们在一个共享的公共广播网络的情况下互相通信 认证的种类OSPF路由方式有三种:0 Null (也就是不认证),1 (明文认证),2 (MD5加密校验和)认证的配置注意事项如果在一个区域内某处配置了认证,必须在整个区域配置认证,在一个区域里,可以在不同网络链路使用不同口令,邻居路由器之间配置相同的口令,比如:R1与R2之间的口令是abc,在R1与R3之间口令可以是bcd。
实训9路由器动态路由协议OSPF单区域的配置【实训目的】(1)熟悉路由器的基本配置;(2)掌握OSPF协议的配置方法;(3)掌握通过动态路由协议学习产生的路由;(4)熟悉广域网线缆的连接方式;【实训技术原理】OSPF开放式最短路径优先协议,是目前网络中应用最广泛的路由协议之一。
属于内部网关路由协议,能够适应各种规模的网络环境,是典型的链路状态协议。
OSPF路由协议通过向全网扩散本设备的链路状态信息,使网络中每台设备最终同步一个具有全网链路状态的数据库,然后路由器采用SPF算法,以自己为根,计算到达其他网络的最短路径,最终形成全网络路由信息。
【实训背景描述】学校有新旧两个校区,每个校区是一个独立的局域网,为了使新旧校区能够正常相互通讯,共享资源。
每个校区出口利用一台路由器进行连接,两台路由器间学校申请了一条2M的DDN专线进行相连,为了简化网管的管理维护工作,学校决定采用OSPF协议实现两校区路由互通。
【实训设备】MSR20-20(2台),PC(2台)、直连线(2条)、V.35线缆(1条)【实训内容】(1)在路由器R1、R2上配置接口的IP地址;(2)查看路由器生成的直连路由;(3)在路由器R1、R2上配置OSPF协议;(4)验证R1、R2是否自动学习了其他网段的路由信息;(5)将PC1、PC2主机默认网关分别设置为与路由器接口E0/0IP地址。
(6)PC1、PC2主机之间可以互相通信;【实训拓扑图】【实训步骤】(1)配置主机Ip地址、默认网关。
PC1:172.16.1.2/24172.16.1.1PC2:172.16.2.2/24172.16.2.1(2)登陆路由器R1、R2上配置以太口的IP地址R1的配置:[Router]interface ethernet0/0[Router-Ethernet0/0]ip address172.16.1.1255.255.255.0 [Router-Ethernet0/0]quit路由器R2配置:[Router]interface ethernet0/0[Router-Ethernet0/0]ip address172.16.3.1255.255.255.0 [Router-Ethernet0/0](3)登录路由器R1、R2上配置接口的IP地址R1的配置:[Router-Ethernet0/0]interface serial1/0[Router-Serial1/0]ip address172.16.2.1255.255.255.0 [Router-Serial1/0]undo shutdownR2配置如上,同学们自己来作。
OSPF配置与管理一、基础OSPF(open shortest path first,开放式最短路径优先)是一个基于LAS(链路状态通告)的AS内部的IGP(内部网关协议)ospf有两种版本:ospfv2,支持ipv4;ospfv3,仅支持ipv6。
以下以V2版本介绍。
ospf通过LSA(链路状态通告)报文进行路由信息交互,通过5种报文(hello、DBD、LSR、LSU、LSAck)进行邻居和邻接关系的建议以及同一区域内部各路由间的LSDB(链路状态数据库)信息的同步,最终形成同一的区域内拓扑数据库。
1、基本概念:1、路由ID:一台运行OSPF协议的路由中每个OSPF进程必须指定一个用于标识本地路由器的router ID,是一个32比特无符号的整数。
在一个AS中必须唯一,但在同一台路由器的不同进程中可以相同。
2、路由域(AS,自治系统):(routing domain),由运行同一种路由协议并且被同一组织机构管理的一组路由器组成。
同一个as中的所有路由器必须运行相同的路由协议,且彼此相连(中间不能被其他协议、路由域所间断),分配相同的as号。
在ospf网络中,只有在同一个as中的路由器才会相互交换链路状态信息,所有的ospf路由器都维护一个相同的as结果描述(as中各区域间的连接关系)的数据库。
3、路由器类型:根据路由器在AS中的不同位置,可以分为4类区域内路由器(internal routers ,IR):所有路由器的接口都在同一个ospf区域内。
区域边界路由器(area border routers,ABR):该类设备接口可分属于不同区域,但其中一个接口必须连接(物理连接或逻辑-虚连接)骨干区域。
骨干路由器(backbone routes,BR):该类设备至少有一个接口属于骨干区域。
所有的ABR和位于骨干区域的设备都是骨干路由器。
自治系统边界路由器(AS boundary routes,ASBR):与其他AS中的设备交换路由信息的设备。
OSPF路由协议单区域概念及配置知识1:OSPF概述开放式最短路径优先协议(Open Shortest Path First,OSPF)是基于开放标准的发链路状态路由选择协议1.OSPF是内部网关路由协议内部网关路由协议(IGP):用于在单一自治系统(Autonomous System-AS)内决策路由自制系统(AS):执行统一路由策略的一组网络设备的组合2.OSPF区域为了适应大型的网络,OSPF在AS内划分多个区域;一定要划分区域0(骨干区域),其他区域必须和区域0相连。
每个OSPF路由器只维护所在区域的完整的链路状态信息3.链路状态路由协议OSPF是链路状态路由协议,链路状态路由协议中的路由器了解OSPF网络内的链路状态信息链路状态路由协议中,直连的路由器之间建立邻接关系,互相“交流”链路信息,来“画”出完整的网络结构知识2:Router IDRouter ID 是在OSPF区域内唯一标识一台路由器的IP地址。
Router ID选取规则▪∙∙首先,路由器选取它所有loopback接口上数值最高的IP地址▪∙∙如果没有loopback接口,就在所有物理端口中选取一个数值最高的IP地址Router ID 不具备强占性,Router ID 只要选定就不会改变,即使是物理接口关闭,Router ID 也不会变,除非重启路由器或进程。
知识3:OSPF的工作过程邻居列表•列出每台路由器全部已经建立邻接关系的邻居路由器链路状态数据库(LSDB)•列出网络中其他路由器的信息,由此显示了全网的网络拓扑路由表•列出通过SPF算法计算出的到达每个相连网络的最佳路径知识4:OSPF邻接关系邻接关系的建立过程建立邻接关系的条件1、Area-id:两个路由器必须在共同的网段上,它们的端口必须属于该网段上的同一个区,且属于同一个子网2、验证(Authentication OSPF):同一区域路由器必须交换相同的验证密码,才能成为邻居3、Hello Interval和Dead Interval: OSPF协议需要两个邻居路由器的这些时间间隔相同,否则就不能成为邻居路由器。