Forum Discussion

Bob_24115's avatar
Bob_24115
Icon for Nimbostratus rankNimbostratus
Oct 14, 2014

trying to call external web service to determine VPN access

hi there I know very little about the F5 APM as I've not yet attended training, so please forgive potential naivety of this question. I would like to check with one of our webservers if the MAC address of the connecting device is known to us. I have an asp page that will return true or false when called with the mac address.

I created this irule

package require http;
when ACCESS_POLICY_AGENT_EVENT {
  switch [ACCESS::policy agent_id] { 
   "our_policy" {
     set clientMAC "[ACCESS::session data get session.client.mac_address]";
     ACCESS::session data set session.custom.mac_from_lan 0;
     ACCESS::session data set session.custom.TEMPclientmac $clientMAC; Just used to test this is firing
     set result [http::geturl http://my.web.server/MacValid.asp?MacAddress=$clientMAC]
     if { [http::data $result] == "TRUE" } { ACCESS::session data set session.custom.mac_from_lan 1 } 
     }
   } 
}

but it errors on the "package require" line

I was hoping to call this irule from my access policy.

I suspect I can't use the tcl http routines? Is there a way I can do what I want? Basically I want to grant restricted access to machines we don't know about and full access to those we do.

thanks in advance

12 Replies