はじめに
このドキュメントでは VRF に対して OSPF ルーティングを設定する際の注意点について解説しています。
VRF で OSPF を使用する際の特徴
VRF で動作する OSPF は、実装当初 MPLS 環境での使用を前提として開発されました。 この背景から、VRF で OSPF を設定する場合、デフォルトでは MPLS 環境を Area 0 に見立て Area 0 へのリンク の有無にかかわらずルータ自身が ABR であるように動作するという特徴があります。ルータがどのように動作しているかは、show ip ospf コマンドで確認することができます。
以下の例は Area 1 のみ設定しているルータが "It is an area border and autonomous system boundary router" の出力より ABR としても動作していることを確認した際の出力です。
#show ip ospf 1
Routing Process "ospf 1" with ID x.x.x.x
Domain ID type 0x0005, value x.x.x.x
Start time: 7w7d, Time elapsed: 7w7d
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Supports Database Exchange Summary List Optimization (RFC 5243)
Connected to MPLS VPN Superbackbone, VRF 511
Event-log disabled
It is an area border and autonomous system boundary router
Redistributing External Routes from,
static with metric mapped to 1, includes subnets in redistribution
(skip)
Reference bandwidth unit is 100 mbps
Area 1
Number of interfaces in this area is 1
Area has no authentication
SPF algorithm last executed 00:02:19.402 ago
SPF algorithm executed 5 times
Area ranges are
Number of LSA X. Checksum Sum 0x03275B
Number of opaque link LSA X. Checksum Sum 0x000000
Number of DCbitless LSA X
Number of indication LSA X
Number of DoNotAge LSA X
Flood list length X
発生しうる問題
MPLS 環境ではない構成で VRF 上の OSPF を使用する際、この設定をするルータにも Area 0 のリンクがある場合には問題がないことが多いですが、Non-backbone Area のリンクのみがある場合、 Area 0 や他の Non-backbone Area のからの Inter Area ルートが学習できないなど、主に Area 間のルーティングにおいで意図しないルーティングとなることがあります。 これは、前述の ABR として動作する特徴によるもので、動作としては期待通りのものとなります
MPLS 環境以外での対応策
MPLS 環境以外で VRF 上で OSPF を動作させる場合には、router ospf 配下に capability vrf-lite を設定します。これにより、前述の動作を含め MPLS 環境固有の動作を行わなくなりますので、通常の OSPF と同様の動作となります。