Forum Discussion

SKumar_381722's avatar
SKumar_381722
Icon for Nimbostratus rankNimbostratus
Jan 21, 2019

can iRule work without assigning it to any virtual server ?

I have a LTM box, where I could see there are some customer iRules present under Local Traffic->iRule List. However,I could not see these iRules mapped to any Virtual Server. I am sure these iRules are working.but wonder how! Could you please tell me, how can I check and troubleshoot for these iRules in case of any issue?

 

3 Replies

  • to check if your irule is assigned to a virtual server, you can use this command in tmsh

    list ltm virtual one-line | grep YourIRuleName

    it will display only virtual servers which contains the irule name in the configuration.

    If you have irules not assigned to any virtual server, it is not enabled, except the RULE_INIT event which is executed when you load it (or reboot the system) and can change static variables.

    Static variables are shared in the whole system, if static variables names are the same in multiple irules, the last irule loaded set the variable value.

  • Hi SKumar,

    in 99,999% of the usecases iRules will be assigned directly to a Virtual Server.

    But it's still possible to attach an iRule indirectly to your Virtual Server(s) via certain Profiles (e.g. using iRules within Persistence Profiles) or by using RULE_INIT events with lesser known techniques to interact with them (e.g. Interact with RULE_INIT events via Traffic Policies).

    To get an overview which iRule is used you may execute the TMSH command below...

    (tmos) show ltm rule

    ... and check the individual iRule execution counters. Those iRule statistics can also be viewed via LTMs Web UI.

    Based on the iRule execution counters and a brief code review of the stuff running in the RULE_INIT event you can finally judge if the iRule is in use or not...

    Note: Last but not least, you may try to delete a given iRule. If the iRule is assigned to a configuration object, the deletion would fail with a errmsg displaying where its been currently used.

    Cheers, Kai

  • The RULE_INIT event is not traffic-oriented. It is triggered when the BIG-IP system is loaded, or when the iRule itself is modified (and therefore gets re-initialized). See here for further details.