Forum Discussion
Brad_Otlin
Mar 07, 2013Employee
actually, nitass, the iRule in the v4.4 deployment guide http://www.f5.com/pdf/deployment-gu...010-dg.pdf says to use "when CLIENT_ACCEPTED". However, devcentral article https://devcentral.f5.com/wiki/iRul...tence.ashx states "For instance, if using HTTP and OneConnect, you could change CLIENT_ACCEPTED to HTTP_REQUEST" We've had to change ours to HTTP_REQUEST due to some OneConnect issues we were having that has since beeen resolved. This was recommeneded by F5 Support.
But, my main concern is how to assign different SNAT IPs based on the pool member selected. So I am hoping this modified iRule works?
********
when RULE_INIT {
set static::snat_ips(0) 10.1.1.138
set static::snat_ips(1) 10.1.1.139
set static::snat_ips(2) 10.1.1.140
set static::snat_ips(3) 10.1.1.141
set static::snat_ips(4) 10.1.1.142
set static::snat_ips(5) 10.1.1.143
set static::NEW_snat_ips(0) 10.2.2.225
set static::NEW_snat_ips(1) 10.2.2.226
set static::NEW_snat_ips(2) 10.2.2.227
set static::NEW_snat_ips(3) 10.2.2.228
set static::NEW_snat_ips(4) 10.2.2.229
set static::NEW_snat_ips(5) 10.2.2.230
}
when HTTP_REQUEST {
if {
[$IP::addr [LB::server addr] starts_with '10.1.1']}
{
snat $static::snat_ips(expr {[crc32 [IP::client_addr]] % [array size static::snat_ips]})
}
else {
snat $static::NEW_snat_ips(expr {[crc32 [IP::client_addr]] % [array size static::snat_ips]})
}
}
********