VRF-Lite の設定

VRF-Lite について

VRF-Lite の機能によって、サービス プロバイダーは、VPN 間で重複した IP アドレスを使用できる複数の VPN をサポートできます。VRF-Lite は入力インターフェイスを使用して異なる VPN のルートを区別し、各 VRF に 1 つまたは複数のレイヤ 3 インターフェイスを対応付けて仮想パケット転送テーブルを形成します。VRF のインターフェイスは、イーサネット ポートなどの物理インターフェイス、または VLAN SVI などの論理インターフェイスにすることができますが、レイヤ 3 インターフェイスは、一度に複数の VRF に属することはできません。


(注)  

VRF-Lite インターフェイスは、レイヤ 3 インターフェイスである必要があります。


VRF-Lite には次のデバイスが含まれます。

  • カスタマーエッジ(CE)デバイスにおいて、カスタマーは、1 つまたは複数の プロバイダー エッジ(PE)ルータへのデータ リンクを介してサービス プロバイダー ネットワークにアクセスできます。CE デバイスは、サイトのローカル ルートをプロバイダー エッジ ルータにアドバタイズし、そこからリモート VPN ルートを学習します。Cisco Catalyst スイッチは、CE にすることができます。

  • プロバイダー ルータ(またはコア ルータ)とは、サービス プロバイダー ネットワーク内にあり、CE デバイスに接続していないすべてのルータです。

次の図に、各 Cisco Catalyst スイッチが複数の仮想 CE として機能する設定を示します。VRF-Lite はレイヤ 3 機能であるため、VRF の各インターフェイスはレイヤ 3 インターフェイスである必要があります。

図 1. 複数の仮想 CE として機能する Cisco Catalyst スイッチ


次の図に、VRF-Lite の CE 対応ネットワークでのパケット転送プロセスを示します。

  • CE が VPN からパケットを受信すると、CE は入力インターフェイスに基づいたルーティング テーブルを検索します。ルートが見つかると、CE はパケットを PE に転送します。

  • 入力 PE は、CE からパケットを受信すると、VRF 検索を実行します。ルートが見つかると、ルータは対応する MPLS ラベルをパケットに追加し、MPLS ネットワークに送信します。

  • 出力 PE は、ネットワークからパケットを受信すると、ラベルを除去してそのラベルを使用し、正しい VPN ルーティング テーブルを識別します。次に、出力 PE が通常のルート検索を行います。ルートが見つかると、パケットを正しい隣接デバイスに転送します。

  • CE が出力 PE からパケットを受信すると、CE は入力インターフェイスを使用して正しい VPN ルーティング テーブルを検索します。ルートが見つかると、CE はパケットを VPN 内に転送します。

VRF を設定するには、VRF テーブルを作成し、VRF に対応付けられたレイヤ 3 インターフェイスを指定します。次に、VPN および CE と PE 間でルーティング プロトコルを設定します。プロバイダーのバックボーンで VPN ルーティング情報を配信する場合は、BGP が優先ルーティング プロトコルです。VRF-Lite ネットワークには、次の 3 つの主要なコンポーネントがあります。

  • VPN ルート ターゲット コミュニティ:VPN コミュニティの他のすべてのメンバをリストします。VPN コミュニティ メンバーごとに VPN ルート ターゲットを設定する必要があります。

  • VPN コミュニティ PE ルータのマルチプロトコル BGP ピアリング: VPN コミュニティのすべてのメンバに VRF の到着可能性情報を伝播します。VPN コミュニティのすべての PE ルータで BGP ピアリングを設定する必要があります。

  • VPN 転送:VPN サービスプロバイダー ネットワークのすべての VPN コミュニティ メンバ間のすべてのトラフィックを転送します。


(注)  

この製品のマニュアルセットは、偏向のない言語を使用するように配慮されています。このドキュメントセットでの偏向のない言語とは、年齢、障害、性別、人種的アイデンティティ、民族的アイデンティティ、性的指向、社会経済的地位、およびインターセクショナリティに基づく差別を意味しない言語として定義されています。製品ソフトウェアのユーザインターフェイスにハードコードされている言語、RFP のドキュメントに基づいて使用されている言語、または参照されているサードパーティ製品で使用されている言語によりドキュメントに例外が存在する場合があります。

VRF-Lite の設定に関するガイドライン

IPv4 と IPv6

  • VRF-Lite が設定されたスイッチは複数のカスタマーで共有され、すべてのカスタマーが独自のルーティング テーブルを持ちます。

  • カスタマーは別々の VRF テーブルを使用するので、同じ IP アドレスを再利用できます。別々の VPN では IP アドレスの重複が許可されます。

  • VRF-Lite では、複数のカスタマーが PE と CE の間で同一の物理リンクを共有できます。複数の VLAN を持つトランク ポートでは、パケットがカスタマー間で分離されます。すべてのカスタマーが独自の VLAN を持ちます。

  • PE ルータでは、VRF-Lite の使用と複数の CE の使用には違いがありません。 では、複数の仮想レイヤ 3 インターフェイスが VRF-Lite デバイスに接続されています。

  • Cisco Catalyst スイッチでは、物理ポートか VLAN SVI、またはその両方の組み合わせを使用して、VRF を設定できます。アクセス ポートまたはトランク ポート経由で SVI を接続できます。

  • カスタマーは、別のカスタマーと重複しないかぎり、複数の VLAN を使用できます。カスタマーの VLAN は、スイッチに保存されている適切なルーティング テーブルの識別に使用される特定のルーティング テーブル ID にマッピングされます。

  • レイヤ 3 TCAM リソースは、すべての VRF 間で共有されます。各 VRF が十分な CAM 領域を持つようにするには、maximum routes コマンドを使用します。

  • VRF を使用した Cisco Catalyst スイッチは、1 つのグローバル ネットワークと複数の VRF をサポートできます。サポートされるルートの総数は、TCAM のサイズに制限されます。

  • 1 つの VRF を IPv4 と IPv6 の両方に設定できます。

  • 着信パケットの宛先アドレスが VRF テーブルにない場合、そのパケットはドロップされます。また、VRF ルートに TCAM 領域が十分にない場合、その VRF のハードウェアスイッチングは無効になり、対応するデータ パケットがソフトウェアに送信されて処理されます。

IPv4 固有

  • CE と PE 間のほとんどのルーティング プロトコル(BGP、OSPF、EIGRP、RIP、およびスタティック ルーティング)を使用できます。ただし、次の理由から External BGP(EBGP)を使用することを推奨します。

    • BGP では、複数の CE とのやり取りに複数のアルゴリズムを必要としません。

    • BGP は、さまざまな管理者によって稼働するシステム間でルーティング情報を渡すように設計されています。

    • BGP は、ルートの属性の CE への引き渡しを単純化します。

  • マルチキャスト VRF-Lite はサポートされていません。

  • router ospfcapability vrf-lite サブコマンドは、PE と CE 間のルーティング プロトコルとして OSPF が設定されている場合に使用する必要があります。

IPv6 固有

  • VRF 認識 OSPFv3、BGPv6、EIGRPv6、および IPv6 スタティックルーティングがサポートされます。

  • VRF 認識 IPv6 ルート アプリケーションには、ping、telnet、ssh、tftp、ftp、およびトレースルートが含まれています(このリストには Mgt インターフェイスは含まれていません。これは、その下に IPv4 も IPv6 も設定できますが、別々に処理されます)。

VRF-Lite の設定方法

IPv4 用の VRF-Lite の設定

VRF 認識サービスの設定

IP サービスは、グローバルなインターフェイス上と、グローバルなルーティング インスタンス内で設定できます。IP サービスは複数のルーティング インスタンス上で稼働するように拡張されます。これが、VRF 認識です。システム内の任意の設定済み VRF であればいずれも、VRF 認識サービス用に指定できます。

VRF 認識サービスは、プラットフォームから独立したモジュールに実装されています。VRF は、Cisco IOS 内の複数のルーティング インスタンスを提供します。各プラットフォームには、サポートする VRF 数に関して独自の制限があります。

VRF 認識サービスには、次の特性があります。

  • ユーザは、ユーザ指定の VRF 内のホストに ping を実行できます。

  • ARP エントリは、個別の VRF で学習されます。ユーザは、特定の VRF の ARP エントリを表示できます。

ARP のユーザ インターフェイスの設定

手順

  コマンドまたはアクション 目的
ステップ 1

show ip arp vrf vrf-name

例:

Switch# show ip arp vrf vrf-name

指定された VRF で、ARP テーブル(スタティック エントリおよびダイナミック エントリ)を表示します。

ステップ 2

arp vrf vrf-name ip-address mac-address ARPA

例:

Switch(config)# arp vrf vrf-name ip-address mac-address ARPA

指定された VRF でスタティック ARP エントリを作成します。

TACACS+ サーバ用の Per-VRF の設定

TACACS+ サーバ機能の per-VRF は TACACS+ サーバの per- 仮想単位ルート転送(per-VRF)の認証、認可、アカウンティング(AAA)を設定することができます。

VRF ルーティング テーブル(ステップ 3 および 4 で示すように)を作成し、インターフェイスを設定する(ステップ 6、7、および 8)ことができます。TACACS+ サーバの per-VRF 単位の実際の設定は、ステップ 10~13 で行われます。

始める前に

TACACS+ サーバの per-VRF を設定する前に、AAA およびサーバ グループを設定しておく必要があります。

手順

  コマンドまたはアクション 目的
ステップ 1

enable

例:

Switch> enable

特権 EXEC モードを有効にします。パスワードを入力します(要求された場合)。

ステップ 2

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 3

vrf definitionvrf-name

例:

Switch(config)# ip vrf vrf-name

VRF 名を指定し、VRF コンフィギュレーション モードを開始します。

ステップ 4

rd route-distinguisher

例:

Switch (config-vrf)# rd route-distinguisher

VRF インスタンスに対するルーティングおよびフォワーディング テーブルを作成します。

ステップ 5

exit

例:

Switch (config-vrf)# exit

VRF コンフィギュレーション モードを終了します。

ステップ 6

interface interface-name

例:

Switch (config)# interface interface-name

インターフェイスを設定し、インターフェイス コンフィギュレーション モードを開始します。

ステップ 7

vrf forwarding vrf-name

例:

Switch (config-if)# vrf forwarding vrf-name

インターフェイスに VRF を設定します。

ステップ 8

ip address ip-address mask [secondary]

例:

Switch (config-if)# ip address ip-address mask [secondary]

インターフェイスに対するプライマリ IP アドレスまたはセカンダリ IP アドレスを設定します。

ステップ 9

exit

例:

Switch (config-vrf)# exit

インターフェイス コンフィギュレーション モードを終了します。

ステップ 10

aaa group server tacacs+ group-name

例:

Switch (config)# aaa group server tacacs+ tacacs1

異なる TACACS+ サーバ ホストを別々のリストと方式にグループ化し、server-group コンフィギュレーション モードを開始します。

ステップ 11

server-private {ip-address | name} [nat] [single-connection] [port port-number] [ timeout seconds] [key [0 | 7] string]

例:

Switch (config-sg-tacacs+)# server-private 10.1.1.1 port 19 key cisco

グループ サーバに対するプライベート TACACS+ サーバの IP アドレスを設定します。

ステップ 12

vrf forwarding vrf-name

例:

Switch (config-sg-tacacs+)# vrf forwarding vrf-name

AAA TACACS+ サーバ グループの VRF リファレンスを設定します。

ステップ 13

ip tacacs source-interface subinterface-name

例:

Switch (config-sg-tacacs+)# ip tacacs source-interface subinterface-name

すべての発信 TACACS+ パケットに対して、指定されたインターフェイスの IP アドレスを使用します。

ステップ 14

exit

例:

Switch (config-sg-tacacs)# exit

server-group コンフィギュレーション モードを終了します。

次の例で、per-VRF TACACS+ の設定に必要なすべての手順をリストします。
Switch> enable
Switch# configure terminal
Switch (config)# vrf definition cisco
Switch (config-vrf)# rd 100:1
Switch (config-vrf)# exit
Switch (config)# interface Loopback0
Switch (config-if)# vrf forwarding cisco
Switch (config-if)# ip address 10.0.0.2 255.0.0.0
Switch (config-if)# exit
Switch (config-sg-tacacs+)# vrf forwarding cisco
Switch (config-sg-tacacs+)# ip tacacs source-interface Loopback0
Switch (config-sg-tacacs)# exit

VPN ルーティング セッションの設定

手順

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

router ospf process-id vrf vrf-name

例:

Switch(config)# router ospf process-id vrf vrf-name

OSPF ルーティングを有効にし、VPN 転送テーブルを指定して、ルータ コンフィギュレーション モードを開始します。

ステップ 3

capability vrf-lite

例:

Switch(config-router)# capability vrf-lite
ステップ 4

log-adjacency-changes

例:

Switch(config-router)# log-adjacency-changes 

(任意)隣接状態(デフォルト)の変更を記録します。

ステップ 5

redistribute bgp autonomous-system-number subnets

例:

Switch(config-router)# redistribute bgp autonomous-system-number subnets

BGP ネットワークから OSPF ネットワークに情報を再配布するようにスイッチを設定します。

ステップ 6

network network-number area area-id

例:

Switch(config-router)# network network-number area area-id

OSPF が動作するネットワーク アドレスとマスク、およびそのネットワーク アドレスのエリア ID を定義します。

ステップ 7

end

例:

Switch(config-router)# end

特権 EXEC モードに戻ります。

ステップ 8

show ip ospf process-id

例:

Switch# show ip ospf process-id 

OSPF ネットワークの設定を確認します。

ステップ 9

copy running-config startup-config

例:

Switch# copy running-config startup-config

(任意)コンフィギュレーション ファイルに設定を保存します。

VPN 転送テーブルと OSPF ルーティングプロセスの関連付けを解除するには、no router ospf process-id vrf vrf-name グローバル コンフィギュレーション コマンドを使用します。

Switch(config)# vrf definition VRF-RED 
Switch(config-vrf)# rd 1:1 
Switch(config-vrf)# exit 
Switch(config)# router eigrp virtual-name
Switch(config-router)# address-family ipv4 vrf VRF-RED autonomous-system 1
Switch(config-router-af)# network 10.0.0.0 0.0.0.255
Switch(config-router-af)# topology base
Switch(config-router-topology)# default-metric 10000 100 255 1 1500 
Switch(config-router-topology)# exit-af-topology
Switch(config-router-af)# exit-address-family

BGP PE/CE ルーティング セッションの設定

手順

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

router bgp autonomous-system-number

例:

Switch(config)# router bgp autonomous-system-number

その他の BGP ルータに渡された AS 番号で BGP ルーティング プロセスを設定し、ルータ コンフィギュレーション モードを開始します。

ステップ 3

network network-number mask network-mask

例:

Switch(config-router)# network network-number mask network-mask

BGP を使用してアナウンスするネットワークおよびマスクを指定します。

ステップ 4

redistribute ospf process-id match internal

例:

Switch(config-router)# redistribute ospf process-id match internal

OSPF 内部ルートを再配布するようにスイッチを設定します。

ステップ 5

network network-number area area-id

例:

Switch(config-router)# network network-number area area-id 

OSPF が動作するネットワーク アドレスとマスク、およびそのネットワーク アドレスのエリア ID を定義します。

ステップ 6

address-family ipv4 vrf vrf-name

例:

Switch(config-router-af)# address-family ipv4 vrf vrf-name

PE から CE のルーティング セッションの BGP パラメータを定義し、VRF アドレス ファミリ モードを開始します。

ステップ 7

neighbor address remote-as as-number

例:

Switch(config-router-af)# neighbor address remote-as as-number

PE と CE ルータの間の BGP セッションを定義します。

ステップ 8

neighbor address activate

例:

Switch(config-router-af)# neighbor address activate 

IPv4 アドレス ファミリのアドバタイズメントをアクティブ化します。

ステップ 9

end

例:

Switch(config-router-af)# end

特権 EXEC モードに戻ります。

ステップ 10

show ip bgp [ipv4] [neighbors]

例:

Switch# show ip bgp [ipv4] [neighbors] 

BGP 設定を確認します。

BGP ルーティングプロセスを削除するには、no router bgp autonomous-system-number グローバル コンフィギュレーション コマンドを使用します。ルーティング特性を削除するには、コマンドにキーワードを指定してこのコマンドを使用します。

IPv4 VRF の設定

手順

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

ip routing

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 3

vrf definitionvrf-name

例:

Switch(config)# vrf definition vrf-name

VRF 名を指定し、VRF コンフィギュレーション モードを開始します。

ステップ 4

rd route-distinguisher

例:

Switch(config-vrf)# rd route-distinguisher

ルート識別子を指定して VRF テーブルを作成します。自律システム番号と任意の数値(xxx:y)、または IP アドレスと任意の数値(A.B.C.D:y)のいずれかを入力します。

ステップ 5

route-target {export | import | both} route-target-ext-community

例:

Switch(config-vrf)# route-target {export | import | both} route-target-ext-community

指定された VRF のインポート、エクスポート、またはインポートおよびエクスポート ルート ターゲット コミュニティのリストを作成します。AS システム番号と任意の番号(xxx:y)または IP アドレスと任意の番号(A.B.C.D:y)を入力します。

(注)   

このコマンドは、BGP が動作している場合にのみ有効です。

ステップ 6

import map ルート マップ

例:

Switch(config-vrf)# import map route-map

(任意)VRF にルート マップを対応付けます。

ステップ 7

interface interface-id

例:

Switch(config-vrf)# interface interface-id

インターフェイス コンフィギュレーション モードを開始して、VRF に対応付けるレイヤ 3 インターフェイスを指定します。インターフェイスにはルーテッド ポートまたは SVI を設定できます。

ステップ 8

vrf forwarding vrf-name

例:

Switch(config-if)# vrf forwarding vrf-name

VRF をレイヤ 3 インターフェイスに対応付けます。

ステップ 9

end

例:

Switch(config-if)# end

特権 EXEC モードに戻ります。

ステップ 10

show ip vrf [brief | detail | interfaces] [vrf-name]

例:

Switch# show ip vrf [brief | detail | interfaces] [vrf-name]

設定を確認します。設定した VRF に関する情報を表示します。

ステップ 11

copy running-config startup-config

例:

Switch# copy running-config startup-config

(任意)コンフィギュレーション ファイルに設定を保存します。

(注)   

次のコマンドの完全な構文と使用方法については、このリリースに対応するスイッチ コマンド リファレンスおよび『Cisco IOS Switching Services Command Reference』を参照してください。

VRF とそのすべてのインターフェイスを削除するには、no vrf definitionvrf-name グローバル コンフィギュレーション コマンドを使用します。VRF からインターフェイスを削除するには、no vrf forwarding インターフェイス コンフィギュレーション コマンドを使用します。

IPv6 用の VRF-Lite の設定

VRF 認識サービスの設定

IPv6 サービスは、グローバルなインターフェイス上と、グローバルなルーティング インスタンス内で設定できます。IPv6 サービスは複数のルーティング インスタンス上で稼働するように拡張されます。これが、VRF 認識です。システム内の任意の設定済み VRF であればいずれも、VRF 認識サービス用に指定できます。

VRF 認識サービスは、プラットフォームから独立したモジュールに実装されています。VRF は、Cisco IOS 内の複数のルーティング インスタンスを提供します。各プラットフォームには、サポートする VRF 数に関して独自の制限があります。

VRF 認識サービスには、次の特性があります。

  • ユーザは、ユーザ指定の VRF 内のホストに ping を実行できます。

  • ネイバー探索エントリは、個別の VRF で学習されます。ユーザは、特定の VRF のネイバー探索(ND)エントリを表示できます。

次のサービスは VRF 認識です。
  • Ping

  • ユニキャスト RPF(uRPF)

  • traceroute

  • FTP および TFTP

  • [Telnet および SSH(Telnet and SSH)]

  • NTP

PING のユーザ インターフェイスの設定

VRF 認識 ping を設定するには、次の作業を実行します。

手順

コマンドまたはアクション 目的

ping vrf vrf-name ipv6-host

例:

Switch# ping vrf vrf-name ipv6-host

指定された VRF で、IPv6 ホストまたはアドレスに対して ping を実行します。

uRPF のユーザ インターフェイスの設定

VRF に割り当てられているインターフェイス上で、uRPF を設定できます。送信元の検索が VRF テーブルで実行されます。

手順の概要

  1. configure terminal
  2. interface interface-id
  3. no switchport
  4. vrf forwarding vrf-name
  5. ipv6 address ip-addresssubnet-mask
  6. ipv6 verify unicast source reachable-via rx allow-default
  7. end

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

interface interface-id

例:

Switch (config)# interface interface-id

インターフェイス コンフィギュレーション モードを開始し、設定するレイヤ 3 インターフェイスを指定します。

ステップ 3

no switchport

例:

Switch (config-if)# no switchport

レイヤ 2 コンフィギュレーション モードからインターフェイスを削除します(物理インターフェイスの場合)。

ステップ 4

vrf forwarding vrf-name

例:

Switch (config-if)# vrf forwarding vrf-name

インターフェイス上で VRF を設定します。

ステップ 5

ipv6 address ip-addresssubnet-mask

例:

Switch (config-if)# ip address ip-address mask

インターフェイスの IPv6 アドレスを入力します。

ステップ 6

ipv6 verify unicast source reachable-via rx allow-default

例:

Switch(config-if)# ipv6 verify unicast source reachable-via 
rx allow-default

インターフェイス上で uRPF を有効にします。

ステップ 7

end

例:

Switch(config-if)# end

特権 EXEC モードに戻ります。

Traceroute のユーザ インターフェイスの設定

手順の概要

  1. traceroute vrf vrf-name ipv6address

手順の詳細

コマンドまたはアクション 目的

traceroute vrf vrf-name ipv6address

例:

Switch# traceroute vrf vrf-name ipv6address

宛先アドレスを取得する VPN VRF の名前を指定します。

Telnet および SSH のユーザ インターフェイスの設定

手順の概要

  1. telnet ipv6-address/ vrf vrf-name
  2. ssh -l username -vrf vrf-name ipv6-host

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

telnet ipv6-address/ vrf vrf-name

例:

Switch# telnet ipv6-address/vrf vrf-name

指定された VRF で、IPv6 ホストまたはアドレスに Telnet 経由で接続します。

ステップ 2

ssh -l username -vrf vrf-name ipv6-host

例:

Switch# ssh -l username -vrf  vrf-name ipv6-host

指定された VRF で、IPv6 ホストまたはアドレスに SSH 経由で接続します。

NTP のユーザ インターフェイスの設定

手順の概要

  1. configure terminal
  2. ntp server vrf vrf-name ipv6-host
  3. ntp peer vrf vrf-name ipv6-host

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:


# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

ntp server vrf vrf-name ipv6-host

例:

(config)# ntp server vrf vrf-name ipv6-host

指定された VRF で NTP サーバを設定します。

ステップ 3

ntp peer vrf vrf-name ipv6-host

例:

(config)# ntp peer vrf vrf-name ipv6-host

指定された VRF で NTP ピアを設定します。

IPv6 VRF の設定

手順の概要

  1. configure terminal
  2. vrf definition vrf-name
  3. rd route-distinguisher
  4. address-family ipv4 | ipv6
  5. route-target {export | import | both} route-target-ext-community
  6. exit-address-family
  7. vrf definition vrf-name
  8. ipv6 multicast multitopology
  9. address-family ipv6 multicast
  10. end

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

vrf definition vrf-name

例:

Switch(config)# vrf definition vrf-name

VRF 名を指定し、VRF コンフィギュレーション モードを開始します。

ステップ 3

rd route-distinguisher

例:

Switch(config-vrf)# rd route-distinguisher

(任意)ルート識別子を指定して VRF テーブルを作成します。自律システム番号および任意の数(xxx:y)、または IP アドレスおよび任意の数(A.B.C.D:y)のいずれかを入力します。

ステップ 4

address-family ipv4 | ipv6

例:

Switch(config-vrf)# address-family ipv4 | ipv6

(任意)デフォルトは IPv4 です。IPv6 の必須設定。

ステップ 5

route-target {export | import | both} route-target-ext-community

例:

Switch(config-vrf)# route-target {export | import | both} route-target-ext-community

指定された VRF のインポート、エクスポート、またはインポートおよびエクスポート ルート ターゲット コミュニティのリストを作成します。AS システム番号と任意の番号(xxx:y)または IP アドレスと任意の番号(A.B.C.D:y)を入力します。

(注)   

このコマンドは、BGP が動作している場合にのみ有効です。

ステップ 6

exit-address-family

例:

Switch(config-vrf)# exit-address-family

VRF アドレス ファミリ コンフィギュレーション モードを終了し、VRF コンフィギュレーション モードに戻ります。

ステップ 7

vrf definition vrf-name

例:

Switch(config)# vrf definition vrf-name

VRF コンフィギュレーション モードを開始します。

ステップ 8

ipv6 multicast multitopology

例:

Switch(config-vrf-af)# ipv6 multicast multitopology

マルチキャスト固有の RPF トポロジを有効にします。

ステップ 9

address-family ipv6 multicast

例:

Switch(config-vrf)# address-family ipv6 multicast

マルチキャスト IPv6 アドレス ファミリを入力します。

ステップ 10

end

例:

Switch(config-vrf-af)# end

特権 EXEC モードに戻ります。

次に、VRF を設定する例を示します。


Switch(config)#  vrf definition red
Switch(config-vrf)# rd 100:1 
Switch(config-vrf)# address family ipv6
Switch(config-vrf-af)# route-target both 200:1
Switch(config-vrf)# exit-address-family
Switch(config-vrf)# vrf definition red
Switch(config-if)# ipv6 multicast multitopology
Switch(config-if)# address-family ipv6 multicast
Switch(config-vrf-af)# end
Switch#

定義済み VRF へのインターフェイスの関連付け

手順の概要

  1. interface interface-id
  2. no switchport
  3. vrf forwarding vrf-name
  4. ipv6 enable
  5. ipv6 address ip-address subnet-mask
  6. show ipv6 vrf [brief | detail | interfaces] [vrf-name]
  7. copy running-config startup-config

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

interface interface-id

例:

Switch(config-vrf)# interface interface-id

インターフェイス コンフィギュレーション モードを開始して、VRF に対応付けるレイヤ 3 インターフェイスを指定します。インターフェイスにはルーテッド ポートまたは SVI を設定できます。

ステップ 2

no switchport

例:

Switch(config-if)# no switchport

コンフィギュレーション モードからインターフェイスを削除します(物理インターフェイスの場合)。

ステップ 3

vrf forwarding vrf-name

例:

Switch(config-if)# vrf forwarding vrf-name

VRF をレイヤ 3 インターフェイスに対応付けます。

ステップ 4

ipv6 enable

例:

Switch(config-if)# ipv6 enable

インターフェイスで IPv6 を有効にします。

ステップ 5

ipv6 address ip-address subnet-mask

例:

Switch(config-if)# ipv6 address ip-address subnet-mask

インターフェイスの IPv6 アドレスを入力します。

ステップ 6

show ipv6 vrf [brief | detail | interfaces] [vrf-name]

例:

Switch# show ipv6 vrf [brief | detail | interfaces] [vrf-name]

設定を確認します。設定した VRF に関する情報を表示します。

ステップ 7

copy running-config startup-config

例:

Switch# copy running-config startup-config

(任意)コンフィギュレーション ファイルに設定を保存します。

次に、インターフェイスを VRF に関連付ける例を示します。
Switch(config-vrf)# interface ethernet0/1
Switch(config-if)# vrf forwarding red
Switch(config-if)# ipv6 enable
Switch(config-if)# ipv6 address 5000::72B/64

ルーティング プロトコル経由での VRF へのルートの入力

VRF スタティック ルートの設定

手順の概要

  1. configure terminal
  2. ipv6 route [vrf vrf-name] ipv6-prefix/prefix-length {ipv6-address | interface-type interface-number [ipv6-address]}

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

ipv6 route [vrf vrf-name] ipv6-prefix/prefix-length {ipv6-address | interface-type interface-number [ipv6-address]}

例:

Switch(config)# ipv6 route [vrf vrf-name] ipv6-prefix/prefix-length {ipv6-address | interface-type interface-number [ipv6-address]}

VRF に固有のスタティック ルートを設定します。

Switch(config)# ipv6 route vrf v6a 7000::/64 TenGigabitEthernet32 4000::2

OSPFv3 ルータ プロセスの設定

手順の概要

  1. configure terminal
  2. router ospfv3 process-id
  3. area area-ID [default-cot | nssa | stub]
  4. router-id router-id
  5. address-family ipv6 unicast vrf vrf-name
  6. redistribute source-protocol [process-id] options
  7. end

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

router ospfv3 process-id

例:

Switch(config)# router ospfv3 process-id

IPv6 アドレス ファミリの OSPFv3 ルータ コンフィギュレーション モードを有効にします。

ステップ 3

area area-ID [default-cot | nssa | stub]

例:

Switch(config-router)# area area-ID [default-cot | nssa | stub]

OSPFv3 エリアを設定します。

ステップ 4

router-id router-id

例:

Switch(config-router)# router-id router-id

固定ルータ ID を使用します。

ステップ 5

address-family ipv6 unicast vrf vrf-name

例:

Switch(config-router)# address-family ipv6 unicast vrf vrf-name

vrf vrf-name の OSPFv3 の IPv6 アドレス ファミリ コンフィギュレーション モードを開始します。

ステップ 6

redistribute source-protocol [process-id] options

例:

Switch(config-router)# redistribute source-protocol [process-id] options

あるルーティング ドメインから別のルーティング ドメインへ IPv6 ルートを再配布します。

ステップ 7

end

例:

Switch(config-router)# end

特権 EXEC モードに戻ります。

次に、OSPFv3 ルータ プロセスを設定する例を示します。
Switch(config-router)# router ospfv3 1
Switch(config-router)# router-id 1.1.1.1
Switch(config-router)# address-family ipv6 unicast
Switch(config-router-af)# exit-address-family

インターフェイス上での OSPFv3 の有効化

手順の概要

  1. configure terminal
  2. interface type-number
  3. ospfv3 process-id area area-id ipv6 [ instance instance-id]
  4. end

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

interface type-number

例:

Switch(config-vrf)# interface type-number

インターフェイスのタイプと番号を指定し、スイッチをインターフェイス コンフィギュレーション モードにします。

ステップ 3

ospfv3 process-id area area-id ipv6 [ instance instance-id]

例:

Switch(config-if)# ospfv3 process-id area area-ID ipv6 [instance instance-id]

IPv6 AF を設定したインターフェイスで OSPFv3 を有効にします。

ステップ 4

end

例:

Switch(config-if)# end

特権 EXEC モードに戻ります。

次に、インターフェイス上で OSPFv3 を有効にする例を示します。
Switch(config)# interface GigabitEthernet2/1
Switch(config-if)# no switchport
Switch(config-if)# ipv6 address 4000::2/64
Switch(config-if)# ipv6 enable
Switch(config-if)# ipv6 ospf 1 area 0
Switch(config-if)# end

EIGRPv6 ルーティング プロセスの設定

手順の概要

  1. configure terminal
  2. router eigrp virtual-instance-name
  3. address-family ipv6 vrf vrf-name autonomous-system autonomous-system-number
  4. topology {base | topology-name tid number
  5. exit-aftopology
  6. eigrp router-id ip-address
  7. end

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

router eigrp virtual-instance-name

例:

Switch(config)# router eigrp virtual-instance-name

EIGRP ルーティング プロセスを設定し、ルータ コンフィギュレーション モードを開始します。

ステップ 3

address-family ipv6 vrf vrf-name autonomous-system autonomous-system-number

例:

Switch(config-router)# address-family ipv6 vrf vrf-name autonomous-system autonomous-system-number

EIGRP IPv6 VRF-Lite を有効にし、アドレス ファミリ コンフィギュレーション モードを開始します。

ステップ 4

topology {base | topology-name tid number

例:

Switch(config-router-af)# topology {base | topology-name tid number

指定されたトポロジ インスタンスで IP トラフィックをルーティングするよう EIGRP プロセスを設定し、アドレス ファミリ トポロジ コンフィギュレーション モードを開始します。

ステップ 5

exit-aftopology

例:

Switch(config-router-af-topology)# exit-aftopology

アドレス ファミリ トポロジ コンフィギュレーション モードを終了します。

ステップ 6

eigrp router-id ip-address

例:

Switch(config-router)# eigrp router-id ip-address

固定ルータ ID の使用を有効にします。

ステップ 7

end

例:

Switch(config-router)# end

ルータ コンフィギュレーション モードを終了します。

次に、EIGRP ルーティング プロセスを設定する例を示します。

Switch(config)# router eigrp test
Switch(config-router)# address-family ipv6 unicast vrf b1 autonomous-system 10
Switch(config-router-af)# topology base
Switch(config-router-af-topology)# exit-af-topology
Switch(config-router)# eigrp router-id 2.3.4.5
Switch(config-router)# exit-address-family

EBGPv6 ルーティング プロセスの設定

手順の概要

  1. configure terminal
  2. router bgp as-number
  3. neighbor peer-group-name peer-group
  4. neighbor {ip-address | ipv6-address[%] | peer-group-name} remote-as autonomous-system-number [ alternate-as autonomous-system-number ...]
  5. address-family ipv6 [ vrf vrf-name] [unicast | multicast | vpnv6]
  6. neighbor ipv6-address peer-group peer-group-name
  7. neighbor {ip-address | peer-group-name | ipv6-address[%]} route-map map-name {in | out}
  8. exit

手順の詳細

  コマンドまたはアクション 目的
ステップ 1

configure terminal

例:

Switch# configure terminal

グローバル コンフィギュレーション モードを開始します。

ステップ 2

router bgp as-number

例:

Switch(config)# router bgp as-number

指定したルーティング プロセスのルータ コンフィギュレーション モードを開始します。

ステップ 3

neighbor peer-group-name peer-group

例:

Switch(config-router)# neighbor peer-group-name peer-group

マルチプロトコル BGP ピア グループを作成します。

ステップ 4

neighbor {ip-address | ipv6-address[%] | peer-group-name} remote-as autonomous-system-number [ alternate-as autonomous-system-number ...]

例:

Switch(config-router)# neighbor {ip-address | ipv6-address[%] | peer-group-name}remote-as autonomous-system-number [alternate-as autonomous-system-number ...]

指定した自律システム内のネイバーの IPv6 アドレスを、ローカル ルータの IPv6 マルチプロトコル BGP ネイバーテーブルに追加します。

ステップ 5

address-family ipv6 [ vrf vrf-name] [unicast | multicast | vpnv6]

例:

Switch(config-router)# address-family ipv6 [vrf vrf-name] [unicast | multicast | vpnv6]

IPv6 アドレス ファミリを指定し、アドレス ファミリ コンフィギュレーション モードを開始します。

  • unicast キーワードは、IPv6 ユニキャスト アドレス ファミリを指定します。デフォルトでは、address-family ipv6 コマンドでユニキャスト キーワードが指定されていない場合、スイッチは IPv6 ユニキャスト アドレス ファミリのコンフィギュレーション モードになります。

  • multicast キーワードは、IPv6 マルチキャスト アドレス プレフィックスを指定します。

ステップ 6

neighbor ipv6-address peer-group peer-group-name

例:

Switch(config-router-af)# neighbor ipv6-address peer-group peer-group-name

BGP ネイバーの IPv6 アドレスをピア グループに割り当てます。

ステップ 7

neighbor {ip-address | peer-group-name | ipv6-address[%]} route-map map-name {in | out}

例:

Switch(config-router-af)# neighbor {ip-address | peer-group-name | ipv6-address[%]}route-map map-name {in | out}

着信ルートまたは発信ルートにルート マップを適用します。ルート マップへの変更は、ピアリングがリセットされるまで、またはソフト リセットが実行されるまで、現在のピアでは有効になりません。soft キーワードと in キーワードを指定して clear bgp ipv6 コマンドを使用すると、ソフト リセットが実行されます。

ステップ 8

exit

例:

Switch(config-router-af)# exit

アドレス ファミリ コンフィギュレーション モードを終了し、ルータをルータ コンフィギュレーション モードに戻します。

次に、EBRPv6 を設定する例を示します。

Switch(config)# router bgp 2
Switch(config-router)# bgp router-id 2.2.2.2
Switch(config-router)# bgp log-neighbor-changes
Switch(config-router)# no bgp default ipv4-unicast
Switch(config-router)# neighbor 2500::1 remote-as 1
Switch(config-router)# neighbor 4000::2 remote-as 3
Switch(config-router)# address-family ipv6 vrf b1
Switch(config-router-af)# network 2500::/64
Switch(config-router-af)# network 4000::/64
Switch(config-router-af)# neighbor 2500::1 remote-as 1
Switch(config-router-af)# neighbor 2500::1 activate
Switch(config-router-af)# neighbor 4000::2 remote-as 3
Switch(config-router-af)# neighbor 4000::2 activate
Switch(config-router-af)# exit-address-family

VRF-Lite に関する追加情報

IPv4 と IPv6 間での VPN の共存

IPv4 を設定するための「以前の」CLI と、IPv6 用の「新しい」CLI 間には下位互換性があります。つまり、設定に両方の CLI を含めることができます。IPv4 CLI は、同じインターフェイス上で、VRF 内で定義されている IP アドレスとともにグローバル ルーティング テーブルで定義されている IPv6 アドレスも備える機能を保持しています。

次に例を示します。
vrf definition red
 rd 100:1 
 address family ipv6
 route-target both 200:1 
 exit-address-family
!
ip vrf blue
 rd 200:1 
 route-target both 200:1
!
interface Ethernet0/0
 vrf forwarding red
 ip address 50.1.1.2 255.255.255.0
 ipv6 address 4000::72B/64
!
interface Ethernet0/1
 vrf forwarding blue
 ip address 60.1.1.2 255.255.255.0
 ipv6 address 5000::72B/64

この例では、Ethernet0/0 用に定義されたすべてのアドレス(v4 と v6)が VRF red を参照します。Ethernet0/1 については、IP アドレスは VRF blue を参照しますが、ipv6 アドレスはグローバル IPv6 アドレス ルーティング テーブルを参照します。

VRF-Lite 設定の確認

IPv4 VRF-Lite ステータスの表示

VRF-Lite の設定およびステータスに関する情報を表示するには、次の作業のいずれかを行います。

コマンド

目的

Switch# show ip protocols vrf vrf-name 

VRF に対応付けられたルーティング プロトコル情報を表示します。

Switch# show ip route vrf vrf-name [connected] [protocol
[as-number]] [list] [mobile] [odr] [profile] [static] [summary][supernets-only] 

VRF に対応付けられた IP ルーティング テーブル情報を表示します。

Switch# show ip vrf [brief | detail | interfaces] [vrf-name]  

定義された VRF インスタンスに関する情報を表示します。

Switch# bidir vrf instance-name a.b.c.d | active | bidriectional| count | interface | proxy | pruned | sparse | ssm | static | summary 

定義された VRF インスタンスに関する情報を表示します。

次に、VRF インスタンス内のマルチキャスト ルート テーブル情報を表示する例を示します。
Switch# show ip mroute 226.0.0.2 
IP Multicast Routing Table
Flags: S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
       L - Local, P - Pruned, R - RP-bit set, F - Register flag,
       T - SPT-bit set, J - Join SPT, M - MSDP created entry, E - Extranet,
       X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
       U - URD, I - Received Source Specific Host Report,
       Z - Multicast Tunnel, z - MDT-data group sender,
       Y - Joined MDT-data group, y - Sending to MDT-data group,
       G - Received BGP C-Mroute, g - Sent BGP C-Mroute,
       N - Received BGP Shared-Tree Prune, n - BGP C-Mroute suppressed,
       Q - Received BGP S-A Route, q - Sent BGP S-A Route,
       V - RD & Vector, v - Vector, p - PIM Joins on route,
       x - VxLAN group, c - PFP-SA cache created entry
Outgoing interface flags: H - Hardware switched, A - Assert winner, p - PIM Join
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
 
(*, 226.0.0.2), 00:01:17/stopped, RP 1.11.1.1, flags: SJCF
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    Vlan100, Forward/Sparse, 00:01:17/00:02:36
 
(5.0.0.11, 226.0.0.2), 00:01:17/00:01:42, flags: FT
  Incoming interface: Vlan5, RPF nbr 0.0.0.0
  Outgoing interface list:
    Vlan100, Forward/Sparse, 00:01:17/00:02:36

IPv6 VRF-Lite ステータスの表示

VRF-Lite の設定およびステータスに関する情報を表示するには、次の作業のいずれかを行います。

コマンド

目的

VRF に対応付けられたルーティング プロトコル情報を表示します。

Switch# show ipv6 mfib vrf instance-name a.b.c.d | active | all | count | linkscope| route | summary | update-sets | verbose 

定義された VRF インスタンスに関する情報を表示します。

次に、VRF インスタンス内のマルチキャスト ルート テーブル情報を表示する例を示します。
show ipv6 mroute vrf vrf1 FF05:ABCD:0:0:0:0:0:1 
Multicast Routing Table
Flags: S - Sparse, B - Bidir Group, s - SSM Group,
C - Connected, L - Local, I - Received Source Specific Host Report,
P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set,
J - Join SPT, Y - Joined MDT-data group,
y - Sending to MDT-data group

g - BGP signal originated, G - BGP Signal received,
N - BGP Shared-Tree Prune received, n - BGP C-Mroute suppressed,
q - BGP Src-Active originated, Q - BGP Src-Active received
E - Extranet
Timers: Uptime/Expires
Interface state: Interface, State

(*, FF05:ABCD::1), 00:06:22/never, RP 1010:ABCD::10, flags: SCJ
Incoming interface: Port-channel33
RPF nbr: FE80::2E31:24FF:FE06:134A
Immediate Outgoing interface list:
TenGigabitEthernet4/0/18, Forward, 00:06:22/never

(3232:ABCD::2, FF05:ABCD::1), 00:04:54/00:02:16, flags: SJT
Incoming interface: Port-channel33
RPF nbr: FE80::2E31:24FF:FE06:134A
Inherited Outgoing interface list:
TenGigabitEthernet4/0/18, Forward, 00:06:22/never
次に、show ipv6 mfib コマンドの出力例を示します。
Switch# show ipv6 mfib vrf vrf1 FF05:ABCD:0:0:0:0:0:1 
Entry Flags:    C - Directly Connected, S - Signal, IA - Inherit A flag,
                ET - Data Rate Exceeds Threshold, K - Keepalive
                DDE - Data Driven Event, HW - Hardware Installed
                ME - MoFRR ECMP entry, MNE - MoFRR Non-ECMP entry, MP - MFIB 
                MoFRR Primary, RP - MRIB MoFRR Primary, P - MoFRR Primary
                MS  - MoFRR  Entry in Sync, MC - MoFRR entry in MoFRR Client.
I/O Item Flags: IC - Internal Copy, NP - Not platform switched,
                NS - Negate Signalling, SP - Signal Present,
                A - Accept, F - Forward, RA - MRIB Accept, RF - MRIB Forward,
                MA - MFIB Accept, A2 - Accept backup,
                RA2 - MRIB Accept backup, MA2 - MFIB Accept backup

Forwarding Counts: Pkt Count/Pkts per second/Avg Pkt Size/Kbits per second
Other counts:      Total/RPF failed/Other drops
I/O Item Counts:   FS Pkt Count/PS Pkt Count
VRF testvrf1
 (*,FF05:ABCD::1) Flags: C HW
   SW Forwarding: 0/0/0/0, Other: 0/0/0
   HW Forwarding:   295/0/512/0, Other: 0/0/0
   Port-channel33 Flags: A NS
   TenGigabitEthernet4/0/18 Flags: F NS
     Pkts: 0/0
 (3232:ABCD::2,FF05:ABCD::1) Flags: HW
   SW Forwarding: 50/0/512/0, Other: 111/0/111
   HW Forwarding:   4387686/14849/512/59398, Other: 0/0/0
   Port-channel33 Flags: A
   TenGigabitEthernet4/0/18 Flags: F NS
     Pkts: 0/50

Switch#

VRF-Lite の設定例

IPv4 VRF-Lite の設定例

VPN1、VPN2、およびグローバル ネットワークで使用されるプロトコルは OSPF です。CE/PE 接続には BGP が使用されます。後続のコマンド例では、CE スイッチ S8 を設定する方法が示されており、スイッチ S20 と S11 の VRF 設定、およびスイッチ S8 のトラフィックに関連する PE ルータコマンドが含まれています。その他のスイッチの設定のコマンドは含まれていませんが、類似したものになります。

図 2. VRF-Lite の設定例


スイッチ S8 の設定

スイッチ S8 上のルーティングを有効にし、VRF を設定します。
Switch# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)# ip routing 
Switch(config)# ip vrf v11
Switch(config-vrf)# rd 800:1
Switch(config-vrf)# route-target export 800:1
Switch(config-vrf)# route-target import 800:1
Switch(config-vrf)# exit
Switch(config)# ip vrf v12
Switch(config-vrf)# rd 800:2
Switch(config-vrf)# route-target export 800:2
Switch(config-vrf)# route-target import 800:2
Switch(config-vrf)# exit
スイッチ S8 上でループバックおよび物理インターフェイスを設定します。ファスト イーサネット インターフェイス 3/5 は、PE へのトランク接続です。インターフェイス 3/7 および 3/11 は、VPN に接続します。
Switch(config)# interface loopback1
Switch(config-if)# vrf forwarding v11
Switch(config-if)# ip address 8.8.1.8 255.255.255.0
Switch(config-if)# exit

Switch(config)# interface loopback2
Switch(config-if)# vrf forwarding v12
Switch(config-if)# ip address 8.8.2.8 255.255.255.0
Switch(config-if)# exit

Switch(config)# interface FastEthernet3/5
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# no ip address
Switch(config-if)# exit

Switch(config)# interface FastEthernet3/8
Switch(config-if)# switchport access vlan 208
Switch(config-if)# no ip address
Switch(config-if)# exit

Switch(config)# interface FastEthernet3/11
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk
Switch(config-if)# no ip address
Switch(config-if)# exit
スイッチ S8 上で使用される VLAN を設定します。VLAN 10 は、CE と PE 間の VRF 11 によって使用されます。VLAN 20 は、CE と PE 間の VRF 12 によって使用されます。VLAN 118 および 208 は、それぞれスイッチ S11 およびスイッチ S20 を含む VPN の VRF に使用されます。
Switch(config)# interface Vlan10
Switch(config-if)# vrf forwarding v11
Switch(config-if)# ip address 38.0.0.8 255.255.255.0
Switch(config-if)# exit

Switch(config)# interface Vlan20
Switch(config-if)# vrf forwarding v12
Switch(config-if)# ip address 83.0.0.8 255.255.255.0
Switch(config-if)# exit

Switch(config)# interface Vlan118
Switch(config-if)# vrf forwarding v12
Switch(config-if)# ip address 118.0.0.8 255.255.255.0
Switch(config-if)# exit

Switch(config)# interface Vlan208
Switch(config-if)# vrf forwarding v11
Switch(config-if)# ip address 208.0.0.8 255.255.255.0
Switch(config-if)# exit
VPN1 および VPN2 に OSPF ルーティングを設定します。
Switch(config)# router ospf 1 vrf vl1
Switch(config-router)# redistribute bgp 800 subnets
Switch(config-router)# network 208.0.0.0 0.0.0.255 area 0
Switch(config-router)# exit 
Switch(config)# router ospf 2 vrf vl2
Switch(config-router)# redistribute bgp 800 subnets
Switch(config-router)# network 118.0.0.0 0.0.0.255 area 0
Switch(config-router)# exit 
CE から PE のルーティングに BGP を設定します。
Switch(config)# router bgp 800
Switch(config-router)# address-family ipv4 vrf vl2
Switch(config-router-af)# redistribute ospf 2 match internal
Switch(config-router-af)# neighbor 83.0.0.3 remote-as 100
Switch(config-router-af)# neighbor 83.0.0.3 activate
Switch(config-router-af)# network 8.8.2.0 mask 255.255.255.0
Switch(config-router-af)# exit 

Switch(config-router)# address-family ipv4 vrf vl1
Switch(config-router-af)# redistribute ospf 1 match internal
Switch(config-router-af)# neighbor 38.0.0.3 remote-as 100
Switch(config-router-af)# neighbor 38.0.0.3 activate
Switch(config-router-af)# network 8.8.1.0 mask 255.255.255.0
Switch(config-router-af)# end 

スイッチ S20 の設定

CE に接続するように S20 を設定します。
Switch# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)# ip routing 
Switch(config)# interface Fast Ethernet 0/7
Switch(config-if)# no switchport
Switch(config-if)# ip address 208.0.0.20 255.255.255.0
Switch(config-if)# exit

Switch(config)# router ospf 101
Switch(config-router)# network 208.0.0.0 0.0.0.255 area 0
Switch(config-router)# end 

スイッチ S11 の設定

CE に接続するように S11 を設定します。
Switch# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)# ip routing 
Switch(config)# interface Gigabit Ethernet 0/3
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# switchport mode trunk 
Switch(config-if)# no ip address
Switch(config-if)# exit

Switch(config)# interface Vlan118
Switch(config-if)# ip address 118.0.0.11 255.255.255.0
Switch(config-if)# exit

Switch(config)# router ospf 101
Switch(config-router)# network 118.0.0.0 0.0.0.255 area 0
Switch(config-router)# end 

PE スイッチ S3 の設定

スイッチ S3(ルータ)上では、次のコマンドはスイッチ S8 への接続だけを設定します。
Router# configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# ip vrf v1
Router(config-vrf)# rd 100:1
Router(config-vrf)# route-target export 100:1
Router(config-vrf)# route-target import 100:1
Router(config-vrf)# exit

Router(config)# ip vrf v2
Router(config-vrf)# rd 100:2
Router(config-vrf)# route-target export 100:2
Router(config-vrf)# route-target import 100:2
Router(config-vrf)# exit

Router(config)# ip cef
Router(config)# interface Loopback1
Router(config-if)# vrf forwarding v1
Router(config-if)# ip address 3.3.1.3 255.255.255.0
Router(config-if)# exit

Router(config)# interface Loopback2
Router(config-if)# vrf forwarding v2
Router(config-if)# ip address 3.3.2.3 255.255.255.0
Router(config-if)# exit

Router(config)# interface Fast Ethernet3/0.10
Router(config-if)# encapsulation dot1q 10
Router(config-if)# vrf forwarding v1
Router(config-if)# ip address 38.0.0.3 255.255.255.0
Router(config-if)# exit

Router(config)# interface Fast Ethernet3/0.20
Router(config-if)# encapsulation dot1q 20
Router(config-if)# vrf forwarding v2
Router(config-if)# ip address 83.0.0.3 255.255.255.0
Router(config-if)# exit

Router(config)# router bgp 100
Router(config-router)# address-family ipv4 vrf v2
Router(config-router-af)# neighbor 83.0.0.8 remote-as 800
Router(config-router-af)# neighbor 83.0.0.8 activate
Router(config-router-af)# network 3.3.2.0 mask 255.255.255.0
Router(config-router-af)# exit 
Router(config-router)# address-family ipv4 vrf vl
Router(config-router-af)# neighbor 83.0.0.8 remote-as 800
Router(config-router-af)# neighbor 83.0.0.8 activate
Router(config-router-af)# network 3.3.1.0 mask 255.255.255.0
Router(config-router-af)# end 

IPv6 VRF-Lite の設定例

次に、CE-PE ルーティングに OSPFv3 を使用するトポロジを示します。

図 3. VRF-Lite の設定例


CE1 スイッチの設定

ipv6 unicast-routing 
vrf definition v1
 rd 100:1
 !
address-family ipv6
 exit-address-family
!

vrf definition v2
 rd 200:1
 !
address-family ipv6
 exit-address-family
!

interface Vlan100
 vrf forwarding v1
 ipv6 address 1000:1::1/64
 ospfv3 100 ipv6 area 0
! 

interface Vlan200
 vrf forwarding v2
 ipv6 address 2000:1::1/64
 ospfv3 200 ipv6 area 0
!         

interface GigabitEthernet 1/0/1
switchport access vlan 100
end

interface GigabitEthernet 1/0/2
switchport access vlan 200
end

interface GigabitEthernet 1/0/24
 switchport trunk encapsulation dot1q

switchport mode trunk
end

router ospfv3 100
 router-id 10.10.10.10
 !
 address-family ipv6 unicast vrf v1
  redistribute connected
  area 0 normal
 exit-address-family
!

router ospfv3 200
 router-id 20.20.20.20
 !
 address-family ipv6 unicast vrf v2
  redistribute connected
  area 0 normal
 exit-address-family
!

PE スイッチの設定

ipv6 unicast-routing 

vrf definition v1
 rd 100:1
 !
address-family ipv6
 exit-address-family
!

vrf definition v2
 rd 200:1
 !
address-family ipv6
 exit-address-family
!
interface Vlan600
 vrf forwarding v1
 no ipv6 address
 ipv6 address 1000:1::2/64
 ospfv3 100 ipv6 area 0
!

interface Vlan700
 vrf forwarding v2
 no ipv6 address
 ipv6 address 2000:1::2/64
 ospfv3 200 ipv6 area 0
!

interface Vlan800
 vrf forwarding v1
 ipv6 address 3000:1::7/64
 ospfv3 100 ipv6 area 0
!
interface Vlan900
 vrf forwarding v2
 ipv6 address 4000:1::7/64
 ospfv3 200 ipv6 area 0
!

interface GigabitEthernet 1/0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
 exit

interface GigabitEthernet 1/0/2
 switchport trunk encapsulation dot1q

switchport mode trunk
	exit

router ospfv3 100
 router-id 30.30.30.30
 !
 address-family ipv6 unicast vrf v1
  redistribute connected
  area 0 normal
 exit-address-family
	!
address-family ipv6 unicast vrf v2
  redistribute connected
  area 0 normal
 exit-address-family
	!

CE2 スイッチの設定

ipv6 unicast-routing 

vrf definition v1
 rd 100:1
 !
address-family ipv6
 exit-address-family
!

vrf definition v2
 rd 200:1
 !
address-family ipv6
 exit-address-family
!

interface Vlan100
 vrf forwarding v1

ipv6 address 1000:1::3/64
 ospfv3 100 ipv6 area 0
!

interface Vlan200
 vrf forwarding v2
 ipv6 address 2000:1::3/64
 ospfv3 200 ipv6 area 0
!

interface GigabitEthernet 1/0/1
switchport access vlan 100
end

interface GigabitEthernet 1/0/2
switchport access vlan 200
end

interface GigabitEthernet 1/0/24
 switchport trunk encapsulation dot1q
 switchport mode trunk
 end

router ospfv3 100
 router-id 40.40.40.40
 !
 address-family ipv6 unicast vrf v1
  redistribute connected
  area 0 normal
 exit-address-family
!

router ospfv3 200
 router-id 50.50.50.50
 !
 address-family ipv6 unicast vrf v2
  redistribute connected

area 0 normal
 exit-address-family
!