Forum Discussion

VSE_113287's avatar
VSE_113287
Icon for Nimbostratus rankNimbostratus
Jun 21, 2007

1st Time iRule Creation. Need some verification

What we were looking to accomplish :

 

 

when HTTP_REQUEST {

 

 

If source IP = 10.10.10.1 and Server A in Pool 1 is up

 

then send traffic to Server A in Pool 1

 

else send traffic to Pool 1

 

 

If source IP = 10.10.10.2 and Server B in Pool 1 is up

 

then send traffic to Server B in Pool 1

 

else send traffic to Pool 1

 

 

}

 

 

 

What we came up with

 

 

Will only work on LTM v9.1.2 HF4 and up ??

 

when HTTP_REQUEST {

 

if { ([IP::addr [IP::client_addr] equals $ip] ) and ( [LB::status pool $poolname member $ip $port] eq "up" ) } {

 

pool $poolname member $ip $port

 

}

 

if { ([IP::addr [IP::client_addr] equals $ip] ) and ( [LB::status pool $poolname member $ip $port] eq "up" ) } {

 

pool $poolname member $ip $port

 

}

 

else {

 

pool $poolname

 

}

 

}

 

 

Questions :

 

1.) Will the above iRule even work? Syntax, thought process, attempt not flawed?

 

2.) Is there another way to accomplish this on v9.1.2 HF3?

 

 

Thanks in Advance !