Forum Discussion

sb_2323_80570's avatar
sb_2323_80570
Icon for Nimbostratus rankNimbostratus
May 07, 2010

lb_selected and node

Hi,

 

 

My scenario, I have two irules in place. One that selects the pool and one that changes the destination tcp port based on a variable based on irule 2.

 

 

pool_xxxx1:2001

 

 

 

The first rule works fine but the second irule does not change the destination port, the variable $tcp_port can be any port, If add lb::reselect to the node entry it works fine but screws up persistency

 

 

when LB_SELECTED {

 

if {[IP::addr [LB::server addr] equals 1.1.1.1]}{

 

node 1.1.1.1 $tcp_port

 

}

 

if {[IP::addr [LB::server addr] equals 1.1.1.2]}{

 

node 1.1.1.2 $tcp_port

 

}

 

}

 

 

Could anyone advise as to where im going wrong please
  • Have you verified that your Variable ($tcp_port) is available across your iRules?

     

     

    You might try enabling some debug logging during your testing.
  • Hi,

     

     

    Will try some more debugging, the variable is there as if i use LB::reselect node 1.1.1.2 $tcp_port it works fine but doesn't create a pesist session
  • spark_86682's avatar
    spark_86682
    Historic F5 Account
    Yes, when you tell the LTM to load-balance to a node, you're overriding persistence, so a persist entry won't be created. You'll have to create it yourself with the persist add command. I believe that should work.