Pulling interface and zone details for an IP using PAN device framework

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.

Pulling interface and zone details for an IP using PAN device framework

L3 Networker

@btorresgil and all ,

 

I am trying to pull interface and zone details for an IP using PAN device framework.

 

Could you please help me on this. My end goal is to run test_security match cmd to find if rule is allow or not .

Current i can do this using fw.op() but i need to put pull zone details manually .

 

Thanks

 

7 REPLIES 7

L5 Sessionator

If you're using pandevice, there's a function for this specifically:

 

https://pandevice.readthedocs.io/en/latest/module-base.html#pandevice.base.PanDevice.test_security_p...

Hi @gfreeman ,

 

Yeah , I am using thing . However i was referring Pulling details regrading Zone details for an IP.

 

Currently i need to verify Zone for an IP from firewall using cli and entering details in function .

 

I am trying to pull interface and zone details for an IP using pandevice.

@gfreeman ,

 

HI ,

Just checking if you can help me on this.

So if you get the info from the CLI, then just mimic what command the CLI uses with pandevice and then you can invoke the function.

 

You can see what op command the CLI is executing by doing cli debug enable before executing the command, then styling your pandevice fw.op() similarly.

HI ,@gfreeman 

Thanks for helping me on this . So i tried but getting below erroro:

 

"PanURLError: URLError: code: 400 reason: Illegal parameter [request]"

 

I tried to use fw.op() .  As mentioned by you i enable the debug and got below :

 

<request cmd="op" cookie="9191129909288394" uid="1003"><operations><test><routing><fib-lookup><virtual-router>default</virtual-router><ip>10.1.1.1</ip></fib-lookup></routing></test></operations></request>

 

Could you please confirm me the value i need to pass for Op function .

i was trying using below:

test><routing><fib-lookup><virtual-router>default</virtual-router><ip>10.1.1.1</ip></fib-lookup></routing></test>

 

Thanks

 

 

You have a few options for how to pass it in.

 

1. Have pandevice create the XML command:

 

fw.op('test routing fib-lookup virtual-router "default" ip "10.1.1.1"')

 

2. Pass in the XML command yourself:

 

fw.op('<test><routing><fib-lookup><virtual-router>default</virtual-router><ip>10.1.1.1</ip></fib-lookup></routing></test>', cmd_xml=False)

 

@gfreeman 

 

Thanks for your help .  🙂

 

 

  • 5366 Views
  • 7 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!