VRF-aware NAT, PAT、VRF-Aware Software Infrastructure (VASI) NATについて

VRF-aware NAT, PATとは

VRF(Virtual Routing and Forwarding)コンテキスト内でNAT(Network Address Translation)やPAT(Port Address Translation)を実行する機能です。

VRF-Aware Software Infrastructure (VASI) とは

VRF-Aware Software Infrastructure (VASI) NATとは、Ciscoのルータやスイッチで使用される技術で、仮想ルーティングおよびフォワーディング(VRF)インスタンス間のNAT(ネットワークアドレス変換)をサポートするものです。これにより、異なるVRF間で通信を行う際に、IPアドレスの変換が可能となります。

設定例

各機器のpre-config

R1

hostname R1

int g0/3
ip address 192.168.1.1 255.255.255.0
no shut

int lo1
ip address 1.1.1.1 255.255.255.0

ip route 0.0.0.0 0.0.0.0 192.168.1.254

R2

hostname R2

int g0/3
ip address 192.168.1.1 255.255.255.0
no shut

int lo2
ip address 2.2.2.2 255.255.255.0

ip route 0.0.0.0 0.0.0.0 192.168.1.254

R3

hostname R3

ip vrf R14
rd 1:10
ip vrf R25
rd 1:20

int g0/1
ip vrf forwarding R14
ip address 192.168.1.254 255.255.255.0
no shut

int g0/4
ip vrf forwarding R14
ip address 192.168.2.254 255.255.255.0
no shut

int g0/2
ip vrf forwarding R25
ip address 192.168.1.254 255.255.255.0
no shut

int g0/5
ip vrf forwarding R25
ip address 192.168.2.254 255.255.255.0
no shut

int g0/6
ip address 172.16.100.254 255.255.255.0
no shut

ip route vrf R14 1.1.1.0 255.255.255.0 192.168.1.1
ip route vrf R14 4.4.4.0 255.255.255.0 192.168.2.1
ip route vrf R25 2.2.2.0 255.255.255.0 192.168.1.1
ip route vrf R25 5.5.5.0 255.255.255.0 192.168.2.1
ip route 6.6.6.0 255.255.255.0 172.16.100.1

R4

hostname R4

int g0/3
ip address 192.168.2.1 255.255.255.0
no shut

int lo4
ip address 4.4.4.4 255.255.255.0

ip route 0.0.0.0 0.0.0.0 192.168.2.254

R5

hostname R5

int g0/3
ip address 192.168.2.1 255.255.255.0
no shut

int lo5
ip address 5.5.5.5 255.255.255.0

ip route 0.0.0.0 0.0.0.0 192.168.2.254

R6

hostname R6

int g0/3
ip address 172.16.100.1 255.255.255.0
no shut

int lo6
ip address 6.6.6.6 255.255.255.0

ip route 0.0.0.0 0.0.0.0 172.16.100.254

VRF内でNATする設定

以下の設定例はvrfR14内で動作するNATの設定例で送信元192.168.1.0/24を192.168.2.254に変換しています。

VRFからVRF外へNATする設定

以下の設定例はVRF:R14から外部ネットワークへ通信をできるようにルーティングして、NAT変換をする設定例です。VRF R14のルーティングではglobal キーワードにより、このルートがグローバルなルーティングテーブルに影響することを示しています。

異なるVRF間でNATする設定

R3にて以下のようなイメージとなるVASIを作成します。作成されたVASIのペアは自動的にパケットを送信し合います。

vasiright1を内部ネットワーク、G5を外部ネットワークとして設定します。

PC1からPC5へPINGを実行してR3とR5の通信をパケットキャプチャするとNAT変換されていることが分かります。

参考文献

Configuring the VRF-Aware Software Infrastructure
【ASR1000】VASIとNATの設定例