欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

實驗設(shè)計與排錯之四OSPF配置、分析與排錯

    1、OSPF協(xié)議簡述

OSPF(開放最短路徑優(yōu)先)是一種內(nèi)部網(wǎng)關(guān)協(xié)議。不同于IGRP,OSPF是一種無類鏈路狀態(tài)路由選擇協(xié)議,而不是一種分類距離矢量協(xié)議。OSPF被標準化,廣泛用于公共和私有網(wǎng)絡(luò)中。下面簡單介紹一下鏈路狀態(tài)路由協(xié)議工作過程,如下:

目前創(chuàng)新互聯(lián)已為上千多家的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬主機、網(wǎng)站改版維護、企業(yè)網(wǎng)站設(shè)計、樂都網(wǎng)站維護等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

  • 每臺路由器學(xué)習(xí)激活的直接相連的網(wǎng)絡(luò)。

  • 每臺路由器和直接相連的路由器互交,發(fā)送Hello報文,建立鄰居關(guān)系。

  • 每臺路由器構(gòu)建包含直接相連的鏈路狀態(tài)的LSA(Link-State Advertisement,鏈路狀態(tài)通告)。鏈路狀態(tài)通告(LSA)中記錄了所有相關(guān)的路由器,包括鄰路由器的標識、鏈路類型、帶寬等。

  • 每臺路由器泛洪鏈路狀態(tài)通告(LSA)給所有的鄰路由器,并且自己也在本地儲存鄰路由發(fā)過來的LSA,然后再將收到的LSA泛洪給自己的所有鄰居,直到在同一區(qū)域中的所有路由器收到了所有的LSA。每臺路由器在本地數(shù)據(jù)庫中保存所有收到的LSA副本,這個數(shù)據(jù)庫被稱作“鏈路狀態(tài)數(shù)據(jù)庫(LSDB,Link-State Database)”

  • 每臺路由器基于本地的“鏈路狀態(tài)數(shù)據(jù)庫(LSDB)”然后執(zhí)行“最短路徑優(yōu)先(SPF)”算法,并以本路由器為根,生成一個SPF樹,基于這個SPF樹計算去往每個網(wǎng)絡(luò)的最短路徑,也就得到了最終的路由表。

    2、實驗?zāi)康?/h4>

簡單理解OSPF以下二個基礎(chǔ)知識點。

  • 理解鄰居表、拓撲表以及路由表;

  • OSPF如何選舉RID?

  • OSPF度量值的計算方法;

    3、實驗拓撲

說明:默認沒有R1到R3的快速以太網(wǎng)鏈路,此鏈路將在后面實驗OPSF度量值的計算方法上使用)

實驗設(shè)計與排錯之四OSPF配置、分析與排錯

(1)、路由表

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - 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 - ODR

P - periodic downloaded static route

 

Gateway of last resort is not set

 

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

O              10.2.0.2/32 [110/65] via 192.168.10.2, 00:04:11, Serial1/1

O              10.5.0.2/32[110/65] via 192.168.20.2, 00:02:21, Serial1/0

C               10.6.0.0/16 is directly connected, Loopback0

O              10.11.0.2/32 [110/65] via 192.168.50.2, 00:00:31, Serial1/3

O              10.12.0.2/32 [110/65] via 192.168.40.2, 00:01:26, Serial1/2

192.168.10.0/30 is subnetted, 1 subnets

C               192.168.10.0 is directly connected, Serial1/1

192.168.20.0/30 is subnetted, 1 subnets

C               192.168.20.0 is directly connected, Serial1/0

192.168.30.0/30 is subnetted, 1 subnets

O              192.168.30.0 [110/128] via 192.168.40.2, 00:00:31, Serial1/2

[110/128] via 192.168.50.2, 00:00:31, Serial1/3

192.168.40.0/30 is subnetted, 1 subnets

C               192.168.40.0 is directly connected, Serial1/2

192.168.50.0/30 is subnetted, 1 subnets

C               192.168.50.0 is directly connected, Serial1/3

如上面紅色部分,在OSPF中所有的回環(huán)接口都被自動宣告成32位的主機路由“/32”,如果想顯示回環(huán)接口的實際子網(wǎng)掩碼,可以在回環(huán)端口上使用下面的命令:

Ip ospf network point-to-point

我們來看看實際的結(jié)果,當在R1、R2上的loopback0端口輸入此命令后如下顯示:

R2#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - 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 - ODR

P - periodic downloaded static route

 

Gateway of last resort is not set

 

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

O              10.2.0.0/16 [110/65] via 192.168.10.2, 00:00:11, Serial1/1

O              10.5.0.2/32 [110/65] via 192.168.20.2, 00:36:53, Serial1/0

C               10.6.0.0/16is directly connected, Loopback0

O              10.11.0.2/32 [110/65] via 192.168.50.2, 00:35:03, Serial1/3

O              10.12.0.2/32 [110/65] via 192.168.40.2, 00:35:57, Serial1/2

------略-----

R1#show ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - 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 - ODR

P - periodic downloaded static route

 

Gateway of last resort is not set

 

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

C               10.2.0.0/16is directly connected, Loopback0

O              10.5.0.2/32 [110/129] via 192.168.10.1, 00:36:39, Serial0/0

O              10.6.0.0/16 [110/65] via 192.168.10.1, 00:00:38, Serial0/0

O              10.11.0.2/32 [110/129] via 192.168.10.1, 00:34:49, Serial0/0

O              10.12.0.2/32 [110/129] via 192.168.10.1, 00:35:48, Serial0/0

------略-----

(2)、鄰居表

R2#show ip ospf neighbor

 

Neighbor ID             Pri            State                 Dead Time      Address                     Interface

10.5.0.2                    0               FULL/ -              00:00:34          192.168.20.2           Serial1/0

10.2.0.2                    0               FULL/ -              00:00:31          192.168.10.2           Serial1/1

10.12.0.2                  0               FULL/ -              00:00:34          192.168.40.2           Serial1/2

10.11.0.2                  0               FULL/ -              00:00:33          192.168.50.2           Serial1/3

Neighbor ID:鄰居的RID,通過上面的輸出可以看到R3的RID是10.5.0.2,R1的RID是10.2.0.2,R5的RID是10.12.0.2和R4的RID是10.11.0.2,分別從不同的接口建立了鄰居關(guān)系。

Pir: OSPF鄰居接口的優(yōu)先級,接口優(yōu)先級用于DR和BDR的選舉,以太網(wǎng)接口的默認優(yōu)先級是1,串行線路不需要選舉DR和BDR,所以串行線路的優(yōu)先級是0,即0代表不參與選舉。

State:鄰居路由器的狀態(tài),F(xiàn)ULL代表已經(jīng)建立鄰接關(guān)系,“/”后面是選舉的DR或BDR標識,因為串行線路不需要選舉,所以是“-”。

Dead time:默認的死亡時間是hello時間的4倍,即40秒。死亡時間是一個倒計時,計時器為0時,該鄰居被刪除。

Address:鄰居直連接口的IP地址。

Interface:本路由的輸出接口。

(3)、拓撲表

R2#show ip ospf database

OSPF Router with ID (10.6.0.2) (Process ID 1)

 

Router Link States (Area 0)

 

Link ID              ADV Router              Age         Seq#                           Checksum       Link count

10.6.0.2           10.6.0.2                    54             0x8000000c             0x00997e        9

10.5.0.2           10.5.0.2                    393          0x80000005             0x00650d        3

10.12.0.2         10.12.0.2                  299          0x80000007             0x0099d6        5

10.11.0.2         10.11.0.2                  285          0x80000007             0x004419        5

10.2.0.2           10.2.0.2                    19             0x80000006             0x00a5ea        3

(4)、OSPF如何選舉Router ID?

Router ID簡稱RID,用來唯一標示OSPF網(wǎng)絡(luò)中的每一臺路由器。如果兩條OSPF路由器的RID一樣,彼此間無法建立鄰接關(guān)系。RID是以IP地址的形式出現(xiàn)的,那么RID的選舉順序是什么?我們先來看看R1的RID:

R1#show ip protocols

 

Routing Protocol is "ospf 1"

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 10.2.0.2      

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

192.168.10.0 0.0.0.255 area 0

0.0.0.0 255.255.255.255 area 0

Routing Information Sources:

Gateway Distance Last Update

10.2.0.2 110 00:07:07

10.5.0.2 110 00:13:21

10.6.0.2 110 00:07:43

10.11.0.2 110 00:11:34

10.12.0.2 110 00:11:48

Distance: (default is 110)

下面我們來手工配置一下R1的Router ID:

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#route ospf 1

A.B.C.D OSPF router-id in IP address format

R1(config-router)#route 20.20.20.20     

R1(config-router)#Reload or use "clear ip ospf process" command, for this to take effect

 

R1(config-router)#end

R1#

%SYS-5-CONFIG_I: Configured from console by console

 

R1#clear ip ospf process         

Reset ALL OSPF processes? [no]: y

 

R1#

01:24:01: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

 

01:24:01: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

 

01:24:05: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from LOADING to FULL, Loading Done

我們再來查看一下Route ID是什么情況:

R1#show ip protocols

 

Routing Protocol is "ospf 1"

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 20.20.20.20

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

-----略-----

從上面的例子中,我們看到RID可以是一個并不存在的IP地址,RID僅僅作為路由的標識,不會用于尋址。

另我們需要想一個問題,那就是如果取消R1的手動配置RID,并且關(guān)閉loopback0接口,這個時候最大的已激活回環(huán)接口IP應(yīng)該是什么?同樣我們來看看實驗:

R1#conf t

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#route ospf 1

R1(config-router)#no route 20.20.20.20         

R1(config-router)#int loopback0

R1(config-if)#shutdown           

R1(config-if)#

%LINK-5-CHANGED: Interface Loopback0, changed state to administratively down

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down

 

R1(config-if)#end

R1#

%SYS-5-CONFIG_I: Configured from console by console

 

R1#clear ip ospf process

Reset ALL OSPF processes? [no]: y

 

R1#

01:36:48: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset

 

01:36:48: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

 

R1#show ip protocols

 

Routing Protocol is "ospf 1"

Outgoing update filter list for all interfaces is not set

Incoming update filter list for all interfaces is not set

Router ID 192.168.10.2 

Number of areas in this router is 1. 1 normal 0 stub 0 nssa

Maximum path: 4

Routing for Networks:

192.168.10.0 0.0.0.255 area 0

0.0.0.0 255.255.255.255 area 0

Routing Information Sources:

Gateway Distance Last Update

Distance: (default is 110)

         R1#

01:36:56: %OSPF-5-ADJCHG: Process 1, Nbr 10.6.0.2 on Serial0/0 from LOADING to FULL, Loading Done

如上實例說明一個問題,若沒有手動指定RID,路由器默認使用最大已激活的回環(huán)接口IP作為RID,但這里要注意的是最大并不是接口號最大,而是IP地址最大。還有一個問題就是如果路由器沒有激活的回環(huán)接口,路由器默認會選擇最大激活的物理接口的IP地址作為RID,如上則選擇的是物理接口192.168.10.2。

(5)、OSPF度量值如何計算?

OSPF中使用的度量值是“花費(Cost)”,默認OSPF使用100Mb/s作為參考帶寬,使用100Mb/s除以實際鏈路帶寬,得出的值取整(對于小于0的結(jié)果,取1),就是花費。

比如串行線路的帶寬是1.544M,快速以太網(wǎng)的帶寬是100M,即如下:

串行線路的花費=100M/1.544≈64(取整,且不四舍五入)

快速以太網(wǎng)線路花費=100M/100M=1

繼續(xù)上面的實驗,同時我們在R1和R3中新增一條快速以太網(wǎng)鏈路,然后做相應(yīng)的配置,再看看其R3的驗證:

R3#show ip route ospf

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

O              10.2.0.0 [110/2] via 172.16.50.1, 00:00:15, FastEthernet0/0

O              10.6.0.0 [110/65] via 192.168.20.1, 00:10:00, Serial0/3

O              10.11.0.2 [110/129] via 192.168.20.1, 00:10:00, Serial0/3

O              10.12.0.2 [110/129] via 192.168.20.1, 00:10:00, Serial0/3

192.168.10.0/30 is subnetted, 1 subnets

O              192.168.10.0 [110/65] via 172.16.50.1, 00:00:15, FastEthernet0/0

192.168.30.0/30 is subnetted, 1 subnets

O              192.168.30.0 [110/192] via 192.168.20.1, 00:10:00, Serial0/3

192.168.40.0/30 is subnetted, 1 subnets

O              192.168.40.0 [110/128] via 192.168.20.1, 00:10:00, Serial0/3

192.168.50.0/30 is subnetted, 1 subnets

O              192.168.50.0 [110/128] via 192.168.20.1, 00:10:00, Serial0/3

我們可以看到[110/2],110是OSPF的默認管理距離,2是花費,去往10.2.0.0/16的花費是2,就是快速以太網(wǎng)的花費加上回環(huán)接口的花費,因為回環(huán)接口的帶寬非常高,用100M去除會小于0,所以取1。另外192.168.10.0 [110/65]的65是通過串行線路花費64,加上以太網(wǎng)花費1得到的。

現(xiàn)在我們關(guān)閉R3的快速以及網(wǎng)接口,再看看R3的路由表:

R3(config)#int fa0/0

R3(config-if)#shutdown

 

R3(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down

 

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to down

 

00:17:25: %OSPF-5-ADJCHG: Process 1, Nbr 10.2.0.2 on FastEthernet0/0 from FULL to DOWN, Neighbor Down: Interface down or detached

end

R3#

%SYS-5-CONFIG_I: Configured from console by console

 

R3#show ip route ospf

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

O              10.2.0.0 [110/129] via 192.168.20.1, 00:00:01, Serial0/3

O              10.6.0.0 [110/65] via 192.168.20.1, 00:17:06, Serial0/3

O              10.11.0.2 [110/129] via 192.168.20.1, 00:17:06, Serial0/3

O              10.12.0.2 [110/129] via 192.168.20.1, 00:17:06, Serial0/3

192.168.10.0/30 is subnetted, 1 subnets

O              192.168.10.0 [110/128] via 192.168.20.1, 00:00:01, Serial0/3

192.168.30.0/30 is subnetted, 1 subnets

O              192.168.30.0 [110/192] via 192.168.20.1, 00:17:06, Serial0/3

192.168.40.0/30 is subnetted, 1 subnets

O              192.168.40.0 [110/128] via 192.168.20.1, 00:17:06, Serial0/3

192.168.50.0/30 is subnetted, 1 subnets

O              192.168.50.0 [110/128] via 192.168.20.1, 00:17:06, Serial0/3

此時會發(fā)現(xiàn)數(shù)據(jù)都要經(jīng)過串行線路,并且花費變成了129。而192.168.10.0 [110/128]也變成了128。其實可以通過下面的方法修改計算花費的參考帶寬:

R3(config)#route ospf 1

R3(config-router)#auto-cost

R3(config-router)#auto-cost reference-bandwidth 10000     

% OSPF: Reference bandwidth is changed.

Please ensure reference bandwidth is consistent across all routers.   

R3(config-router)#end

R3#

%SYS-5-CONFIG_I: Configured from console by console

當修改了所有路由器的參考帶寬后,再看看R3的路由表:

R3#show ip route ospf

10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks

O              10.2.0.0 [110/12953] via 192.168.20.1, 00:00:28, Serial0/3

O              10.6.0.0 [110/6477] via 192.168.20.1, 00:02:42, Serial0/3

O              10.11.0.2 [110/12953] via 192.168.20.1, 00:00:28, Serial0/3

O              10.12.0.2 [110/12953] via 192.168.20.1, 00:00:28, Serial0/3

O              172.16.0.0 [110/13052] via 192.168.20.1, 00:00:28, Serial0/3

192.168.10.0/30 is subnetted, 1 subnets

O              192.168.10.0 [110/12952] via 192.168.20.1, 00:00:28, Serial0/3

192.168.30.0/30 is subnetted, 1 subnets

O              192.168.30.0 [110/19428] via 192.168.20.1, 00:00:18, Serial0/3

192.168.40.0/30 is subnetted, 1 subnets

O              192.168.40.0 [110/12952] via 192.168.20.1, 00:00:28, Serial0/3

192.168.50.0/30 is subnetted, 1 subnets

O              192.168.50.0 [110/12952] via 192.168.20.1, 00:00:28, Serial0/3

同樣用去往10.2.0.0/16網(wǎng)絡(luò)的12953舉例計算花費如下:

        R3和R2相連的串行鏈路花費=10000M/1.544M≈6476

    R2和R1相連的串行鏈路花費=10000M/1.544M≈6476

    R1上的loopback0接口的花費=10000M/8000M≈1

   三條線路花費綜合即為12953,另其它端口花費同樣計算。

最后可以通過下面方法查看某接口的OSPF信息:

R3#show ip ospf int se0/3

 

Serial0/3 is up, line protocol is up

Internet address is 192.168.20.2/30, Area 0

Process ID 1, Router ID 10.5.0.2, Network Type POINT-TO-POINT, Cost: 6476

Transmit Delay is 1 sec, State POINT-TO-POINT, Priority 0

No designated router on this network

No backup designated router on this network

Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5

Hello due in 00:00:01

Index 2/2, flood queue length 0

Next 0x0(0)/0x0(0)

Last flood scan length is 1, maximum is 1

Last flood scan time is 0 msec, maximum is 0 msec

Neighbor Count is 1 , Adjacent neighbor count is 1

Adjacent with neighbor 10.6.0.2

Suppress hello for 0 neighbor(s)

 

新聞名稱:實驗設(shè)計與排錯之四OSPF配置、分析與排錯
網(wǎng)頁鏈接:http://chinadenli.net/article46/jigihg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃網(wǎng)站收錄軟件開發(fā)域名注冊靜態(tài)網(wǎng)站商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)