<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Static NAT on Juniper SRX - Juniper Firewall				            </title>
            <link>https://www.hacktheforum.com/juniper-firewall/static-nat-on-juniper-srx/</link>
            <description>Hack The Forum Discussion Board</description>
            <language>en</language>
            <lastBuildDate>Sat, 18 Apr 2026 03:48:12 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Static NAT on Juniper SRX</title>
                        <link>https://www.hacktheforum.com/juniper-firewall/static-nat-on-juniper-srx/#post-801</link>
                        <pubDate>Sat, 23 Nov 2024 09:59:58 +0000</pubDate>
                        <description><![CDATA[Static NAT (Network Address Translation) is a one-to-one mapping between a private IP address (internal) and a public IP address (external). This is often used for allowing external clients ...]]></description>
                        <content:encoded><![CDATA[<p>Static NAT (Network Address Translation) is a one-to-one mapping between a private IP address (internal) and a public IP address (external). This is often used for allowing external clients to access internal servers, such as web servers, email servers, or any other resources that need to be directly accessible from the internet.</p>
<p>On a <strong>Juniper SRX</strong> device, static NAT is configured using the <strong><code>security nat static</code></strong> command. This type of NAT allows inbound traffic to be directed to an internal host by mapping a public IP address to an internal private IP address.</p>
<h3><strong>Steps to Configure Static NAT on Juniper SRX:</strong></h3>
<p>Here's a step-by-step guide to configure <strong>Static NAT</strong> on a Juniper SRX device:</p>
<hr />
<h3><strong>1. Access the SRX Device:</strong></h3>
<ul>
<li><strong>Log in</strong> to the SRX device via SSH, console, or the J-Web interface.</li>
</ul>
<hr />
<h3><strong>2. Configure the Static NAT Rule:</strong></h3>
<p>You'll need to configure a static NAT rule that specifies:</p>
<ul>
<li><strong>Source IP:</strong> The external/public IP address.</li>
<li><strong>Destination IP:</strong> The internal/private IP address.</li>
</ul>
<h4><strong>Basic Configuration Command:</strong></h4>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code>
<pre contenteditable="false">set security nat static rule-set &lt;rule-set-name&gt; from &lt;zone-name&gt; to &lt;zone-name&gt; rule &lt;rule-name&gt; match destination-address &lt;public-ip&gt;
set security nat static rule-set &lt;rule-set-name&gt; from &lt;zone-name&gt; to &lt;zone-name&gt; rule &lt;rule-name&gt; then destination-nat &lt;public-ip&gt; to &lt;private-ip&gt;
</pre>
</div>
</div>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"> </div>
</div>
<p>Where:</p>
<ul>
<li><strong><code>&lt;rule-set-name&gt;</code></strong>: Name for the rule set (e.g., "static-nat").</li>
<li><strong><code>&lt;zone-name&gt;</code></strong>: The name of the security zones involved in the NAT translation.</li>
<li><strong><code>&lt;rule-name&gt;</code></strong>: The name of the specific rule.</li>
<li><strong><code>&lt;public-ip&gt;</code></strong>: The public IP address (external IP) that will be mapped to the private IP.</li>
<li><strong><code>&lt;private-ip&gt;</code></strong>: The internal IP address of the machine you want to make accessible.</li>
</ul>
<h4><strong>Example:</strong></h4>
<p>Let's assume:</p>
<ul>
<li><strong>Public IP</strong>: <code>203.0.113.10</code> (the external IP provided by the ISP).</li>
<li><strong>Private IP</strong>: <code>192.168.1.10</code> (the internal IP of the server you want to expose).</li>
<li><strong>Zone</strong>: We will assume <code>untrust</code> is the external zone and <code>trust</code> is the internal zone.</li>
</ul>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code>
<pre contenteditable="false">set security nat static rule-set static-nat from untrust to trust rule 1 match destination-address 203.0.113.10
set security nat static rule-set static-nat from untrust to trust rule 1 then destination-nat 203.0.113.10 to 192.168.1.10
</pre>
</div>
</div>
<p>In this example:</p>
<ul>
<li>Any traffic destined for <code>203.0.113.10</code> (public IP) will be forwarded to <code>192.168.1.10</code> (private IP) within the <strong><code>trust</code></strong> zone.</li>
<li>The rule set is named <strong><code>static-nat</code></strong>, and the rule is <strong><code>1</code></strong>.</li>
</ul>
<hr />
<h3><strong>3. Commit the Configuration:</strong></h3>
<p>After configuring the NAT rule, commit the changes to the device:<code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code></p>
<pre contenteditable="false">commit
</pre>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"> </div>
</div>
<h3><strong>4. (Optional) Configure Security Policies:</strong></h3>
<p>In addition to the static NAT rule, you must configure security policies to allow traffic to flow between the relevant zones (e.g., from the <strong><code>untrust</code></strong> zone to the <strong><code>trust</code></strong> zone).</p>
<p>Example to allow inbound traffic from the untrust zone to the trust zone for the mapped public IP:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code>
<pre contenteditable="false">set security policies from-zone untrust to-zone trust policy allow-web-app match source-address any destination-address 203.0.113.10 application any
set security policies from-zone untrust to-zone trust policy allow-web-app then permit
</pre>
</div>
</div>
<p>This policy:</p>
<ul>
<li>Allows traffic from <strong>any source</strong> to the public IP (<code>203.0.113.10</code>), for any application.</li>
<li>The traffic is then permitted through the firewall.</li>
</ul>
<p>You can adjust the <strong>source-address</strong> and <strong>application</strong> as needed to restrict access.</p>
<p> </p>
<hr />
<h3><strong>5. Verify the Configuration:</strong></h3>
<p>After applying the configuration, you can verify that the static NAT rule is working as expected using the following commands:</p>
<h4><strong>Check NAT Rules:</strong></h4>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code>
<pre contenteditable="false">show security nat static
</pre>
</div>
</div>
<h4><strong>Check Traffic Flow:</strong></h4>
<p>To check if the NAT translation is working:</p>
<div class="contain-inline-size rounded-md border- border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-bash"><code class="!whitespace-pre hljs language-bash"></code></code>
<pre contenteditable="false">show security flow session | match 203.0.113.10
</pre>
</div>
</div>
<p>This will display any active sessions that are using the mapped public IP (<code>203.0.113.10</code>).</p>
<p> </p>
<p> </p>]]></content:encoded>
						                            <category domain="https://www.hacktheforum.com/juniper-firewall/">Juniper Firewall</category>                        <dc:creator>paul0000</dc:creator>
                        <guid isPermaLink="true">https://www.hacktheforum.com/juniper-firewall/static-nat-on-juniper-srx/#post-801</guid>
                    </item>
							        </channel>
        </rss>
		