Forum Discussion

teknet7_237497's avatar
teknet7_237497
Icon for Nimbostratus rankNimbostratus
Dec 14, 2015

iRule - two persist commands

Hello Team,

Can i have two persist commands in one iRule ? I would like to create two different entries which would be used by two different types of traffic (protocols) for two other Virtual Servers having the same ip ("match across services").

Example:
VIP1 for radius - iRule creating two persistent entries based on different Radius AV Pairs
VIP2 for http - iRule based on source ip hitting one of those entries
VIP3 for smtp - iRule based on domain hitting the second of those entries

Possible ?

Thanks, Michal

2 Replies

  • Hi Michal,

    you can (pre)create as many persistence records as you want in a single iRule using the

    [persist add]
    command. To allign the individual connections/virtual servers to the (pre)created persistence records you may use
    [persist lookup]
    following by a manual selection of the node.

    For further reading: https://devcentral.f5.com/wiki/iRules.persist.ashx

    Cheers, Kai

  • Hi Kai,

    Thank you for the clarification.

    I have tried to call:

    persist uie "$calling:$framed_ip" 30
    persist uie "$framed_ip" 30
    persist uie "$calling" 30
    

    And always just the last persistence record was added.

    I need to do everything in CLIENT_ACCEPTED because my attributes are only in the request from client. If i understand i can not use persistence add, because i want to do two things at the same time:'

    • follow any existing persistence (if existing)
    • create a new one if not existing for any of those two arguments (or refresh existing)

    How could i achieve that ?

    Thanks, Michal