<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Test nat-policy rules API in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/test-nat-policy-rules-api/m-p/228851#M1769</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to use the APIs to test if the source, destination, protocol and port that I've inserted, match with one of my NAT policy rules.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The complete request of the API that I've implemented is:&lt;/P&gt;&lt;PRE&gt;https://192.168.111.192/api/?type=op&amp;amp;cmd=&amp;lt;test&amp;gt;&amp;lt;nat-policy-match&amp;gt;&amp;lt;source&amp;gt;10.226.163.81&amp;lt;/source&amp;gt;&amp;lt;destination&amp;gt;10.227.248.113&amp;lt;/destination&amp;gt;&amp;lt;protocol&amp;gt;6&amp;lt;/protocol&amp;gt;&amp;lt;destination-port&amp;gt;123&amp;lt;/destination-port&amp;gt;&amp;lt;/nat-policy-match&amp;gt;&amp;lt;/test&amp;gt;&amp;amp;key=&amp;lt;myKey&amp;gt;&lt;/PRE&gt;&lt;P&gt;and the Nat policy rule for the API request is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rules.png" style="width: 800px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/16386i9CBC1E93D42BE468/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="rules.png" alt="rules.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below, the same request via CLI:&lt;/P&gt;&lt;PRE&gt;user@ic-f-bih-1(active)&amp;gt; test nat-policy-match source 10.226.163.81 destination 10.227.248.113 protocol 6 destination-port 123

Destination-NAT: Rule matched: Rule24
10.227.248.113:123 =&amp;gt; 10.10.1.85:123&lt;/PRE&gt;&lt;P&gt;In the CLI the request is successfull, but with API the result is the follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;response cmd="status" status="success"&amp;gt;
  &amp;lt;result&amp;gt;
    &amp;lt;rules&amp;gt;
      &amp;lt;entry/&amp;gt;
    &amp;lt;/rules&amp;gt;
  &amp;lt;/result&amp;gt;
&amp;lt;/response&amp;gt;&lt;/PRE&gt;&lt;P&gt;This happens only with rules that have Destination Translation filled. If the nat rule has Source translation filled, the response of the API query is successfull.&lt;/P&gt;&lt;P&gt;What I wrong with this API query? Thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 11:22:33 GMT</pubDate>
    <dc:creator>enricobiella</dc:creator>
    <dc:date>2018-08-30T11:22:33Z</dc:date>
    <item>
      <title>Test nat-policy rules API</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/test-nat-policy-rules-api/m-p/228851#M1769</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I want to use the APIs to test if the source, destination, protocol and port that I've inserted, match with one of my NAT policy rules.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The complete request of the API that I've implemented is:&lt;/P&gt;&lt;PRE&gt;https://192.168.111.192/api/?type=op&amp;amp;cmd=&amp;lt;test&amp;gt;&amp;lt;nat-policy-match&amp;gt;&amp;lt;source&amp;gt;10.226.163.81&amp;lt;/source&amp;gt;&amp;lt;destination&amp;gt;10.227.248.113&amp;lt;/destination&amp;gt;&amp;lt;protocol&amp;gt;6&amp;lt;/protocol&amp;gt;&amp;lt;destination-port&amp;gt;123&amp;lt;/destination-port&amp;gt;&amp;lt;/nat-policy-match&amp;gt;&amp;lt;/test&amp;gt;&amp;amp;key=&amp;lt;myKey&amp;gt;&lt;/PRE&gt;&lt;P&gt;and the Nat policy rule for the API request is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rules.png" style="width: 800px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/16386i9CBC1E93D42BE468/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="rules.png" alt="rules.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below, the same request via CLI:&lt;/P&gt;&lt;PRE&gt;user@ic-f-bih-1(active)&amp;gt; test nat-policy-match source 10.226.163.81 destination 10.227.248.113 protocol 6 destination-port 123

Destination-NAT: Rule matched: Rule24
10.227.248.113:123 =&amp;gt; 10.10.1.85:123&lt;/PRE&gt;&lt;P&gt;In the CLI the request is successfull, but with API the result is the follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;response cmd="status" status="success"&amp;gt;
  &amp;lt;result&amp;gt;
    &amp;lt;rules&amp;gt;
      &amp;lt;entry/&amp;gt;
    &amp;lt;/rules&amp;gt;
  &amp;lt;/result&amp;gt;
&amp;lt;/response&amp;gt;&lt;/PRE&gt;&lt;P&gt;This happens only with rules that have Destination Translation filled. If the nat rule has Source translation filled, the response of the API query is successfull.&lt;/P&gt;&lt;P&gt;What I wrong with this API query? Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 11:22:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/test-nat-policy-rules-api/m-p/228851#M1769</guid>
      <dc:creator>enricobiella</dc:creator>
      <dc:date>2018-08-30T11:22:33Z</dc:date>
    </item>
  </channel>
</rss>

