Forum Discussion

Helena_101649's avatar
Helena_101649
Icon for Nimbostratus rankNimbostratus
Aug 30, 2012

iRule for pool selection, Oneconnect and SNAT

Hi,

 

 

I have a Virtual server with http profile, oneconnect profile with 0.0.0.0 mask, SNAT Automap, a default pool, and an iRule which selects a pool based on client IP address, with a workaround for sol6879 (OneConnect transformations do not occur on HTTP 4XX server responses):

 

 

when CLIENT_ACCEPTED {

 

if {[class match [IP::client_addr] equals IP_DATAGROUP]} {

 

pool pool_1

 

} else {

 

pool pool_2

 

}

 

}

 

when HTTP_RESPONSE {

 

if { [HTTP::status] starts_with "4"} {

 

ONECONNECT::reuse enable

 

}

 

}

 

 

Neither pool_1 or pool_2 are the default pool. In fact, the default pool includes all the nodes of pool_1 and pool_2, but if the iRule is correct it should never be used.

 

 

All client connections whose IP address is included in IP_DATAGROUP should go to pool_1, and all other connections to pool_2. But it is not working, as we are seeing client connections in either pools, regardless of the client IP address.

 

 

I was thinking that this behaviour could be due to the oneconnect profile (first request go to de correct pool but subsequent requests go to an idle connection to any of the two pools), and that it could be resolved by changing the profile's mask to 255.255.255.255. But since I also have snat configured (same snat for all pools) ¿should I assign a different snat for each pool also? ¿Am I correct about oneconnect behaviour?

 

 

Thanks.