當前位置:學問君>人在職場>電腦培訓>

OSPF的network設定

學問君 人氣:3.3W

SPF是,主要是interface狀態:ip address,mask,Hello這些資訊在Routers間建立adjency的過程中會透過LSAs被互換,下面是本站小編整理的OSPF的network設定相關知識,歡迎閱讀參考!

OSPF的network設定

我們再看看OSPF執行時的過程:(簡單舉例)

int s1

ip add ()

int s2

ip add ()

int s3

ip add ()

int s4

ip add ()

route ospf 10

network area 0

network area 0

當進入OSPF 10,OSPF首先執行network ,查找interface address,有匹配s0,分配至Area 0,然後再執行network aera 0,匹配s2->Area 0,最後我們在其它Routers上看到的.資訊是:

is subnetted, 1 subnets

O [110/128] via , 00:00:00, Serialx

is subnetted, 1 subnets

O [110/74] via , 00:00:05, Serialx

在着裏可以看到submask是24,忽略了在network中配製的inverse mask,爲什麼?

我們再看當添加新的network後有什麼結果?

route ospf 10

network area 0

network area 0

network area 1

network area 2

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

O IA [110/933] via , 00:00:05, Serialx

O IA [110/933] via , 00:00:02, Serialx

is subnetted, 1 subnets

O [110/128] via , 00:00:10, Serialx

is subnetted, 1 subnets

O [110/74] via , 00:00:05, Serialx

這裏s3,s4都在Area 1(被標記爲IA掩碼16)。

總結:實際的網絡範圍在interface mask中已經說明了,這在所有的Routers的Link state database 被清楚標記,不會因OSPF的network配置而發生改變。而在OSPF的network配置中,inverse mask只是起到指明在本Router的OSPF process 中的網絡範圍的作用,如network 指定範圍從 ~ ,在次範圍中的所有interface分配至Area 1,最後其他所有的地址被分配到Area 2.

如果在Stub Area 中,沒有Loopback interface的情況下,甚至可以簡單配製爲

router ospf 20

network area x

這樣就不用單獨指定網絡範圍了。

在其它類型中,推薦配置使用interface ip address,即精確匹配,以防止錯誤發生。如:

network area 0