Advanced NAT in Junos extends basic NAT capabilities to address complex network requirements. It supports features such as persistent NAT, DNS doctoring, dual-stack NAT (NAT64/NAT46), and advanced NAT pools for granular control. These enhancements make it suitable for modern applications like VoIP, mixed IPv4/IPv6 environments, and multi-tenant configurations.
Persistent NAT ensures consistent external IP/port mappings for specific internal hosts. This is critical for applications that require predictable communication, such as VoIP or video conferencing.
set security nat source persistent-nat rule-set rule1 match source-address 192.168.1.100
set security nat source persistent-nat rule-set rule1 then permit
DNS doctoring modifies DNS responses to align with NAT translations. This ensures external clients resolve the correct public (NATed) address instead of the private IP.
set security nat destination pool pool1 address 203.0.113.1/32
set security nat destination rule-set rule1 match destination-address 10.0.0.0/24
Dual-stack NAT enables seamless communication between IPv4 and IPv6 networks. This includes:
set security nat64 source pool nat64-pool prefix 64:ff9b::/96
set security nat64 rule-set rule1 match destination-address 10.0.0.0/24
Advanced NAT pools provide fine-grained control over NAT behavior. This includes specifying:
set security nat source pool nat-pool address 203.0.113.10/32
set security nat source pool nat-pool port range 10000 to 20000
set security nat source rule-set rule1 from zone trust to zone untrust match source-address 192.168.1.0/24
set security nat source rule-set rule1 then source-nat pool nat-pool
Session monitoring helps verify active NAT mappings and their current status.
show security flow session
Trace options can be enabled to log NAT processing details. This is useful for diagnosing misconfigured NAT rules or troubleshooting unexpected behavior.
Enable trace options:
set security nat traceoptions file nat-debug
set security nat traceoptions flag all
View logs:
show log nat-debug
Analyzing live traffic helps identify mismatches between NAT rules and actual packet behavior.
monitor traffic interface ge-0/0/1
Persistent NAT in Junos is not a single feature but rather a framework supporting multiple behavioral modes, each designed to handle different communication requirements for dynamic NAT scenarios.
NAT with Inbound Mapping
Enables external clients to initiate sessions with internal hosts by maintaining an externally visible IP and port association.
NAT with Sticky Address
Ensures the same internal source is always mapped to the same external IP and/or port for the duration of the binding or session.
Address Persistence
Maintains the NAT binding for a defined timeout even after the session is closed, useful for applications that reopen connections frequently (e.g., VoIP signaling).
You may encounter scenario-based questions asking “What type of persistent NAT behavior ensures external initiation is allowed?” – the correct answer would typically involve inbound mapping.
DNS Doctoring is a NAT-related feature that modifies DNS replies so that internal IP addresses in A-records are replaced with their translated (NATed) public addresses. However, its effectiveness depends on DNS ALG.
DNS doctoring relies on the DNS ALG to inspect and rewrite DNS responses dynamically.
If ALG is disabled, or the DNS traffic does not pass through a NAT zone, the rewriting will not occur.
Only supports DNS protocol, not arbitrary name resolution mechanisms.
Only works if DNS ALG is enabled and active.
NAT translation must be present and matched by the rule during DNS traversal.
Be cautious of options implying that all protocols support doctoring—only DNS is supported, and even then, only under correct ALG and NAT rule conditions.
NAT64 enables IPv6-only clients to reach IPv4-only servers by translating IPv6 packets into IPv4 format.
NAT64 is unidirectional: from IPv6 to IPv4.
It does not support IPv6-to-IPv6 (NAT66) or general dual-stack behavior.
Return traffic from IPv4 servers to IPv6 clients works only if initiated by the IPv6 side or configured with stateful mapping.
Unsolicited IPv4-to-IPv6 connections are not supported by default.
A common trap is a question like:
“Can NAT64 support IPv6-to-IPv6 or allow inbound traffic from IPv4 to IPv6?”
The correct answer is No unless reverse mapping is configured.
Junos evaluates NAT rules in a top-down sequential order—very similar to firewall policies.
NAT rule-sets are processed in the configured order.
The first rule that matches is applied, and subsequent rules are ignored, even if they might match better.
Place specific NAT rules (narrow address or port match) at the top.
Place general or fallback rules (e.g., source any to destination any) at the bottom.
A NAT rule placed after a broader one may never be hit, even if it appears more “specific.” Always remember: first match wins.
| Function | Command | Use Case |
|---|---|---|
| View active NAT sessions | show security flow session |
Confirm NAT is applied to current traffic |
| Show source NAT statistics | show security nat source statistics |
Validate source NAT behavior |
| Check all configured source rules | show security nat source rule all |
Ensure correct rule definition and state |
| Check destination NAT rule hits | show security nat destination rule all |
Confirm destination NAT engagement |
| View NAT trace logs | show log nat-debug |
Review detailed NAT match and translation info |
| Topic | Common Misunderstanding | Correct Understanding |
|---|---|---|
| NAT Pools | Believed port range is always mandatory | Port ranges are optional, but useful for port overloading scenarios |
| Persistent NAT | Mistaken for static NAT | Persistent NAT is dynamic NAT with extended session behavior, not static |
| NAT64 | Thought to support NAT66 or IPv6 inbound | NAT64 supports only IPv6 → IPv4, and does not allow unsolicited IPv4-to-IPv6 traffic |
| DNS Doctoring | Believed to work with all protocols | Only DNS is supported, and only with ALG enabled |
| NAT Rule Priority | Assumed all rules are checked | Junos stops at first matching NAT rule; ordering is critical |
In what order does an SRX device process NAT rules when handling incoming traffic?
The SRX evaluates NAT rules in the order: static NAT, destination NAT, then source NAT.
Junos applies NAT types in a specific sequence during packet processing. Static NAT rules are evaluated first because they create a fixed one-to-one mapping between internal and external addresses. If no static NAT rule matches, the device evaluates destination NAT rules, which modify the destination address of incoming traffic—typically for port-forwarding scenarios. Finally, source NAT rules are applied to outbound traffic leaving a security zone. Understanding this order is critical when troubleshooting NAT conflicts because a higher-priority NAT type can override others. For example, a static NAT rule can prevent a destination NAT rule from ever matching the same traffic flow.
Demand Score: 92
Exam Relevance Score: 95
Why might a configured source NAT rule fail to translate outbound traffic on an SRX firewall?
The most common cause is that the NAT rule does not match the correct from zone, to zone, or source address criteria.
Source NAT rules rely on matching conditions before translation occurs. If the rule references the wrong security zones or does not include the correct source address range, the traffic will bypass the rule entirely. Another common issue is that the traffic is not leaving the expected interface, causing the rule’s to-zone condition to fail. Administrators should verify the NAT rule-set configuration, check policy matches, and use operational commands such as show security nat source rule all to confirm rule hits. Debugging with flow session output also helps determine whether NAT was attempted during packet processing.
Demand Score: 90
Exam Relevance Score: 94
What happens if both a static NAT rule and a source NAT rule match the same traffic?
The static NAT rule takes precedence and is applied first.
Static NAT has the highest priority among NAT types in Junos. When a packet matches a static NAT rule, the translation occurs immediately and the system does not evaluate destination or source NAT rules for that traffic. This behavior ensures predictable one-to-one address mappings for services that require consistent addressing. However, it can also lead to troubleshooting confusion when administrators expect a source NAT rule to apply. If the traffic matches a static NAT rule first, the source NAT rule will never be evaluated. Therefore, verifying NAT rule overlap is an important step when diagnosing translation problems.
Demand Score: 85
Exam Relevance Score: 92
What is the difference between interface NAT and pool-based NAT on an SRX firewall?
Interface NAT uses the outgoing interface IP address for translation, while pool-based NAT uses addresses from a configured NAT pool.
Interface NAT is often used for simple internet access scenarios because it automatically translates traffic using the egress interface address. This reduces configuration complexity. Pool-based NAT provides greater flexibility because administrators can define a range of public addresses used for translation. Pools support address reuse options such as port address translation (PAT) and persistent NAT. Pool-based NAT is commonly deployed in service provider or enterprise environments where multiple public IP addresses are available and traffic distribution across those addresses is required.
Demand Score: 81
Exam Relevance Score: 88
How does proxy ARP support destination NAT services on an SRX firewall?
Proxy ARP allows the SRX to respond to ARP requests for translated public IP addresses.
When destination NAT is used to publish internal services, external hosts attempt to reach the translated public address. If that address is not assigned directly to an interface, the SRX must respond to ARP requests on behalf of that IP. Proxy ARP enables the firewall to advertise its MAC address for the public IP so incoming traffic is directed to the device. Without proxy ARP, upstream devices would not know how to reach the translated address and packets would never arrive at the firewall for translation.
Demand Score: 79
Exam Relevance Score: 90
What operational command can help verify whether NAT translation is occurring on an SRX firewall?
The command show security flow session can be used to verify NAT translations.
This command displays active flow sessions along with the original and translated addresses associated with each session. By examining the session table, administrators can confirm whether the firewall applied source or destination NAT to the traffic. The output also reveals the matched security policy and interface information, which helps identify whether traffic is hitting the expected NAT rule. If no translation appears in the session entry, the NAT rule likely did not match and further investigation of rule conditions is required.
Demand Score: 84
Exam Relevance Score: 89