Jump to content
Welcome to our new Citrix community!

Need help converting F5 irule to Citrix Netscaler


Recommended Posts

Hi, I need help converting the following F5 irule to Citrix Netscaler:

 

F5:

 

when HTTP_REQUEST {

if {[HTTP::uri] contains "rddh.env=uat1" } {

                use pool P_RDDH-INSTR-UAT1_U}

elseif {[HTTP::uri] contains "rddh.env=uat2" } {

                use pool P_RDDH-INSTR-UAT2_U}

elseif {[HTTP::uri] contains "rddh.env=uat3" } {

                use pool P_RDDH-INSTR-UAT3_U}

elseif {[HTTP::uri] contains "rddh.env=tst" } {

                use pool P_RDDH-INSTR-TST_U}

elseif {[HTTP::uri] contains "rddh.env=tst1" } {

                use pool P_RDDH-INSTR-TST1_U}

else {

                use pool P_RDDH-INSTR-UAT_U}

}

 

Citrix (this is what we've configured so far):

 

add cs vserver CSV_u-rddh-instr-uat HTTP IP 11105 -stateupdate ENABLED -cltTimeout 180 -comment SWCI_AA34099

 

add cs policy CSP_u_rddh_instr_uat_1 -rule "HTTP.REQ.URL.CONTAINS(\"uat1\")" -action CSA_u_rddh_instr_uat_1

add cs action CSA_u_rddh_instr_uat_1 -targetLBVserver V_u-rddh-instr-uat-1

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_1 -priority 90

 

add cs policy CSP_u_rddh_instr_uat_2 -rule "HTTP.REQ.URL.CONTAINS(\"uat2\")" -action CSA_u_rddh_instr_uat_2

add cs action CSA_u_rddh_instr_uat_2 -targetLBVserver V_u-rddh-instr-uat-2

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_2  -priority 100

 

add cs policy CSP_u_rddh_instr_uat_3 -rule "HTTP.REQ.URL.CONTAINS(\"uat3\")" -action CSA_u_rddh_instr_uat_3

add cs action CSA_u_rddh_instr_uat_3 -targetLBVserver V_u-rddh-instr-uat-3

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_3  -priority 110

 

add cs policy CSP_u_rddh_instr_uat_4 -rule "HTTP.REQ.URL.CONTAINS(\"tst\")" -action CSA_u_rddh_instr_uat_4

add cs action CSA_u_rddh_instr_uat_4 -targetLBVserver V_u-rddh-instr-uat-4

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_4  -priority 120

 

add cs policy CSP_u_rddh_instr_uat_5 -rule "HTTP.REQ.URL.CONTAINS(\"tst1\")" -action CSA_u_rddh_instr_uat_5

add cs action CSA_u_rddh_instr_uat_5 -targetLBVserver V_u-rddh-instr-uat-5

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_5  -priority 130

 

We need a policy to send all traffic to a default website if none of the policies match.  Any ideas?

Link to comment
Share on other sites

Carl, looking at our above policy/actions, do you see any reason why these policies would accept connections from something other than what's in the expression?  For example:

 

add cs policy CSP_u_rddh_instr_uat_4 -rule "HTTP.REQ.URL.CONTAINS(\"tst\")" -action CSA_u_rddh_instr_uat_4

add cs action CSA_u_rddh_instr_uat_4 -targetLBVserver V_u-rddh-instr-uat-4

bind cs vserver CSV_u-rddh-instr-uat  -policyName CSP_u_rddh_instr_uat_4  -priority 120

 

We're seeing the policy for "tst1" being forwarded to the "tst" vserver.  Should we be using a different expression?  I figured this would be specific to whatever is with the "contains" section.

 

FYI, we've got state update disabled so it should see all of the vservers under the csv as UP and forward accordingly unless I'm wrong?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...