Forum Discussion

George_33482's avatar
George_33482
Icon for Nimbostratus rankNimbostratus
Jan 24, 2012

link controller load balancing on multiple criteria

Hello,i have a LC and i was requested to perform load balancing based on multiple criteria

 

1- source ip address

 

2- destination ip address

 

3- destination port

 

4- specific websites

 

5- specific patern bits in the packet (can this be done?????)

 

 

i am using the irule below but it is giving an error "command is not valid in current event context (CLIENT_ACCEPTED)] [HTTP::uri]"

 

 

How i can fix this issue??

 

 

However, how can i see the utilization of each link? which ip address (source or destination) is using the link?

 

 

when CLIENT_ACCEPTED {

 

if {([IP::addr [IP::local_addr] equals "172.16.101.0/24"]) or ([IP::addr [IP::local_addr] equals "172.16.100.0/24"])}{

 

pool source_ip_pool

 

snat automap

 

persist dest_addr

 

}

 

elseif {([ IP::addr [IP::remote_addr] equals "123.123.123.1/32"]) or ([HTTP::uri] equals "www.cisco.com")}{

 

pool boomerange

 

snat automap

 

}

 

elseif {([TCP::remote_port] equals 20) or ([TCP::remote_port] equals 21)}

 

{

 

pool fw

 

snat automap

 

persist dest_add

 

}

 

else {

 

pool default_pool

 

persist dest_add

 

}

 

 

 

Thank you and Regards,

 

George

 

 

 

1 Reply

  • Hi George,

     

     

    With a standard Link Controller license, you can't parse the TCP and HTTP and get the HTTP host or URI. You could potentially do this with a combo LC+LTM license. I think the rest of the iRule should work with a LC only license.

     

     

    Aaron