Forum Discussion

bengbrewer_1026's avatar
Icon for Nimbostratus rankNimbostratus
Nov 19, 2010

Dynamically writing to an iRule

I am new to DevCentral.



I was wondering, is there a way via the iControl openAPI to dynamically write IP addresses to an iRule? If so, where might I be able to find some pointers on how to do so?




Thanks in Advance.






3 Replies

  • Ben, could you explain a bit more what you are trying to do? iControl is a programmatic API to get at the control plane (configuration of virtual servers, pools, etc) while iRules are scripts that run in the data plane (real time connections through the device). Think of iControl as an extension of the product GUI. There's not really a way to use a GUI to insert addresses into the real-time traffic through the device.



    If you could explain what problem you are trying to solve, we'll see if we can give you some advice on how to get there.





  • I am trying leverage our SIEM to send an IP ( which is generated by an alert) to our LTM and add the IP to an iRule, which will redirect them to a specific page or pool.



  • I'm still a bit confused. In your situation you are getting an alert in the form of an address and you want to send that address to the iRule to redirect a connection. Am I to assume that the address in question that your alert system is sending out is one that you want to check for user connections from and then redirect those users? That sounds like what you want to do but it's still a bit unclear to me.



    If that is what you want to do, you can use iControl to store the addresses in a data group (or Class in iControl speak). Then you can build an iRule that will compare the client address of a connection to see if it exists in that data group. If you look up the "matchclass" or "findclass" iRule commands in the Wiki, you'll find examples of just that. You'll just need to write the iControl code to access and modify the data groups. I wrote a tech tip on accessing Data Groups with iControl a while back that may be useful to you.





    Hope this helps...