概要

OSPFのLSDB同期とフラグメントの影響について、設定ミスの切り分けと修正を行います。

ネットワーク構成

次の図のようにR1、R2、R3でシングルエリアのOSPFの設定を行います。

図 OSPF 設定ミスの切り分けと修正 Part4 ネットワーク構成
図 OSPF 設定ミスの切り分けと修正 Part4 ネットワーク構成

設定概要

各ルータでのIPアドレスやOSPFに関連する設定の抜粋を示します。これらの設定には一部設定ミスがあります。

R1

interface Loopback0
 ip address 10.1.1.1 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.13.1 255.255.255.0
 ip mtu 1492
!
interface Serial1/0
 ip address 192.168.12.1 255.255.255.0
 encapsulation frame-relay
 serial restart-delay 0
 frame-relay map ip 192.168.12.2 100 broadcast
 frame-relay interface-dlci 100
  class FRF
!
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 10.1.1.1 0.0.0.0 area 0
 network 192.168.12.0 0.0.0.255 area 0
 network 192.168.13.0 0.0.0.255 area 0
 neighbor 192.168.12.2
!
map-class frame-relay FRF
 frame-relay fair-queue
 frame-relay fragment 100

R2

interface Loopback0
 ip address 10.2.2.2 255.255.255.255
!
interface Serial1/0
 ip address 192.168.12.2 255.255.255.0
 encapsulation frame-relay
 serial restart-delay 0
 frame-relay traffic-shaping
 frame-relay map ip 192.168.12.1 200 broadcast
 frame-relay interface-dlci 200
  class FRF
!
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 network 10.2.2.2 0.0.0.0 area 0
 network 192.168.12.0 0.0.0.255 area 0
!
map-class frame-relay FRF
 frame-relay fair-queue
 frame-relay fragment 100

R3

interface Loopback0
 ip address 10.3.3.3 255.255.255.255
!
interface FastEthernet0/0
 ip address 192.168.13.3 255.255.255.0
!
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 10.3.3.3 0.0.0.0 area 0
 network 192.168.13.0 0.0.0.255 area 0

トラブルの症状

R1でOSPFネイバーを確認すると、R2、R3ともにFULL状態にまでいたらず、LSDBの同期を取ることができません。そのため、当然、通信もできません。

R1 show ip ospf neighbor

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   EXSTART/DR      00:00:39    192.168.13.3    FastEthernet0/0
2.2.2.2           1   EXCHANGE/DR     00:01:53    192.168.12.2    Serial1/0

トラブルを切り分けるために、各ルータで以下のshowコマンドを実行しました。

R1
show ip ospf interface
show ip interface Fa0/0
show frame-relay map
show frame-relay fragment

R2
show ip ospf interface
show frame-relay map
show frame-relay fragment

R3
show ip ospf interface
show ip interface Fa0/0

R1 showコマンドの結果

R1#show ip ospf interface
Loopback0 is up, line protocol is up
  Internet Address 10.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
FastEthernet0/0 is up, line protocol is up
  Internet Address 192.168.13.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 1.1.1.1, Interface address 192.168.13.1
  No backup designated router on this network
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  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 1, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
Serial1/0 is up, line protocol is up
  Internet Address 192.168.12.1/24, Area 0
  Process ID 1, Router ID 1.1.1.1, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State BDR, Priority 1
  Designated Router (ID) 2.2.2.2, Interface address 192.168.12.2
  Backup Designated router (ID) 1.1.1.1, Interface address 192.168.12.1
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Index 2/2, flood queue length 0
  Next 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 0
  Suppress hello for 0 neighbor(s)
R1#show ip int fa 0/0
FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.13.1/24
  Broadcast address is 255.255.255.255
  Address determined by non-volatile memory
  MTU is 1492 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.5 224.0.0.6
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  Security level is default
  Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is enabled
  IP fast switching on the same interface is disabled
  IP Flow switching is disabled
  IP CEF switching is enabled
  IP CEF Fast switching turbo vector
  IP multicast fast switching is enabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are Fast, CEF
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Policy routing is disabled
  Network address translation is disabled
  BGP Policy Mapping is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect inbound is disabled
  WCCP Redirect exclude is disabled
R1#show frame-relay map
Serial1/0 (up): ip 192.168.12.2 dlci 100(0x64,0x1840), static,
              broadcast,
              CISCO, status defined, active
R1#show frame-relay fragment
interface                dlci frag-type  size in-frag    out-frag   dropped-frag

R2 showコマンドの結果

R2#show ip ospf interface
Loopback0 is up, line protocol is up
  Internet Address 10.2.2.2/32, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type LOOPBACK, Cost: 1
  Loopback interface is treated as a stub Host
Serial1/0 is up, line protocol is up
  Internet Address 192.168.12.2/24, Area 0
  Process ID 1, Router ID 2.2.2.2, Network Type NON_BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 2.2.2.2, Interface address 192.168.12.2
  Backup Designated router (ID) 1.1.1.1, Interface address 192.168.12.1
  Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5
    oob-resync timeout 120
    Hello due in 00:00:14
  Supports Link-local Signaling (LLS)
  Index 2/2, 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 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 0
  Suppress hello for 0 neighbor(s)
R2#show frame-relay map
Serial1/0 (up): ip 192.168.12.1 dlci 200(0xC8,0x3080), static,
              broadcast,
              CISCO, status defined, active
R2#show frame-relay fragment
interface                dlci frag-type  size in-frag    out-frag   dropped-frag
Se1/0                    200  end-to-end 100  0          184        0

R3 showコマンドの結果

R3#show ip interface Fa0/0
FastEthernet0/0 is up, line protocol is up
  Internet address is 192.168.13.3/24
  Broadcast address is 255.255.255.255
  Address determined by non-volatile memory
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Multicast reserved groups joined: 224.0.0.5 224.0.0.6
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  Security level is default
  Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is enabled
  IP fast switching on the same interface is disabled
  IP Flow switching is disabled
  IP CEF switching is enabled
  IP CEF Fast switching turbo vector
  IP multicast fast switching is enabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are Fast, CEF
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Policy routing is disabled
  Network address translation is disabled
  BGP Policy Mapping is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect inbound is disabled
  WCCP Redirect exclude is disabled

問題

  • なぜOSPFネイバーを正常に確立できないのですか?
  • OSPFネイバーを確立してルーティングできるようにするためには、どのように設定を修正すればよいですか?

解答

なぜOSPFネイバーを正常に確立できないのですか?

【R1-R2間】

R2ではFRF(Frame Relay Fragment)によって100バイトでフラグメントされているが、R1ではフラグメントされていない。R1のS1/0でframe-relay traffic-shapingが有効化されていないのでR1のFRFは有効ではないから。

【R1-R3間】

MTUサイズが一致していないために、DBDの交換ができていないから

OSPFネイバーを確立してルーティングできるようにするためには、どのように設定を修正すればよいですか?

R1

interface FastEthernet0/0
 no ip mtu 1492
!
interface Serial1/0
 frame-relay traffic-shaping

ワンポイント

  • ネイバー間でMTUサイズが一致していないとOSPF DBDパケットの交換を正しく行うことができない
  • FRTSを有効化しないと、FRFは機能しない

解説

R1-R2間、R1-R3間でOSPFネイバー同士でLSDBの同期を取ることができていません。それぞれでLSDBの同期が取れない原因は次の通りです。

R1-R2間
R1でFRFのフラグメントが行われていない。R2ではDBDをフラグメントするが、R1ではFRFが機能していないので、R2から送信されたDBDを受信できない

R1-R3間
ネイバー間でMTUサイズが一致していないのでDBDの交換を行っていない。

以降、それぞれについて詳細を解説します。

図 設定ミスの内容
図 設定ミスの内容


【R1-R2間】

R1-R2間はフレームリレーで接続しています。R1、R2では次のようにマップクラス「FRF」でフラグメントの設定を行っています。

R1 フレームリレーのフラグメント

interface Serial1/0
 encapsulation frame-relay
 frame-relay map ip 192.168.12.2 100 broadcast
 frame-relay interface-dlci 100
  class FRF
!
map-class frame-relay FRF
 frame-relay fair-queue
 frame-relay fragment 100

R2 フレームリレーのフラグメント

interface Serial1/0
 encapsulation frame-relay
 frame-relay traffic-shaping
 frame-relay map ip 192.168.12.1 200 broadcast
 frame-relay interface-dlci 200
  class FRF
!
map-class frame-relay FRF
 frame-relay fair-queue
 frame-relay fragment 100

しかし、R1のSerial1/0でframe-relay traffic-shapingが有効化されていません。そのため、R1ではフレームリレーのフラグメントは行われていません。そのことは、R1でshow frame-relay fragmentを見ると、よくわかります。

R1 show frame-relay fragment

R1#show frame-relay fragment
interface                dlci frag-type  size in-frag    out-frag   dropped-frag

Helloパケットはフラグメントサイズの100バイトに満たないので、フラグメントされません。そのため、R1-R2間でHelloパケットを交換できます。しかし、DBDパケットは違います。R2はDBDパケットをフラグメントしてR1へ送信しますが、R1でそれを正しく処理できません。そのため、R1-R2間でLSDBの同期を取ることができません。

R1でもフレームリレーのフラグメントができるように、Serial1/0でframe-relay traffic-shapingの設定が必要です。

R1 FRTSの有効化

interface Serial1/0
 frame-relay traffic-shaping

R1でFRTSを有効化して、show frame-relay fragmentとshow ip ospf neighborを見ると、次のようになります。

R1 show frame-relay fragment/show ip ospf neighbor

R1#show frame-relay fragment
interface                dlci frag-type  size in-frag    out-frag   dropped-frag
Se1/0                    100  end-to-end 100  2          6          0
R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   EXSTART/DR      00:00:39    192.168.13.3    FastEthernet0/0
2.2.2.2           1   FULL/DR         00:01:49    192.168.12.2    Serial1/0

R1でもフレームリレーのフラグメントを行い、その結果、R2との間でLSDBの同期を取っていることがわかります。

【R1-R3間】

OSPFでDBDパケットを交換するときには、お互いのMTUサイズが一致しているかどうかを確認しています。MTUサイズが不一致の場合は、ネイバーの状態はEXSTART状態でスタックしてしまいます。(IOSのバージョンによってはEXSTART/EXCHANGE)

このことはdebug ip ospf adjを見ると、よくわかります。R3でdebug ip ospf adjは次のような出力になります。

R3 debug ip ospf adj

R3#debug ip ospf adj
OSPF adjacency events debugging is on
R3#
*Mar  1 00:39:58.119: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:39:58.123: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:39:58.123: OSPF: Elect BDR 0.0.0.0
*Mar  1 00:39:58.127: OSPF: Elect DR 3.3.3.3
*Mar  1 00:39:58.127:        DR: 3.3.3.3 (Id)   BDR: none
*Mar  1 00:40:06.035: OSPF: 2 Way Communication to 1.1.1.1 on FastEthernet0/0, state 2WAY
*Mar  1 00:40:06.035: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:40:06.039: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:40:06.039: OSPF: Elect BDR 1.1.1.1
*Mar  1 00:40:06.043: OSPF: Elect DR 3.3.3.3
*Mar  1 00:40:06.043:        DR: 3.3.3.3 (Id)   BDR: 1.1.1.1 (Id)
*Mar  1 00:40:06.047: OSPF: Send DBD to 1.1.1.1 on FastEthernet0/0 seq 0x80B opt 0x52 flag 0x7 len 32
*Mar  1 00:40:06.047: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:40:06.047: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:40:06.047: OSPF: Elect BDR 1.1.1.1
*Mar  1 00:40:06.047: OSPF: Elect DR 3.3.3.3
*Mar  1 00:40:06.047:        DR: 3.3.3.3 (Id)   BDR: 1.1.1.1 (Id)
*Mar  1 00:40:06.047: OSPF: Neighbor change Event on interface FastEthernet0/0
*Mar  1 00:40:06.047: OSPF: DR/BDR election on FastEthernet0/0
*Mar  1 00:40:06.047: OSPF: Elect BDR 1.1.1.1
*Mar  1 00:40:06.047: OSPF: Elect DR 3.3.3.3
*Mar  1 00:40:06.047:        DR: 3.3.3.3 (Id)   BDR: 1.1.1.1 (Id)
*Mar  1 00:40:06.051: OSPF: Rcv DBD from 1.1.1.1 on FastEthernet0/0 seq 0x303 opt 0x52 flag 0x7 len 32  mtu 1492 state EXSTART
*Mar  1 00:40:06.051: OSPF: Nbr 1.1.1.1 has smaller interface MTU
*Mar  1 00:40:06.051: OSPF: First DBD and we are not SLAVE

R3はネイバー1.1.1.1(R1)のMTUサイズが1492バイトで、自身のMTUサイズ(1500バイト)よりも小さいことを検出しています。そして、DBDパケットの再送信を繰り返します。この問題を修復するためには、R1とR3でMTUサイズを一致させなければいけません。R1でMTUサイズが変更されているので、その設定を削除します。

R1 MTUサイズをデフォルトに戻す

interface FastEthernet0/0
 no ip mtu 1492

R1でMTUサイズをデフォルトに戻したあと、show ip ospf neighborを確認すると、R1-R3間でLSDBの同期を取れていることがわかります。

R1 show ip ospf neighbor

R1#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/DR         00:00:38    192.168.13.3    FastEthernet0/0
2.2.2.2           1   FULL/DR         00:01:38    192.168.12.2    Serial1/0

また、別の方法としてMTUサイズのミスマッチを無視するように設定できます。R1、R3のFastEthernet0/0でip ospf mtu-ignoreコマンドによって、MTUサイズのミスマッチを無視します。

R1、R3

interface FastEthernet0/0
 ip ospf mtu-ignore

OSPFの仕組み