路由ospf的配置_第1頁
路由ospf的配置_第2頁
路由ospf的配置_第3頁
路由ospf的配置_第4頁
路由ospf的配置_第5頁
已閱讀5頁,還剩52頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、it education & trainingdate: 24 october 2021計算機系 鄒瑞源計算機網(wǎng)絡(luò)互聯(lián)技術(shù) it education & trainingdate: 24 october 2021 ospf簡介 ospf是一種典型的鏈路狀態(tài)路由協(xié)議。采用ospf的路由器彼此交換并保存整個網(wǎng)絡(luò)的鏈路信息,從而掌握全網(wǎng)的拓撲結(jié)構(gòu),獨立計算路由。 ospf作為一種內(nèi)部網(wǎng)關(guān)協(xié)議(interior gateway protocol,igp),用于在同一個自治域(as)中的路由器之間發(fā)布路由信息。區(qū)別于距離矢量協(xié)議(rip),ospf具有支持大型網(wǎng)絡(luò)、路由收斂快、占用網(wǎng)絡(luò)資

2、源少等優(yōu)點,在目前應(yīng)用的路由協(xié)議中占有相當重要的地位。it education & trainingdate: 24 october 2021ospf簡介開放的國際標準開放的國際標準shortest path first (spf最短路徑優(yōu)先最短路徑優(yōu)先) 算法算法鏈路狀態(tài)路由協(xié)議鏈路狀態(tài)路由協(xié)議it education & trainingdate: 24 october 2021ospf 概述 通過交換hello數(shù)據(jù)包來創(chuàng)建鄰居關(guān)系 以傳播lsa( link-state advertisements )代替路由表更新. 鏈路(link):路由器接口 狀態(tài)(state):描述

3、接口以及它與鄰居路由器的關(guān)系 lsas 泛洪到區(qū)域中的所有ospf路由器,而不僅僅是直連路由器 收集由ospf路由器生成的所有l(wèi)sa以創(chuàng)建ospf鏈路狀態(tài)數(shù)據(jù)庫. 使用spf算法計算到每個目的地的最短距離,并將其置于路由表中.it education & trainingdate: 24 october 2021ospf術(shù)語it education & trainingdate: 24 october 2021shortest path first algorithm 將每臺路由器放置在樹的根節(jié)點,并根據(jù)累計開銷計算到將每臺路由器放置在樹的根節(jié)點,并根據(jù)累計開銷計算到達每個目的

4、地的最短路徑達每個目的地的最短路徑 開銷(開銷(cost) = 參考帶寬(參考帶寬(108)/接口帶寬接口帶寬 (bps)it education & trainingdate: 24 october 2021ospf特點詳介特點詳介ospfopen shortest path first 使用cost(成本)作為其路由度量值,其默認成本基于介質(zhì)的傳輸帶寬來度量it education & trainingdate: 24 october 2021ospf特點詳介特點詳介三大優(yōu)越性: 1、收斂時間快 2、支持vlsm和cidr 3、網(wǎng)絡(luò)的擴展性強 對跳數(shù)基本沒有限制,對于跳數(shù)過

5、多的網(wǎng)絡(luò)可通過層次化的設(shè)計,將達的ospf網(wǎng)絡(luò)化分成小的、易管理的ospf域it education & trainingdate: 24 october 2021ospf 層級示列 區(qū)域和自治系統(tǒng)區(qū)域和自治系統(tǒng) 盡量減少路由表條目盡量減少路由表條目 使拓撲變化僅影響本區(qū)域內(nèi)部使拓撲變化僅影響本區(qū)域內(nèi)部it education & trainingdate: 24 october 2021ospf數(shù)據(jù)包類型(ospf packet types)it education & trainingdate: 24 october 2021 ospf 的五種分組類型 類型類型1,

6、問候,問候(hello)分組。分組。類型類型2,數(shù)據(jù)庫描述,數(shù)據(jù)庫描述(database description)分組。分組。類型類型3,鏈路狀態(tài)請求,鏈路狀態(tài)請求(link state request)分組。分組。類型類型4,鏈路狀態(tài)更新,鏈路狀態(tài)更新(link state update)分組,分組, 用洪泛法對全網(wǎng)更新鏈路狀態(tài)。用洪泛法對全網(wǎng)更新鏈路狀態(tài)。類型類型5,鏈路狀態(tài)確認,鏈路狀態(tài)確認(link state acknowledgment) 分組。分組。 it education & trainingdate: 24 october 2021ospf操作操作 1. 建立鄰接關(guān)

7、系2. 必要的進行dr選舉3. 發(fā)現(xiàn)路由4. 選擇相應(yīng)的路由5. 維護路由信息it education & trainingdate: 24 october 2021建立鄰接關(guān)系建立鄰接關(guān)系*標記的在鄰居路由器上必須匹配標記的在鄰居路由器上必須匹配it education & trainingdate: 24 october 2021ospf網(wǎng)絡(luò)類型network typenetwork typecharacteristicscharacteristicsdr/bdr elected?dr/bdr elected?以太網(wǎng)(以太網(wǎng)(ethernetethernet)yes幀中繼(

8、幀中繼(frame relayframe relay)yesppp, hdlcppp, hdlcno管理員用子接口配置(管理員用子接口配置(configured by administrator configured by administrator with subinterfaceswith subinterfaces)noframe relayx.25廣播broadcast multiaccess非廣播nonbroadcast multiaccess點到點point-to-point點到多點point-to-multipointit education & trainingdat

9、e: 24 october 2021點到點鏈路(point-to-point links)不進行dr選舉ospf自動檢測這種接口類型it education & trainingdate: 24 october 2021廣播型多路訪問網(wǎng)絡(luò)進行dr選舉鄰居只與dr和dbr形成鄰接關(guān)系it education & trainingdate: 24 october 2021必要時進行dr選舉 dr與bdr的選舉取決于路由器的優(yōu)先級 可通過接口配置模式 ip ospf priority 命令修改該路由器的優(yōu)先級 如果優(yōu)先級相同,則比較router id。 router id: 默認值:

10、ospf過程啟動時活動接口上的最高ip地址 可以使用環(huán)回接口覆蓋:環(huán)回接口的最高ip地址(次優(yōu)先) 可以使用router-id命令手動設(shè)置(最優(yōu)先)it education & trainingdate: 24 october 2021選舉dr和bdr最高接口優(yōu)先級的路由器被選成dr最高路由器id的路由器被選舉成drdr選舉不具有搶占性it education & trainingdate: 24 october 2021建立雙向通信建立雙向通信it education & trainingdate: 24 october 2021建立雙向通信it education

11、& trainingdate: 24 october 2021建立雙向通信it education & trainingdate: 24 october 2021建立雙向通信it education & trainingdate: 24 october 2021查找網(wǎng)絡(luò)路由it education & trainingdate: 24 october 2021查找網(wǎng)絡(luò)路由it education & trainingdate: 24 october 2021增加鏈路狀態(tài)條目it education & trainingdate: 24 octob

12、er 2021增加鏈路狀態(tài)條目it education & trainingdate: 24 october 2021增加鏈路狀態(tài)條目it education & trainingdate: 24 october 2021維護路由信息路由器用路由器用224.0.0.6通知通知dr it education & trainingdate: 24 october 2021維護路由信息dr利用組播地址利用組播地址224.0.0.5通知其它路由器通知其它路由器it education & trainingdate: 24 october 2021維護路由信息it edu

13、cation & trainingdate: 24 october 2021維護路由信息it education & trainingdate: 24 october 2021配置單區(qū)域的ospfrouter(config-router)# network address wildcard-mask area area-id 將網(wǎng)絡(luò)分配到將網(wǎng)絡(luò)分配到ospf 區(qū)域區(qū)域router(config)# router ospf process-id 將將 ospf定義為定義為 ip 路由協(xié)議路由協(xié)議it education & trainingdate: 24 october

14、 2021ospf 配置示列it education & trainingdate: 24 october 2021ospf配置實例it education & trainingdate: 24 october 2021驗證ospf 配置router# show ip protocols 檢驗是否已配置檢驗是否已配置ospfrouter# show ip route 顯示路由器所學習到的所有路由顯示路由器所學習到的所有路由router# show ip routecodes: i - igrp derived, r - rip derived, o - ospf derived

15、, c - connected, s - static, e - egp derived, b - bgp derived, e2 - ospf external type 2 route, n1 - ospf nssa external type 1 route, n2 - ospf nssa external type 2 route gateway of last resort is 10.119.254.240 to network 10.140.0.0 o e2 10.110.0.0 160/5 via 10.119.254.6, 0:01:00, ethernet2 e 10.67

16、.10.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 o e2 10.68.132.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 o e2 10.130.0.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 e 10.128.0.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 . . .it education & trainingdate: 24 october 2021router# show ip

17、 ospf驗證ospf 配置 顯示顯示ospf路由器、計時器和統(tǒng)計信息路由器、計時器和統(tǒng)計信息router# show ip ospfrouting process ospf 1 with id 172.16.6.1 start time: 00:38:41.540, time elapsed: 00:00:25.860 supports only single tos(tos0) routes supports opaque lsa supports link-local signaling (lls) supports area transit capability router is n

18、ot originating router-lsas with maximum metric initial spf schedule delay 5000 msecsarea backbone(0) (inactive) number of interfaces in this area is 1 area has no authentication spf algorithm last executed 00:00:07.368 ago spf algorithm executed 1 times.it education & trainingdate: 24 october 20

19、21router# show ip ospf interface驗證ospf 配置 顯示區(qū)域顯示區(qū)域 id 和鄰接信息和鄰接信息router# show ip ospf interface ethernet 0 ethernet 0 is up, line protocol is up internet address 192.168.254.202, mask 255.255.255.0, area 0.0.0.0 as 201, router id 192.168.99.1, network type broadcast, cost: 10 transmit delay is 1 sec,

20、 state other, priority 1 designated router id 192.168.254.10, interface address 192.168.254.10 backup designated router id 192.168.254.28, interface addr 192.168.254.28 timer intervals configured, hello 10, dead 60, wait 40, retransmit 5 hello due in 0:00:05 neighbor count is 8, adjacent neighbor co

21、unt is 2 adjacent with neighbor 192.168.254.28 (backup designated router) adjacent with neighbor 192.168.254.10 (designated router) it education & trainingdate: 24 october 2021驗證ospf 配置router# show ip ospf neighbor顯示每個接口上的顯示每個接口上的ospf鄰居信息鄰居信息router# show ip ospf neighbor id pri state dead time a

22、ddress interface 10.199.199.137 1 full/dr 0:00:31 192.168.80.37 ethernet0 172.16.48.1 1 full/drother 0:00:33 172.16.48.1 fddi0 172.16.48.200 1 full/drother 0:00:33 172.16.48.200 fddi0 10.199.199.137 5 full/dr 0:00:33 172.16.48.189 fddi0 it education & trainingdate: 24 october 2021驗證ospf 配置router

23、# show ip ospf neighbor 10.199.199.137 neighbor 10.199.199.137, interface address 192.168.80.37 in the area 0.0.0.0 via interface ethernet0 neighbor priority is 1, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:04 neighbor 10.199.199.137, interface address 17

24、2.16.48.189 in the area 0.0.0.0 via interface fddi0 neighbor priority is 5, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:03 router# show ip ospf neighbor detail neighbor 192.168.5.2, interface address 10.225.200.28 in the area 0 via interface gigabitetherne

25、t1/0/0 neighbor priority is 1, state is full, 6 state changes dr is 10.225.200.28 bdr is 10.225.200.30 options is 0 x42 lls options is 0 x1 (lr), last oob-resync 00:03:08 ago dead timer due in 00:00:36 neighbor is up for 00:09:46 index 1/1, retransmission queue length 0, number of retransmission 1 f

26、irst 0 x0(0)/0 x0(0) next 0 x0(0)/0 x0(0) last retransmission scan length is 1, maximum is 1 last retransmission scan time is 0 msec, maximum is 0 msec it education & trainingdate: 24 october 2021ospf 調(diào)試命令router# debug ip ospf eventsospf:hello with invalid timers on interface ethernet0hello inte

27、rval received 10 configured 10net mask received 255.255.255.0 configured 255.255.255.0dead interval received 40 configured 30router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.117 aid:0.0.0.0 chk:6ab2 aut:0 auk: router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.116 aid:0

28、.0.0.0 chk:0 aut:2 keyid:1 seq:0 x0it education & trainingdate: 24 october 2021實驗環(huán)境ab192.168.1.64/27192.168.1.32/27192.168.1.104/29it education & trainingdate: 24 october 2021ospf的基本配置router_a#config terminalrouter_a(config)#router_a(config)#router ospf 1 /啟動ospf協(xié)議,其進程為1 router_a(config-rout

29、er)#network 192.168.1.32 0.0.0.31 area 0router_a(config-router)#network 192.168.1.64 0.0.0.31 area 0it education & trainingdate: 24 october 2021router_b#config terminalrouter_b(config)#router_b(config)#router ospf 1 /啟動ospf協(xié)議,其進程為1 router_b(config-router)#network 192.168.1.32 0.0.0.31 area 0rout

30、er_b(config-router)#network 192.168.1.104 0.0.0.7 area 0it education & trainingdate: 24 october 2021ospf身份驗證 ospf支持以下幾種類型的身份驗證: -空(無身份驗證) -明文(或簡單)口令身份驗證 -md5身份驗證 路由器生成并檢查每個ospf數(shù)據(jù)包。 路由器驗證接收到的每個路由更新數(shù)據(jù)包的來源。 配置“密鑰”(口令):每個參與的鄰居都必須配置相同的密鑰。it education & trainingdate: 24 october 2021配置ospf身份驗證步驟一:設(shè)

31、定驗證的口令 1、設(shè)定明文口令 router(config-if)# ip ospf authentication-key password 分配用于鄰居路由器的口令(最長8個字符) 2、設(shè)定md5加密的口令 router(config-if)# ip ospf message-digest-key id md5 password 分配用于鄰居路由器的口令(md5加密,最長16個字符)it education & trainingdate: 24 october 2021配置ospf身份驗證步驟二:啟用ospf身份驗證并指定驗證類型 方法1:在接口上直接指定(12.0版本以上提供) r

32、outer(config-if)# ip ospf authentication message-digest | null 指定接口的身份驗證類型 message-digest :md5加密口令 null :空口令 方法2:整個ospf 區(qū)域指定驗證類型 router(config-router)# area area-id authentication message-digest message-digest :md5加密口令it education & trainingdate: 24 october 2021使用ospf配置負載均衡ospf負載均衡 路徑必須為等價路徑 默認情

33、況下,最多可在路由表中加入4條等價路徑 通過更改配置,最多可以配置16條等價路徑 -(config-router)# maximum-paths 可更改鏈路的開銷以確保路徑等價進行負載均衡 -(config-if)# ip ospf cost it education & trainingdate: 24 october 2021修改鏈路成本router#router#config terminalrouter(config)#interface f0/0router(config-if)#ip ospf cost number/number為為1到到65535之間的值之間的值it e

34、ducation & trainingdate: 24 october 2021internet互聯(lián)網(wǎng)局域網(wǎng):內(nèi)部使用ospf接入互聯(lián)網(wǎng)使用默認路由內(nèi)部計算機如何使用默認路由?默認路由it education & trainingdate: 24 october 2021默認路由發(fā)布到ospf區(qū)域 將默認路由發(fā)布到ospf區(qū)域中,使用以下命令: router(config-router)# default-information originateit education & trainingdate: 24 october 2021課堂作業(yè)e0e0s0s0it education & trainingdate: 24 october 2021思考題(questions)1. ospf是一種典型的_路由協(xié)議。2. ospf路由協(xié)議的管理距離是_。3. ospf路由協(xié)議采用_作為度量標準。4. ospf路由器利用_算法,獨立地計算出到達任意目的地的路由。5. 默認情況下,快速以太網(wǎng)的開銷是_。6. ospf將網(wǎng)絡(luò)劃分為四種類型:_、_、_、_。7. ethernet的hello interval為_秒,dead interval為_秒。8. nbma網(wǎng)絡(luò)的hello interval_秒,dead interva

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論