Load Balance traffic based on source IP location to hit local proxy.
I have a request to load balance traffic coming to proxys based on the source IP subnet (Location). So, if it comes from subnet 1.xc.0.0/16 and 1.df.0.0/16 and pool-A is up then send it to Proxy-A elseif 1.xc.0.0/16 and 1.df.0.0/16 and pool-A is Down then send it to Proxy-B. And if it comes from subnet 10.rt.0.0/16 and 10.nm.0.0/16 and pool-B is up then send it to Proxy-B elseif 10.rt.0.0/16 and 10.nm.0.0/16 and pool-B is Down then send it to Proxy-A. I tryed the below iRule but it keep defaulting to on Proxy.
when DNS_REQUEST { if {([IP::addr [IP::remote_addr]/16 equals 10.xc.0.0/16]) and ([active_members proxy_NJ_80_pool] > 0)}{ host } elseif { ([IP::addr [IP::remote_addr]/16 equals 10.xc.0.0/16]) and ([active_members proxy_NY_80_pool ] > 0)}{ host } elseif {([IP::addr [IP::remote_addr]/16 equals 10.nm.0.0/16]) and ([active_members proxy_NY_80_pool] > 0)}{ host } elseif { ([IP::addr [IP::remote_addr]/16 equals 10.nm.0.0/16]) and ([active_members proxy_NJ_80_pool ] > 0)}{ host } else { host } }