Need a help. Inject CLI command via API to PAN with client IP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Need a help. Inject CLI command via API to PAN with client IP

L2 Linker

Hi all,

I would to make a log-out page for captive portal. which working by inject an CLI command to PAN with client IP.

for example

clear user-cache ip 192.168.5.200

1. what php code can I use to collect client IP address ?

2. what php code can I inject API to PAN ?

Thank you.

1 REPLY 1

L1 Bithead

Hi,

Not sure if this helps, but what we've done in this scenario is implement a little javascript heartbeat function on the (captive portal) destination server such that users close the page to trigger a logout() function (via window.onbeforeunload), which in turn clears the user-ip mapping in the palo via the restful api call..

https://HOSTNAME/api/?type=op&cmd=<clear><user-cache><ip>USER_IP</ip></user-cache></clear>&key=APIKEY

I wont post any example code here as what weve used is a little more convoluted (in that we use websockets to push messages via an AMQP broker that has workers proxying api calls to the palo) but please let me know if you want further details..

cheers

damian

  • 1826 Views
  • 1 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!