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

Announcements

ATTENTION Customers, All Partners and Employees: The Customer Support Portal (CSP) will be undergoing maintenance and unavailable on Saturday, November 7, 2020, from 11 am to 11 pm PST. Please read our blog for more information.

Reply
Highlighted
L3 Networker

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

@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

 

Highlighted
L4 Transporter

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...

L3 Networker

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.

Highlighted
L3 Networker

@gfreeman ,

 

HI ,

Just checking if you can help me on this.

Highlighted
L4 Transporter

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.

Highlighted
L3 Networker

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

 

 

Highlighted
L4 Transporter

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)

 

Highlighted
L3 Networker

@gfreeman 

 

Thanks for your help . 

 

 

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 Live Community as a whole!

The Live Community thanks you for your participation!