はじめに
このドキュメントでは、基本的なマルチプロトコルラベルスイッチング(MPLS)VPNコアネットワークを設定する方法について説明します。
前提条件
要件
次の項目に関する知識があることが推奨されます。
- IPルーティングの基礎知識
- Cisco IOS® コマンドラインインターフェイス(CLI)に関する知識
使用するコンポーネント
このドキュメントの情報は、次のソフトウェアとハードウェアのバージョンに基づいています。
P および PE ルータ
C および CE ルータ
このドキュメントの情報は、特定のラボ環境にあるデバイスに基づいて作成されました。このドキュメントで使用するすべてのデバイスは、クリアな(デフォルト)設定で作業を開始しています。本稼働中のネットワークでは、各コマンドによって起こる可能性がある影響を十分確認してください。
表記法
表記法の詳細については、『シスコ テクニカル ティップスの表記法』を参照してください。
次の文字は使用されるルータおよびスイッチのタイプを表します。
-
P – プロバイダールータ
-
PE —プロバイダー エッジ ルータ
-
CE —Customer Edgeルータ
-
C —ルータCustomer
注:PEルータは、プロバイダーネットワークの最後のホップです。これらのデバイスはCEルータに直接接続します。CEルータはカスタマー所有のデバイスで、サービスプロバイダーネットワークと接続しますが、MPLS操作には参加しません。
背景説明
MPLSは、長いネットワークアドレスの代わりに短いパスラベルを使用して、ノード間でデータを転送する高性能なネットワークテクノロジーです。
このアプローチにより、企業およびサービスプロバイダーのネットワーク全体のトラフィックフローを高速化し、シェーピングできます。
MPLSはパケットにラベルを割り当てます。このラベルは、ラベルスイッチングルータ(LSR)またはPルータが転送の決定に使用します。
ネットワークエッジのエッジルータ(LER)またはPEルータは、これらのラベルを追加および削除します。
MPLSはForwarding Equivalence Class(FEC;転送等価クラス)を使用して、同じ方法で転送されるパケットをグループ化し、Label Distribution Protocol(LDP;ラベル配布プロトコル)を使用してルータ間でラベルマッピングを配布します。
これにより、ネットワーク全体でラベルバインディングの一貫したビューが確保されます。
MPLSの利点には、パフォーマンス、スケーラビリティ、トラフィックエンジニアリング機能の向上、Quality of Service(QoS)のサポートなどがあります。
プロトコルに依存しないため、さまざまなネットワーク環境に対応する多目的なソリューションです。
MPLSは、スケーラブルでセキュアなバーチャルプライベートネットワーク(VPN)の作成、トラフィックフローの管理と最適化、さまざまな種類のトラフィック(データ、音声、ビデオなど)の単一のネットワークインフラストラクチャへのコンバージェンスのサポートに広く使用されています。
このドキュメントでは、プロバイダーエッジ(PE)ルータとCEカスタマーエッジ(CE)ルータの間でボーダーゲートウェイプロトコル(BGP)が使用されるMPLS VPNネットワークの設定例を紹介します。
VPN 機能を MPLS と組み合せて使用すると、複数のサイトがサービス プロバイダー ネットワークを通じて透過的に相互接続できます。
1つのサービスプロバイダーネットワークは、複数の異なるIP VPNをサポートできます。各VPNは、他のすべてのネットワークから分離されたプライベートネットワークとしてユーザに認識されます。
1 つの VPN を通じて、各サイトは同じ VPN 内にある他のサイトに IP パケットを送信できます。
各VPNは、1つ以上のVirtual Routing and Forwarding(VRF)インスタンスに関連付けられています。VRF は、IP ルーティング テーブル、派生された Cisco Express Forwarding(CEF)テーブル、およびこの転送テーブルを使用するインターフェイスのセットから構成されます。
ルータは、VRFごとに個別のルーティング情報ベース(RIB)とCEFテーブルを維持します。これにより、情報がVPNの外部に送信されなくなり、IPアドレスの重複の問題を引き起こすことなく、複数のVPNで同じサブネットを使用できるようになります。
マルチプロトコルBGP(MP-BGP)を使用するルータは、MP-BGP拡張コミュニティを使用してVPNルーティング情報を配信します。
コンフィギュレーション
このセクションでは、設定例とその実装方法について説明します。
ネットワーク図
このドキュメントでは、次のネットワーク構成を使用しています。次の図に、前述の表記法を示す一般的な設定を示します。
MPLSトポロジ
MPLSの設定手順
コアネットワークでのMPLSの設定
1. MPLSが必要なルータでip cefが有効になっていることを確認します(最新のソフトウェアリリースではCEFがデフォルトで有効になっています)。
2. サービスプロバイダーコアでInterior Gateway Protocol(IGP)を設定し、Open Shortest Path First(OSPF)またはIntermediate System-to-Intermediate System(IS-IS)プロトコルのいずれかを推奨オプションとして使用して、各PルータおよびPEルータからLoopback0をアドバタイズします。
3. サービスプロバイダーのコアルータがループバック間でレイヤ3(L3)に完全に到達可能になったら、PルータとPEルータ間の各L3インターフェイスにコマンドmpls ipを設定するか、mpls ldp autoconfigコマンドを使用して、OSPFまたはIS-ISプロセスを実行している各インターフェイスでLDPを有効にします。
注:CEルータに直接接続するPEルータインターフェイスでは、mpls ipコマンド設定は必要ありません。
mpls ip設定がインターフェイスに追加されたら、PEルータで次の手順を実行します。
4. vrf definition コマンドを使用して、接続されたVPNごとに1つのVRFを作成します。追加の手順:
そのVPNに使用されるルート識別子を指定します。 rd コマンドを使用するとIPアドレスが拡張されるため、IPアドレスが属するVPNを識別できます。
vrf definition Client_A
rd 100:110
MP-BGP 拡張コミュニティのインポートおよびエクスポート プロパティを設定します。これらは、次の出力に示すように、コマンドroute-target {import|export|both} <target VPN extended community>でインポートおよびエクスポートプロセスをフィルタリングするために使用されます。
vrf definition Client_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
address-family ipv4
exit-address-family
5. PEルータで、CEを接続するインターフェイスを対応するVRFに追加します。vrf forwardingコマンドを使用して、各インターフェイスに転送の詳細を設定し、IPアドレスを設定します。
PE-1#show run interface GigabitEthernet0/1
Building configuration...
Current configuration : 138 bytes
!
interface GigabitEthernet0/1
vrf forwarding Client_A
ip address 10.0.4.2 255.255.255.0
duplex auto
speed auto
media-type rj45
end
MP-BGPの設定
BGPを設定するには、いくつかの方法があります。たとえば、PEルータをBGPネイバーとして設定したり、ルートリフレクタ(RR)またはコンフェデレーション方式を使用したりできます。次の例ではルートリフレクタが使用されていますが、これはPEルータ間でフルメッシュのネイバーを使用するよりもスケーラブルです。
1. このPEルータに存在するVPNごとにaddress-family ipv4 vrf <VRF name>コマンドを入力します。次に、必要に応じて、次の手順を1つ以上実行します。
注:使用するPE-CEルーティングプロトコルに基づいて、PEデバイスとCEデバイスの間にダイナミックルーティングプロトコル(EIGRP、OSPF、またはBGP)を設定できます。PEとCEの間でルーティング情報を交換するために使用されるプロトコルがBGPである場合は、プロトコル間の再配布を設定する必要はありません。
2. router bgp hierarchyの下でaddress-family vpnv4モードに入り、次の手順を実行します。
コンフィギュレーション
このドキュメントでは、次の設定を使用してMPLS VPNネットワークの例をセットアップします。
| PE-1 |
hostname PE-1
!
ip cef
!
!--- VPN Client_A commands.
vrf definition Client_A
rd 100:110
route-target export 100:1000
route-target import 100:1000 !
address-family ipv4
exit-address-family
!--- Enables the VPN routing and forwarding (VRF) routing table. !--- Route distinguisher creates routing and forwarding tables for a VRF. !--- Route targets creates lists of import and export extended communities for the specified VRF.
!--- VPN Client_B commands.
vrf definition Client_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
address-family ipv4
exit-address-family ! interface Loopback0
ip address 10.10.10.4 255.255.255.255
ip router isis !
interface GigabitEthernet0/1
vrf forwarding Client_A
ip address 10.0.4.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
vrf forwarding Client_B
ip address 10.0.4.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!--- Associates a VRF instance with an interface or subinterface. !--- GigabitEthernet0/1 and 0/2 use the same IP address, 10.0.4.2. !--- This is allowed because they belong to two different customer VRFs.
! interface GigabitEthernet0/0
description link to P-1
ip address 10.1.1.14 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!--- Enables MPLS on the L3 interface connecting to the P router
! router isis
net 49.0001.0000.0000.0004.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!--- Enables IS-IS as the IGP in the provider core network
!
router bgp 65000
bgp log-neighbor-changes neighbor 10.10.10.2 remote-as 65000 neighbor 10.10.10.2 update-source Loopback0
!--- Adds an entry to the BGP or MP-BGP neighbor table. !--- And enables BGP sessions to use a specific operational interface for TCP connections.
!
address-family vpnv4
neighbor 10.10.10.2 activate
neighbor 10.10.10.2 send-community both
exit-address-family
!--- To enter address family configuration mode that use standard VPN version 4 address prefixes. !--- Creates the VPNv4 neighbor session to the Route Reflector. !--- And to send the community attribute to the BGP neighbor. !
address-family ipv4 vrf Client_A
neighbor 10.0.4.1 remote-as 65002
neighbor 10.0.4.1 activate
exit-address-family
!
address-family ipv4 vrf Client_B
neighbor 10.0.4.1 remote-as 65001
neighbor 10.0.4.1 activate
exit-address-family
!--- These are the eBGP sessions to each CE router belonging to different customers. !--- The eBGP sessions are configured within the VRF address family
! end
|
| PE-2 |
hostname PE-2
!
ip cef !
vrf definition Client_A
rd 100:110
route-target export 100:1000
route-target import 100:1000
!
address-family ipv4
exit-address-family
! vrf definition Client_B
rd 100:120
route-target export 100:2000
route-target import 100:2000
!
address-family ipv4
exit-address-family
!
ip cef
!
interface Loopback0
ip address 10.10.10.6 255.255.255.255 ip router isis !
interface GigabitEthernet0/0
description link to P-2
ip address 10.1.1.22 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
vrf forwarding Client_B
ip address 10.0.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/2
vrf forwarding Client_A
ip address 10.1.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
interface GigabitEthernet0/3
vrf forwarding Client_A
ip address 10.0.6.2 255.255.255.0
duplex auto
speed auto
media-type rj45
!
router isis
net 49.0001.0000.0000.0006.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
router bgp 65000
bgp log-neighbor-changes
neighbor 10.10.10.2 remote-as 65000
neighbor 10.10.10.2 update-source Loopback0
!
address-family vpnv4
neighbor 10.10.10.2 activate
neighbor 10.10.10.2 send-community both
exit-address-family
!
address-family ipv4 vrf Client_A
neighbor 10.0.6.1 remote-as 65004
neighbor 10.0.6.1 activate
neighbor 10.1.6.1 remote-as 65004
neighbor 10.1.6.1 activate
exit-address-family
!
address-family ipv4 vrf Client_B
neighbor 10.0.6.1 remote-as 65003
neighbor 10.0.6.1 activate
exit-address-family
!
!
end
|
| P-2 |
hostname P-2
!
ip cef
!
interface Loopback0
ip address 10.10.10.3 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to PE-2
ip address 10.1.1.21 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to P-1
ip address 10.1.1.6 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/2
description link to RR
ip address 10.1.1.9 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
router isis
net 49.0001.0000.0000.0003.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
end
|
| RR |
hostname RR
!
ip cef
!
interface Loopback0
ip address 10.10.10.2 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to P-1
ip address 10.1.1.2 255.255.255.252ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to P-2
ip address 10.1.1.10 255.255.255.252ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/3
no ip address
shutdown
duplex auto
speed auto
media-type rj45
!
router isis
net 49.0001.0000.0000.0002.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
router bgp 65000
bgp log-neighbor-changes
neighbor 10.10.10.4 remote-as 65000
neighbor 10.10.10.4 update-source Loopback0
neighbor 10.10.10.6 remote-as 65000
neighbor 10.10.10.6 update-source Loopback0
!
address-family vpnv4
neighbor 10.10.10.4 activate
neighbor 10.10.10.4 send-community both
neighbor 10.10.10.4 route-reflector-client
neighbor 10.10.10.6 activate
neighbor 10.10.10.6 send-community both
neighbor 10.10.10.6 route-reflector-client
exit-address-family
!
!
end
|
| P-1 |
hostname P-1
!
ip cef
!
interface Loopback0
ip address 10.10.10.1 255.255.255.255
ip router isis
!
interface GigabitEthernet0/0
description link to PE-1
ip address 10.1.1.13 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/1
description link to RR
ip address 10.1.1.5 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
interface GigabitEthernet0/2
description link to P-2
ip address 10.1.1.1 255.255.255.252
ip router isis
duplex auto
speed auto
media-type rj45
mpls ip
!
router isis
net 49.0001.0000.0000.0001.00
is-type level-2-only
metric-style wide
passive-interface Loopback0
!
end
|
| CE-A1 |
CE-A3 |
hostname CE-A1
!
ip cef
!
interface GigabitEthernet0/0
ip address 10.0.4.1 255.255.255.0
duplex auto
speed auto
media-type rj45
!
router bgp 65002
bgp log-neighbor-changes
redistribute connected
neighbor 10.0.4.2 remote-as 65000
!
end
|
hostname CE-A3
!
ip cef
!
interface GigabitEthernet0/0
ip address 10.0.6.1 255.255.255.0
duplex auto
speed auto
media-type rj45
!
router bgp 65004
bgp log-neighbor-changes
redistribute connected
neighbor 10.0.6.2 remote-as 65000
!
end
|
検証
このセクションでは、設定が正しく動作していることを確認するために使用できる情報を提供しています。
PEからCEへの検証コマンド
- show ip vrf:正しい VRF が存在することを確認する。
- show ip vrf interfaces:アクティベートされているインターフェイスを確認する。
- show ip route vrf <VRF name>:PEルータでのルーティング情報を確認する。
- traceroute vrf <VRF名> <IPアドレス>:PEルータでのルーティング情報を確認する。
- show ip cef vrf <VRF name> <IPアドレス> detail:PEルータでのルーティング情報を確認する。
MPLS LDP検証コマンド
- mplsインターフェイスの表示
- MPLS転送テーブルの表示
- mpls ldpバインディングの表示
- mpls ldpネイバーの表示
PEからPE/RRへの検証コマンド
- show bgp vpnv4 unicast allの要約
- show bgp vpnv4 unicast all neighbor <ネイバーIPアドレス> advertised-routes:送信されたVPNv4プレフィックスを確認します。
- show bgp vpnv4 unicast all neighbor <neighbor IP address> routes:受信したVPNv4プレフィックスを確認します
次に、show ip vrfコマンドの出力例を示します。
PE-1#show ip vrf
Name Default RD Interfaces
Client_A 100:110 Gi0/1
Client_B 100:120 Gi0/2
次に、show ip vrf interfacesコマンドの出力例を示します。
PE-2#show ip vrf interfaces
Interface IP-Address VRF Protocol
Gi0/2 10.1.6.2 Client_A up
Gi0/3 10.0.6.2 Client_A up
Gi0/1 10.0.6.2 Client_B up
次の例では、show ip route vrfコマンドの両方の出力に同じプレフィクスである10.0.6.0/24が表示されています。これは、リモートPEが2つのCiscoクライアント(CE_B2とCE_A3)に対して同じネットワークを持つためです。これは一般的なMPLS VPNソリューションで許可されます。
PE-1#show ip route vrf Client_A
Routing Table: Client_A
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
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.0.4.0/24 is directly connected, GigabitEthernet0/1
L 10.0.4.2/32 is directly connected, GigabitEthernet0/1
B 10.0.6.0/24 [200/0] via 10.10.10.6, 11:11:11
B 10.1.6.0/24 [200/0] via 10.10.10.6, 11:24:16
PE-1#
PE-1#show ip route vrf Client_B
Routing Table: Client_B
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
10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 10.0.4.0/24 is directly connected, GigabitEthernet0/2
L 10.0.4.2/32 is directly connected, GigabitEthernet0/2
B 10.0.6.0/24 [200/0] via 10.10.10.6, 11:26:05
2つのサイト間でtracerouteを実行すると、この例では2つのサイト(Client_A)(CE-A1からCE-A3)で、MPLSネットワークで使用されるラベルスタックを確認できます(ラベルスタックを使用するようにmpls ip propagate-ttlで設定している場合)。
CE-A1#show ip route 10.0.6.1
Routing entry for 10.0.6.0/24
Known via "bgp 65002", distance 20, metric 0
Tag 65000, type external
Last update from 10.0.4.2 11:16:14 ago
Routing Descriptor Blocks:
* 10.0.4.2, from 10.0.4.2, 11:16:14 ago
Route metric is 0, traffic share count is 1
AS Hops 2
Route tag 65000
MPLS label: none
CE-A1#
CE-A1#ping 10.0.6.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 7/8/9 ms
CE-A1#
CE-A1#traceroute 10.0.6.1 probe 1 numeric
Type escape sequence to abort.
Tracing the route to 10.0.6.1
VRF info: (vrf in name/id, vrf out name/id)
1 10.0.4.2 2 msec
2 10.1.1.13 [MPLS: Labels 20/26 Exp 0] 8 msec
3 10.1.1.6 [MPLS: Labels 21/26 Exp 0] 17 msec
4 10.0.6.2 [AS 65004] 11 msec
5 10.0.6.1 [AS 65004] 8 msec
注:Exp 0は、Quality of Service(QoS)に使用する実験的なフィールドです。
次の出力は、RRとサービスプロバイダーコアネットワーク内の一部のPルータの間で確立されたIS-ISおよびLDP隣接関係を示しています。
RR#show isis neighbors
Tag null:
System Id Type Interface IP Address State Holdtime Circuit Id
P-1 L2 Gi0/0 10.1.1.1 UP 25 RR.01
P-2 L2 Gi0/1 10.1.1.9 UP 23 RR.02
RR#
RR#show mpls ldp neighbor
Peer LDP Ident: 10.10.10.1:0; Local LDP Ident 10.10.10.2:0
TCP connection: 10.10.10.1.646 - 10.10.10.2.46298
State: Oper; Msgs sent/rcvd: 924/921; Downstream
Up time: 13:16:03
LDP discovery sources:
GigabitEthernet0/0, Src IP addr: 10.1.1.1
Addresses bound to peer LDP Ident:
10.1.1.13 10.1.1.5 10.1.1.1 10.10.10.1
Peer LDP Ident: 10.10.10.3:0; Local LDP Ident 10.10.10.2:0
TCP connection: 10.10.10.3.14116 - 10.10.10.2.646
State: Oper; Msgs sent/rcvd: 920/916; Downstream
Up time: 13:13:09
LDP discovery sources:
GigabitEthernet0/1, Src IP addr: 10.1.1.9
Addresses bound to peer LDP Ident:
10.1.1.6 10.1.1.9 10.10.10.3 10.1.1.21
関連情報