Forum Discussion

Bret_McGinnis_1's avatar
Bret_McGinnis_1
Icon for Nimbostratus rankNimbostratus
Sep 14, 2006

Changing persistence with an iRule

Hi,

 

 

I have a VIP that is assigned a persistence profile of source address. I want to change it to Cookie Insert persistence in an iRule. The BigIP doc implies that I can not do this. I created an iRule to test it and I'm unable to assign a persistence profile of source address with an iRule that changes the persistence to Cookie Insert.

 

 

Am I doing something worng or is it not possible to do this?

 

I'm running ver 9.1.1 on my BigIPs.

 

 

 

 

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    May I ask why it is that you're trying to do this? Is there a reason that you're not just using the iRule to do source address persistence when needed and insert a cookie for persistence in the cases when that's needed?

     

     

    It wouldn't have all the bells and whistles of a profile perhaps, but it might be a solution that would work for you.

     

     

    I guess my question is, what is it you're really trying to accomplish?

     

     

    Thanks,

     

    Colin
  • I'm not sure I understand your response. Maybe I didn't ask the right question. The VIP is set for source address presistence. When a specific condition is met I want to change the persisence to cookie insert through an iRule. My problem is specific to changing persistence from source address to Cookie Insert.

     

     

    Does that help or am I completely missing your meaning?

     

     

     

    Regards
  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    While there are commands that allow you to to manipulate persistence via an iRule, there are not currently commands to change the profile type or switch between profiles.

     

     

    That being the case, you'd have to do this more manually. I.E. use the persist command to specifically set the type of persistence you want when the specific conditions are met. You can read more about the persist command in iRules here: Click here

     

     

    Colin
  • Ok, the link you listed shows the following syntax for the persis command:

     

     

    persist

     

    persist simple [] []

     

    persist source_addr [] []

     

    persist sticky [] []

     

    persist dest_addr [] []

     

    persist ssl []

     

    persist msrdp []

     

    persist cookie [insert [] [] |

     

    rewrite [] [] |

     

    passive [] |

     

    hash [{ [] } []] ]

     

    persist uie []

     

    persist hash []

     

     

     

    The first line shows "persist ". What does "" represent? It looks like a profile name but you stated that I can't swtich between profiles.

     

     

    After show test I found that I can define the VIP with Cookie persistence and then change it to source_addr in an iRule. But I can't define the VIP with source_addr persistence and change it to cookie in the iRule. It that correct?

     

     

    Regards,

     

     

     

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    I apologize if I wasn't clear above. There aren't currently commands available to switch between profile types (ftp, tcp, http), but you can certainly enlist the persistence options of your choice in real-time.

     

     

    As far as changing from source address to cookie, I'm not sure that this should cause any problems. What is it that you're trying to do and what results are you seeing that lead you to believe the iRule isn't functioning properly.

     

     

    Colin