テナントシステム向けNAT
NAT は、パケット ヘッダー内のネットワーク アドレス情報を変更または変換するための方法です。パケット内の送信元アドレスと宛先アドレスのいずれか、または両方を変換できます。詳細については、次のトピックを参照してください。
テナントシステムのネットワークアドレス変換について
リリース 18.3R1 以降Junos OS、論理システムでサポートされている送信元NAT、宛先NAT、静的NATを含むネットワークアドレス変換がテナントシステムでもサポートされます。
テナントシステムには、テナントシステムの送信元NAT、宛先NAT、静的NATを設定できる管理者(テナント管理者)があります。テナント管理者は、テナントシステムの送信元 NAT、宛先 NAT、静的 NAT の詳細を表示できます。プライマリ管理者は、任意のテナント システムの送信元 NAT、宛先 NAT、静的 NAT の統計情報または情報を表示できます。
テナントシステムの場合、プライマリ管理者は、以下のNATリソースの最大数と予約数を設定できます。
送信元 NAT プールと宛先 NAT プール
ポートアドレス変換あり/なしの送信元NATプール内のIPアドレス
送信元、宛先、静的NATのルール
ルール一致のプレフィックスリスト
NATコーンバインディング
ポートオーバーロードをサポートするIPアドレス
割り当てられた予約された数によって、指定されたリソース量がテナントシステムで常に利用可能であることが保証されます。テナントシステムの管理者は、NATオプションとともに show system security-profile コマンドを使用して、テナントシステムに割り当てられているリソースNAT表示できます。
関連項目
例:テナントシステムのネットワークアドレス変換の設定
この例では、特定のテナントシステムに対して送信元NAT、宛先NAT、静的NATを設定する方法を示しています。
要件
この例では、以下のハードウェアおよびソフトウェアコンポーネントを使用しています。
Junos OSリリース18.3R1以降を搭載したSRXシリーズファイアウォール。この設定例は、Junos OSリリース18.3R1向けにテストされています。
-
テナントシステムを作成します。を参照してください: 例:テナントシステム、テナントシステム管理者、および相互接続VPLSスイッチの作成。
ネットワークインターフェイスを設定します。テ ナントシステムのルーティングインスタンスの設定を参照してください。
概要
この例では、まずプライベートアドレス空間にtrustセキュリティゾーンを設定し、次にパブリックアドレス空間にuntrustセキュリティゾーンを設定します。
untrust ゾーンのデバイスは、宛先 IP アドレスが 203.0.113.200/24 の trust ゾーン内の特定のホストにアクセスします。この例では、表 NAT の設定:テナント システムの NAT 設定で説明されています。
機能 |
名前 |
設定パラメータ |
|---|---|---|
静的、送信元、宛先のNATルールセット |
R1 |
|
ソースプール |
パット |
アドレス192.0.2.1から192.0.2.24まで。 |
宛先プール |
H1 |
住所:192.168.1.200。 |
プロキシARP |
ARP |
アドレス192.0.2.1から192.0.2.24まで。 |
トラフィック方向用の NAT インターフェイス。 |
ge-0/0/0 と ge-0/0/1。 |
設定
手順
CLIクイックコンフィグレーション
この例をすばやく設定するには、以下のコマンドをコピーしてテキスト ファイルに貼り付け、改行を削除し、ネットワーク設定に一致させる必要がある詳細情報を変更し、コマンドを [edit] 階層レベルでCLIにコピー アンド ペーストして、設定モードから commit を入力します。
set tenants tn1 security nat source pool pat address 192.0.2.1 to 192.0.2.24 set tenants tn1 security nat source rule-set from_intf from interface ge-0/0/0.0 set tenants tn1 security nat source rule-set from_intf to interface ge-0/0/1.0 set tenants tn1 security nat source rule-set from_intf rule r1 match source-address 192.0.2.0/24 set tenants tn1 security nat source rule-set from_intf rule r1 match destination-address 203.0.113.200/24 set tenants tn1 security nat source rule-set from_intf rule r1 then source-nat pool pat set tenants tn1 security nat static rule-set from_zone from zone trust set tenants tn1 security nat static rule-set from_zone rule r1 match source-address 192.0.2.0/24 set tenants tn1 security nat static rule-set from_zone rule r1 match destination-address 203.0.113.203/24 set tenants tn1 security nat static rule-set from_zone rule r1 then static-nat prefix 192.168.1.203/24 set tenants tn1 security nat destination pool h1 address 192.168.1.200 set tenants tn1 security nat destination rule-set from_zone from zone trust set tenants tn1 security nat destination rule-set from_zone rule r1 match source-address 192.0.2.0/24 set tenants tn1 security nat destination rule-set from_zone rule r1 match destination-address 203.0.113.202/24 set tenants tn1 security nat destination rule-set from_zone rule r1 then destination-nat pool h1 set tenants tn1 security nat proxy-arp interface ge-0/0/1.0 address 192.0.2.1 to 192.0.2.24
ステップバイステップの手順
次の例では、設定階層のさまざまなレベルに移動する必要があります。その方法の詳細については、『Junos OS CLIユーザーガイド』の「 構成モードでのCLIエディターの使用 」を参照してください。
テナントシステムでNATを設定するには:
テナントシステムのセキュリティNATソースプールとルールセットを作成します。
[edit tenant tn1 security nat source] user@host# set tenants tn1 security nat source pool pat address 192.0.2.1 to 192.0.2.24 user@host# set tenants tn1 security nat source rule-set from_intf from interface ge-0/0/0.0 user@host# set tenants tn1 security nat source rule-set from_intf to interface ge-0/0/1.0 user@host# set tenants tn1 security nat source rule-set from_intf rule r1 match source-address 192.0.2.0/24 user@host# set tenants tn1 security nat source rule-set from_intf rule r1 match destination-address 203.0.113.200/24 user@host# set tenants tn1 security nat source rule-set from_intf rule r1 then source-nat pool pat
テナントシステム用のセキュリティNAT静的ルールセットを作成します。
[edit tenants tn1 security nat static] user@host# set tenants tn1 security nat static rule-set from_zone from zone trust user@host# set tenants tn1 security nat static rule-set from_zone rule r1 match source-address 192.0.2.0/24 user@host# set tenants tn1 security nat static rule-set from_zone rule r1 match destination-address 203.0.113.203/24 user@host# set tenants tn1 security nat static rule-set from_zone rule r1 then static-nat prefix 192.168.1.203/24
テナントシステムのセキュリティ NAT 宛先プールとルールセットを作成します。
[edit tenants tn1 security nat destination] user@host# set tenants tn1 security nat destination pool h1 address 192.168.1.200 user@host# set tenants tn1 security nat destination rule-set from_zone from zone trust user@host# set tenants tn1 security nat destination rule-set from_zone rule r1 match source-address 192.0.2.0/24 user@host# set tenants tn1 security nat destination rule-set from_zone rule r1 match destination-address 203.0.113.202/24 user@host# set tenants tn1 security nat destination rule-set from_zone rule r1 then destination-nat pool h1
プロキシ ARP(Address Resolution Protocol)を設定します。
[edit tenant tn1 security nat] user@host# set tenants tn1 security nat proxy-arp interface ge-0/0/1.0 address 192.0.2.1 to 192.0.2.24
結果
設定モードから、 show tenants tn1 security nat コマンドを入力して設定を確認します。出力に意図した設定が表示されない場合は、この例の設定手順を繰り返して修正します。
source {
pool pat {
address {
192.0.2.1 to 192.0.2.24;
}
}
rule-set from_intf {
from interface ge-0/0/0.0;
to interface ge-0/0/1.0;
rule r1 {
match {
source-address 192.168.1.0/24;
destination-address [203.0.113.200/24 ];
}
then {
source-nat {
pool {
pat;
}
}
}
}
}
}
destination {
pool h1 {
address 192.168.1.200;
}
rule-set from_zone {
from zone untrust;
rule r1 {
match {
source-address 192.0.2.0/24;
destination-address 203.0.113.202/24;
}
then {
destination-nat {
pool {
h1;
}
}
}
}
}
}
static {
rule-set from_zone {
from zone untrust;
rule r1 {
match {
source-address 192.0.2.0/24;
destination-address 203.0.113.203/24;
}
then {
static-nat {
prefix {
192.168.1.203/24;
}
}
}
}
}
}
proxy-arp {
interface ge-0/0/1.0 {
address {
192.0.2.1 to 192.0.2.24;
}
}
}
デバイスの設定が完了したら、設定モードから commit を入力します。
検証
設定が正常に機能していることを確認するには、以下のタスクを実行します。
静的 NAT 設定の検証
目的
静的 NAT ルールセットに一致するトラフィックがあることを確認するには、次の手順に従います。
アクション
動作モードから、 show security nat static rule all tenant tn1 コマンドを入力します。 Translation hits フィールドを表示して、ルールに一致するトラフィックを確認します。
user@host> show security nat static rule all tenant tn1
出力例
コマンド名
Total static-nat rules: 1
Total referenced IPv4/IPv6 ip-prefixes: 2/0
Static NAT rule: r1 Rule-set: from_zone
Rule-Id : 1
Rule position : 1
From zone : untrust
Source addresses : 192.0.2.0 - 192.0.2.255
Destination addresses : 203.0.113.203
Host addresses : 192.168.1.203
Netmask : 32
Host routing-instance : N/A
Translation hits : 0
Successful sessions : 0
Failed sessions : 0
Number of sessions : 0
意味
コマンド出力は、静的 NAT ルールを表示します。 Translation hits フィールドを表示して、静的ルールに一致するトラフィックを確認します。
宛先 NAT 設定の検証
目的
宛先NATルールセットに一致するトラフィックがあることを確認するには。
アクション
動作モードから、 show security nat destination rule all tenant tn1 コマンドを入力します。 Translation hits フィールドを表示して、ルールに一致するトラフィックを確認します。
user@host> show security nat destination rule all tenant tn1
出力例
コマンド名
Total destination-nat rules: 1
Total referenced IPv4/IPv6 ip-prefixes: 2/0
Destination NAT rule: r1 Rule-set: from_zone
Rule-Id : 1
Rule position : 1
From zone : untrust
Match
Source addresses : 192.0.2.0 - 192.0.2.255
Destination addresses : 203.0.113.202 - 203.0.113.202
Action : h1
Translation hits : 0
Successful sessions : 0
Failed sessions : 0
Number of sessions : 0
意味
コマンド出力は、宛先NATルールを表示します。 Translation hits フィールドを表示して、宛先ルールに一致するトラフィックを確認します。
送信元 NAT 設定の検証
目的
送信元NATルールセットに一致するトラフィックがあることを確認するには、次の手順に従います。
アクション
動作モードから、 show security nat source rule all tenant tn1 コマンドを入力します。 Translation hits フィールドを表示して、ルールに一致するトラフィックを確認します。
user@host> show security nat source rule all tenant tn1
出力例
コマンド名
Total rules: 1
Total referenced IPv4/IPv6 ip-prefixes: 2/0
source NAT rule: r1 Rule-set: from_intf
Rule-Id : 1
Rule position : 1
From interface : ge-0/0/0.0
To interface : ge-0/0/1.0
Match
Source addresses : 192.168.1.0 - 192.168.1.255
Destination addresses : 203.0.113.200 - 203.0.113.200
Action : pat
Persistent NAT type : N/A
Persistent NAT mapping type : address-port-mapping
Inactivity timeout : 0
Max session number : 0
Translation hits : 0
Successful sessions : 0
Failed sessions : 0
Number of sessions : 0
意味
コマンド出力は、送信元NATルールを表示します。 Translation hits フィールドを表示して、送信元ルールに一致するトラフィックを確認します。