정적 대상 NAT
IPv4 네트워크에서 정적 대상 주소 변환 구성
대상 주소 변환을 사용하려면 풀 주소 공간의 크기가 대상 주소 공간보다 크거나 같아야 합니다. 풀의 네트워크 주소 변환(NAT) 주소 수가 문의 대상 주소 수보다 큰 한 여러 주소, 범위 또는 접두사를 포함할 수 있는 문 이름을 destination-pool 지정해야 합니다.from
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 주소로 HTTP(Hypertext Transfer Protocol) 트래픽에 대한 대상 주소 변환을 수행합니다. 가상 서버 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;
}
}
}
}