iRule understand

Hello Folks,

Could you please explain me the following iRule :-

when CLIENT_ACCEPTED {

if {[ class match [IP::client_addr] equals private_net] } {
            pool MY_Internal_Farm
            log local0. "[IP::client_addr] is 1"
        } else {
            pool MY_proxy_farm 
            log local0. "[IP::client_addr] is 2"
        }
    }

Based on the client source IP address it selects which pool will be used. Apparently all clients that come from private networks will be using the MY_Internal_Farm. The private networks are listed in the private_net datagroup. All other clients will be using the MY_proxy_farm pool.

It is pretty easy. When TCP connection is established CLIENT_ACCEPTED being triggered. If IP address of a client is in private_net data group list then the request will be forwarded to a pool member of pool MY_Internal_Farm and the client’s IP address will be logged into /var/log/lmt

If the IP address of the client is not in private_net data group then the request will be forwarded to a pool member of pool MY_proxy_farm and the client’s IP address will be logged into /var/log/ltm