| 確認 |
MPLSが威力を発揮するのは,MPLSを使ったVPN(MPLS-VPN)の構築です。
決められた拠点同士だけが通信できるネットワークを作ることができます。
現在,通信事業者が提供している「IP-VPNサービス」で使われている技術です。
●MPLS-VPNの考え方
MPLS-VPNの設定は,入力するコマンドが多くて複雑です。
そのため最初に設定の全体像を見ておきましょう。
まず準備として,MPLSネットワーク内のルーターでMPLSを動作させて,拠点同士で通信できるようにしておきます。
(「MPLSの基本」の設定です。)
その上で,
@VPN(仮想ルーター:VRF)を設定する
A拠点の経路情報をMPLSネットワーク上で運ぶためのMP-BGPを設定する
BCE-PE間のルーティング設定をする
という三つのステップで設定します(下の図)。
このステップを頭に入れておけば,あまり迷うことはありません。

ポイントは,PEルーターに「VRF」と呼ばれる仮想ルーターを作るところです。
その仮想ルーターに拠点をつなぎます。
拠点にある経路情報は,PEルーターがBGPでやりとりします。
仮想ルーターはあくまでも独立したルーターなので,専用のネットワーク(VPN)ができるわけです。
この三つの流れで,具体的な設定を見ていきましょう。
●@VPNの設定
RouterAにVRF(仮想ルーター)を作り,拠点のルーターとつなげます。
RouterA(config)#ip vrf VPNA ←@
RouterA(config-vrf)#rd 1:100 ←A
RouterA(config-vrf)#route-target both 1:100 ←B
RouterA(config-vrf)#exit
RouterA(config)#interface serial 1/0
RouterA(config-if)#ip vrf forwarding VPNA ←C
% Interface Serial1/0 IP address 192.1.1.2 removed due to enabling VRF VPNA ←D
RouterA(config-if)#ip address 192.1.1.2 255.255.255.0 ←E
RouterA(config-if)#no shutdown
@「VPNA」という名前のVRF(仮想ルーター)を作ります。
AVPNを識別するための識別子(RD:route distinguisher)を「1:100」と定義します。「AS番号:VPN識別番号」とするのが一般的。これにより「VPNv4アドレス」が「RD+IPアドレス」という形で表されます。
Bさらに,経路情報の送受信の制御に使う情報(RT:route target)を「1:100」と定義します。これもRDとフォーマットは同じで「AS番号:任意の値」とするのが一般的。BGPでやりとりされる経路情報には,このRTが拡張コミュニティ属性として付与されます。このケースでは「both」と指定しているので,送信時に経路情報に「1:100」という属性を付けて送り出し,受信時に「1:100」という属性が付いた経路情報を受け取るようになります。
CSerial1/0を仮想ルーター「VPNA」のインタフェースとします。これで仮想ルーターと拠点が結ばれます。
DインタフェースをVRFに関連付けると,そのインタフェースからIPアドレスが取り除かれます。そのメッセージが出ます。
Eそのため,Serial1/0(=仮想ルーター)のIPアドレスを再設定します。
以上を設定した後に,「VPNA」というVRFが出来ているかを確認してみます。
VRF名が「VPNA」,RDが「1:100」,RTが送受信とも「1:100」といった設定が反映されているのがわかります(下の赤字)。
RouterA#show ip vrf detail VPNA
VRF VPNA; default RD 1:100; default VPNID <not set>
Interfaces:
Se1/0
Connected addresses are not in global routing table
Export VPN route-target communities
RT:1:100
Import VPN route-target communities
RT:1:100
No import route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
もう片方のPEルーターであるRouterDも,RouterAと同様に設定します。
RouterD(config)#ip vrf VPNA
RouterD(config-vrf)#rd 1:100
RouterD(config-vrf)#route-target both 1:100
RouterD(config-vrf)#exit
RouterD(config)#interface serial 1/1
RouterD(config-if)#ip vrf forwarding VPNA
% Interface Serial1/1 IP address 196.1.1.1 removed due to enabling VRF VPNA
RouterD(config-if)#ip address 196.1.1.1 255.255.255.0
RouterD(config-if)#no shutdown
RouterDでも上で設定した内容が反映されていることが確認できます。
RouterD#show ip vrf detail VPNA
VRF VPNA; default RD 1:100; default VPNID <not set>
Interfaces:
Se1/1
Connected addresses are not in global routing table
Export VPN route-target communities
RT:1:100
Import VPN route-target communities
RT:1:100
No import route-map
No export route-map
VRF label distribution protocol: not configured
VRF label allocation mode: per-prefix
これで,PEルーターであるRouterAとRouterDに「VPNA」という名前のVRF(仮想ルーター)が作られ,それぞれが拠点のCEルーターと接続されました。
●AMP-BGPの設定
続いて,MP-BGPの設定をします。
MPLSネットワーク内で,拠点にある経路情報をBGPで転送するための設定です。
RouterAのMP-BGPの設定は以下です。
RouterA(config)#interface loopback 0 ←@
RouterA(config-if)#ip address 1.1.1.1 255.255.255.255
RouterA(config-if)#no shutdown
RouterA(config-if)#exit
RouterA(config)#router bgp 1
RouterA(config-router)#no bgp default ipv4-unicast ←A
RouterA(config-router)#neighbor 4.4.4.4 remote-as 1 ←B
RouterA(config-router)#neighbor 4.4.4.4 update-source loopback 0 ←C
RouterA(config-router)#address-family vpnv4 ←D
RouterA(config-router-af)#neighbor 4.4.4.4 activate ←E
@BGPでピアを張るためのループバックアドレスを設定します。
AMPLS-VPNの場合,BGPで運ぶのはIPv4アドレスではなくて「VPNv4アドレス」です。そのため,IPv4アドレスのやりとりをオフにします。
BBGPでピアを張るネイバーのルーター(RouterD)のアドレスを指定します。
Cネイバーとピアを張るときは,自身のループバックアドレス(1.1.1.1)で張るようにします。
DMP-BGPでは,さまざまなアドレスをやりとりできるようになっています(IPv4,IPv6,NSAPなど)。ここでは,VPNv4のアドレスを使うことを宣言します。
EネイバーにVPNv4アドレスのアクティベート(利用開始)を宣言します。
RouterAのBGPピアになるRouterDの設定は以下です。
設定すると,ピアがアップしたことを示すメッセージが出ます。
RouterD(config)#interface loopback 0
RouterD(config-if)#ip address 4.4.4.4 255.255.255.255
RouterD(config-if)#no shutdown
RouterD(config-if)#exit
RouterD(config)#router bgp 1
RouterD(config-router)#no bgp default ipv4-unicast
RouterD(config-router)#neighbor 1.1.1.1 remote-as 1
RouterD(config-router)#neighbor 1.1.1.1 update-source loopback 0
RouterD(config-router)#address-family vpnv4
RouterD(config-router-af)#neighbor 1.1.1.1 activate
RouterD(config-router-af)#
*Jun 27 22:12:50.624: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up
設定が反映されているか,BGPのネイバー情報を確認してみましょう。
RouterAのBGPネイバーを見ると,VPNv4アドレスをやりとりしていることがわかります(下の赤字)。
RouterA#show ip bgp neighbors 4.4.4.4
BGP neighbor is 4.4.4.4, remote AS 1, internal link
BGP version 4, remote router ID 4.4.4.4
BGP state = Established, up for 00:06:11
Last read 00:00:11, last write 00:00:11, hold time is 180, keepalive interval
is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family VPNv4 Unicast: advertised and received
Message statistics:
(以下略)
RouterDも同様に,RouteA(1.1.1.1)とVPNv4アドレスをやりとりしています(下の赤字)。
RouterD#show ip bgp neighbors 1.1.1.1
BGP neighbor is 1.1.1.1, remote AS 1, internal link
BGP version 4, remote router ID 1.1.1.1
BGP state = Established, up for 00:09:14
Last read 00:00:13, last write 00:00:13, hold time is 180, keepalive interval
is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(old & new)
Address family VPNv4 Unicast: advertised and received
Message statistics:
(以下略)
MPLSネットワークで拠点の経路情報をやりとりするための,PE-PE間の設定は以上です。
●BCE-PE間のルーティング設定
最後が,PEルーターとCEルーター間のルーティング設定です。
今回は,スタティック・ルーティングを使って,PEルーターであるRouteAに拠点の経路情報を教えてやります。
RouterAの設定は以下です。
RouterA(config)#ip route vrf VPNA 100.100.100.100 255.255.255.255 serial 1/0 ←@
RouterA(config)#router bgp 1
RouterA(config-router)#address-family ipv4 vrf VPNA ←A
RouterA(config-router-af)#redistribute static ←B
@VPNAのVRF(仮想ルーター)にスタティック・ルーティングを設定します。100.100.100.100/32あてのトラフィックはSerial1/0に送出するように設定します。
A拠点側のIPv4の経路情報をMP-BGPで通知するためには,アドレスファミリを指定して通知します。そのため,
BGPの設定モードの中に入り,そこでIPv4アドレスファミリを指定してVPNAの設定モードに入ります。
Bスタティック・ルートをBGPで再配布します。これにより,@で設定した経路情報がMP-BGPでRouterDに伝わります。ちなみに,直接接続のルート(192.1.1.0/24)を再配布するときは,「redistribute
connected」と入力すればOKです。
RouterAに以上の設定をした状態で,RouterAのVPNA(仮想ルーター)のルーティング・テーブルを見てみます。
100.100.100.100/32の経路情報がスタティックで登録されているのがわかります(下の赤字)。
RouterA#show ip route vrf VPNA
Routing Table: VPNA
Codes: 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
Gateway of last resort is not set
100.0.0.0/32 is subnetted, 1 subnets
S 100.100.100.100 is directly connected, Serial1/0
C 192.1.1.0/24 is directly connected, Serial1/0
同様に,RouterDもスタティック・ルーティングを使って設定します。
「VPNA」というVRF(仮想ルーター)に対して,「200.200.200.200あてはSerial1/1に出す」と設定してやります。
RouterD(config)#ip route vrf VPNA 200.200.200.200 255.255.255.255 serial 1/1
RouterD(config)#router bgp 1
RouterD(config-router)#address-family ipv4 vrf VPNA
RouterD(config-router-af)#redistribute static
ルーターの設定は以上です。
●設定の確認
RouterAのVPNA(仮想ルーター)のルーティング・テーブルを見てみましょう。
200.200.200.200/32という経路情報がBGPで伝わってきたことがわかります(下の赤字)。
RouterA#show ip route vrf VPNA
Routing Table: VPNA
Codes: 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
Gateway of last resort is not set
200.200.200.0/32 is subnetted, 1 subnets
B 200.200.200.200 [200/0] via 4.4.4.4, 00:00:16
100.0.0.0/32 is subnetted, 1 subnets
S 100.100.100.100 is directly connected, Serial1/0
C 192.1.1.0/24 is directly connected, Serial1/0
RouterDのVPNAのルーティング・テーブルも見てみましょう。
同様に,100.100.100.100/32の経路情報が,BGPで伝わってきているのがわかります(下の赤字)。
RouterD#show ip route vrf VPNA
Routing Table: VPNA
Codes: 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
Gateway of last resort is not set
200.200.200.0/32 is subnetted, 1 subnets
S 200.200.200.200 is directly connected, Serial1/1
100.0.0.0/32 is subnetted, 1 subnets
B 100.100.100.100 [200/0] via 1.1.1.1, 00:05:29
C 196.1.1.0/24 is directly connected, Serial1/1
●動作の確認
では,拠点同士できちんと通信ができるかを確認してみます。
一方の拠点にある100.100.100.100から,他方の拠点にある200.200.200.200にpingを打ちます。
CE_A1#ping
Protocol [ip]:
Target IP address: 200.200.200.200
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 100.100.100.100
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 200.200.200.200, timeout is 2 seconds:
Packet sent with a source address of 100.100.100.100
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 44/94/120 ms
きちんと応答が返ってきました。
MPLS-VPNを使って,拠点間で通信できるようになりました。
(おまけ)
VPNA(仮想ルーター)のBGPテーブルを見ることもできます。
RouterAのBGPテーブルは以下です。
RouterA#show ip bgp vpnv4 vrf VPNA
BGP table version is 5, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100 (default for vrf VPNA)
*> 100.100.100.100/32
192.1.1.1 0 32768 ?
*>i200.200.200.200/32
4.4.4.4 0 100 0 ?
RouterDのBGPテーブルは以下です。
RouterD#show ip bgp vpnv4 vrf VPNA
BGP table version is 5, local router ID is 4.4.4.4
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100 (default for vrf VPNA)
*>i100.100.100.100/32
1.1.1.1 0 100 0 ?
*> 200.200.200.200/32
196.1.1.2 0 32768 ?
●MPLS VPNの基本設定
http://www.cisco.com/japanese/warp/public/3/jp/service/tac/105/mpls_vpn_basic-j.shtml
■Dynamipsでの検証
このラボ・シナリオはDynamipsで検証しました。
Dynagenのコンフィグファイルは以下です。
# MPLS lab
autostart = False
[localhost]
[[7200]]
image = C:\Program Files\Dynamips\images\c7200-**********.bin
npe = npe-400
ram = 160
idlepc = 0x********
[[ROUTER CEA1]]
S1/0 = R1 S1/0
model = 7200
[[ROUTER R1]]
S1/1 = R2 S1/0
model = 7200
[[ROUTER R2]]
S1/1 = R3 S1/0
model = 7200
[[ROUTER R3]]
S1/1 = R4 S1/0
model = 7200
[[ROUTER R4]]
S1/1 = CEA2 S1/0
model = 7200
[[ROUTER CEA2]]
model = 7200 |
|