廣播多路訪問鏈路的(OSPF)

 

 

步驟: 網絡

1)步驟1:配置路由器R1 ide

R1(config)#router ospf 1 oop

R1(config-router)#router-id 1.1.1 .1 ui

R1(config-router)#network 1.1.1 .1 0.0.0.255 area 0 this

R1(config-router)#network 192.168.1.0 0.0.0 .255 area 0 spa

2)步驟2:配置路由器R2 debug

R2(config)#router ospf 1 orm

R2(config-router)#router-id 2.2.2 .2 router

R2(config-router)#network 2.2.2 .2 0.0.0.255 area 0 blog

R2(config-router)#network 192.168.1.0 0.0.0 .255 area 0

3)步驟3:配置路由器R3

R3(config)#router ospf 1

R3(config-router)#router-id 3.3.3 .3

R3(config-router)#network 3.3.3 .3 0.0.0.255 area 0

R3(config-router)#network 192.168.1.0 0.0.0 .255 area 0

4)步驟4:配置路由器R4

R4(config)#router ospf 1

R4(config-router)#router-id 4.4.4 .4

R4(config-router)#network 4.4.4 .4 0.0.0.255 area 0

R4(config-router)#network 192.168.1.0 0.0.0 .255 area 0

2show ip ospf neighbor:查看ospf鄰居關係

R1#show ip ospf neighbor

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

2.2.2 .2           1   FULL/BDR        00:00:36    192.168.1.2     Ethernet0/0

3.3.3 .3           1   FULL/DROTHER    00:00:39    192.168.1.3     Ethernet0/0

4.4.4 .4           1   FULL/DROTHER    00:00:39    192.168.1.4     Ethernet0/0

以上輸出代表在該廣播多路訪問網絡中,R1 DR,R2 BDR,R3 R4 DROTHER

【技術要點】

1)爲了不路由器之間創建徹底鄰接關係而引發的大量開銷,OSPF 要求在多路訪問的網絡中選舉一個DR,每一個路由器都與之創建鄰接關係。選舉DR 的同時也選舉出一個BDR,在DR 失效的時候,BDR 擔負起DR 的職責,並且全部其它路由器只與DR BDR 創建鄰接關係;

2DR BDR 有它們本身的組播地址224.0.0.6

3DR BDR 的選舉是以各個網絡爲基礎的,也就是說DR BDR 選舉是一個路由器的接口特性,而不是整個路由器的特性;

4DR 選舉的原則:

① 首要因素是時間,最早啓動的路由器被選舉成DR

② 若是同時啓動,或者從新選舉,則看接口優先級(範圍爲0-255),優先級最高的被選舉成DR,默認狀況下,多路訪問網絡的接口優先級爲1,點到點網絡接口優先級爲0,修改接口優先級的命令是「 ip ospf priority」,若是接口的優先級被設置爲0,那麼該接口將不參與DR 選舉;

③ 若是前二者相同,最後看路由器ID,路由器ID 最高的被選舉成DR

5DR 選舉是非搶佔的,除非人爲地從新選舉。從新選舉DR 的方法有兩種,一是路由器從新啓動,二是執行「clear ip ospf process」命令。

3debug ip ospf adj:顯示OSPF 鄰接關係建立或中斷的過程

R2#debug ip ospf adj

OSPF adjacency events debugging is on

R2#clear ip ospf process

Reset ALL OSPF processes? [no]: y

*Mar  1 00:18:23.543: OSPF: Interface Ethernet0/0 going Down

*Mar  1 00:18:23.543: OSPF: 2.2.2 .2 address 192.168.1.2 on Ethernet0/0 is dead,

state DOWN

*Mar  1 00:18:23.543: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.543: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.547: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.547: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.547: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.547: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.547:        DR: 1.1.1 .1 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.551: OSPF: Reset adjacency with 3.3.3 .3 on Ethernet0/0, state 2

WAY

*Mar  1 00:18:23.551: OSPF: 1.1.1 .1 address 192.168.1.1 on Ethernet0/0 is dead,

state DOWN

*Mar  1 00:18:23.551: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1 .1 on Ethernet0/0 from

 FULL to DOWN, Neighbor Down: Interface down or detached

*Mar  1 00:18:23.555: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.555: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.555: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:28.803: OSPF: Rcv LS UPD from 1.1.1 .1 on Ethernet0/0 length 76 LSA

 count 100:18:23.555:        DR: 4.4.4 .4 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:29.127: OSPF: Rcv LS UPD from 1.1.1 .1 on Ethernet0/0 length 76 LSA

 count 100:18:23.559: OSPF: 3.3.3 .3 address 192.168.1.3 on Ethernet0/0 is dead,

*Mar  1 00:18:29.179: OSPF: Rcv LS UPD from 4.4.4 .4 on Ethernet0/0 length 76 LSA

 count 100:18:23.559: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3 .3 on Ethernet0/0 from

*Mar  1 00:18:29.571: OSPF: Build router LSA for area 0, router ID 2.2.2 .2, seq

0x80000004:18:23.559: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:29.611: OSPF: Rcv LS UPD from 1.1.1 .1 on Ethernet0/0 length 76 LSA

 count 100:18:23.563: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:31.475: %CDP-4-DUPLEX_MISMATCH: duplex mismatch discovered on Ethe

rnet0/0 (not full duplex), with Router FastEthernet0/2 (full duplex).

*Mar  1 00:18:23.563: OSPF: 4.4.4 .4 address 192.168.1.4 on Ethernet0/0 is dead,

state DOWN

*Mar  1 00:18:23.567: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4 .4 on Ethernet0/0 from

 FULL to DOWN, Neighbor Down: Interface down or detached

*Mar  1 00:18:23.567: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.567: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.571: OSPF: Elect BDR 0.0.0 .0

*Mar  1 00:18:23.571: OSPF: Elect DR 0.0.0 .0

*Mar  1 00:18:23.571:        DR: none    BDR: none

*Mar  1 00:18:23.571: OSPF: Remember old DR 4.4.4 .4 (id)

*Mar  1 00:18:23.571: OSPF: Interface Loopback0 going Down

*Mar  1 00:18:23.575: OSPF: 2.2.2 .2 address 2.2.2.2 on Loopback0 is dead, state

DOWN

*Mar  1 00:18:23.655: OSPF: Interface Ethernet0/0 going Up

*Mar  1 00:18:23.655: OSPF: Interface Loopback0 going Up

*Mar  1 00:18:23.675: OSPF: 2 Way Communication to 4.4.4 .4 on Ethernet0/0, state

 2WAY

*Mar  1 00:18:23.679: OSPF: Backup seen Event before WAIT timer on Ethernet0/0

*Mar  1 00:18:23.679: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.679: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.679: OSPF: Elect DR 4.4.4 .4

*Mar  1 00:18:23.679:        DR: 4.4.4 .4 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.683: OSPF: Send DBD to 4.4.4 .4 on Ethernet0/0 seq 0xE02 opt 0x5

2 flag 0x7 len 32

*Mar  1 00:18:23.683: OSPF: 2 Way Communication to 1.1.1 .1 on Ethernet0/0, state

 2WAY

*Mar  1 00:18:23.687: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.687: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.687: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.687: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.687:        DR: 1.1.1 .1 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.691: OSPF: Send DBD to 1.1.1 .1 on Ethernet0/0 seq 0x 224A opt 0x

52 flag 0x7 len 32

*Mar  1 00:18:23.691: OSPF: Remember old DR 4.4.4 .4 (id)

*Mar  1 00:18:23.691: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.691: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.695: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.695: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.695:        DR: 1.1.1 .1 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.695: OSPF: 2 Way Communication to 3.3.3 .3 on Ethernet0/0, state

 2WAY

*Mar  1 00:18:23.699: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.699: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.699: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.699: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.699:        DR: 1.1.1 .1 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.703: OSPF: Neighbor change Event on interface Ethernet0/0

*Mar  1 00:18:23.703: OSPF: DR/BDR election on Ethernet0/0

*Mar  1 00:18:23.703: OSPF: Elect BDR 4.4.4 .4

*Mar  1 00:18:23.703: OSPF: Elect DR 1.1.1 .1

*Mar  1 00:18:23.703:        DR: 1.1.1 .1 (Id)   BDR: 4.4.4.4 (Id)

*Mar  1 00:18:23.719: OSPF: Rcv DBD from 4.4.4 .4 on Ethernet0/0 seq 0xD85 opt 0x

以上的輸出代表:

DR 從新選舉的過程和結果,新的DR R1BDR R4

② 在OSPF 鄰接關係創建的過程當中,接口的狀態的變化包括DOWN2 WayEXSTART

EXCHANGELoading FULL

相關文章
相關標籤/搜索