<?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 Re: Configuring tunnel ike-gateway with API in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439916#M99858</link>
    <description>&lt;P&gt;I think this is boiling down to the quotes I was using in windows command prompt. I was using double-quotes on the outside, and all single quotes on the parameters, but it did not like that in CMD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon further inspection, the browser changed all the single quotes but for the ike-gateway name to %27, and had no double-quotes for the request in the browser. I changed my quotes in the cmd request to %27 as well and it worked like a&amp;nbsp; charm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't opening and closing my quotes in a way command prompt could understand.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Oct 2021 09:25:47 GMT</pubDate>
    <dc:creator>Joshua_Peterson</dc:creator>
    <dc:date>2021-10-10T09:25:47Z</dc:date>
    <item>
      <title>Configuring tunnel ike-gateway with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439830#M99844</link>
      <description>&lt;P&gt;I am at my wits end with this. Can anybody tell me what I am doing wrong here? I'm trying to make a script that will use the API to stand up L2L VPN tunnels, and there is something in this request that is making the firewall puke (error 18 "Malformed Request").&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API calls:&lt;/P&gt;&lt;P&gt;making the gateway, this works just fine:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl --globoff -X GET "&lt;A href="https://palo.mydomain.com/api?key=" target="_blank"&gt;https://palo.mydomain.com/api?key=&lt;/A&gt;&amp;lt;censored&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/ike/gateway/entry[@name='test']&amp;amp;element=&amp;lt;authentication&amp;gt;&amp;lt;pre-shared-key&amp;gt;&amp;lt;key&amp;gt;PASSWORD&amp;lt;/key&amp;gt;&amp;lt;/pre-shared-key&amp;gt;&amp;lt;/authentication&amp;gt;&amp;lt;protocol&amp;gt;&amp;lt;ikev1&amp;gt;&amp;lt;dpd&amp;gt;&amp;lt;enable&amp;gt;yes&amp;lt;/enable&amp;gt;&amp;lt;/dpd&amp;gt;&amp;lt;ike-crypto-profile&amp;gt;API-Test&amp;lt;/ike-crypto-profile&amp;gt;&amp;lt;/ikev1&amp;gt;&amp;lt;ikev2&amp;gt;&amp;lt;dpd&amp;gt;&amp;lt;enable&amp;gt;yes&amp;lt;/enable&amp;gt;&amp;lt;/dpd&amp;gt;&amp;lt;/ikev2&amp;gt;&amp;lt;/protocol&amp;gt;&amp;lt;local-address&amp;gt;&amp;lt;ip&amp;gt;1.1.1.1&amp;lt;/ip&amp;gt;&amp;lt;interface&amp;gt;ethernet1/4&amp;lt;/interface&amp;gt;&amp;lt;/local-address&amp;gt;&amp;lt;protocol-common&amp;gt;&amp;lt;nat-traversal&amp;gt;&amp;lt;enable&amp;gt;no&amp;lt;/enable&amp;gt;&amp;lt;/nat-traversal&amp;gt;&amp;lt;fragmentation&amp;gt;&amp;lt;enable&amp;gt;no&amp;lt;/enable&amp;gt;&amp;lt;/fragmentation&amp;gt;&amp;lt;/protocol-common&amp;gt;&amp;lt;peer-address&amp;gt;&amp;lt;ip&amp;gt;IP-1.1.1.1&amp;lt;/ip&amp;gt;&amp;lt;/peer-address&amp;gt;&amp;lt;local-id&amp;gt;&amp;lt;id&amp;gt;1.1.1.1&amp;lt;/id&amp;gt;&amp;lt;type&amp;gt;ipaddr&amp;lt;/type&amp;gt;&amp;lt;/local-id&amp;gt;&amp;lt;peer-id&amp;gt;&amp;lt;id&amp;gt;2.2.2.2&amp;lt;/id&amp;gt;&amp;lt;type&amp;gt;ipaddr&amp;lt;/type&amp;gt;&amp;lt;/peer-id&amp;gt;"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Making the ipsec tunnel, this one pukes only for the ike-gateway parameter:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl --globoff -X GET "&lt;A href="https://palo.mydomain.com/api?key=" target="_blank"&gt;https://palo.mydomain.com/api?key=&lt;/A&gt;&amp;lt;censored&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='tunnel_name']/auto-key/ike-gateway&amp;amp;element=&amp;lt;entry name='Test'/&amp;gt;"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;response status="error" code="18"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;Malformed Request&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also tried and get the same error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;curl --globoff -X GET "&lt;A href="https://palo.mydomain.com/api?key=" target="_blank"&gt;https://palo.mydomain.com/api?key=&lt;/A&gt;&amp;lt;censored&amp;gt;&amp;amp;type=config&amp;amp;action=set&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='tunnel_name']&amp;amp;element=&amp;lt;auto-key&amp;gt;&amp;lt;ike-gateway&amp;gt;&amp;lt;entry name="test"/&amp;gt;&amp;lt;/ike-gateway&amp;gt;&amp;lt;/auto-key&amp;gt;"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;lt;response status="error" code="18"&amp;gt;&amp;lt;msg&amp;gt;&amp;lt;line&amp;gt;Malformed Request&amp;lt;/line&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The CLI Debug:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;user@PA# set network tunnel ipsec tunnel_name auto-key ike-gateway Test&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;(container-tag: network container-tag: tunnel container-tag: ipsec container-tag: entry key-tag: name value: tunnel_name container-tag: auto-key container-tag: ike-gateway container-tag: entry key-tag: name value: Test)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;((eol-matched: . #t) (xpath-prefix: . /config/devices/entry[@name='localhost.localdomain']) (context-inserted-at-end-p: . #f))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(network (tunnel (ipsec (entry (@ (name tunnel_name)) (auto-key (ike-gateway (entry (@ (name Test)))))))))&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;(entry (@ (name Test)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;request cmd="set" obj="/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='tunnel_name']/auto-key/ike-gateway" cookie=""&amp;gt;&amp;lt;entry name='Test'/&amp;gt;&amp;lt;/request&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;2021-10-09 09:21:23&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;lt;response status="success" code="20"&amp;gt;&amp;lt;msg&amp;gt;command succeeded&amp;lt;/msg&amp;gt;&amp;lt;/response&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a lab device running 10.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't figure out what I'm doing wrong here. Am I nuts?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 13:55:32 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439830#M99844</guid>
      <dc:creator>Joshua_Peterson</dc:creator>
      <dc:date>2021-10-09T13:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring tunnel ike-gateway with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439851#M99846</link>
      <description>&lt;P&gt;Looking through the API browser it gave me a xpath for&amp;nbsp;&lt;A href="https://palo3/api/?type=config&amp;amp;action=get&amp;amp;xpath=%2Fconfig%2Fdevices%2Fentry%5B%40name%3D%27localhost.localdomain%27%5D%2Fnetwork%2Ftunnel%2Fipsec%2Fentry%5B%40name%3D%27api-test%27%5D%2Fauto-key%2Fike-gateway%2Fentry%5B%40name%3D%27test1%27%5D&amp;amp;REST_API_TOKEN=787828614" target="_rest_api"&gt;/api/?type=config&amp;amp;action=get&amp;amp;xpath=/config/devices/entry[@name='localhost.localdomain']/network/tunnel/ipsec/entry[@name='api-test']/auto-key/ike-gateway/entry[@name='test1']&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(forgive me for changing the tunnel and ike-gateway names, I'm trying to see if there is some character or term it doesn't like)&lt;/P&gt;&lt;P&gt;If I try to run this it tells me there is a error for the configuration target. That makes send to me, because up to this point the [@name="thing"]&amp;nbsp; syntax has only been used for the target of a change, and I am not trying to change "thing" in this case but rather trying to apply it as a setting, as is, to the tunnel.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 19:27:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439851#M99846</guid>
      <dc:creator>Joshua_Peterson</dc:creator>
      <dc:date>2021-10-09T19:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring tunnel ike-gateway with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439857#M99848</link>
      <description>&lt;P&gt;This is absolutely BIZZAR. I ran the command "&lt;STRONG&gt;set network tunnel ipsec asdf auto-key ike-gateway test1&lt;/STRONG&gt;" from the CLI with "&lt;STRONG&gt;debug cli on&lt;/STRONG&gt;" and found there was an error &lt;EM&gt;"Server error : asdf -&amp;gt; auto-key constraints failed : default crypto profile doesn't exist&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;asdf -&amp;gt; auto-key is invalid"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no 'default' crypto policies.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had seen this before and assumed it was an order of operation issue, and so I set the crypto profile before I set the ike-gateway by doing &amp;lt;auto-key&amp;gt;&amp;lt;ipsec-crypto-profile&amp;gt;asdf&amp;lt;/ipsec-crypto-profile&amp;gt;&amp;lt;ike-gateway&amp;gt;&amp;lt;entry name="test1"/&amp;gt;&amp;lt;/ike-gateway&amp;gt;&amp;lt;/auto-key&amp;gt; (the ipsec policy is set &lt;EM&gt;before&lt;/EM&gt; the gateway, so it doesn't need to worry about the default crypto policy) but that did not help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So of all the stupid things I have ever had to do, it added a ipsec policy called 'default'. Bam, it works just fine now. It's so stupid I can't even be happy I've solved it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUMMARY: If you want to use the API, don't go deleting your 'defaults'...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(┛◉Д◉)┛彡┻━┻&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 20:07:39 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439857#M99848</guid>
      <dc:creator>Joshua_Peterson</dc:creator>
      <dc:date>2021-10-09T20:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring tunnel ike-gateway with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439864#M99849</link>
      <description>&lt;P&gt;Well, never mind. I accidentally ran the command with action=get instead of action=set, and that always works. Back to the drawing board.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Oct 2021 21:27:22 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439864#M99849</guid>
      <dc:creator>Joshua_Peterson</dc:creator>
      <dc:date>2021-10-09T21:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring tunnel ike-gateway with API</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439916#M99858</link>
      <description>&lt;P&gt;I think this is boiling down to the quotes I was using in windows command prompt. I was using double-quotes on the outside, and all single quotes on the parameters, but it did not like that in CMD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon further inspection, the browser changed all the single quotes but for the ike-gateway name to %27, and had no double-quotes for the request in the browser. I changed my quotes in the cmd request to %27 as well and it worked like a&amp;nbsp; charm.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't opening and closing my quotes in a way command prompt could understand.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Oct 2021 09:25:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/configuring-tunnel-ike-gateway-with-api/m-p/439916#M99858</guid>
      <dc:creator>Joshua_Peterson</dc:creator>
      <dc:date>2021-10-10T09:25:47Z</dc:date>
    </item>
  </channel>
</rss>

