Forum Discussion

meena_60183's avatar
meena_60183
Icon for Nimbostratus rankNimbostratus
Aug 18, 2010

persitence entry lookup across two different VS

Hi All,

 

 

I have a need to query the persistence table on a VS based on the entry created by another VS and select a node based on the entry.

 

 

I created the following irule by looking at other examples in this forum but tcpdump shows the traffic going out from the F5 to the respective client but the client never sees it.

 

 

The irule is applied to the second VS and I am trying to look at the perist table based on the client IP. Here is the irule

 

 

when CLIENT_ACCEPTED {

 

if { [matchclass [IP::client_addr] equals $::ie_vlan] & [matchclass [IP::local_addr] equals $::dns_servers]} {

 

log local0. "client IP is [IP::client_addr]"

 

log local0. "local address is [IP::local_addr]"

 

if { [persist lookup simple [IP::client_addr] node] equals "10.44.254.23" }{

 

pool ie_http_pool member 10.22.255.24 0

 

log local0. "selected server1"

 

} elseif { [persist lookup simple [IP::client_addr] node] equals "10.44.254.24" }{

 

pool ie_http_pool member 10.22.255.23

 

log local0. "selected server2"

 

} elseif { [persist lookup simple [IP::client_addr] node] equals "10.44.254.25" }{

 

pool ie_http_pool member 10.22.255.25 0

 

log local0. "selected server3"

 

}

 

}

 

}

 

 

Is client_accepted a correct event? I am seeing log statements being hit.

 

 

Meena

 

  • This is a tough one because of the way your are doing persistence. Have you read this article and made certain it does not apply to you?

    https://support.f5.com/kb/en-us/solutions/public/9000/800/sol9815.html

    I also found:

    http://devcentral.f5.com/wiki/default.aspx/iRules/persist.html

    Is it possible that since there are multiple pools involved with your persistence that you have to set the values and use "any pool" like this:

    
    when HTTP_REQUEST {
        Save the value of the UIE persistence record for this client for any pool
       set value [persist lookup uie "[IP::client_addr] any pool"]
    }
    
  • No, this does not apply since I am using persistence based on the source_addr and not based on a cookie.

     

     

    When I look at the persistence table by doing "b persist client show

     

     

    I am seeing the persistence entries and it matches with the lookup command result.

     

     

    Meena

     

  • Meena: have you looked at the 'match across virtual servers' entry in the persistence profile options, by chance? Looks like you may be able to avoid an iRule completely. Also have a look at 'match across services' and see if that works for you as well (don't have enough info to tell).

     

     

    HTH,

     

    -Matt
  • Matt,

     

     

    Thank you for the response.

     

     

    I looked at the match across virtual servers option. But what I found out is that the auto last hop feature makes the traffic come back to the same server. I was using transparent load balancing (no port or address translation and no snat) and I thought I had to find a way to select the right server in the pool.

     

     

    The auto last hop feature made it easier and I did not have to do anything.

     

     

    Meena