steve_111974
Feb 24, 2010Nimbostratus
combine irules for LB by client IP and then http hostname
Hi,
I want to LB a certain range of source IP to a particular pool, else forward all other traffic to another irule that will LB by hostname. When i apply both irules, it also go the the second one. How to it fix this and is it possible to combine both irules to one?
First irule-LB by source IP:
when CLIENT_ACCEPTED {
if { [matchclass [IP::client_addr] equals $::Sharepoint_SrcIP_Allowed] }{
Uncomment the line below to turn on logging.
log local0. "Connection accepted from [IP::client_addr]:[TCP::local_port] to tcp port [TCP::remote_port]"
pool sharepoint
}
}
----above irule sends client matching Sharepoint_SrcIP_Allowed" Datagroup to pool "sharepoint"--
2nd Irule - LB by hostname:
when HTTP_REQUEST {
if { [HTTP::host] eq "itportal" } {
pool itportal }
elseif { [HTTP::host] eq "espportal" }{
pool espportal }
elseif { [HTTP::host] eq "mysite" }{
pool mysite }
elseif { [HTTP::host] eq "qaportal" }{
pool qaportal }
elseif { [HTTP::host] eq "sharepointssp" }{
pool sharepointssp }
elseif { [HTTP::host] eq "portal" }{
pool portal_sharepoint }
}
----
If I either one, it works fine but when I apply both, it always process the 2nd irule even when i matches the first one. Any advice?