1. 程式人生 > >ospf實驗(1)

ospf實驗(1)

ospf實驗(1)

ospf實驗(1)

技術分享圖片


1 route id的選舉

a 手動配置,通過命令route-id x.x.x.x指定,為最優先;

b 如果沒有手動指定,那麽選取IP地址最高的回環端都作為route-id,即使這個端口並沒有參與OSPF進程;

c 如果沒有回環端口,那麽選舉IP地址最高的物理接口地址作route-id,即使這個端口沒有參與OSPF進程,但是該端口一定要是UP的;


2 show ip ospf interface brief

查看那些接口參與的ospf進程;


3 show ip ospf neighbor

查看ospf鄰居

OSFP的DR,BDR選舉規則:

a 首先看接口優先級,優先級大為優

b 如果優先級相同,那麽比較route-id,route-id大的優

c 選舉完成以後,不具有搶占性

接口下:ip ospf priority <0-255>

重啟ospf進程:clear ip ospf process


4 show ip ospf database

查看LSDB

其中database的實際內容為鄰居之間同步獲得的LSA(鏈路狀態通告)


5 被動端口的配置

在ospf進程中配置:passive-interface s1/0 //指定s1/0接口不接受ospf的hello包;


6 修改hello時間,並查看;

show ip ospf interface s1/0

如果兩端hellow時間不匹配,那麽在鄰居dead-time超時以後,這個鄰居條目自然就會被斷開;


7 如果兩者route-id相同

報錯如下:

00:20:38: OSPF: Rcv DBD from 1.1.1.1 on Serial0/0/0 seq 0x6e20 opt 0x00 flag 0x7 len 32 mtu 1500 state EXSTART

00:20:38: OSPF: First DBD and we are not SLAVE

如果兩者route-id相同,則會停留在EXSHTART狀態;


8 如果MTU不匹配


9 ospf認證配置

ospf支持兩種認證,分別是明文認證和MD5的密文認證。

兩種認證都可以采取給予接口或者給予區域的兩種配置方式。
a 端口認證
明文
(if)ip ospf authentication
(if)ip ospf authentication-key cisco
md5
(if)ip ospf authentication message-digest
(if)ip ospf message-digest-key 1 md5 cisco

b 區域認證
明文
(if)ip ospf authentication-key cisco
(route)area 0 authentication
md5
(if)ip ospf message-digest-key 1 md5 cisco
(route)area 0 authentication message-digest

c virtual-link
明文
(route)area 2 virtual-link 14.1.1.1 authentication authentication-key cisco
md5
(route)area 2 virtual-link 14.1.1.1 authentication message-digest


10 網絡類型

點到點和點到多點,默認都不選舉DR和BDR,默認的hello時間為30s;

非廣播的網絡類型,無法自動發現鄰居,需要選舉DR和BDR;

所以,在配置ospf的時候,一定要保證兩端的網絡類型一直;











ospf實驗(1)