Static Destination NAT
Configuring Static Destination Address Translation in IPv4 Networks
To use destination address translation, the size of the
pool address space must be greater than or equal to the destination
address space. You must specify a name for the destination-pool statement, which can contain multiple addresses, ranges, or prefixes,
as long as the number of NAT addresses in the pool is larger than
the number of destination addresses in the from statement.
To configure destination address translation in IPv4 networks:
The following example configures the translation type as 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;
}
}
In the following configuration, term1 configures source address translation for traffic from any private address to any public address. The translation is applied for all services. term2 performs destination address translation for Hypertext Transfer Protocol (HTTP) traffic from any public address to the server’s virtual IP address. The virtual server IP address is translated to an internal IP address.
[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
}
}
}
}
}
The following configuration performs NAT using the destination prefix 20.20.10.0/32 without defining a pool.
[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;
}
}
}
}