Forum Discussion

Pieter_1379's avatar
Pieter_1379
Icon for Nimbostratus rankNimbostratus
Jul 02, 2013

Persistence in CLIENT_ACCEPTED

Hi

 

I want to add persisitence for each pool how do I combine these

 

 

when CLIENT_ACCEPTED {

 

switch [TCP::local_port] {

 

1001 {

 

pool pool_1001

 

}

 

1002 {

 

pool pool_1002

 

}

 

default {

 

reject

 

}

 

}

 

}

 

Thanks

 

P.

 

4 Replies

  • You can do this in an irule, but why not keep it simple and just set up a virtual server for each TCP port and use the relevant pool, with persistence applied on the VS?
  • Hi

     

    Thanks for the quick response

     

    We use to do it but we are running out of IP's for that range .... and are consolidating all VIP's

     

    The problem is even worst in our DMZ as we only got limited public IP's

     

    So how would the syntax look if you combine it ?

     

    thanks

     

    P.

     

     

  • Hmm I can switch to

     

    when HTTP_REQUEST {

     

    switch -glob [HTTP::uri] {

     

     

    then I can add persist

     

     

    But then how do I use port .... URL will be the same in this case

     

     

    Any takers ?

     

     

    Thanks

     

    P.
  • Persistence can be applied at any layer of the client side connection (ex. layer 4 source address, layer 6 SSL sessionid, layer 7 HTTP cookie, etc.). The question is what do you want to persist on? I gathered from the first post that you wanted to persist on the request port. If so, you can see the request port [TCP::local_port] in CLIENT_ACCEPTED AND HTTP_REQUEST. You can only persist on layer 4 data, however, in the CLIENT_ACCEPTED event (ie. src address), and pretty much anything in the HTTP_REQUEST event.

     

     

    Will users be flopping around between the request ports in a single session? If not, then simple HTTP cookie persistence is by far the easiest solution and you don't really have to deal with the request port (other than setting the pool).