command cli show arp and export result

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

command cli show arp and export result

L2 Linker
command cli show arp and export result
I search to export the result show arp command

show command, copy the result and export to my computer in ssh

2 accepted solutions

Accepted Solutions

excuse me it's ok

thank you very mutch

View solution in original post

Hi@axelfa ,

 

As you're looking for exporting arp list, just put IP address of your firewall and a associated API key in below path, the file will get exported through curl. In the post, may be you're not able to see full path, just copy below path and paste it in notepad. So you'll get more clarity.

Just make sure IP address and API key is correct.

 

curl -kG "https://192.168.1.1/api/?type=op&cmd=%3Cshow%3E%3Carp%3E%3Centry+name+%3D+%27all%27%2F%3E%3C%2Farp%3E%3C%2Fshow%3E&key=<api-key>"  > arp-list.xml

 

Hope it works!

Mayur

 

 

M

View solution in original post

17 REPLIES 17

Cyber Elite
Cyber Elite

Hello,

If using SSH, then just highlight the stuff you want to copy and then paste it into notepad or something else. 

 

Regards,

Thank you for you help but i don't want to do manualy

it's possible for the exemple ( scp export configuration from MyBackup.xml to user@<scphost>:/path) so whay not for show arp ..

 

perhaps it's possible to do show arp and >into a file and export the file ?

 

@axelfa,

 

You can try to export it using API.

 

API URL would be,

/api/?type=op&cmd=<show><arp><entry name = 'all'/></arp></show>

 

Mayur

M

thank you

i 'm beginner

can you help me for a sample example:

i m testing: https://myfirewall/api/?type=op&command=<show><arp><entry name='all'/></arp></show>

message:

<response status="error" code="403">
<result>
<msg>Invalid Credential</msg>
</result>
</response>

 

@axelfa,

 

First you need to generate API key for your firewall and then you can use it under following path to execute required tasks. For generating api-key, try below path from system's browser from where your firewall is reachable. Here put login credentials which has proper access related to XML/REST API on firewall.

 

https://<firewall-ip>/api/?type=keygen&user=<username>&password=<password>

 

 

Once you have API-KEY for your firewall, use it under below path and shoot it. You should get ARP list in xml format.

 

https://192.168.1.1/api/?type=op&cmd=<show><arp><entry+name+%3D+%27all%27%2F><%2Farp><%2Fshow>&key=<...

 

 

Now if you want to export it in xml file on your system then try below through command prompt. For this, you need to install CURL. Once curl is install, try below from command prompt.

 

curl -kG "https://192.168.1.1/api/?type=op&cmd=%3Cshow%3E%3Carp%3E%3Centry+name+%3D+%27all%27%2F%3E%3C%2Farp%3...>" > arp-list.xml

 

I tried above in my lab and i am getting xml file created with name arp-list.xml.

 

If you need any reference guide for generating API key, installing CURL etc, please refer below KB article.

 

https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000Cm7yCAC

 

Hope it helps!

Mayur

M

Looks good, I will also try this in my environment. Just confirm if it creates any extra resource utilization due to these API calls.

@Vikashh, It shouldn't create any negative impact on the firewall.

 

Mayur

M

Hello
I'm access a web acces Firewall

login password

and /api:

XML API
Commit
Configuration Commands
Export
Import
Logs
Operational Commands
Reports
User ID

it's similar to access : https://<firewall-ip>/api/?type=keygen&user=<username>&password=<password>

OR NOT ?

@axelfa,

 

https://<firewall-ip>/api/?type=keygen&user=<username>&password=<password>

 

Above path is for generating API-Key which will be used for further paths under <api-key> fileld.

 

Mayur

 

 

M

thank you

and logout Api ?

Hello

it's ok for api authentification

<response status="success">

 

but i did not understand

i execute this two lignes ?

https://192.168.1.1/api/?type=op&cmd=<show><arp><entry+name+%3D+%27all%27%2F><%2Farp><%2Fshow>&key=<....

"key"     my key ???   " UTFGRIKesytu ....."

 

curl -kG "https://192.168.1.1/api/?type=op&cmd=%3Cshow%3E%3Carp%3E%3Centry+name+%3D+%27all%27%2F%3E%3C%2Farp%3...>" > arp-list.xml

 

and the writing characters as wrong (copy past)

thank you

 

excuse me it's ok

thank you very mutch

@axelfa,

Apologies, i was not able to respond.

Were you able to execute path and export file?

 

Mayur

M
  • 2 accepted solutions
  • 24206 Views
  • 17 replies
  • 0 Likes
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!