◾️DR/BDR設定
【やりたい事】・R1をDR,R2をBDR,R3はDR/BDRに選出されないようにする。
・DR障害時及び復旧時のDR/BDRの選出方針を理解する。
◾️検証環境図
①検証環境 事前設定確認
(1)OSPFネイバー確認OSPFネイバーが正常に張れている事を確認する。
R1#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 1 FULL/BDR 00:00:38 192.168.1.2 Ethernet0/0
3.3.3.3 1 FULL/DR 00:00:34 192.168.1.3 Ethernet0/0
R2#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DROTHER 00:00:33 192.168.1.1 Ethernet0/1
3.3.3.3 1 FULL/DR 00:00:36 192.168.1.3 Ethernet0/1
R3#sh ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
1.1.1.1 1 FULL/DROTHER 00:00:32 192.168.1.1 Ethernet0/2
2.2.2.2 1 FULL/BDR 00:00:39 192.168.1.2 Ethernet0/2
(2)OSPFインターフェース確認
OSPFのエリア設定及びState(DR/BDR/DROTHER)値が正しく設定されている事を確認する。
R1#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Et0/0 1 0 192.168.1.1/24 10 DROTH 2/2
※R1のEthernet0/0はDROTHER
R2#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Et0/1 1 0 192.168.1.2/24 10 BDR 2/2
※R2のEthernet0/1はBDR
R3#sh ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Et0/2 1 0 192.168.1.3/24 10 DR 2/2
※R2のEthernet0/1はDRDR/BDRの選出は①priority値が最大(デフォルト1)②priorityが同じ場合はルータIDが最大のインターフェースのルータがDR/BDRに選出される。
②設定変更1(DR/BDR)
(1)R1,R2,R3 priorityを変更する。
R1(config)#int e0/0
R1(config-if)#ip ospf priority 255
R2(config)#int e0/1
R2(config-if)#ip ospf priority 254
R3(config)#int e0/2
R3(config-if)#ip ospf priority 0
※R3はDR/BDRにならないように明示的に「0」を設定する。(2)R1,R2,R3 OSPFプロセスを再起動する。
R1#clear ip ospf process
R2#clear ip ospf process
R3#clear ip ospf process
(3)OSPFインターフェース確認
R1#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DR, Priority 255
R2#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State BDR, Priority 254
R3#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DROTHER, Priority 0
(4)R1(DR)のインターフェースをDownする。※DRが故障した際の挙動確認。
R1(config)#int e0/0
R1(config-if)#shut
※その後、OSPF Deadインターバル(40秒)後、DRの再選出が行われる。
R2#debug ip ospf adj
OSPF adjacency debugging is on
May 4 01:52:08.085: OSPF-1 ADJ Et0/1: 1.1.1.1 address 192.168.1.1 is dead
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: 1.1.1.1 address 192.168.1.1 is dead, state DOWN
May 4 01:52:08.086: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Ethernet0/1 from FULL to DOWN, Neighbor Down: Dead timer expired
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: Neighbor change event
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: DR/BDR election
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: Elect BDR 0.0.0.0
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: Elect DR 2.2.2.2
May 4 01:52:08.086: OSPF-1 ADJ Et0/1: DR: 2.2.2.2 (Id) BDR: none
R1#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DOWN, Priority 255
R2#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DR, Priority 254
R3#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DROTHER, Priority 0
(4)R1をのインターフェースをUPする。。※元DRが復活した際の挙動確認。
R1(config)#int e0/0
R1(config-if)#no shut
R1#debug ip ospf adj
OSPF adjacency debugging is on
May 4 02:01:35.614: OSPF-1 ADJ Et0/0: Route adjust notification: UP/UP
May 4 02:01:35.614: OSPF-1 ADJ Et0/0: Interface going Up
May 4 02:01:35.614: OSPF-1 ADJ Et0/0: Interface state change to UP, new ospf state WAIT
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: 2 Way Communication to 2.2.2.2, state 2WAY
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Backup seen event before WAIT timer
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: DR/BDR election
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Elect BDR 1.1.1.1
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Elect DR 2.2.2.2
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Elect BDR 1.1.1.1
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Elect DR 2.2.2.2
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
May 4 02:01:35.616: OSPF-1 ADJ Et0/0: Nbr 2.2.2.2: Prepare dbase exchange
R2#debug ip ospf adj
OSPF adjacency debugging is on
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: Rcv DBD from 1.1.1.1 seq 0x1369 opt 0x52 flag 0x7 len 32 mtu 1500 state INIT
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: 2 Way Communication to 1.1.1.1, state 2WAY
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: Neighbor change event
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: DR/BDR election
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: Elect BDR 1.1.1.1
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: Elect DR 2.2.2.2
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id)
May 4 02:01:48.703: OSPF-1 ADJ Et0/1: Nbr 1.1.1.1: Prepare dbase exchange
R1#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State BDR, Priority 255
R2#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DR, Priority 254
R3#show ip ospf interface | include Priority
Transmit Delay is 1 sec, State DROTHER, Priority 0
※DRはR2がそのまま引き継ぎ、R1がBDRになる。(R1がDRにはならない。[プリエンプトしない])