Jump to content
Welcome to our new Citrix community!

Help converting F5 irules - Active/passive with uri redirection

Recommended Posts



I am trying to convert some F5 Irules.  Below is an example.  I have about 20-25 irules per environment (breakfix, test1, test2, e2e)


    when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/keepalive-20037" -
"/URIone*" -
"/URItwo*" -
"/URIthree*" {
                if { [active_members breakfix-test-20037] < 1 } {
                        log local0. "Server Pool, breakfix-test-20037, is down!"
                        log local0. "[IP::client_addr]:: Routing URI:[HTTP::uri] to breakfix-test-20037-hb1 domain"
                        pool breakfix-test-20037-hb1 
                } else {
                        log local0. "[IP::client_addr]:: Routing URI:[HTTP::uri] to breakfix-test-20037 domain"
                        pool breakfix-test-20037


Based on my limited F5 irule knowledge, it seems that if the if the keepalive is false, then go to the breakfix-test-20037-hb1 domain, otherwise go to breakfix-test-20037 domain.  IT also looks like the different URIs, go to that specific port on that virtual server.  So /URIone*, /URItwo*, /URIthree* go to the virtual server on port 20037.  I have 20-25 irules on different ports in the breakfix env with different URIs, other than this example.


It seems like it is setup as active/passive, but with a URI policy to send the traffic to a specific port:uri when it matches.


I hope I understand it correctly, if not enlighten me.

Link to comment
Share on other sites

So I guess my question now is how do I setup content switching with multiple backend ports.  I played around some and created an active/pasive setup based on this:


Example (using service groups, since you mentioned them):

add servicegroup svcg_primary HTTP

bind servicegroup svcg_primary 80


add servicegroup svcg_secondary HTTP

bind servicegroup svcg_secondary 80


add lb vserver lb_vsrv_secondary HTTP 0

bind lb vserver lb_vsrv_secondary svcg_secondary


add lb vserver lb_vsrv_primary HTTP <VIP1> 80

bind lb vserver lb_vsrv_primary svcg_primary

set lb vserver lb_vsrv_primary -backupVserver lb_vserver_secondary


So I have two Vservers setup, primary/secondary.  The primary has the IP:80 and the secondary is non-addressable.  The primary points to the primary host, and the secondary points to the secondary host and the secondary is setup as a backup virtual server for the primary. 


What I don't know now is the port stuff on the group members.  The group member binding are pointing to the server with * as the port since they will be going to multiple ports.  I don't think this is correct but not sure how to set it up.

Link to comment
Share on other sites

Citrix ADC usually has a different CSW/LB configuration for each client-side port number.


If the port numbers on the front end are the same as the back end then you can do * port and optionally use listen policies to restrict the ports it will listen on.


Your LB vServers can have services that have port numbers that are different from the client-side.

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...