内容

概要

この文書の目的は、グローバル ルーティング テーブルを使用した

特定のネットワーク シナリオでは、企業サイト間の VPN 接続性を継続的に維持しながら、MPLS ベースの VPN からインターネットへアクセスしなければなりません。このサンプル構成では、インターネット ゲートウェイ ルータ(IGW)へのデフォルト ルートを含む VPN ルーティング/転送(VRF)からのインターネットへのアクセスの提供を中心に説明します。

前提条件

要件

このドキュメントの内容をよく理解するためには、MPLS 転送および MPLS VPN の基本的な理解が必要です。

使用するコンポーネント

このドキュメントの情報は、次のソフトウェアとハードウェアのバージョンに基づくものです。

このマニュアルの情報は、特定のラボ環境に置かれたデバイスに基づいて作成されました。このドキュメントで使用するすべてのデバイスは、初期(デフォルト)設定の状態から起動しています。実稼動中のネットワークで作業をしている場合、実際にコマンドを使用する前に、その潜在的な影響について理解しておく必要があります。

背景理論

このサンプル構成では、次のポリシーが設定されています。

表記法

このドキュメントで使用する略語は次のとおりです。

ドキュメントの表記法の詳細は、「シスコ テクニカル ティップスの表記法」を参照してください。

設定

注:インターネットゲートウェイのネクストホッ192.168.67.1はcustomer1 VRFの一部ではないため、インターネットゲートウェイインターフェイスs8/0 IP 192.168.67.1を指すcustomer1 VRFの下にデフォルトルートが設定されます。192.168.67.1へのルートはcustomer1 VRF内にないので、globalキーワードが必要です。グローバル キーワードは、スタティック ルートのネクストホップ アドレスが customer1 VRF 内ではなく、グローバル ルーティング テーブル内で解決されることを指定します。

次に、スタティック ルートの例を示します。

ip route vrf customer1 0.0.0.0 0.0.0.0 192.168.67.1 global

customer1 VRF にグローバル キーワードを設定したスタティック ルートが存在すると、インターネットに送られるすべてのパケットは必ず、インターネット ゲートウェイにルーティングされてからインターネットにルーティングされます。

注意: PE 1 内のデフォルト ルートは、ループバック アドレス(10.1.1.6)ではなく、インターネット ゲートウェイのシリアル インターフェイス IP アドレス(192.168.67.1)を指すように設定されています。 これにより、インターネット ゲートウェイとインターネット(R7)間の接続障害発生時に、ルートがブラックホール化することを防げます。 デフォルト ルートがインターネット ゲートウェイのループバック アドレスを指していて、インターネット ゲートウェイと R7 間の接続がダウンした場合、すべてのパケットはインターネット ゲートウェイにルーティングされ続けます。このようなことが発生するのは、ループバック アドレスが有効のまま(この点がインターフェイス s8/0 がダウンした場合にグローバル ルーティング テーブルから削除される 192.168.67.1 と異なる点です)、デフォルト ルートがルーティング テーブル内に存在し続けるためです。

次の手順では、インターネットから送信先 CE 1 ネットワーク 11.11.11.0/24 へ戻ってくるパケットが、インターネット ゲートウェイから MPLS コアを経由して PE 1 および CE 1 へルーティングされることを確認します。これは、PE 1 上のグローバル ルーティング テーブル内のシリアル 8/0 インターフェイスを指す CE 1 ネットワークに対するスタティック ルートを設定することによって実現されます。 インターネット ゲートウェイが自身のグローバル ルーティング テーブル内にそのルートが設定されるように、そのルートを Open Shortest Path First(OSPF) に再配布します。これにより、インターネット ゲートウェイで、インターネットから受信するすべてのパケットが PE 1 へルーティングされ、さらには CE 1 を経由して最終送信先へルーティングされます。

次の例は、PE 1 の構成で使用された ip route コマンドです。

ip route 11.11.11.0 255.255.255.0 Serial8/0 192.168.10.1

注:グローバルルーティングテーブルで設定された上記のスタティックルートは、VPNネットワークレイヤ到着可能性情報(NLRI)に使用されるcustomer1 VRF内で設定されたスタティックルートに追加されます。 PE 1 では、次のように設定されています。

ip route vrf customer1 11.11.11.0 255.255.255.0 192.168.10.1

注:この文書で使用されているコマンドの詳細を調べるには、「Command Lookup ツール」を使用してください(登録ユーザのみ)。

ネットワーク図

このドキュメントでは次の図に示すネットワーク構成を使用しています。

internet_access_mpls_vpn.gif

設定

このドキュメントでは、次に示す設定を使用しています。

CE 1
version 12.2
!
hostname CE-1
!
ip subnet-zero
!
interface Loopback0
 ip address 10.1.1.1 255.255.255.255
!
interface Loopback2
 ip address 11.11.11.1 255.255.255.0
!
interface Serial8/0
 ip address 192.168.10.1 255.255.255.252 

 !--- The interface is connected to PE 1.

 !
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.10.2

!--- This is the default route to route all packets to PE 1.

!

PE 1
version 12.2
!
hostname PE-1
!
ip subnet-zero
!
ip vrf customer1

!--- This configured VRF customer1.
 
 rd 100:1

!--- This configured the route distiguisher for VRF.
 
 route-target export 1:1
 route-target import 1:1

!--- This configured the export and import policies into VRF.
 
!
ip cef

!--- This enabled Cisco Express Forwarding (CEF) switching.

!
interface Loopback0
 ip address 10.1.1.2 255.255.255.255
!       
interface Ethernet0/0

!--- It is connected to P router.

 ip address 10.10.23.2 255.255.255.0
 tag-switching ip

!--- MPLS switching is enabled.
 
!
interface Serial8/0
! Connected to CE-1
 ip vrf forwarding customer1

!--- Route forwarding based on customer1 VRF is enabled.
 
 ip address 192.168.10.2 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 redistribute static subnets
 network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.1.4 remote-as 100

!--- Neighbor relationship with PE 2 is established.

 neighbor 10.1.1.4 update-source Loopback0
 neighbor 10.1.1.4 next-hop-self
 no auto-summary
!
 address-family ipv4 vrf customer1

!--- The address-family configuration mode specifies IPv4 unicast !---address prefixes for customer1 VRF.

 no auto-summary
 no synchronization
 network 11.11.11.0 mask 255.255.255.0

!--- CE 1 network 11.11.11.0/24 to PE 2 is announced.

network 192.168.10.0 mask 255.255.255.252
 exit-address-family
!
address-family vpnv4

!--- This is the address-family VPNV4 configuration mode for !--- configuring BGP sessions.

 neighbor 10.1.1.4 activate
 neighbor 10.1.1.4 send-community extended
 no auto-summary
 exit-address-family
!
ip classless
ip route 11.11.11.0 255.255.255.0 Serial8/0 192.168.10.1

!--- The static route in the global routing table is pointing to !--- the interface connected to CE 1.

ip route vrf customer1 0.0.0.0 0.0.0.0 192.168.67.1 global

!--- The static default route under customer1 VRF, routing packets !--- outside of VPN to the Internet gateway.

! routes
ip route vrf customer1 11.11.11.0 255.255.255.0 192.168.10.1

!--- The static route for network 11.11.11.0/24 (CE-1 Network) under !---customer1 VRF ensures the reachability of CE 1 network from the !--- other VPN sites.

P
version 12.2
!
hostname P
!
ip subnet-zero
!
ip cef

!--- CEF switching is enabled.

!
interface Loopback0
 ip address 10.1.1.3 255.255.255.255
!
interface Ethernet0/0

!--- This is connected to PE 1.

 ip address 10.10.23.3 255.255.255.0
 tag-switching ip

!--- MPLS switching is enabled.

!
interface Ethernet1/0

!--- This is connected to PE 2.

 ip address 10.10.34.3 255.255.255.0
 tag-switching ip
!
interface Ethernet2/0

!--- This is connected to the Internet gateway.

 ip address 10.10.36.3 255.255.255.0
 tag-switching ip
!
router ospf 1 
 log-adjacency-changes 
network 0.0.0.0 255.255.255.255 area 0

IGW
version 12.2
!
hostname IGW
!
ip subnet-zero
!
ip cef

!--- This enabled CEF switching.

!
interface Loopback0
 ip address 10.1.1.6 255.255.255.255
!
interface Ethernet2/0

!--- This is connected to P router.

 ip address 10.10.36.6 255.255.255.0
tag-switching ip
!
interface Serial8/0

!--- This is connected to Internet R7.

 ip address 192.168.67.1 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0
 !
 router bgp 100
 no synchronization
 bgp log-neighbor-changes
 network 11.11.11.0 mask 255.255.255.0
 network 22.22.22.0 mask 255.255.255.0
 neighbor 192.168.67.2 remote-as 200
 no auto-summary

PE 2
version 12.2
!
hostname PE-2
!
ip subnet-zero
!
ip vrf customer1

!--- Customer1 VRF is configured.

 rd 100:1 

!--- Route Distinguisher for VRF is configured.
 
 route-target export 1:1 
 route-target import 1:1 

!--- This configured the import and export policies for customer1 !--- VRF.

!
ip cef 

!--- This enabled CEF switching.
 
! 
interface Loopback0 
 ip address 10.1.1.4 255.255.255.255
interface Ethernet1/0

!--- Connected to P router.

 ip address 10.10.34.4 255.255.255.0
 tag-switching ip

!--- MPLS switching is enabled.

!
interface Serial9/0

!--- Connected to CE 2 router.

ip vrf forwarding customer1

!--- This enables VRF forwarding on the interface.

 ip address 192.168.20.1 255.255.255.252
!
router ospf 1
 log-adjacency-changes
 redistribute static subnets
 network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
 no synchronization
 bgp log-neighbor-changes
 neighbor 10.1.1.2 remote-as 100
 neighbor 10.1.1.2 update-source Loopback0
 neighbor 10.1.1.2 next-hop-self 
no auto-summary 
!
 address-family ipv4 vrf customer1

!--- This is the address-family IPv4 configuration of customer1 VRF.

 no auto-summary
 no synchronization
 network 22.22.22.0 mask 255.255.255.0

!--- This announces the CE 2 network to PE 1.

 exit-address-family
!
 address-family vpnv4

!--- This is the address-family VPNV4 configuration for BGP Sessions !--- with PE 1.

 neighbor 10.1.1.2 activate
 neighbor 10.1.1.2 send-community extended
 no auto-summary
 exit-address-family
!
ip classless
ip route 22.22.22.0 255.255.255.0 Serial9/0 192.168.20.2

!--- This is the static route for network 22.22.22.0/24 in the global !--- routing table pointing to the interface connected to CE 2.

ip route vrf customer1 0.0.0.0 0.0.0.0 192.168.67.1 global

!--- This is the static default route for customer VRF !--- for destinations outside the VPN.

ip route vrf customer1 22.22.22.0 255.255.255.0 192.168.20.2 

!--- This is the static route within customer1 VRF for CE 2 !--- network for VPN connectivity.

CE 2
version 12.2
!
hostname CE-2
!
ip subnet-zero
!
interface Loopback0
 ip address 22.22.22.22 255.255.255.0
!
interface Serial9/0

!--- This is connected to PE 2.

 ip address 192.168.20.2 255.255.255.252
!
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.20.1

!--- This is the default route pointing to PE 2.

確認

ここでは、設定が正しく機能していることを確認するために使用する情報を示します。

CE 1とCE 2間のVPN接続

CE 1 と CE 2 間の VPN 接続性を確認するため、CE 1 では CE 2 のネットワーク 22.22.22.0/24 と双方向に通信ができなければなりません。このことをチェックするため、PE 1 の customer1 VRF で、ネットワーク 22.22.22.0/24 へのルーティングを確認します。

一部の show コマンドはアウトプット インタープリタ ツールによってサポートされています(登録ユーザ専用)。このツールを使用することによって、show コマンド出力の分析結果を表示できます。

  1. show ip route vrf customer1コマンドは、次の出力で強調表示されている10.1.1.4(PE 2のループバックアドレス)から学習したネットワーク22.22.22.0/24へのルートを確認します。

    PE-1# show ip route vrf customer1
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
           i - IS-IS, 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 192.168.67.1 to network 0.0.0.0
    
    192.168.10.0/30 is subnetted, 1 subnets
    C       192.168.10.0 is directly connected, Serial8/0
           22.0.0.0/24 is subnetted, 1 subnets
    B       22.22.22.0 [200/0] via 10.1.1.4, 01:00:50
           11.0.0.0/24 is subnetted, 1 subnets
    S      11.11.11.0 [1/0] via 192.168.10.1
    S*   0.0.0.0/0 [1/0] via 192.168.67.1
  2. 同様に、PE 2 における customer1 VRF のネットワーク 11.11.11.0/24 へのルートを、次の例に示します。

    PE-2# show ip route vrf customer1
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
           i - IS-IS, 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 192.168.67.1 to network 0.0.0.0
    
    192.168.10.0/30 is subnetted, 1 subnets
    B       192.168.10.0 [200/0] via 10.1.1.2, 01:00:09
         22.0.0.0/24 is subnetted, 1 subnets
    S       22.22.22.0 [1/0] via 192.168.20.2
         192.168.20.0/30 is subnetted, 1 subnets
    C       192.168.20.0 is directly connected, Serial9/0
         11.0.0.0/24 is subnetted, 1 subnets
    B       11.11.11.0 [200/0] via 10.1.1.2, 01:00:09
    S*   0.0.0.0/0 [1/0] via 192.168.67.1
  3. ここで、CE 1 のソース IP アドレス 11.11.11.1 を使って CE 2 上のホスト 22.22.22.22 に ping を実行し、CE 1 と CE 2 間の接続性をチェックします。

    CE-1# ping
    Protocol [ip]:
    Target IP address: 22.22.22.22
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 11.11.11.1
    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 22.22.22.22, timeout is 2 seconds:
    !!!!!
    
    Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms

CE 1 からのインターネットへの接続

次の手順に従って、CE 1 からインターネットへの接続性を確認します。

  1. CE 1 からインターネット、または VPN へ送信されたすべてのパケットは、次に示すように、PE 1 を指している CE 1 で設定されたデフォルト ルートを使ってルーティングされます。

    CE-1# show ip route 0.0.0.0
    Routing entry for 0.0.0.0/0, supernet
      Known via "static", distance 1, metric 0, candidate default path
      Routing Descriptor Blocks:
      * 192.168.10.2
    Route metric is 0, traffic share count is 1
  2. PE 1 インターフェイス s8/0 に着信するパケットは、customer1 VRF ルーティング テーブルを使って、ルーティングされます。PE 1 上の show ip route vrf customer1 に対する次の出力に示されているように、PE 1 は IGW IP アドレス 192.168.67.1 を示している customer1 VRF にデフォルト ルートがあります。

    PE-1# show ip route vrf customer1
    Codes: C - connected, S - static, I - IGRP, 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, E - EGP
           i - IS-IS, 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 192.168.67.1 to network 0.0.0.0
    
         192.168.10.0/30 is subnetted, 1 subnets
    C       192.168.10.0 is directly connected, Serial8/0
         22.0.0.0/24 is subnetted, 1 subnets
    B       22.22.22.0 [200/0] via 10.1.1.4, 01:21:11
         11.0.0.0/24 is subnetted, 1 subnets
    S       11.11.11.0 [1/0] via 192.168.10.1
    S*   0.0.0.0/0 [1/0] via 192.168.67.1
    
  3. PE 1 上のデフォルト ルートはグローバル キーワードを使って設定されているため、グローバル ルーティング テーブル内でネクストホップ 192.168.67.1 が検索され、次に示すように IGW へルーティングされます。

    PE-1# show ip route 192.168.67.1
    Routing entry for 192.168.67.0/30
      Known via "ospf 1", distance 110, metric 84, type intra area
      Last update from 10.10.23.3 on Ethernet0/0, 00:21:54 ago
      Routing Descriptor Blocks:
      * 10.10.23.3, from 10.1.1.6, 00:21:54 ago, via Ethernet0/0
     Route metric is 84, traffic share count is 1
  4. IGWに到達するパケットは、R7から学習したBGPルートに基づいてインターネットにルーティングされます。この場合、R7から学習したBGPルートを調べて、インターネットへの接続を示すことができます。IGW ルーティング テーブルで R7 から収集した BGP ルート(ネットワーク 99.99.99.0/24)を次に示します。

    IGW# show ip route 99.99.99.0
    Routing entry for 99.99.99.0/24
      Known via "bgp 100", distance 20, metric 0
      Tag 200, type external
      Last update from 192.168.67.2 01:37:25 ago
      Routing Descriptor Blocks:
      * 192.168.67.2, from 192.168.67.2, 01:37:25 ago
          Route metric is 0, traffic share count is 1
          AS Hops 1

    CE-1 から送信されたパケットは、インターネットへルーティングされます。

  5. CE 1 ネットワーク 11.11.11.0/24 へ送信されたパケットがインターネットから戻ってくる場合、IGW のグローバル ルーティング テーブル内に PE 1 を指しているルートが設定されている可能性があります。CE 1 に接続されている PE1 上の s8/0 インターフェイスを指す PE 1 のグローバル ルーティング テーブル内のスタティック ルートと、そのルートの OSPFへの再配布は設定されています。これにより、IGWのグローバルルーティングテーブルにPE 1を指すルートが確実に存在します。PE 1のスタティックルートとIGWのOSPF学習ルートを次に示します。

    IGW# show ip route 11.11.11.0
    Routing entry for 11.11.11.0/24
      Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
      Last update from 10.10.36.3 on Ethernet2/0, 00:34:34 ago
      Routing Descriptor Blocks:
      * 10.10.36.3, from 10.1.1.2, 00:34:34 ago, via Ethernet2/0
          Route metric is 20, traffic share count is 1
    
    PE-1# show ip route 11.11.11.0
    Routing entry for 11.11.11.0/24
      Known via "static", distance 1, metric 0
      Redistributing via ospf 1
      Advertised by ospf 1 subnets
      Routing Descriptor Blocks:
      * 192.168.10.1, via Serial8/0
          Route metric is 0, traffic share count is 1
  6. ここで、CE 1 ソース アドレス 11.11.11.1 を使って、R7 IP アドレス 99.99.99.1 に ping を実行することによって、CE 1 からインターネットへの接続性をチェックします。

    CE-1# ping
    Protocol [ip]:
    Target IP address: 99.99.99.1
    Repeat count [5]:
    Datagram size [100]:
    Timeout in seconds [2]:
    Extended commands [n]: y
    Source address or interface: 11.11.11.1
    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 99.99.99.1, timeout is 2 seconds:
    !!!!!
    Success rate is 100 percent (5/5), round-trip min/avg/max = 20/24/32 ms
    CE-1#

トラブルシュート

現在、この設定に関する特定のトラブルシューティング情報はありません。

関連情報