Forum Discussion

cjunior_138458's avatar
cjunior_138458
Icon for Altostratus rankAltostratus
Dec 16, 2015

LTM Policy and iRule together

We have a customer that uses LTM policy because he need more friendly visibility than a iRule script acknowledgment, though, there are hard features that need to be done in iRules and it can cause some conflicts. I've been researching some way to work mixing Policy and LTM iRule and I don't know yet. Meanwhile, I created a semaphore variable in the policy rule and then check it in the iRule script whether to go on. If var not exists, iRule will do the job, otherwise, exit.

For example:

Policy with dynamic forwarding rules:

iRule with static treatment:

when HTTP_REQUEST {
    if { [info exists disable_irule] } {
        unset disable_irule
        event disable all
        return
    }

    
}

What do you think about it? I did something unnecessary?

What is the best approach?

1 Reply

  • Hi Cjunior,

    Using LTM-Policies to set a TCL variables, which would then trigger a certain iRule script blocks will work and using

    [info exist]
    to check for its existence is ideal. But dont forget that these TCL variables are connection based, so make sure they will get an proper
    [unset]
    (as you did in your example).

    Also keep in mind that

    [event disable all]
    is connection based, so you have to make sure the connection is getting closed to reenable iRule processing again. You may also want to use LTM Policies to enable the event processing on each request by creating a TCL expression
    [event enable all]
    .

    Update: Removed misleading information

    Cheers, Kai