Mikan Network Lab.

ネットワーク技術やCisco製品に関して、勉強・検証した内容を発信しています。

Mikan Network Lab.

IOS: OSPF - Hello/Deadインターバル

OSPFのHelloインターバル、Deadインターバルを変更するコンフィグを記載します。

目次

1. 前提条件

本記事は以下に基づいて作成しています。
・Cisco Modeling Labs 2.1.1
・Cisco IOS Software, Version 15.9(3)M2

2. 要件

  • R1とR2のLo0のセグメント間でお互いに通信できるように設定してください。
  • ルーティングプロトコルはOSPFを使用してください。
  • R1とR2のGi0/0でHelloインターバルを5秒、Deadインターバルを15秒に設定してください。
  • ルータIDはLo0のIPアドレスを明示的に指定してください。

構成図

3. 設定例

要件を満たす設定例を以下に示します。

 R1 

hostname R1
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 192.168.12.1 255.255.255.0
 ip ospf dead-interval 15
 ip ospf hello-interval 5
!
router ospf 1
 router-id 1.1.1.1
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.12.1 0.0.0.0 area 0
!
end

 R2 

hostname R2
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
!
interface GigabitEthernet0/0
 ip address 192.168.12.2 255.255.255.0
 ip ospf dead-interval 15
 ip ospf hello-interval 5
!
router ospf 1
 router-id 2.2.2.2
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.12.2 0.0.0.0 area 0
!
end

4. 動作確認

4.1. show ip ospf interface

  • R1とR2のGi0/0でHelloインターバルが5秒、Deadインターバルが15秒になっていることを確認します。

R1#show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
  Internet Address 192.168.12.1/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 192.168.12.1
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.12.2
  Timer intervals configured, Hello 5, Dead 15, Wait 15, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/2/2, flood queue length 0
  Next 0x0(0)/0x0(0)/0x0(0)
  Last flood scan length is 0, 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  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)
R2#show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
  Internet Address 192.168.12.2/24, Area 0, Attached via Network Statement
  Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1
  Topology-MTID    Cost    Disabled    Shutdown      Topology Name
        0           1         no          no            Base
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 192.168.12.1
  Backup Designated router (ID) 2.2.2.2, Interface address 192.168.12.2
  Timer intervals configured, Hello 5, Dead 15, Wait 15, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Cisco NSF helper support enabled
  IETF NSF helper support enabled
  Index 1/2/2, flood queue length 0
  Next 0x0(0)/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 1.1.1.1  (Designated Router)
  Suppress hello for 0 neighbor(s)

4.2. show ip ospf neighbor

  • R1とR2でOSPFネイバーが確立されていることを確認します。

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2           1   FULL/BDR        00:00:11    192.168.12.2    GigabitEthernet0/0
R2#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
1.1.1.1           1   FULL/DR         00:00:12    192.168.12.1    GigabitEthernet0/0

4.3. show ip route ospf

  • R1で2.2.2.2/32のルートを学習していることを確認します。
  • R2で1.1.1.1/32のルートを学習していることを確認します。

R1#show ip route ospf
Codes: L - local, C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      2.0.0.0/32 is subnetted, 1 subnets
O        2.2.2.2 [110/2] via 192.168.12.2, 00:02:32, GigabitEthernet0/0
R2#show ip route ospf
Codes: L - local, C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      1.0.0.0/32 is subnetted, 1 subnets
O        1.1.1.1 [110/2] via 192.168.12.1, 00:03:11, GigabitEthernet0/0

5. 補足

  • OSPFネイバーを確立させるためには、OSPFネイバー同士でHelloインターバルとDeadインターバルが一致している必要があります。以下はR1のHelloインターバルは10秒、Deadインターバルは40秒、R2のHelloインターバルは5秒、Deadインターバルは15秒に設定している場合ですが、デバッグを確認するとHelloパラメータの不一致を示すメッセージが出力されており、ネイバーが確立できていないことが分かります。

R1#show ip ospf interface GigabitEthernet0/0
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
R2#show ip ospf interface GigabitEthernet0/0
  Timer intervals configured, Hello 5, Dead 15, Wait 15, Retransmit 5
R1#debug ip ospf hello
OSPF hello debugging is on

R1#
*May 17 07:40:16.624: OSPF-1 HELLO Gi0/0: Rcv hello from 2.2.2.2 area 0 192.168.12.2
*May 17 07:40:16.624: OSPF-1 HELLO Gi0/0: Mismatched hello parameters from 192.168.12.2
*May 17 07:40:16.624: OSPF-1 HELLO Gi0/0: Dead R 15 C 40, Hello R 5 C 10 Mask R 255.255.255.0 C 255.255.255.0

R1#show ip ospf neighbor
R1#