OSPF関連コマンド -超基本確認コマンド4つ-
★ネイバーup時のコンソールログ
================================================================================ %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on Ethernet0/1 from LOADING to FULL, Loading Done !! ネイバーのアドレス on 自分のIF ================================================================================
★ネイバーの確認
# show ip ospf neighbor
================================================================================ 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.0.2 Ethernet0/0 R1# R2#sh ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1.1.1.1 100 FULL/DR 00:00:36 192.168.0.1 Ethernet0/1 R2# ================================================================================
★ネイバーup時のデバッグ
# debug ip ospf events
================================================================================ R2#deb ip ospf ev OSPF events debugging is on R2# *Mar 1 00:03:56.035: OSPF: Rcv hello from 1.1.1.1 area 0 from Ethernet0/1 192.168.0.1 *Mar 1 00:03:56.035: OSPF: End of hello processing *Mar 1 00:03:56.039: OSPF: Rcv DBD from 1.1.1.1 on Ethernet0/1 seq 0x2077 opt 0x52 flag 0x7 len 32 mtu 1500 state 2WAY *Mar 1 00:03:56.039: OSPF: Nbr state is 2WAY *Mar 1 00:03:56.759: OSPF: end of Wait on interface Ethernet0/1 *Mar 1 00:03:56.759: OSPF: DR/BDR election on Ethernet0/1 *Mar 1 00:03:56.759: OSPF: Elect BDR 2.2.2.2 *Mar 1 00:03:56.759: OSPF: Elect DR 2.2.2.2 *Mar 1 00:03:56.759: OSPF: Elect BDR 1.1.1.1 *Mar 1 00:03:56.759: OSPF: Elect DR 2.2.2.2 *Mar 1 00:03:56.759: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id) *Mar 1 00:03:56.763: OSPF: Send DBD to 1.1.1.1 on Ethernet0/1 seq 0x261D opt 0x52 flag 0x7 len 32 *Mar 1 00:03:56.763: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0/1 from 192.168.0.2 *Mar 1 00:03:56.795: OSPF: Rcv DBD from 1.1.1.1 on Ethernet0/1 seq 0x261D opt 0x52 flag 0x2 len 52 mtu 1500 state EXSTART *Mar 1 00:03:56.795: OSPF: NBR Negotiation Done. We are the MASTER *Mar 1 00:03:56.795: OSPF: Send DBD to 1.1.1.1 on Ethernet0/1 seq 0x261E opt 0x52 flag 0x3 len 52 *Mar 1 00:03:56.799: OSPF: Database request to 1.1.1.1 *Mar 1 00:03:56.799: OSPF: sent LS REQ packet to 192.168.0.1, length 12 *Mar 1 00:03:56.835: OSPF: Rcv DBD from 1.1.1.1 on Ethernet0/1 seq 0x261E opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE *Mar 1 00:03:56.835: OSPF: Send DBD to 1.1.1.1 on Ethernet0/1 seq 0x261F opt 0x52 flag 0x1 len 32 *Mar 1 00:03:56.859: OSPF: Rcv DBD from 1.1.1.1 on Ethernet0/1 seq 0x261F opt 0x52 flag 0x0 len 32 mtu 1500 state EXCHANGE *Mar 1 00:03:56.859: OSPF: Exchange Done with 1.1.1.1 on Ethernet0/1 *Mar 1 00:03:56.859: OSPF: Synchronized with 1.1.1.1 on Ethernet0/1, state FULL *Mar 1 00:03:56.863: %OSPF-5-ADJCHG: Process 2, Nbr 1.1.1.1 on Ethernet0/1 from LOADING to FULL, Loading Done R2# R2# *Mar 1 00:04:06.019: OSPF: Rcv hello from 1.1.1.1 area 0 from Ethernet0/1 192.168.0.1 *Mar 1 00:04:06.019: OSPF: Neighbor change Event on interface Ethernet0/1 *Mar 1 00:04:06.019: OSPF: DR/BDR election on Ethernet0/1 *Mar 1 00:04:06.019: OSPF: Elect BDR 1.1.1.1 *Mar 1 00:04:06.023: OSPF: Elect DR 2.2.2.2 *Mar 1 00:04:06.023: DR: 2.2.2.2 (Id) BDR: 1.1.1.1 (Id) *Mar 1 00:04:06.023: OSPF: End of hello processing *Mar 1 00:04:06.763: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0/1 from 192.168.0.2 R2# *Mar 1 00:04:16.027: OSPF: Rcv hello from 1.1.1.1 area 0 from Ethernet0/1 192.168.0.1 *Mar 1 00:04:16.027: OSPF: End of hello processing *Mar 1 00:04:16.763: OSPF: Send hello to 224.0.0.5 area 0 on Ethernet0/1 from 192.168.0.2 R2# ================================================================================
★OSPF IFの状態確認
# show ip ospf interface
!! OSPFが動いているIFを表示する
!! AddressRange,ProcessID,RouterID,Costなどを見る
!! Costは計算式あるっぽいけど今は Serial=1,Eth=10,Giga=100,Ten=1000 と覚えとく
!! Passive Interfaceは No Hellos とでる
================================================================================ R1#sh ip ospf int Ethernet0/3 is up, line protocol is up Internet Address 172.16.1.254/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State WAITING, Priority 1 No designated router on this network No backup designated router on this network Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 No Hellos (Passive interface) Wait time before Designated router selection 00:00:26 Supports Link-local Signaling (LLS) Index 3/3, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s) Loopback0 is up, line protocol is up Internet Address 1.1.1.1/32, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type LOOPBACK, Cost: 1 Loopback interface is treated as a stub Host Ethernet0/0 is up, line protocol is up Internet Address 192.168.0.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State BDR, Priority 1 Designated Router (ID) 2.2.2.2, Interface address 192.168.0.2 Backup Designated router (ID) 1.1.1.1, Interface address 192.168.0.1 Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:07 Supports Link-local Signaling (LLS) Index 1/1, 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 2.2.2.2 (Designated Router) Suppress hello for 0 neighbor(s) R1# ================================================================================