NAT 設定の概要
このトピックでは、ネットワークアドレス変換(NAT)と複数の ISP を設定する方法について説明します。また、このトピックでは、トレース オプションの設定と NAT テーブルの監視によって、NAT トラフィックを検証するのに役立ちます。
NAT ウィザードを使用した NAT の構成
NAT ウィザードを使用して、基本的な NAT 設定を実行できます。より高度な設定を行うには、J-Web インターフェイスまたは CLI を使用します。
NAT ウィザードを使用して NAT を設定するには、次の手順に従います。
- J-Web インターフェイスで [
Configure>Tasks>Configure NAT] を選択します。 - [Launch NAT Wizard](NATウィザードを起動)ボタンをクリックします。
- ウィザードのプロンプトに従います。
ウィザードページの左上のエリアは、構成プロセスの進捗を示しています。ページの左下のエリアは、フィールドに対応するヘルプを示しています。リソース見出しの下のリンクをクリックすると、ブラウザーでドキュメントが開きます。ドキュメントが新しいタブで開いた場合は、ドキュメントを閉じる際、(ブラウザー ウィンドウではなく)タブのみを閉じるようにしてください。
例:複数の ISP の NAT の設定
この例では、複数の ISP のアドレス変換用に Juniper Networks デバイスを設定する方法を示しています。
必要条件
開始する前に、以下を実行します。
デバイス上のネットワークインターフェイスを設定します。 セキュリティデバイス向けインターフェイスユーザーガイドを参照してください。
セキュリティ ゾーンを作成し、インターフェイスを割り当てます。 セキュリティゾーンとはを参照してください。
概要
この例では、2つのISP接続を介してNAT機能を使用し、LANをインターネットに接続することで、SRXシリーズファイアウォールを設定できます。この構成では、信頼はプライベート アドレス空間のセキュリティ ゾーンであり、パブリック アドレス空間の 2 つの信頼されていないセキュリティ ゾーンは、LAN から 2 つの ISP への接続、またはその逆の接続に使用されます。この例は、LAN からインターネットに接続する送信元 NAT ルールと、インターネットから LAN に接続するための宛先および静的 NAT ルールを組み合わせたものです。
構成
複数の ISP の NAT を構成する
CLIクイック構成
この例を素早く設定するには、以下のコマンドをコピーしてテキスト・ファイルに貼り付け、改行を削除し、ネットワーク設定に一致させる必要がある詳細情報を変更し、[ edit] 階層レベルのCLIにコマンドをコピー&ペーストし、設定モードから commit を入力してください。
set routing-instances isp1 instance-type virtual-router set routing-instances isp1 interface ge-0/0/2.0 set routing-instances isp1 routing-options static route 10.0.0.0/8 next-table inet.0 set routing-instances isp1 routing-options static route 0.0.0.0/0 next-hop 192.0.2.20 set routing-instances isp2 instance-type virtual-router set routing-instances isp2 interface ge-0/0/3.0 set routing-instances isp2 routing-options static route 10.0.0.0/8 next-table inet.0 set routing-instances isp2 routing-options static route 0.0.0.0/0 next-hop 198.51.100.251 set routing-options interface-routes rib-group inet isp set routing-options static route 10.0.0.0/8 next-hop 10.0.21.254 set routing-options rib-groups isp import-rib inet.0 set routing-options rib-groups isp import-rib isp1.inet.0 set routing-options rib-groups isp import-rib isp2.inet.0 set security policies from-zone trust to-zone untrust1 policy tr-untr1-pol match source-address any set security policies from-zone trust to-zone untrust1 policy tr-untr1-pol match destination-address any set security policies from-zone trust to-zone untrust1 policy tr-untr1-pol match application any set security policies from-zone trust to-zone untrust1 policy tr-untr1-pol then permit set security policies from-zone trust to-zone untrust2 policy tr-untr2-pol match source-address any set security policies from-zone trust to-zone untrust2 policy tr-untr2-pol match destination-address any set security policies from-zone trust to-zone untrust2 policy tr-untr2-pol match application any set security policies from-zone trust to-zone untrust2 policy tr-untr2-pol then permit set security policies from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match source-address any set security policies from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match destination-address any set security policies from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match application any set security policies from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol then reject set security policies from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match source-address any set security policies from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match destination-address any set security policies from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match application any set security policies from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol then reject set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol match source-address any set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol match destination-address ftp-ser set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol match destination-address telnet-ser set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol match application junos-ftp set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol match application junos-telnet set security policies from-zone untrust1 to-zone trust policy untr1-tr-pol then permit set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match source-address any set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address 10.171.9.23/32 set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address http-ser set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address 10.103.12.0/24 set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-http set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-icmp-all set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-dhcp-server set security policies from-zone untrust2 to-zone trust policy untr2-tr-pol then permit set security nat source pool pool_1 address 192.0.2.40/32 to 192.0.2.190/32 set security nat source pool pool_2 address 192.0.2.250/32 set security nat source pool pool_3 address 198.51.100.20/32 to 198.51.100.30/32 set security nat source address-persistent set security nat source pool-utilization-alarm raise-threshold 90 set security nat source pool-utilization-alarm clear-threshold 80 set security nat source rule-set SR_SET_1 from zone trust set security nat source rule-set SR_SET_1 to zone untrust1 set security nat source rule-set SR_SET_1 rule rule1 match source-address 10.11.0.0/16 set security nat source rule-set SR_SET_1 rule rule1 match source-address 10.147.0.0/16 set security nat source rule-set SR_SET_1 rule rule1 match destination-address 0.0.0.0/0 set security nat source rule-set SR_SET_1 rule rule1 then source-nat pool pool_1 set security nat source rule-set SR_SET_1 rule rule2 match source-address 10.148.1.0/27 set security nat source rule-set SR_SET_1 rule rule2 match destination-address 0.0.0.0/0 set security nat source rule-set SR_SET_1 rule rule2 then source-nat interface set security nat source rule-set SR_SET_2 from zone trust set security nat source rule-set SR_SET_2 to zone untrust2 set security nat source rule-set SR_SET_2 rule rule3 match source-address 10.140.21.0/27 set security nat source rule-set SR_SET_2 rule rule3 then source-nat pool pool_3 set security nat source rule-set SR_SET_2 rule rule4 match source-address 10.150.45.0/24 set security nat source rule-set SR_SET_2 rule rule4 then source-nat off set security nat destination pool dppol_1 address 10.101.1.10/32 set security nat destination pool dppol_1 address port 21 set security nat destination pool dppol_2 address 10.101.1.11/32 set security nat destination pool dppol_2 address port 2101 set security nat destination pool dppol_3 address 10.103.12.251/32 set security nat destination pool dppol_3 address port 23 set security nat destination pool dppol_4 address 10.103.12.241/32 set security nat destination pool dppol_4 address port 23 set security nat destination pool dppol_5 address 10.103.1.11/32 set security nat destination pool dppol_5 address port 22 set security nat destination rule-set DR_SET1 from routing-instance isp1 set security nat destination rule-set DR_SET1 rule rule1 match destination-address 192.168.0.10/32 set security nat destination rule-set DR_SET1 rule rule1 match destination-port 7230 set security nat destination rule-set DR_SET1 rule rule1 then destination-nat pool dppol_1 set security nat destination rule-set DR_SET1 rule rule2 match destination-address 192.169.1.0/24 set security nat destination rule-set DR_SET1 rule rule2 then destination-nat pool dppol_2 set security nat destination rule-set DR_SET2 from routing-instance isp2 set security nat destination rule-set DR_SET2 rule rule3 match destination-address 192.168.2.2/32 set security nat destination rule-set DR_SET2 rule rule3 match destination-port 7351 set security nat destination rule-set DR_SET2 rule rule3 then destination-nat pool dppol_3 set security nat destination rule-set DR_SET2 rule rule4 match destination-address 192.168.4.171/32 set security nat destination rule-set DR_SET2 rule rule4 match destination-port 3451 set security nat destination rule-set DR_SET2 rule rule4 then destination-nat pool dppol_4 set security nat static rule-set ST_SET1 from zone trust set security nat static rule-set ST_SET1 rule rule1 match destination-address 10.0.10.0/24 set security nat static rule-set ST_SET1 rule rule1 then static-nat prefix 192.168.5.0/24 set security nat static rule-set ST_SET2 from routing-instance isp1 set security nat static rule-set ST_SET2 rule rule2 match destination-address 192.168.6.0/24 set security nat static rule-set ST_SET2 rule rule2 then static-nat prefix 10.107.30.0/24 set security nat static rule-set ST_SET2 rule rule3 match destination-address 192.168.0.10/32 set security nat static rule-set ST_SET2 rule rule3 then static-nat prefix 10.171.9.23/32
手順
次の例では、設定階層のいくつかのレベルに移動する必要があります。その方法の説明については、Junos OS CLIユーザーガイドの 設定モードでCLIエディターを使用する を参照してください。
ルーティングインスタンスを設定します。
[edit ] user@host# set routing-instances isp1 instance-type virtual-router user@host# set routing-instances isp1 interface ge-0/0/2.0 user@host# set routing-instances isp1 routing-options static route 10.0.0.0/8 next-table inet.0 user@host# set routing-instances isp1 routing-options static route 0.0.0.0/0 next-hop 192.0.2.20 user@host# set routing-instances isp2 instance-type virtual-router user@host# set routing-instances isp2 interface ge-0/0/3.0 user@host# set routing-instances isp2 routing-options static route 10.0.0.0/8 next-table inet.0 user@host# set routing-instances isp2 routing-options static route 0.0.0.0/0 next-hop 198.51.100.251
RIBグループとルーティングオプションを設定します。
[edit ] user@host# set routing-options interface-routes rib-group inet isp user@host# set routing-options static route 10.0.0.0/8 next-hop 10.0.21.254 user@host# set routing-options rib-groups isp import-rib inet.0 user@host# set routing-options rib-groups isp import-rib isp1.inet.0 user@host# set routing-options rib-groups isp import-rib isp2.inet.0
セキュリティポリシーを設定します。
[edit security policies] user@host# set from-zone trust to-zone untrust1 policy tr-untr1-pol match source-address any user@host# set from-zone trust to-zone untrust1 policy tr-untr1-pol match destination-address any user@host# set from-zone trust to-zone untrust1 policy tr-untr1-pol match application any user@host# set from-zone trust to-zone untrust1 policy tr-untr1-pol then permit user@host# set from-zone trust to-zone untrust2 policy tr-untr2-pol match source-address any user@host# set from-zone trust to-zone untrust2 policy tr-untr2-pol match destination-address any user@host# set from-zone trust to-zone untrust2 policy tr-untr2-pol match application any user@host# set from-zone trust to-zone untrust2 policy tr-untr2-pol then permit user@host# set from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match source-address any user@host# set from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match destination-address anyfrom-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match destination-address any user@host# set from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol match application any user@host# set from-zone untrust1 to-zone untrust2 policy untr1-untr2-pol then reject user@host# set from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match source-address any user@host# set from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match destination-address any user@host# set from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol match application any user@host# set from-zone untrust2 to-zone untrust1 policy untr2-untr1-pol then reject user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol match source-address any user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol match destination-address ftp-ser user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol match destination-address telnet-ser user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol match application junos-ftp user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol match application junos-telnet user@host# set from-zone untrust1 to-zone trust policy untr1-tr-pol then permit user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match source-address any user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address 10.171.9.23/32 user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address http-ser user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match destination-address 10.103.12.0/24 user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-http user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-icmp-all user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol match application junos-dhcp-server user@host# set from-zone untrust2 to-zone trust policy untr2-tr-pol then permit
送信元NATプールとルールを設定します。
[edit security nat] user@host# set source pool pool_1 address 192.0.2.40/32 to 192.0.2.190/32 user@host# set source pool pool_2 address 192.0.2.250/32 user@host# set source pool pool_3 address 198.51.100.20/32 to 198.51.100.30/32 user@host# set source address-persistent user@host# set source pool-utilization-alarm raise-threshold 90 user@host# set source pool-utilization-alarm clear-threshold 80 user@host# set source rule-set SR_SET_1 from zone trust user@host# set source rule-set SR_SET_1 to zone untrust1 user@host# set source rule-set SR_SET_1 rule rule1 match source-address 10.11.0.0/16 user@host# set source rule-set SR_SET_1 rule rule1 match source-address 10.147.0.0/16 user@host# set source rule-set SR_SET_1 rule rule1 match destination-address 0.0.0.0/0 user@host# set source rule-set SR_SET_1 rule rule1 then source-nat pool pool_1 user@host# set source rule-set SR_SET_1 rule rule2 match source-address 10.148.1.0/27 user@host# set source rule-set SR_SET_1 rule rule2 match destination-address 0.0.0.0/0 user@host# set source rule-set SR_SET_1 rule rule2 then source-nat interface user@host# set source rule-set SR_SET_2 from zone trust user@host# set source rule-set SR_SET_2 to zone untrust2 user@host# set source rule-set SR_SET_2 rule rule3 match source-address 10.140.21.0/27 user@host# set source rule-set SR_SET_2 rule rule3 then source-nat pool pool_3 user@host# set source rule-set SR_SET_2 rule rule4 match source-address 10.150.45.0/24 user@host# set source rule-set SR_SET_2 rule rule4 then source-nat off
宛先 NAT プールとルールを構成します。
[edit security nat] user@host#set destination pool dppol_1 address 10.101.1.10/32 user@host#set destination pool dppol_1 address port 21 user@host#set destination pool dppol_2 address 10.101.1.11/32 user@host#set destination pool dppol_2 address port 2101 user@host#set destination pool dppol_3 address 10.103.12.251/32 user@host#set destination pool dppol_3 address port 23 user@host#set destination pool dppol_4 address 10.103.12.241/32 user@host#set destination pool dppol_4 address port 23 user@host#set destination pool dppol_5 address 10.103.1.11/32 user@host#set destination pool dppol_5 address port 22 user@host#set destination rule-set DR_SET1 from routing-instance isp1 user@host#set destination rule-set DR_SET1 rule rule1 match destination-address 192.168.0.10/32 user@host#set destination rule-set DR_SET1 rule rule1 match destination-port 7230 user@host#set destination rule-set DR_SET1 rule rule1 then destination-nat pool dppol_1 user@host#set destination rule-set DR_SET1 rule rule2 match destination-address 192.169.1.0/24 user@host#set destination rule-set DR_SET1 rule rule2 then destination-nat pool dppol_2 user@host#set destination rule-set DR_SET2 from routing-instance isp2 user@host#set destination rule-set DR_SET2 rule rule3 match destination-address 192.168.2.2/32 user@host#set destination rule-set DR_SET2 rule rule3 match destination-port 7351 user@host#set destination rule-set DR_SET2 rule rule3 then destination-nat pool dppol_3 user@host#set destination rule-set DR_SET2 rule rule4 match destination-address 192.168.4.171/32 user@host#set destination rule-set DR_SET2 rule rule4 match destination-port 3451 user@host#set destination rule-set DR_SET2 rule rule4 then destination-nat pool dppol_4
静的NATルールを設定します。
[edit security nat] user@host#set static rule-set ST_SET1 from zone trust user@host#set static rule-set ST_SET1 rule rule1 match destination-address 10.0.10.0/24 user@host#set static rule-set ST_SET1 rule rule1 then static-nat prefix 192.168.5.0/24 user@host#set static rule-set ST_SET2 from routing-instance isp1 user@host#set static rule-set ST_SET2 rule rule2 match destination-address 192.168.6.0/24 user@host#set static rule-set ST_SET2 rule rule2 then static-nat prefix 10.107.30.0/24 user@host#set static rule-set ST_SET2 rule rule3 match destination-address 192.168.7.2/32 user@host#set static rule-set ST_SET2 rule rule3 then static-nat prefix 10.171.9.23/32
業績
設定モードから、 show configuration コマンドを入力して設定を確認します。出力結果に意図した設定内容が表示されない場合は、この例の設定手順を繰り返して設定を修正します。
user@host# show configuration routing-intances
routing-instances {
isp1 {
instance-type virtual-router;
interface ge-0/0/2.0;
routing-options {
static {
route 10.0.0.0/8 next-table inet.0;
route 0.0.0.0/0 next-hop 192.0.2.20;
}
}
}
isp2 {
instance-type virtual-router;
interface ge-0/0/3.0;
routing-options {
static {
route 10.0.0.0/8 next-table inet.0;
route 0.0.0.0/0 next-hop 198.51.100.251;
}
}
}
}
user@host# show configuration routing-options
routing-options {
interface-routes {
rib-group inet isp;
}
static {
route 10.0.0.0/8 next-hop 10.0.21.254;
}
rib-groups {
isp {
import-rib [ isp1.inet.0 isp2.inet.0 ];
}
}
}
user@host# show configuration policies
policies {
from-zone trust to-zone untrust1 {
policy tr-untr1-pol {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
from-zone trust to-zone untrust2 {
policy tr-untr2-pol {
match {
source-address any;
destination-address any;
application any;
}
then {
permit;
}
}
}
from-zone untrust1 to-zone untrust2 {
policy untr1-untr2-pol {
match {
source-address any;
destination-address any;
application any;
}
then {
reject;
}
}
}
from-zone untrust2 to-zone untrust1 {
policy untr2-untr1-pol {
match {
source-address any;
destination-address any;
application any;
}
then {
reject;
}
}
}
from-zone untrust1 to-zone trust {
policy untr1-tr-pol {
match {
source-address any;
destination-address [ ftp-ser telnet-ser ];
application [ junos-ftp junos-telnet ];
}
then {
permit;
}
}
}
from-zone untrust2 to-zone trust {
policy untr2-tr-pol {
match {
source-address any;
destination-address [ 10.171.9.23/32 http-ser 10.103.12.0/24 ];
application [ junos-http junos-icmp-all junos-dhcp-server ];
}
then {
permit;
}
}
}
}
user@host# show configuration security nat
security {
nat {
source {
pool pool_1 {
address {
192.0.2.40/32 to 192.0.2.190/32;
}
}
pool pool_2 {
address {
192.0.2.250/32;
}
}
pool pool_3 {
address {
198.51.100.20/32 to 198.51.100.30/32;
}
}
address-persistent;
pool-utilization-alarm raise-threshold 90 clear-threshold 80;
rule-set SR_SET_1 {
from zone trust;
to zone untrust1;
rule rule1 {
match {
source-address [ 10.11.0.0/16 10.147.0.0/16 ];
destination-address 0.0.0.0/0;
}
then {
source-nat {
pool {
pool_1;
}
}
}
}
rule rule2 {
match {
source-address 10.148.1.0/27;
destination-address 0.0.0.0/0;
}
then {
source-nat {
interface;
}
}
}
}
rule-set SR_SET_2 {
from zone trust;
to zone untrust2;
rule rule3 {
match {
source-address 10.140.21.0/27;
}
then {
source-nat {
pool {
pool_3;
}
}
}
}
rule rule4 {
match {
source-address 10.150.45.0/24;
}
then {
source-nat {
off;
}
}
}
}
}
user@host# show configuration security nat
destination {
pool dppol_1 {
address 10.101.1.10/32 port 21;
}
pool dppol_2 {
address 10.101.1.11/32 port 2101;
}
pool dppol_3 {
address 10.103.12.251/32 port 23;
}
pool dppol_4 {
address 10.103.12.241/32 port 23;
}
pool dppol_5 {
address 10.103.1.11/32 port 22;
}
rule-set DR_SET1 {
from routing-instance isp1;
rule rule1 {
match {
destination-address 192.168.0.10/32;
destination-port 7230;
}
then {
destination-nat pool dppol_1;
}
}
rule rule2 {
match {
destination-address 192.169.1.0/24;
}
then {
destination-nat pool dppol_2;
}
}
}
rule-set DR_SET2 {
from routing-instance isp2;
rule rule3 {
match {
destination-address 192.168.2.2/32;
destination-port 7351;
}
then {
destination-nat pool dppol_3;
}
}
rule rule4 {
match {
destination-address 192.168.4.171/32;
destination-port 3451;
}
then {
destination-nat pool dppol_4;
}
}
}
}
user@host# show configuration static nat
static {
rule-set ST_SET1 {
from zone trust;
rule rule1 {
match {
destination-address 10.0.10.0/24;
}
then {
static-nat prefix 192.168.5.0/24;
}
}
}
rule-set ST_SET2 {
from routing-instance isp1;
rule rule2 {
match {
destination-address 192.168.6.0/24;
}
then {
static-nat prefix 10.107.30.0/24;
}
}
rule rule3 {
match {
destination-address 192.168.7.2/32;
}
then {
static-nat prefix 10.171.9.23/32;
}
}
}
}
}
デバイスの設定が完了したら、設定モードから commit を入力します。
NAT のプロキシ ARP の設定(CLI 手順)
NAT プロキシ ARP機能を使用して、送信元または宛先の NAT を必要とし、イングレス インターフェイスと同じサブネット内にある IP アドレスのプロキシ ARP エントリーを設定します。SRXシリーズファイアウォールでは、NATプロキシ ARPを明示的に設定する必要があります。
NAT プロキシ ARP を設定する場合、プロキシ ARP を設定する論理インターフェイスを指定する必要があります。次に、アドレスまたはアドレス範囲を入力します。
デバイスは、以下の条件でプロキシ ARP を実行します。
静的NATと送信元NAT プールで定義されたアドレスが、イングレスインターフェイスのアドレスと同じサブネットにある場合
宛先 NAT ルールの元の宛先アドレス エントリのアドレスが、イングレス インターフェイスのアドレスと同じサブネットにある場合
user@host# set security nat proxy-arp interface fe-0/0/0.0 address 10.1.1.10 to 10.1.1.20
NAT トレース オプションの設定
目的
NAT トレース オプションの階層では、検証用のトレース ファイルとフラグを設定します。
SRXシリーズファイアウォールには、ルーティングエンジン(RE)とパケット転送エンジン(PFE)の2つの主要コンポーネントがあります。PFE は、ukernel 部分とリアルタイム部分に分かれています。
NAT設定がコミットされると、まずREで設定がチェックされ、検証されます。検証後、設定はPFEにプッシュされます。構成は ukernel PFE にインストールされ、リアルタイム PFE の NAT ルールに一致する各パケットに対してアクションが実行されます。
検証のために、フラグを個別にオンにして、RE、ukernel PFE、またはリアルタイム PFE の NAT 機能をデバッグできます。
nat-reフラグは、REでのNAT設定検証とPFEへの設定プッシュのトレースを記録します。nat-pfeフラグは、ukernel PFE への NAT 設定インストールのトレースを記録します。nat-rtフラグは、NAT ルール一致のトレースと、リアルタイム PFE に対する後続のアクションを記録します。
トレース・データはデフォルトで /var/log/security-trace に書き込まれ、 show log security-traceコマンドを使用して表示できます。
デバイスのデバイスからも削除されます セッションログが有効になっている場合、セッションログには各セッションの特定のNATの詳細が含まれます。セッションログを有効にする方法については セキュリティポリシー統計の監視 を、セッションログで提供される情報の説明については SRXシリーズサービスゲートウェイのセッションログエントリで提供される情報 を参照してください。
アクション
コミット時にデバイスからも削除されますがデバイスに正しく更新され、NAT ルール一致とその後のアクションが正しいことを確認するには、 security nat traceoptions ステートメントを使用します。
user@host# set security nat traceoptions flag all user@host# set security nat traceoptions flag destination-nat-pfe user@host# set security nat traceoptions flag destination-nat-re user@host# set security nat traceoptions flag destination-nat-rti user@host# set security nat traceoptions flag source-nat-pfe user@host# set security nat traceoptions flag source-nat-re user@host# set security nat traceoptions flag source-nat-rt user@host# set security nat traceoptions flag static-nat-pfe user@host# set security nat traceoptions flag static-nat-re user@host# set security nat traceoptions flag static-nat-rt
NAT 変換がトラフィックに適用されていることを確認し、NAT 変換による個々のトラフィック フロー処理を表示するには、 security nat traceoptions コマンドと security flow traceoptions コマンドの両方を同時に使用します。コマンドも設定されていないと、 security nat traceoptions コマンドを使用して設定された NAT トレースは記録されないため、コマンド flow traceoptions 一緒に使用されます。
特定のフローをフィルタリングするには、パケット フィルターを定義し、それを traceoption として使用します。
user@host# set security flow traceoptions packet-filter packet-filter user@host# set security flow traceoptions packet-filter packet-filter apply-groups user@host# set security flow traceoptions packet-filter packet-filter apply-groups-except user@host# set security flow traceoptions packet-filter packet-filter destination-port user@host# set security flow traceoptions packet-filter packet-filter destination-prefix user@host# set security flow traceoptions packet-filter packet-filter interface user@host# set security flow traceoptions packet-filter packet-filter protocol user@host# set security flow traceoptions packet-filter packet-filter source-port user@host# set security flow traceoptions packet-filter packet-filter source-prefix
NAT トラフィックを検証し、データ プレーンですべてのトラフィック トレースを有効にするには、次の例に示すように、traceoptions set security flow traceoptions flag basic-datapath コマンドを使用します。シンプルなパケット フィルターを使用します。
user@host# set security flow traceoptions file filename user@host# set security flow traceoptions flag basic-datapath user@host# set security flow traceoptions packet-filter client-traffic source-prefixprefix user@host# set security flow traceoptions packet-filter client-traffic destination-prefixprefix user@host# set security nat traceoptions flag all
NAT 受信テーブル情報の監視
目的
NAT テーブル情報を表示します。
アクション
J-Web ユーザーインターフェイスで [Monitor>NAT>Incoming Table ] を選択するか、次の CLI コマンドを入力します。
show security nat incoming-table
表 1 は、入力テーブル表示の主要な出力フィールドを要約したものです。
畑 |
価値観 |
|---|---|
| 統計学 | |
使用中 |
NAT テーブル内のエントリー数。 |
最大 |
NAT テーブルで可能なエントリーの最大数。 |
エントリの割り当てに失敗しました |
割り振りに失敗したエントリーの数。 |
| 受信テーブル | |
クリア |
|
行き先 |
宛先 IP アドレスとポート番号。 |
ホスト |
ホスト IP アドレスと、IP アドレスがマップされているポート番号。 |
参照 |
エントリーを参照しているセッションの数。 |
タイムアウト |
NAT テーブル内のエントリーのタイムアウト(秒単位)。 |
ソースプール |
変換が割り当てられているソース プールの名前。 |
インターフェイス NAT ポート情報の監視
目的
インターフェイスのソースプール情報のポート使用状況を表示します。
アクション
インターフェイスのNATポート情報を監視するには、次のいずれかを実行します。
J-Web ユーザ インターフェイスで [Monitor>Firewall/NAT>Interface NAT ] または [Monitor>NAT>Interface NAT Ports ] を選択するか、CLI コマンド
show security nat interface-nat-portsを入力します。
表 2 は、インターフェイス NAT 表示の主要な出力フィールドをまとめたものです。
畑 |
価値観 |
追加情報 |
|---|---|---|
| インターフェイス NAT サマリー テーブル | ||
プール インデックス |
ポート プール インデックス。 |
– |
合計ポート数 |
ポート プール内のポートの合計数。 |
– |
単一ポート割り当て |
一度に 1 つずつ割り当てられる、使用中のポートの数。 |
– |
シングルポートが利用可能 |
一度に 1 つずつ割り当てられ、無料で使用できるポートの数。 |
– |
割り当てられたツイン ポート |
一度に 2 つ割り当てられる使用中のポートの数。 |
– |
ツインポートが利用可能 |
一度に 2 つ割り当てられ、無料で使用できるポートの数。 |
– |