Source NAT Pool

Learn how Source NAT pools provide translated IP addresses for source NAT operations. Understand address pool configuration, one-to-one and many-to-one (PAT) translation methods, port allocation options, and efficient utilization of public IP addresses for scalable outbound connectivity.

Source NAT Pools

A NAT pool is a user-defined set of IP addresses that are used for translation. Unlike static NAT, where there is a one-to-one mapping that includes destination IP address translation in one direction and source IP address translation in the reverse direction, with source NAT, you translate the original source IP address to an IP address in the address pool.

For source Network Address Translation (NAT) address pools, specify the following:

  • Name of the source NAT address pool.

  • Up to 64 address ranges.

    Do not overlap NAT addresses for source NAT, destination NAT, and static NAT within one routing instance.

  • Routing instance—Routing instance to which the pool belongs (the default is the main inet.0 routing instance).

  • Port —The Port Address Translation (PAT) for a source pool. By default, PAT is performed with source NAT. If you specify the no-translation option, the number of hosts that the source NAT pool can support is limited to the number of addresses in the pool. If you specify block-allocation, a block of ports is allocated for translation, instead of individual ports being allocated. If you specify deterministic, an incoming (source) IP address and port always map to the specific destination address and port block, based on predefined, deterministic NAT algorithm. If you specify port-overloading, you can configure the port overloading capacity in source NAT. If you specify range, you can provide the port number range attached to each address in the pool, and the twin port range for source NAT pools.

  • Overflow pool (optional)—Packets are dropped if there are no addresses available in the designated source NAT pool. To prevent that from happening when the port no-translation option is configured, you can specify an overflow pool. Once addresses from the original source NAT pool are exhausted, IP addresses and port numbers are allocated from the overflow pool. A user-defined source NAT pool or an egress interface can be used as the overflow pool. (When the overflow pool is used, the pool ID is returned with the address.)

  • IP address shifting (optional)—A range of original source IP addresses can be mapped to another range of IP addresses, or to a single IP address, by shifting the IP addresses. Specify the host-address-base option with the base address of the original source IP address range.

  • Address sharing (optional)—Multiple internal IP addresses can be mapped to the same external IP address. This option can be used only when the source NAT pool is configured with no port translation. Specify the address-shared option when a source NAT pool has few external IP addresses available, or only one external IP address. With a many-to-one mapping, use of this option increases NAT resources and improves traffic.

  • Address pooling (optional)— Address pooling can be configured as paired or no-paired. Specify address-pooling paired for applications that require all sessions associated with one internal IP address to be mapped to the same external IP address for the duration of a session. This differs from the persistent-address option, in which the same internal address is translated to the same external address every time. Specify address-pooling no-paired for applications that can be can be assigned IP addresses in a round-robin fashion. If either address-pooling paired or address-pooling no-paired is configured for a source NAT pool with PAT, the persistent address option is disabled. If address-shared is configured on a source NAT pool without PAT, then the persistent-address option is enabled. Both address-shared and address-pooling paired can be configured on the same source NAT pool without PAT.

  • Pool utilization alarm (optional)— When the raise-threshold option is configured for source NAT, an SNMP trap is triggered if the source NAT pool utilization rises above this threshold. If the optional clear-threshold option is configured, an SNMP trap is triggered if the source NAT pool utilization drops below this threshold. If clear-threshold is not configured, it is set by default to 80 percent of the raise-threshold value.

You can use the show security nat resource usage source pool command to view address use in a source NAT pool without PAT, and to view port use in a source NAT pool with PAT.

Understand NAT Session Persistence

Network Address Translation (NAT) session persistence provides a means to retain existing sessions, instead of clearing them, when there changes in the NAT configuration. If session persistence is enabled, the retained sessions continue to process and forward packets as time and resources are optimally used to rebuild the impacted sessions. Thus, packet forwarding does not stop even if the NAT configuration is changed for some or all sessions.

From Junos OS Release 18.3R1 onward, with the support for NAT session persistence, the Packet Forwarding Engine scans the sessions and decides whether to keep the sessions or clear the sessions. In releases before Junos OS Release 18.3R1, the NAT sessions are cleared if there is a change in the NAT configuration.

The Packet Forwarding Engine performs the following two types of scans to decide whether to retain or drop sessions:

  • Source NAT pool session persistence scan—The Packet Forwarding Engine compares the existing session IP address with source pool address range. If the existing session IP address is in the specified source pool address range, the session is kept alive, otherwise the session is cleared.

  • Source NAT rule session persistence scan—The Packet Forwarding Engine uses the rule ID to compare the source IP address, source port, destination IP address, and destination port between the old and new configurations. If the new and old configurations are the same, then the session is kept alive, otherwise the session is cleared.

NAT session persistence is not supported for static NAT and destination NAT.

NAT session persistence is not supported if the PAT pool is configured with the address persistent, address pooling paired, source address-persistent, port block allocation, port deterministic, persistent nat, and port overloading factor fields.

NAT session persistence is supported only for source NAT in the following scenarios:

  • Source pool—Change in an address range in a Port Address Translation (PAT) pool.

  • Source rule—Change in match conditions for the address book, application, destination IP address, destination port, source IP address, and destination port information.

To enable the NAT session persistence scanning, include the session-persistence-scan statement at the [edit security nat source] hierarchy level.

You can also configure a timeout value to retain the sessions for the specified time period by using the set security nat source session-drop-hold-down CLI command. The value of the session-drop-hold-down option ranges from 30 through 28,800 seconds (eight hours). The session expires after the configured timeout period.

Limitations of NAT Session Persistence

  • When there is a change in IP addresses in the NAT source pool, the newly configured IP addresses are appended to the NAT source pool. After the NAT source pool is rebuilt, the new IP addresses are not the same as the existing IP addresses. The differences in the IP addresses in the NAT source pool impacts the round-robin mode of picking IP addresses from the NAT source pool.

  • If the scan types identify sessions that will never be timed out (that is, the sessions for which the session-drop-hold-down value is not configured or is configured as 8 hours), then the Packet Forwarding Engine ignores those sessions, and the sessions are retained.

Understand Shared Addresses in Source NAT Pools without PAT

Source NAT pools with no port address translation perform static, one-to-one mappings from one source IP address to one external IP address. When there is only one external IP address, or very few available in a source no-pat pool , the address-shared option enables you to map many source IP addresses to one external IP address as long as the traffic comes from different source ports.

For example, if there is a source NAT pool with no port translation containing only two IP addresses, IP 1 and IP 2, when a packet arrives from

  1. Source IP 1, port 1, it is translated to IP 1, port 1.

  2. Source IP 2, port 2, it is translated to IP 2, port 2.

  3. Source IP 3, port 1, it is translated to IP 2, port 1. (It cannot be translated to IP 1 port 1 because that port is already used.

    However, if another packet arrives from Source IP 3, port 1 for a different destination IP and port, it cannot be translated to IP 1, port 1 or IP 2, port 1 because port 1 is already used for both available IP addresses. The session will fail.

This option increases NAT resources and improves the possibility of setting up successful translated traffic. It cannot be used on source NAT pools with port address translation because address sharing is already their default behavior.

Source NAT Pools Without PAT

When you define a source pool, Junos OS enables PAT by default. To disable PAT, you must specify no port translation when you are defining a source pool.

When using a source pool without PAT, Junos OS performs source Network Address Translation for the IP address without performing PAT for the source port number. For applications that require that a particular source port number remain fixed, you must use source pool without PAT.

The source pool can contain multiple IP addresses, multiple IP address ranges, or both. For source pool without PAT, Junos OS assigns one translated source address to the same host for all its concurrent sessions unless the address-pooling no-paired option is enabled.

The number of hosts that a source NAT pool without PAT can support is limited to the number of addresses in the pool. When you have a pool with a single IP address, only one host can be supported, and traffic from other hosts is blocked because there are no resources available. If a single IP address is configured for a source NAT pool without PAT when NAT resource assignment is not in active-backup mode in a chassis cluster, traffic through node 1 will be blocked.

Pool utilization for each source pool without PAT is computed. You can turn on pool utilization alarm by configuring alarm thresholds. An SNMP trap is triggered every time pool utilization rises above a threshold and goes below a threshold.

If a static NAT rule is for one-to-one IP translation, avoid dividing the rule into a destination rule and a source rule when source no-pat pool without address sharing is used. If you choose to divide the rule, you will then have to use source pat-pool with single IP or source no-pat pool with multiple IP.

Monitor Subscriber Port Utilization Using Carrier Grade NAT

Before you begin:

You can configure threshold limits to monitor port utilization, by receiving notifications when port or port block usage is exceeded. Both Port Block Allocation (PBA) and Deterministic NAT (DetNAT) modes of deployment are supported.

The SNMP MIB objects are:

The system log messages are:

  • RT_SRC_NAT_SUBS_POOL_ALARM_DAMPENINGRT_NAT: RT_SRC_NAT_SUBS_POOL_ALARM_RAISE: Subscriber ip: 10.0.0.1, Source NAT pool: pool-name, Pool type: PBA, threshold: 90%, current: 100%
  • RT_SRC_NAT_SUBS_POOL_ALARM_CLEARRT_NAT: RT_SRC_NAT_SUBS_POOL_ALARM_CLEAR: Subscriber ip: 10.0.0.1, Source NAT pool: pool-name, Pool type: PBA, threshold: 50%, current: 25%
  • RT_SRC_NAT_SUBS_POOL_ALARM_RAISERT_NAT: RT_SRC_NAT_SUBS_POOL_ALARM_DAMPENING: Subscriber IP: 10.1.1.2, NAT pool: pool-name, threshold alarm [raise, clear] suppressed for 2 times in last 10 seconds
  1. Configure source NAT pool Pool1 IP address with subnet, deterministic NAT block size and IP address, alarm threshold, system log, SNMP trap, and timeout information.
  2. Configure source NAT pool Pool2 IP address with subnet, deterministic NAT block size and IP address, alarm threshold, system log, SNMP trap, and timeout information.
  3. Configure subscriber pool utilization alarm threshold, dampening interval, system log, and SNMP trap information.
  4. Configure NAT rules.
  5. Configure NAT traceoptions.
  6. Commit the configuration.
  7. Verify the output value for subscriber port utilization configuration.

Example: Configure MAP-E on SRX Series Firewalls

Use this configuration example to configure Mapping of Address and Port with Encapsulation (MAP-E) functionality on SRX Series Firewalls.

Tip:
Table 1: Readability Score and Time Estimates

Reading Time

Less than an hour

Configuration Time

Less than an hour

Example Prerequisites

Table 2: Hardware and Software Requirements

Hardware requirements

Juniper Networks® SRX1500 Firewall or lower-numbered device models or Juniper Networks® vSRX Virtual Firewall (vSRX3.0)

Software requirements

Junos OS Release 19.4R1 or later.

Before You Begin

Table 3: Benefits, Resources, and Additional Information

Benefits

  • IPv4 to IPv6 Migration

    MAP-E supports IPv4 to IPv6 migration by allowing service providers to transport IPv4 packets across an IPv6 network. This is useful during transition periods when only the IPv6 network is available.

  • Enables address sharing:

    MAP-E enables the sharing of public IPv4 addresses among multiple CE devices. This helps in managing limited public IPv4 address pools.

Know more

Understanding Mapping of Address and Port with Encapsulation (MAP-E)

Hands-on experience

vLab Sandbox: NAT - Source & Destination

Learn more

Configuring MAP-E on NFX Series DevicesUnderstanding Mapping of Address and Port with Encapsulation (MAP-E)Mapping of Address and Port with Encapsulation (MAP-E) for Next Gen Services

Functional Overview

MAP-E transports IPv4 packets across an IPv6 network. A MAP-E network contains two types of devices:

  • MAP-E Customer Edge (CE): These dual-stacked CE devices support both IPv4 and IPv6. They can also perform Network Address Port Translation (NAPT).

  • MAP-E Border Relay (BR): The CE device connects a private IPv4 host and a BR device across an IPv6-only network domain.

Table 4 provides a quick summary of the configuration components deployed in this example.

Table 4: MAP-E Functional Overview

Technologies used

  • MAP-E—The dual stack MAP-E CE devices can execute NAPT. These devices make a connection to a MAP-E BR device through an IPv6-only MAP-E network domain. The dual stack MAP-E BR device maintains a connection with a public IPv4 network and an IPv6 MAP-E network.

  • Border Relay (BR)—MAP-E-enabled provider edge (PE) device in a MAP domain. A BR device has at least an IPv6-enabled interface and an IPv4 interface connected to the native IPv4 network.

  • MAP-E Customer Edge (CE)—MAP-E-enabled customer edge device in a MAP deployment.

  • MAP domain—One or more MAP-E CE devices and BR devices connected to the same virtual link.

  • Softwire—Tunnel between two IPv6 end-points to carry IPv4 packets or two IPv4 end-points to carry IPv6 packets.

Primary verification tasks

After completing the MAP-E configuration on an SRX Series Firewall, you can verify the status of the MAP-E configuration.

Topology Overview

This topology presents the configuration process for MAP-E CE functionality on SRX Series Firewall devices. It also depicts the encapsulation and transport of IPv4 packets originating from MAP-E CE devices. The configuration moves these packets through an IPv4-over-IPv6 tunnel to MAP-E PE and BR devices. The packets then undergo detunneling in an IPv6 routing topology for further processing. A dual-stack MX Series device, connected to both a public IPv4 network and an IPv6 MAP-E network, serves as the MAP-E BR device.

Table 5: MAP-E Topology Overview

Hostname

Role

Function

LAN end-point

End-user network devices.

Connects to the IPv4 network.

SRX Series Firewall

Connects the BR router and end user network devices.

Supports connectivity to a large number of IPv4 subscribers over the ISP IPv6 access network.

BR router

Connects the IPv4 network and SRX Series Firewall device.

A BR device has at least an IPv6-enabled interface and an IPv4 interface connected to the native IPv4 network.

Topology Illustration

Figure 1: MAP-E Deployment on SRX Series Firewall Network architecture showing MAP-E for IPv4-over-IPv6 tunneling. IPv4 traffic encapsulated in IPv6 packets traverses an IPv6-only network.

Step-By-Step Configuration on SRX Series Firewall as a MAP-E CE Device

  1. Configure security policies and zones for applying different security measures on IPv4-facing interfaces and IPv6-facing interfaces. The following configuration adds a LAN interface (ge-1/0/1) and a WAN interface on the service provider end (ge-1/0/2) into relevant security zones and configures a policy to permit all traffic between these zones. The configuration also adds corresponding internal logical tunnel (lt) interface units into security zones.
  2. Configure interfaces to provide network connectivity and data flow. The following configuration assigns an IPv4 address on the LAN side and an IPv6 address on the WAN side. The MTU on the IPv6 side must support maximum MTU.
  3. Configure the logical tunnel interfaces. The logical tunnel interfaces act as internal endpoints to MAP-E encapsulator or decapsulator block in an SRX Series Firewall device. This separates the network traffic for IPv4 and IPv6. Here, lt-1/0/0 unit 1 terminates IPv4 traffic that is received on ge-1/0/1 and lt-1/0/0 unit 2 initiates IPv6 traffic to be sent out through ge-1/0/2. Then, lt-1/0/0 unit 2 terminates IPv6 traffic that is received on ge-1/0/2 and lt-1/0/0 unit 1 initiates IPv4 traffic to be sent out through ge-1/0/1.
  4. Configure routing instances for the IPv4 and IPv6 network traffic domains:
  5. Configure the MAP-E BMR and FMR rules to provide mapping between the IPv4 network and IPv6 network:
  6. Configure source NAT rule and NAT pool:
  7. Commit the configuration:

Step-By-Step Configuration on MX Series Device as a BR Device

To configure an MX Series device as a BR device:

  1. Configure the service set for MAP-E on the MX Series device:
  2. Configure the MAP-E softwire concentrator and associated parameters. This creates a tunnel between two IPv6 endpoints to carry IPv4 packets; or two IPv4 endpoints to carry IPv6 packets.
  3. Configure a softwire rule to specify the direction of traffic to be tunneled and the MAP-E softwire concentrator to be used:
  4. Configure a service interface inside the dual-stack domain:
  5. Configure a service interface outside the dual-stack domain:
  6. Configure the MTU on the BR interface:
  7. Configure the logical interfaces and assign the IPv4 and IPv6 addresses:
  8. Configure the routing instances:
  9. Commit the configuration:

Verification

This section provides a list of show commands that you can use to verify the feature in this example.

You must establish an SSH session on end devices to generate CLI output.

Table 6: Verification Tasks

Command

Verification Task

show security flow session

Verify the Flow Session

show security softwires map-e domain mapce1 Verify the MAP-E Domain
show security nat source rule all

Verify the NAT Source Rule

show security nat source pool all

Verify the NAT Source Pool

show security nat source summary

Verify the NAT Source Summary

show security nat source persistent-nat-table all

Verify the Persistent NAT Table

show services inline softwire statistics mape

Verify the Softwire Statistics on the MX Series Device

Verify the Flow Session

Purpose

Verify the packet flow session.

Action

From operational mode, enter the show security flow session command to view the packet flow.

Meaning

The sample output confirms the packet flow session are up.

Verify the MAP-E Domain

Purpose

Verify whether the IPv4 and IPv6 addresses are configured correctly.

Action

From operational mode, enter the show security softwires map-e domain mapce1 command to view the IPv4 and IPv6 addresses.

Meaning

The sample output displays the configured IPv4 and IPv6 addresses.

Verify the NAT Source Rule

Purpose

View details of the NAT source rule.

Action

From operational mode, enter the show security nat source rule all command to view the NAT source rules.

Meaning

The sample output displays the configured NAT source rules.

Verify the NAT Source Pool

Purpose

View details of the NAT source pool.

Action

From operational mode, enter the show security nat source pool all command to view the NAT source pool.

Meaning

The sample output displays the configured NAT source pool.

Verify the NAT Source Summary

Purpose

View the NAT source summary.

Action

From operational mode, enter the show security nat source summary command to view the NAT source details.

Meaning

The sample output displays the configured NAT source details.

Verify the Persistent NAT Table

Purpose

View the persistent NAT table.

Action

From operational mode, enter the show security nat source persistent-nat-table all command to view the persistent NAT table.

Meaning

The sample output displays the persistent NAT table.

Verify the Softwire Statistics on the MX Series Device

Purpose

View the softwire statistics on the MX Series device.

Action

From operational mode, enter the show services inline softwire statistics mape command to view the softwire statistics on the MX Series device.

Meaning

The sample output displays the softwire statistics on the MX Series device.

Appendix 1: Set Commands on All Devices

Set command output on all devices.

Set Commands on MAP-E CE Device

Set Commands on BR Device

Appendix 2: Show Configuration Output on All Devices

Show command output on all devices.

Show Commands on MAP-E CE Device

From configuration mode, confirm your configuration by entering the show security policies, show security zones, show interfaces, show routing-instances, show security softwires, and show security nat source commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

Show Commands on BR Device

From configuration mode, confirm your configuration by entering the show services, show interfaces, and show routing-options commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

Example: Configure Source and Destination NAT Translations

This example describes how to configure both source and destination NAT mappings.

Requirements

Before you begin:

  1. Configure network interfaces on the device. See Interfaces User Guide for Security Devices.

  2. Create security zones and assign interfaces to them. See Understanding Security Zones.

Overview

This example uses the trust security zone for the private address space and the untrust security zone for the public address space. In Figure 2, the following translations are performed on the Juniper Networks security device:

  • The source IP address in packets sent by the device with the private address 192.168.1.200 in the trust zone to any address in the untrust zone is translated to a public address in the range from 203.0.113.10 through 203.0.113.14.

  • The destination IP address 203.0.113.100/32 in packets sent from the trust zone to the untrust zone is translated to the address 10.1.1.200/32.

Figure 2: Source and Destination NAT TranslationsNetwork topology with an SRX Series firewall separating Untrust Zone (203.0.113.0/24) and Trust Zone (192.168.1.0/24) with traffic flow.

This example describes the following configurations:

  • Source NAT pool src-nat-pool-1 that contains the IP address range 203.0.113.10 through 203.0.113.14.

  • Source NAT rule set rs1 with rule r1 to match any packets from the trust zone to the untrust zone. For matching packets, the source address is translated to an IP address in the src-nat-pool-1 pool.

  • Destination NAT pool dst-nat-pool-1 that contains the IP address 10.1.1.200/32.

  • Destination NAT rule set rs1 with rule r1 to match packets from the trust zone with the destination IP address 203.0.113.100. For matching packets, the destination address is translated to the IP address in the dst-nat-pool-1 pool.

  • Proxy ARP for the addresses 203.0.113.10 through 203.0.113.14 and 203.0.113.100/32 on interface ge-0/0/0.0. This allows the Juniper Networks security device to respond to ARP requests received on the interface for those addresses.

  • Security policy to permit traffic from the trust zone to the untrust zone.

  • Security policy to permit traffic from the untrust zone to the translated destination IP addresses in the trust zone.

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

The following example requires you to navigate throughout various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode.

To configure the source and destination NAT translations:

  1. Create a source NAT pool.

  2. Create a source NAT rule set.

  3. Configure a rule that matches packets and translates the source address to an address in the source NAT pool.

  4. Create a destination NAT pool.

  5. Create a destination NAT rule set.

  6. Configure a rule that matches packets and translates the destination address to the address in the destination NAT pool.

  7. Configure proxy ARP.

  8. Configure a security policy that allows traffic from the trust zone to the untrust zone.

  9. Configure an address in the global address book.

  10. Configure a security policy that allows traffic from the untrust zone to the trust zone.

Results

From configuration mode, confirm your configuration by entering the show security nat and show security policies commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

To confirm that the configuration is working properly, perform these tasks:

Verifying Source NAT Pool Usage

Purpose

Verify that there is traffic using IP addresses from the source NAT pool.

Action

From operational mode, enter the show security nat source pool all command. View the Translation hits field to check for traffic using IP addresses from the pool.

Verifying Source NAT Rule Usage

Purpose

Verify that there is traffic matching the source NAT rule.

Action

From operational mode, enter the show security nat source rule all command. View the Translation hits field to check for traffic that matches the rule.

Verifying Destination NAT Pool Usage

Purpose

Verify that there is traffic using IP addresses from the destination NAT pool.

Action

From operational mode, enter the show security nat destination pool all command. View the Translation hits field to check for traffic using IP addresses from the pool.

Verifying Destination NAT Rule Usage

Purpose

Verify that there is traffic matching the destination NAT rule.

Action

From operational mode, enter the show security nat destination rule all command. View the Translation hits field to check for traffic that matches the rule.

Verifying NAT Application to Traffic

Purpose

Verify that NAT is being applied to the specified traffic.

Action

From operational mode, enter the show security flow session command.

Example: Configure Single IP Address in a Source NAT Pool Without PAT

This example describes how to configure a private address block to a single public address in a source NAT pool without Port Address Translation.

PAT is enabled by default for source NAT pools. When PAT is disabled, the number of translations that the source NAT pool can concurrently support is limited to the number of addresses in the pool. Packets are dropped if there are no addresses available in the source NAT pool. However, using the address-shared option, you can map more that one private IP address to a single public IP address as long as the traffic is from different source ports.

Requirements

Before you begin:

  1. Configure network interfaces on the device. See Interfaces User Guide for Security Devices.

  2. Create security zones and assign interfaces to them. See Understanding Security Zones.

Overview

This example uses the trust security zone for the private address space and the untrust security zone for the public address space. The source IP address of packets sent from the trust zone to the untrust zone are mapped to a single public address.

This example describes the following configurations:

  • Source NAT pool src-nat-pool-1 that contains the IP address 203.0.113.1/30. The port no-translation option and the address shared option are specified for the pool.

  • Source NAT rule set rs1 to match all packets from the trust zone to the untrust zone. For matching packets, the source IP address is translated to an IP address in the src-nat-pool-1 pool.

  • Security policies to permit traffic from the trust zone to the untrust zone.

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

The following example requires you to navigate throughout various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode.

To configure a source NAT mapping from a private address block to a single public address without PAT:

  1. Create a source NAT pool with a single IP address for the shared address.

    Specify the port no-translation option.

  2. Specify the address-shared option.

  3. Create a source NAT rule set.

  4. Configure a rule that matches packets and translates the source address to an address in the pool.

  5. Configure a security policy that allows traffic from the trust zone to the untrust zone.

Results

From configuration mode, confirm your configuration by entering the show security nat source pool and show security policies commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

To confirm that the configuration is working properly, perform these tasks:

Verifying Shared Address

Purpose

Verify that two internal IP addresses, with different source ports, share one external IP address.

Action

From operational mode, enter the show security nat source pool command. View the Address assignment field to verify that it is shared.

Verifying Shared Address Application to Traffic

Purpose

Verify that two sessions are using the same IP address.

Action

From operational mode, enter the show security flow session command.

Example: Configure Multiple Addresses in a Source NAT Pool Without PAT

This example describes how to configure a source NAT mapping of a private address block to a smaller public address block without port address translation.

Port address translation is enabled by default for source NAT pools. When port address translation is disabled, the number of translations that the source NAT pool can concurrently support is limited to the number of addresses in the pool. Packets are dropped if there are no addresses available in the source NAT pool. You can optionally specify an overflow pool from which IP addresses and port numbers are allocated when there are no addresses available in the original source NAT pool.

Requirements

Before you begin:

  1. Configure network interfaces on the device. See Interfaces User Guide for Security Devices.

  2. Create security zones and assign interfaces to them. See Understanding Security Zones.

Overview

This example uses the trust security zone for the private address space and the untrust security zone for the public address space. In Figure 3, the source IP address in packets sent from the trust zone to the untrust zone is mapped to a smaller block of public addresses in the range from 203.0.113.1/32 through 203.0.113.24/32.

Figure 3: Source NAT Multiple Addresses Without PATNetwork topology with SRX Series device connecting a Trust zone to the Untrust zone. Internet cloud labeled Internet with public IP 203.0.113.0/24. SRX performs NAT translating Trust zone subnets 10.1.1.0/24, 10.1.2.0/24, and 192.168.1.0/24 to public IP 203.0.113.1.

This example describes the following configurations:

  • Source NAT pool src-nat-pool-1 that contains the IP address range 203.0.113.1/32 through 203.0.113.24/32. The port no-translation option is specified for the pool.

  • Source NAT rule set rs1 to match all packets from the trust zone to the untrust zone. For matching packets, the source IP address is translated to an IP address in the src-nat-pool-1 pool.

  • Proxy ARP for the addresses 203.0.113.1/32 through 203.0.113.24/32 on interface ge-0/0/0.0. This allows the Juniper Networks security device to respond to ARP requests received on the interface for those addresses.

  • Security policies to permit traffic from the trust zone to the untrust zone.

Configuration

Procedure

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, copy and paste the commands into the CLI at the [edit] hierarchy level, and then enter commit from configuration mode.

Step-by-Step Procedure

The following example requires you to navigate throughout various levels in the configuration hierarchy. For instructions on how to do that, see Using the CLI Editor in Configuration Mode.

To configure a source NAT mapping from a private address block to a smaller public address block without PAT:

  1. Create a source NAT pool.

  2. Specify the port no-translation option.

  3. Create a source NAT rule set.

  4. Configure a rule that matches packets and translates the source address to an address in the pool.

  5. Configure proxy ARP.

  6. Configure a security policy that allows traffic from the trust zone to the untrust zone.

Results

From configuration mode, confirm your configuration by entering the show security nat and show security policies commands. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

If you are done configuring the device, enter commit from configuration mode.

Verification

To confirm that the configuration is working properly, perform these tasks:

Verifying Source NAT Pool Usage

Purpose

Verify that there is traffic using IP addresses from the source NAT pool.

Action

From operational mode, enter the show security nat source pool all command. View the Translation hits field to check for traffic using IP addresses from the pool.

Verifying Source NAT Rule Usage

Purpose

Verify that there is traffic matching the source NAT rule.

Action

From operational mode, enter the show security nat source rule all command. View the Translation hits field to check for traffic that matches the rule.

Verifying NAT Application to Traffic

Purpose

Verify that NAT is being applied to the specified traffic.

Action

From operational mode, enter the show security flow session command.

Configure the NAT Session Hold Timeout and NAT Session Persistence Scan

This configuration shows how to configure the NAT session hold timeout and NAT session persistence.

Configuring NAT Session Hold Timeout

The following configuration shows how to configure the NAT session hold timeout.

  • To set the NAT session hold timeout period:

    The value of the time variable ranges from 30 through 28,800 seconds (eight hours). The session expires after the configured timeout period.

Results

From configuration mode, confirm your configuration by entering the show security command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

Configuring NAT Session Persistence Scan

The following configuration shows how to configure the NAT session persistence scan.

  • To enable the NAT session persistence scan:

Results

From configuration mode, confirm your configuration by entering the show security command. If the output does not display the intended configuration, repeat the configuration instructions in this example to correct it.

NAT Configuration Check on Egress Interfaces after Reroute

The Network Address Translation (NAT) configuration often changes to accommodate more users and to enhance shortest route to transfer the traffic. If there is a change in egress interface because of rerouting of traffic, you can use the set security flow enable-reroute-uniform-link-check nat command to retain the existing NAT configuration and rule.

When the enable-reroute-uniform-link-check nat command is enabled:

  • The session is retained with the existing NAT rule, if the new egress interface and the previous egress interface are in the same security zone, and there is no change in the matched NAT rule or if no rule is applied before and after rerouting.

  • The session expires if the new egress interface and the previous egress interface are in the same security zone and the matched NAT rule is changed.

When the enable-reroute-uniform-link-check nat command is disabled:

  • The traffic is forwarded to the new egress interface if the new egress interface and the previous egress interface are in the same security zone.

Configuration

To enable the NAT configuration for an existing session when there is a change in egress interface because of rerouting, use the following command:

[edit] user@host# set security flow enable-reroute-uniform-link-check natThe new configuration is applied when you commit the configuration changes.

The enable-reroute-uniform-link-check nat command is disabled by default.

Limitations

Retaining the NAT configuration using the set security flow enable-reroute-uniform-link-check nat command has the following limitations:

  • The TCP synchronization does not allow the new session to transfer the traffic. You must disable the TCP synchronization to allow the transfer of traffic in new sessions.

  • The packet information might lost if reroute is initiated after a three-way handshake to initialize communication. You must disable the Junos OS Services Framework (JSF) like Application Layer Gateway (ALG) to allow the transfer of traffic in new sessions.

Additional Platform Information

Use Feature Explorer to confirm platform and release support for specific features. Additional platforms may be supported.

Pool/PAT Maximum Address Capacity SRX300SRX320SRX650 SRX340SRX345 SRX400 SRX440SRX440-2AC

SRX1400SRX1500

SRX3400SRX3600SRX4100SRX4200

SRX4700

SRX5400SRX5600SRX5800

Source NAT pools

2048

2048

1280 1536

8192

10,240

30720

12,288

IP addresses supporting port translation

2048

2048

1280 1536

8192

12,288

1048576

1M

PAT port number

64M

64M

64M 64M

256M

384M

2576M

384M