Exporting NAT configuration

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting NAT configuration

Not applicable

So I'm wanting to get the XML out of the firewall for specific DMZ's so that I can assemble IPAM updates from the XML.

Right now, if I ssh into Panorama, go into config mode, and issue this command:

show device-group DMZ pre-rulebase nat rules

Then I get the output I want, however, doing it interactively isn't what I want - what I'd like to do is convert this into an API call, so I can fetch this with a URL...

Using the API browser however, I cannot seem to duplicate this..export

1 ACCEPTED SOLUTION

Accepted Solutions

Not applicable

Hi,

You can use that url :

/api/?type=op&cmd=<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>

go on http://YOUR.PANORAMA.IP/php/rest/browse.php/op::show::config::running::xpath

change the xml content with:

<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>

click submit

regards

View solution in original post

2 REPLIES 2

Not applicable

Hi,

You can use that url :

/api/?type=op&cmd=<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>

go on http://YOUR.PANORAMA.IP/php/rest/browse.php/op::show::config::running::xpath

change the xml content with:

<show><config><running><xpath>devices/entry[@name='localhost.localdomain']/device-group/entry[@name='DMZ']/pre-rulebase/nat</xpath></running></config></show>

click submit

regards

Yeah, took me another hour of digging, but I eventually found it.

The trick was to get a full copy of the config downloaded locally and view it in Notepad++ in XML mode, then I started collapsing the config elements so that I was only viewing from levels 1 through 5 - and thats when I could see the path....

<devices>

<entry name="localhost.localdomain">

   <device-group>

     <entry name="DMZ">

       <pre-rulebase>

         <nat>

XML and I definitely have a love/hate relationship.  Smiley Happy

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!