静的宛先 NAT
IPv4ネットワークにおける静的宛先アドレス変換の設定
宛先アドレス変換を使用するには、プールアドレス空間のサイズが宛先アドレス空間以上である必要があります。プール内のNATアドレス数がfromステートメントの宛先アドレス数よりも多い限り、複数のアドレス、範囲、またはプレフィックスを含めることができるdestination-poolステートメントの名前を指定する必要があります。
IPv4ネットワークで宛先アドレス変換を設定するには:
次の例では、変換タイプを dnat-44として設定しています。
[edit services]
user@host# show
service-set s1 {
nat-rules rule-dnat44;
interface-service {
service-interface ms-0/1/0;
}
}
nat {
pool dest-pool {
address 4.1.1.2/32;
}
rule rule-dnat44 {
match-direction input;
term t1 {
from {
destination-address {
20.20.20.20/32;
}
}
then {
translated {
destination-pool dest-pool;
translation-type {
dnat-44;
}
}
}
}
}
}
adaptive-services-pics {
traceoptions {
flag all;
}
}
以下の設定では、 term1 は任意のプライベートアドレスから任意のパブリックアドレスへのトラフィックの送信元アドレス変換を設定します。変換はすべてのサービスに適用されます。 term2 は、任意のパブリックアドレスからサーバーの仮想 IP アドレスへの Hypertext Transfer Protocol(HTTP)トラフィックの宛先アドレス変換を実行します。仮想サーバーのIPアドレスは、内部IPアドレスに変換されます。
[edit services nat]
rule my-nat-rule {
match-direction input;
term my-term1 {
from {
source-address private;
destination-address public;
}
then {
translated {
source-pool my-pool; # pick address from a pool
translation-type napt-44; # dynamic NAT with port translation
}
}
}
}
rule my-nat-rule2 {
match-direction input;
term my-term2 {
from {
destination-address 192.168.137.3; # my server’s virtual address
application http;
}
then {
translated {
destination-pool nat-pool-name;
translation-type dnat-44; # static destination NAT
}
}
}
}
}
以下の設定では、プールを定義せずに宛先プレフィックス 20.20.10.0/32 を使用して NAT を実行します。
[edit services nat]
rule src-nat {
match-direction input;
term t1 {
from {
destination-address 10.10.10.10/32;
then {
translation-type dnat44;
destination-prefix 20.20.10.0/24;
}
}
}
}