netscaler 9.3 content switching - · pdf filea content switching configuration consists of a...

86
Content Switching 2015-04-28 17:47:31 UTC © 2015 Citrix Systems, Inc. All rights reserved. Terms of Use | Trademarks | Privacy Statement

Upload: ngohuong

Post on 27-Mar-2018

227 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Content Switching

2015-04-28 17:47:31 UTC

© 2015 Citrix Systems, Inc. All rights reserved. Terms of Use | Trademarks | Privacy Statement

Page 2: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Contents

Content Switching ............................................................................................ 4

Content Switching................................................................................ 5

How Content Switching Works ............................................................ 7

Configuring Basic Content Switching .................................................... 9

Enabling Content Switching.......................................................... 10

Creating Content Switching Virtual Servers ....................................... 12

Configuring a Load Balancing Setup for Content Switching..................... 14

Configuring Content Switching Policies ............................................ 15

Configuring Content Switching Policy Labels ..................................... 18

Binding Policies to a Content Switching Virtual Server.......................... 23

Verifying the Configuration.......................................................... 25

Viewing the Properties of Content Switching Virtual Servers............. 26

Viewing Content Switching Policies........................................... 29

Viewing a Content Switching Virtual Server Configuration by Using theVisualizer.......................................................................... 30

Dynamic Load Balancing Virtual Server Selection for Content Switching .......... 33

Creating a content switching action for dynamic LB virtual serverselection ................................................................................ 34

Configuring Content Switching Policies ............................................ 39

Binding Policies to a Content Switching Virtual Server.......................... 42

Customizing the Basic Content Switching Configuration ............................. 44

Configuring Case Sensitivity for Policy Evaluation ............................... 45

Setting the Precedence for Policy Evaluation .................................... 47

Configuring per-VLAN Wildcarded Virtual Servers ............................... 50

Protecting the Content Switching Setup against Failure ............................. 53

Configuring a Redirection URL ...................................................... 54

Configuring a Backup Virtual Server................................................ 56

Diverting Excess Traffic to a Backup Virtual Server ............................. 58

Configuring the State Update Option .............................................. 60

Flushing the Surge Queue ............................................................ 63

2

Page 3: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Managing a Content Switching Setup .................................................... 65

Unbinding Policies from the Content Switching Virtual Server................. 66

Removing Content Switching Virtual Servers ..................................... 68

Disabling and Re-Enabling Content Switching Virtual Servers.................. 69

Renaming Content Switching Virtual Servers ..................................... 70

Managing Content Switching Policies............................................... 71

Modifying a Content Switching Configuration by Using the Visualizer ........ 75

Managing Client Connections ............................................................. 76

Redirecting Client Requests to a Cache ........................................... 77

Enabling Delayed Cleanup of Virtual Server Connections....................... 79

Rewriting Ports and Protocols for Redirection.................................... 81

Inserting the IP Address and Port of a Virtual Server in the Request Header 83

Setting a Time-out Value for Idle Client Connections ........................... 85

3

Page 4: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

4

Content Switching

In today’s complex Web sites, you may want to present different content to different users.For example, you may want to allow users from the IP range of a customer or partner tohave access to a special Web portal. You may want to present content relevant to a specificgeographical area to users from that area. You may want to present content in differentlanguages to the speakers of those languages. You may want to present content tailored tospecific devices, such as smartphones, to those who use the devices. The Citrix®NetScaler® content switching feature enables the NetScaler appliance to distribute clientrequests across multiple servers on the basis of specific content that you wish to present tothose users.

To configure content switching, first create a basic content switching setup, and thencustomize it to meet your needs. This entails enabling the content switching feature,setting up load balancing for the server or servers that host each version of the contentthat is being switched, creating a content switching virtual server, creating policies tochoose which requests are directed to which load balancing virtual server, and binding thepolicies to the content switching virtual server. You can then customize the setup to meetyour needs by setting precedence for your policies, protecting your setup by configuring abackup virtual server, and improving the performance of your setup by redirecting requeststo a cache.

Page 5: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

5

How Content Switching Works

Content Switching enables the NetScaler appliance to direct requests sent to the same Webhost to different servers with different content. For example, you can configure theappliance to direct requests for dynamic content (such as URLs with a suffix of .asp, .dll, or.exe) to one server and requests for static content to another server. You can configure theappliance to perform content switching based on TCP/IP headers and payload.

You can also use content switching to configure the appliance to redirect requests todifferent servers with different content on the basis of various client attributes. Some ofthose client attributes are:

• Device Type. The appliance examines the user agent or custom HTTP header in theclient request for the type of device from which the request originated. Based on thedevice type, it directs the request to a specific Web server. For example, if the requestcame from a cell phone, the request is directed to a server that is capable of servingcontent that the user can view on his or her cell phone. A request from a computer isdirected to a different server that is capable of serving content designed for acomputer screen.

• Language. The appliance examines the Accept-Language HTTP header in the clientrequest and determines the language used by the client’s browser. The appliance thensends the request to a server that serves content in that language. For example, usingcontent switching based on language, the appliance can send someone whose browser isconfigured to request content in French to a server with the French version of anewspaper. It can send someone else whose browser is configured to request content inEnglish to a server with the English version.

• Cookie. The appliance examines the HTTP request headers for a cookie that the serverset previously. If it finds the cookie, it directs requests to the appropriate server, whichhosts custom content. For example, if a cookie is found that indicates that the client isa member of a customer loyalty program, the request is directed to a faster server orone with special content. If it does not find a cookie, or if the cookie indicates that theuser is not a member, the request is directed to a server for the general public.

• HTTP Method. The appliance examines the HTTP header for the method used, andsends the client request to the right server. For example, GET requests for images canbe directed to an image server, while POST requests can be directed to a faster serverthat handles dynamic content.

• Layer 3/4 Data. The appliance examines requests for the source or destination IP,source or destination port, or any other information present in the TCP or UDP headers,and directs the client request to the right server. For example, requests from source IPsthat belong to customers can be directed to a custom web portal on a faster server, orone with special content.

A typical content switching deployment consists of the entities described in the followingdiagram.

Figure 1. Content Switching Architecture

Page 6: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

A content switching configuration consists of a content switching virtual server, a loadbalancing setup consisting of load balancing virtual servers and services, and contentswitching policies. To configure content switching, you must configure a content switchingvirtual server and associate it with policies and load balancing virtual servers. This processcreates a content group—a group of all virtual servers and policies involved in a particularcontent switching configuration.

Content switching can be used with HTTP, HTTPS, TCP, and UDP connections. For HTTPS,you must enable SSL Offload.

When a request reaches the content switching virtual server, the virtual server applies theassociated content switching policies to that request. The priority of the policy defines theorder in which the policies bound to the content switching virtual server are evaluated. Ifyou are using default syntax policies, when you bind a policy to the content switchingvirtual server, you must assign a priority to that policy. If you are using NetScaler classicpolicies, you can assign a priority to your policies, but are not required to do so. If youassign priorities, the policies are evaluated in the order that you set. If you do not, theNetScaler appliance evaluates your policies in the order in which they were created.

In addition to configuring policy priorities, you can manipulate the order of policyevaluation by using Goto expressions and policy bank invocations. For more details aboutdefault syntax policy configuration, see "Configuring Default Syntax Policies."

After it evaluates the policies, the content switching virtual server routes the request tothe appropriate load balancing virtual server, which sends it to the appropriate service.

Content switching virtual servers can only send requests to other virtual servers. If you areusing an external load balancer, you must create a load balancing virtual server for it andbind its virtual server as a service to the content switching virtual server.

Content Switching

6

Page 7: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

7

How Content Switching Works

Content Switching enables the NetScaler appliance to direct requests sent to the same Webhost to different servers with different content. For example, you can configure theappliance to direct requests for dynamic content (such as URLs with a suffix of .asp, .dll, or.exe) to one server and requests for static content to another server. You can configure theappliance to perform content switching based on TCP/IP headers and payload.

You can also use content switching to configure the appliance to redirect requests todifferent servers with different content on the basis of various client attributes. Some ofthose client attributes are:

• Device Type. The appliance examines the user agent or custom HTTP header in theclient request for the type of device from which the request originated. Based on thedevice type, it directs the request to a specific Web server. For example, if the requestcame from a cell phone, the request is directed to a server that is capable of servingcontent that the user can view on his or her cell phone. A request from a computer isdirected to a different server that is capable of serving content designed for acomputer screen.

• Language. The appliance examines the Accept-Language HTTP header in the clientrequest and determines the language used by the client’s browser. The appliance thensends the request to a server that serves content in that language. For example, usingcontent switching based on language, the appliance can send someone whose browser isconfigured to request content in French to a server with the French version of anewspaper. It can send someone else whose browser is configured to request content inEnglish to a server with the English version.

• Cookie. The appliance examines the HTTP request headers for a cookie that the serverset previously. If it finds the cookie, it directs requests to the appropriate server, whichhosts custom content. For example, if a cookie is found that indicates that the client isa member of a customer loyalty program, the request is directed to a faster server orone with special content. If it does not find a cookie, or if the cookie indicates that theuser is not a member, the request is directed to a server for the general public.

• HTTP Method. The appliance examines the HTTP header for the method used, andsends the client request to the right server. For example, GET requests for images canbe directed to an image server, while POST requests can be directed to a faster serverthat handles dynamic content.

• Layer 3/4 Data. The appliance examines requests for the source or destination IP,source or destination port, or any other information present in the TCP or UDP headers,and directs the client request to the right server. For example, requests from source IPsthat belong to customers can be directed to a custom web portal on a faster server, orone with special content.

A typical content switching deployment consists of the entities described in the followingdiagram.

Figure 1. Content Switching Architecture

Page 8: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

A content switching configuration consists of a content switching virtual server, a loadbalancing setup consisting of load balancing virtual servers and services, and contentswitching policies. To configure content switching, you must configure a content switchingvirtual server and associate it with policies and load balancing virtual servers. This processcreates a content group—a group of all virtual servers and policies involved in a particularcontent switching configuration.

Content switching can be used with HTTP, HTTPS, TCP, and UDP connections. For HTTPS,you must enable SSL Offload.

When a request reaches the content switching virtual server, the virtual server applies theassociated content switching policies to that request. The priority of the policy defines theorder in which the policies bound to the content switching virtual server are evaluated. Ifyou are using default syntax policies, when you bind a policy to the content switchingvirtual server, you must assign a priority to that policy. If you are using NetScaler classicpolicies, you can assign a priority to your policies, but are not required to do so. If youassign priorities, the policies are evaluated in the order that you set. If you do not, theNetScaler appliance evaluates your policies in the order in which they were created.

In addition to configuring policy priorities, you can manipulate the order of policyevaluation by using Goto expressions and policy bank invocations. For more details aboutdefault syntax policy configuration, see "Configuring Default Syntax Policies."

After it evaluates the policies, the content switching virtual server routes the request tothe appropriate load balancing virtual server, which sends it to the appropriate service.

Content switching virtual servers can only send requests to other virtual servers. If you areusing an external load balancer, you must create a load balancing virtual server for it andbind its virtual server as a service to the content switching virtual server.

How Content Switching Works

8

Page 9: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

9

Configuring Basic Content Switching

Before you configure content switching, you must understand how content switching is setup and how the services and virtual servers are connected.

To configure a basic, functional content switching setup, first enable the content switchingfeature. Then, create at least one content group. For each content group, create a contentswitching virtual server to accept requests to a group of web sites that use contentswitching. Also create a load balancing setup, which includes a group of load balancingvirtual servers to which the content switching virtual server directs requests. To specifywhich requests to direct to which load balancing virtual server, create at least two contentswitching policies, one for each type of request that is to be redirected. When you havecreated the virtual servers and policies, bind the policies to the content switching virtualserver. You can also bind a policy to multiple content switching virtual servers. When youbind a policy, you specify the load balancing virtual server to which requests that matchthe policy are to be directed.

In addition to binding individual policies to a content switching virtual server, you can bindpolicy labels. If you create additional content groups, you can bind a policy or policy labelto more than one of the content switching virtual servers.

Note: After creating a content group, you can modify its content switching virtual serveto customize the configuration. For information on modifying the configuration of anexisting content switching virtual server, see "Customizing the Basic Content SwitchingConfiguration." For information on disabling and re-enabling entities, unbinding policies,and removing entities, see "Managing a Content Switching Setup."

Page 10: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

10

Enabling Content Switching

To use the content switching feature, you must enable content switching. You canconfigure content switching entities even though the content switching feature is disabled.However, the entities will not work.

To enable content switching by using the commandline interface

At the command prompt, type the following commands to enable content switching andverify the configuration:

• enable ns feature CS

• show ns feature

Example

> enable feature ContentSwitch Done> show feature

Feature Acronym Status ------- ------- ------ 1) Web Logging WL OFF 2) Surge Protection SP ON 3) Load Balancing LB ON 4) Content Switching CS ON . . . 22) Responder RESPONDER ON 23) HTML Injection HTMLInjection ON 24) NetScaler Push push OFF Done

Page 11: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To enable content switching by using theconfiguration utility

1. In the navigation pane, expand System, and then click Settings.

2. In the details pane, under Modes and Features, click Change basic features.

3. In the Configure Basic Features dialog box, select the Content Switching check box, andthen click OK.

4. In the Enable/Disable Features(?) dialog box, click Yes.

Enabling Content Switching

11

Page 12: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

12

Creating Content Switching VirtualServers

You can add, modify, and remove content switching virtual servers. The state of a virtualserver is DOWN when you create it, because the load balancing virtual server is not yetbound to it.

To create a virtual server by using the command lineinterface

At the command prompt, type:

add cs vserver <name> <protocol> <IPAddress> <port>

Example

add cs vserver Vserver-CS-1 HTTP 10.102.29.161 80

Parameters for configuring content switchingvServerName

Name of the content switching virtual server. The name must not exceed 127 characters,and the leading character must be a number or letter. The following characters are alsoallowed: @ _ - . (period) : (colon) # and blank space.

IPAddress

IP address of the virtual server. This IP address (VIP) is usually a public IP address towhich the clients send connection requests.

port

Port on which the virtual server listens for client connections. The port number must bebetween 0-65535.

protocol

Protocol of the requests processed by the content switching virtual server. Choose one ofthe following service types:

• HTTP. For HTTP services.

• TCP. For non-RFC implementation of HTTP services.

Page 13: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

• UDP. For DNS, ICMP, and other UDP-based services.

• FTP. For FTP services. This setting ensures that the NetScaler appliance takes careof the specifics of the FTP protocol.

• SSL. For HTTPS services. Select this type to encrypt HTTP traffic between theNetScaler appliance and the server.

• SSL_TCP. For secure TCP services.

• RTSP. For Real-Time Streaming Protocol services.

• DNS. For domain name servers.

• SIP-UDP. For SIP servers.

• ANY. For services that accept all traffic of any protocol type.

• RADIUS. For RADIUS authentication services.

• RDP. For remote desktop services.

• MYSQL. For MySQL database servers.

• MSSQL. For Microsoft SQL Servers.

To add a content switching virtual server by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, click Add.

3. In the Create Virtual Server (Content Switching) dialog box, in the Name, IP Address,and Port text boxes, type the name, IP address, and port of the virtual server, (forexample, Vserver-CS-1, 10.102.29.161, and 80).

Note: If you need to enter an IPv6 address, select the IPv6 check box before youenter the address.

4. In the Protocol list, select the type of the virtual server (for example, HTTP).

5. Click Create, and then click Close.

Creating Content Switching Virtual Servers

13

Page 14: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

14

Configuring a Load Balancing Setup forContent Switching

The content switching virtual server redirects all requests to a load balancing virtual server.You must create one load balancing virtual server for each version of the content that isbeing switched. This is true even when your setup has only one server for each version ofthe content, and you are therefore not doing any load balancing with those servers. You canalso configure actual load balancing with multiple load-balanced servers that mirror eachversion of the content. In either scenario, the content switching virtual server needs tohave a specific load balancing virtual server assigned to each version of the content that isbeing switched.

The load balancing virtual server then forwards the request to a service. If it has only oneservice bound to it, it selects that service. If it has multiple services bound to it, it uses itsconfigured load balancing method to select a service for the request, and forwards thatrequest to the service that it selected.

To configure a basic load balancing setup, you need to perform the following tasks:

• Create load balancing virtual servers

• Create services

• Bind services to the load balancing virtual server

For more information on load balancing, see "Load Balancing." For detailed instructions onsetting up a basic load balancing configuration, see "Setting Up Basic Load Balancing."

Page 15: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

15

Configuring Content Switching Policies

A content switching policy defines a type of request that is to be directed to a loadbalancing virtual server. These policies are applied in the order of the priorities assigned tothem or (if you are using NetScaler classic policies and do not assign priorities when bindingthem) in the order in which the policies were created.

The policies can be:

• Domain-based policies. The NetScaler appliance compares the domain of an incomingURL with the domains specified in the policies. The appliance then returns the mostappropriate content. Domain-based policies must be classic policies; default syntaxpolicies are not supported for this type of content switching policy.

• URL-based policies. The appliance compares an incoming URL with the URLs specifiedin the policies. The appliance then returns the most appropriate URL-based content,which is usually the longest matching configured URL. URL-based policies must beclassic policies; default syntax policies are not supported for this type of contentswitching policy.

• Rule-based policies. The appliance compares incoming data to expressions specified inthe policies. You create rule-based policies by using either a classic expression or adefault syntax expression. Both classic and default syntax policies are supported forrule-based content switching policies.

Note: A rule based policy can be configured with an optional action. A policy with anaction can be bound to multiple virtual servers or policy labels.

If you set a priority when binding your policies to the content switching virtual server,the policies are evaluated in order of priority. If you do not set specific priorities whenbinding your policies, the policies are evaluated in the order in which they werecreated.

For information about NetScaler classic policies and expressions, see "Configuring ClassicPolicies and Expressions." For information about Default Syntax policies, see "ConfiguringDefault Syntax Expressions."

To create a content switching policy by using thecommand line interface

At the command prompt, type one of the following commands:

• add cs policy <policyName> -domain <domain>

• add cs policy <policyName> -url <URLValue>

• add cs policy <policyName> -rule <RULEValue>

• add cs policy <policyName> -rule <RULEValue> -action <actionName>

Page 16: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Example

add cs policy Policy-CS-1 -url "/sports/*"

add cs policy Policy-CS-1 -domain "example.com"

add cs policy Policy-CS-1 -rule "CLIENT.IP.SRC.SUBNET(24).EQ(10.217.84.0)"

add cs policy Policy-CS-2 -rule "SYS.TIME.BETWEEN(GMT 2009 Nov,GMT 2009 Dec)"

add cs policy Policy-CS-3 -rule "http.req.method.eq(GET)" -action act1

Parameters for configuring content switching policiespolicyName (Name)

Name for the content switching policy. Must begin with an ASCII alphanumeric orunderscore (_) character, and must contain only ASCII alphanumeric, underscore, hash(#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Ifthe name includes one or more spaces, enclose the name in double or single quotationmarks (for example, “my policy” or ‘my policy’).

Cannot be changed after the policy is created.

domain (Domain)

The domain in the URL. The NetScaler appliance uses the domain to choose the correctcontent for each incoming request.

URLValue (URL)

An absolute or relative URL. The NetScaler appliance uses the URL to choose the correctcontent for each incoming request.

RULEValue (Expression)

A classic or default syntax policy expression that defines the appropriate content foreach request.

action (Action)

Name of the content switching action to be used by the policy.

Configuring Content Switching Policies

16

Page 17: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To create a content switching policy by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Policies.

2. In the details pane, click Add.

3. In the Create Content Switching Policy dialog box, in the Name text box, type the nameof the policy (for example, Policy-CS-1).

4. Choose the type of policy that you want to create, and configure the policy.

• To create a domain-based policy, in the Domain text box, type the domain (forexample, example.com).

• To create a URL-based policy, click URL, and in the Value text box, type anabsolute or relative URL (for example, http://www.example.com/sports, or just/sports).

• To create a rule-based policy, click Configure, and do the following:

a. In the Create Expression dialog box, choose the expression syntax you want touse.

• If you want to use default syntax, accept the default and proceed to thenext step.

• If you want to use classic syntax, click Switch to Classic Syntax.

The Expression portion of the dialog box changes to match your choice. Thedefault syntax Expression view has fewer elements than does the classicsyntax Expression view. In the default syntax Expression view, instead of apreview window, a button provides access to an expression evaluator. Theevaluator evaluates the expression you entered, to verify that it is valid,and displays an analysis of the expression's effect.

b. Enter your policy expressions.

• If you are using classic syntax and need further instructions, see ConfiguringClassic Policies and Expressions.

• If you are using the default syntax and need further instructions, seeConfiguring Default Syntax Expressions.

5. Click Create, and then click Close. The policy you created appears in the ContentSwitching Policies pane.

Configuring Content Switching Policies

17

Page 18: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

18

Configuring Content Switching PolicyLabels

A policy label is a user-defined bind point to which policies are bound. When a policy labelis invoked, all the policies bound to it are evaluated in the order of the priority that youassigned to them. A policy label can include one or more policies, each of which can beassigned its own result. A match on one policy in the policy label can result in proceeding tothe next policy, invoking a different policy label or appropriate resource, or an immediateend to policy evaluation and return of control to the policy that invoked the policy label.You can create policy labels for default syntax policies only.

For information about policy labels, see the "Creating Policy Labels."

A content switching policy label consists of a name, a label type, and a list of policiesbound to the policy label. The policy label type specifies the protocol that was assigned tothe policies bound to the label. It must match the service type of the content switchingvirtual server to which the policy that invokes the policy label is bound. For example, youcan bind TCP Payload policies to a policy label of type TCP only. Binding TCP Payloadpolicies to a policy label of type HTTP is not supported.

Each policy in a content switching policy label is associated with either a target (which isequivalent to the action that is associated with other types of policies, such as rewrite andresponder policies) or a gotoPriorityExpression option and/or an invoke option. That is, fora given policy in a content switching policy label, you can specify a target, or you can setthe gotoPriorityExpression option and/or the invoke option. Additionally, if multiplepolicies evaluate to true, only the target of the last policy that evaluates to true isconsidered.

You can use either the NetScaler command line or the configuration utility to configurecontent switching policy labels. In the NetScaler command-line interface (CLI), you firstcreate a policy label by using the add cs policylabel command. Then, you bind policies tothe policy label, one policy at a time, by using the bind cs policylabel command. In theNetScaler configuration utility, you perform both tasks in a single dialog box.

To create a content switching policy label by usingthe command line interface

At the command prompt, type:

add cs policylabel <labelName> <cspolicylabelTypetype>

Example

add cs policylabel testpollab http

Page 19: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Parameters for creating content switching policylabels

name (Name)

Name for the policy label. Must begin with an ASCII alphanumeric or underscore (_)character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.),space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. If the nameincludes one or more spaces, enclose the name in double or single quotation marks (forexample, “my label” or ‘my label’). The label name must be unique within the list ofpolicy labels for content switching. Cannot be changed after the policy label is created.

type (Label type)

Protocol supported by the policy label. All policies bound to the policy label must eithermatch the specified protocol or be a subtype of that protocol. Available settings functionas follows:

• HTTP—Supports policies that process HTTP traffic. Used to access unencrypted Websites.

• SSL—Supports policies that process HTTPS/SSL encrypted traffic. Used to accessencrypted Web sites.

• TCP—Supports policies that process any type of TCP traffic, including HTTP.

• SSL_TCP—Supports policies that process SSL-encrypted TCP traffic, including SSL.

• UDP—Supports policies that process any type of UDP-based traffic, including DNS.

• DNS—Supports policies that process DNS traffic.

• ANY—Supports all types of policies except HTTP, SSL, and TCP.

• SIP_UDP—Supports policies that process UDP based Session Initiation Protocol (SIP)traffic. SIP initiates, manages, and terminates multimedia communications sessions,and has emerged as the standard for Internet telephony (VoIP).

• RTSP—Supports policies that process Real Time Streaming Protocol (RTSP) traffic.RTSP provides delivery of multimedia and other streaming data, such as audio, video,and other types of streamed media.

• RADIUS—Supports policies that process Remote Authentication Dial In User Service(RADIUS) traffic. RADIUS supports combined authentication, authorization, andauditing services for network management.

• RDP—Supports policies that process remote desktop traffic.

• MYSQL—Supports policies that process MYSQL traffic.

• MSSQL—Supports policies that process Microsoft SQL traffic.All policies bound to the policy label must either match the designated protocol or be asubtype of the designated protocol.

Configuring Content Switching Policy Labels

19

Page 20: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To bind a policy to a content switching policy label byusing the command line interface

At the command prompt, type the following commands to bind a policy to a policy label andverify the configuration:

• bind cs policylabel <labelName> <policyName> <priority>[ [-targetVserver <string>] |[-gotoPriorityExpression <expression>] | [-invoke <labeltype> <labelName>] ]

• show cs policylabel <labelName>

Example

bind cs policylabel testpollab test_Pol 100 -targetVserver LBVIPshow cs policylabel testpollab Label Name: testpollab Label Type: HTTP Number of bound policies: 1 Number of times invoked: 01) Policy Name: test_Pol Priority: 100 Target Virtual Server: LBVIP

Note: If a policy is configure with an action, the target virtual server (targetVserver), goto priority expression (gotoPriorityExpression), and invoke (invoke) parameters are notrequired. If a policy is not configure with an action, you need to configure at least one ofthe following parameters: targetVserver, gotoPriorityExpression, and invoke.

Parameters for binding a policy to a content switchingpolicy label

labelName

Name of the policy label to which to bind a content switching policy.

policyName

Name of the content switching policy to bind to the content switching policy label.

priority

Unsigned integer that determines the priority of the policy relative to other policies inthis policy label. Smaller the number, higher the priority.

targetVserver

Name of the virtual server to which to forward requests that match the policy.

Configuring Content Switching Policy Labels

20

Page 21: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

gotoPriorityExpression

Expression or other value specifying the priority of the next policy to be evaluated if thecurrent policy rule evaluates to TRUE. Alternatively, you can specify one of the followingvalues:

• NEXT. Go to the policy with the next higher priority.

• END. End evaluation. (This is the default. Evaluation stops if thegotoPriorityExpression parameter is not set.)

• USE_INVOCATION_RESULT. Applicable if this entry invokes another policy label. Ifthe final Goto in the invoked policy label has a value of END, evaluation stops. If thefinal Goto is anything other than END, the current policy label performs a NEXT.

invoke

Invoke other policy labels. After evaluating the policies in the invoked policy label, theappliance continues to evaluate policies that are bound to the current policy label (theselected bind point).

labelType

Type of policy label to be invoked.

To unbind a policy from a policy label by using thecommand line interface

At the command prompt, type the following commands to unbind a policy from a policylabel and verify the configuration:

• unbind cs policylabel <labelName> <policyName>

• show cs policylabel <labelName>

Example

unbind cs policylabel testpollab test_Polshow cs policylabel testpollab Label Name: testpollab Label Type: HTTP Number of bound policies: 0 Number of times invoked: 0

Parameters for unbinding a policy from a contentswitching policy label

labelName

Configuring Content Switching Policy Labels

21

Page 22: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Name of the policy label from which to unbind a content switching policy.

policyName

Name of the content switching policy to unbind from the label.

To remove a policy label by using the command lineinterface

At the command prompt, type:

rm cs policylabel <labelName>

To manage a content switching policy label by usingthe configuration utility

1. In the navigation pane, expand Content Switching, and then click Policy Labels.

2. In the details pane, do one of the following:

• To create a new policy label, click Add.

• To modify an existing policy label, select the policy label, and then click Open.3. In the Create Content Switching Policy Label dialog box, set the following parameters:

• Name*

• Label Type** A required parameter

4. To add a policy to a list, click Insert Policy, and then click one of the policies in thedrop-down list. If you click New Policy, create a new policy as described in "CreatingContent Switching Policies."

5. For the policy that you added to the list, set the following parameters:

• Priority* (The default value is 100. To modify the value, double-click in the Prioritycolumn.)

• Target

• Goto Expression

• Invoke* A required parameter

6. To automatically renumber the policies, click Regenerate Priorities.

7. Click Create or OK.

Configuring Content Switching Policy Labels

22

Page 23: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

23

Binding Policies to a Content SwitchingVirtual Server

After you create your content switching virtual server and policies, you bind each policy tothe content switching virtual server. When binding the policy to the content switchingvirtual server, you specify the target load balancing virtual server.

Note: If your content switching policy uses a default syntax rule, you can configure acontent switching action for the policy. If you configure an action, you must specify thetarget load balancing virtual server when you are configuring the action, not when youare binding the policy to the content switching virtual server. For more information aboutconfiguring a content switching action, see Configuring a Content Switching Action.

To bind a policy to a content switching virtual serverand select a target load balancing virtual server byusing the command line interface

At the command prompt, type:

bind cs vserver <name>[-lbvserver<string> -targetLBVServer<string> -policyname <string>-priority <positive_integer>] [-gotoPriorityExpression <expression>] [-type ( REQUEST |RESPONSE )] [-invoke (<labelType> <labelName>) ]

Example

bind cs vserver csw-vip2 -policyname csw-ape-policy2 -priority 14 -gotoPriorityExpression NEXT

bind cs vserver csw-vip3 -policyname rewrite-policy1 -priority 17 -gotoPriorityExpression 'q.header("a").count' -flowtype REQUEST -invoke policylabel label1

bind cs vserver Vserver-CS-1 Vserver-LB-1 -policyname Policy-CS-1 -priority 20

Note: The parameters, target load balancing virtual server (targetVserver), go to priorityexpression (gotoPriorityExpression), and invoke method (invoke) cannot be used if apolicy has an action.

Page 24: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To bind a policy to a content switching virtual serverand select a target load balancing virtual server byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, double-click the virtual server for which you want to bind the policy(for example, Vserver-CS-1).

3. In the Configure Virtual Server (Content Switching) dialog box, on the Policies tab, clickInsert Policy. A list of existing policies appears in the Policy Name drop-down list, Youcan either select an existing policy or create a new policy:

• Select an existing policy that you previously created to bind to the virtual server.

• Select New Policy from the Policy Name drop-down list to create a new contentswitching policy. After you create a new policy, it is automatically bound to thevirtual server.

4. Click OK.

Binding Policies to a Content Switching Virtual Server

24

Page 25: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

25

Verifying the Configuration

To verify that your content switching configuration is correct, you need to view the contentswitching entities. To verify proper operation after your content switching configuration hasbeen deployed, you can view the statistics that are generated as the servers are accessed.

Page 26: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

26

Viewing the Properties of ContentSwitching Virtual Servers

You can view the properties of content switching virtual servers that you have configuredon the NetScaler. You can use the information to verify whether the virtual server iscorrectly configured and, if necessary, to troubleshoot. In addition to details such as name,IP address, and port, you can view the various policies bound to a virtual server, and itstraffic-management settings.

The content switching policies are displayed in the order of their priority. If more than onepolicy has the same priority, they are shown in the order in which they are bound to thevirtual server.

Note: If you have configured the content switching virtual server to forward traffic to aload balancing virtual server, you can also view the content switching policies by viewingthe properties of the load balancing virtual server.

To view the properties of content switching virtualservers by using the command line interface

To list basic properties of all content switching virtual servers in your configuration, ordetailed properties of a specific content switching virtual server, at the command prompt,type one of the following commands:

• show cs vserver

• show cs vserver <name>

Example

1. show cs vserver Vserver-CS-1Vserver-CS-1 (10.102.29.161:80) - HTTP Type: CONTENTState: UPLast state change was at Thu Jun 30 10:48:59 2011Time since last state change: 6 days, 20:03:00.760Client Idle Timeout: 180 secDown state flush: ENABLEDDisable Primary Vserver On Down : DISABLEDAppflow logging: DISABLEDPort Rewrite : DISABLEDState Update: DISABLEDDefault: Content Precedence: RULEVserver IP and Port insertion: OFFCase Sensitivity: ONPush: DISABLED Push VServer:

Page 27: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Push Label Rule: none

...1) Policy : __ESNS_PREBODY_POLICY Priority:02) Policy : __ESNS_POSTBODY_POLICY Priority:0

1) Compression Policy Name: __ESNS_CMP_POLICY Priority: 2147483647GotoPriority Expression: ENDFlowtype: REQUEST

1) Rewrite Policy Name: __ESNS_REWRITE_POLICY Priority: 2147483647GotoPriority Expression: ENDFlowtype: REQUEST

1) Cache Policy Name: dfbx Priority: 10GotoPriority Expression: ENDFlowtype: REQUEST

1) Responder Policy Name: __ESNS_RESPONDER_POLICY Priority: 2147483647GotoPriority Expression: END

1) Policy: wiki Target: LBVIP2 Priority: 25 Hits: 02) Policy: plain Target: LBVIP1 Priority: 90 Hits: 03) Policy: DispOrderTest2 Target: KerbAuthLBVS Priority: 91 Hits: 04) Policy: test_Pol Target: LBVIP1 Priority: 92 Hits: 05) Policy: PolicyNameTesting Target: LBVIP1 Priority: 100 Hits: 0 Done>

2.show cs vserver1) Vserver-CS-1 (10.102.29.161:80) - HTTP Type: CONTENTState: UP…Appflow logging: DISABLEDPort Rewrite : DISABLEDState Update: DISABLED

2) apubendpt (10.111.111.1:80) - HTTP Type: CONTENTState: UP…Client Idle Timeout: 180 secDown state flush: DISABLED…

3) apubendpt1 (10.111.111.2:80) - HTTP Type: CONTENTState: UP…Disable Primary Vserver On Down : DISABLEDAppflow logging: DISABLEDPort Rewrite : DISABLEDState Update: DISABLED…

Viewing the Properties of Content Switching Virtual Servers

27

Page 28: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To view the properties of content switching virtualservers by using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, click a virtual server to display its configuration details at thebottom of the screen.

3. To display the names of the policies that are bound to the content switching virtualserver, double-click the virtual server and then click the Policies tab.

Viewing the Properties of Content Switching Virtual Servers

28

Page 29: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

29

Viewing Content Switching Policies

You can view the properties of the content switching policies that you defined, such as thename, domain, and URL or expression, and use the information to find any mistakes in theconfiguration, or to troubleshoot if something is not working as it should.

To view the properties of content switching policiesby using the command line interface

To list either basic properties of all content switching policies in your configuration ordetailed properties of a specific content switching policy, at the command prompt, typeone of the following commands:

• show cs policy

• show cs policy <PolicyName>

Example

show cs policy

show cs policy Policy-CS-1

To view the properties of content switching policiesby using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Policies.

2. In the details pane, double-click a policy to view the details.

3. To view the policy labels and virtual servers that this policy is bound to, on the ContentSwitching Policies pane, click Show Bindings.

Page 30: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

30

Viewing a Content Switching VirtualServer Configuration by Using theVisualizer

The Content Switching Visualizer is a tool that you can use to view a content switchingconfiguration in graphical format. You can use the visualizer to view the followingconfiguration items:

• A summary of the load balancing virtual servers to which the content switching virtualserver is bound.

• All services and service groups that are bound to the load balancing virtual server andall monitors that are bound to the services.

• The configuration details of any displayed element.

• Any policies bound to the content switching virtual server. These policies need not becontent switching policies. Many types of policies, such as Rewrite policies, can bebound to a content switching virtual server.

After you configure the various elements in a content switching and load balancing setup,you can export the entire configuration to an application template file.

Note: The Visualizer requires a graphical interface, so it is available only through theconfiguration utility.

Page 31: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To view a content switching configuration by usingthe Visualizer in the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to view, and then clickVisualizer.

3. In the Content Switching Visualizer window, you can adjust the viewable area asfollows:

• Click the Zoom In and Zoom Out icons to increase or decrease the viewable area.

• Click the Save Image icon to save the graph as an image file.

• In the Search in text field, begin typing the name of the item you are looking for.When you have typed enough characters to identify the item, its location ishighlighted. To restrict the search, click the drop-down menu and select the type ofelement that you want to search for.

4. To view configuration details for entities that are bound to this virtual server, you cando the following:

• To view policies that are bound to the virtual server, in the tool bar at the top ofthe dialog box select one or more feature-specific policy icons. If policy labels areconfigured, they appear in the main view area.

• To view the configuration details for a bound service or service group, click the iconfor the service, click the Related Tasks tab, and then click Show Member Services.

• To view the configuration details for a monitor, click the icon for the monitor, clickthe Related Tasks tab, and then click View Monitor.

5. To view detailed statistics for any virtual server in the content switching configuration,click the virtual server for which you want to view statistics, then click the RelatedTasks tab, and then click Statistics.

6. To view a comparative list of the parameters whose values either differ or are notdefined across service containers for a load balancing virtual server, click the icon for acontainer, click the Related Tasks tab, and then click Service Attributes Diff.

7. To view monitor binding details for the services in a container, in the Service AttributesDiff dialog box, in the Group column for the container, click Details. This comparativelist helps you determine which service container has the configuration you want toapply to all the service containers.

8. To view the number of requests received per second at a given point in time by thevirtual servers in the configuration, and the number of hits per second at a given pointin time for rewrite, responder, and cache policies, click Show Stats. The statisticalinformation is displayed on the respective nodes in the Visualizer. This information isnot updated in real time. It has to be refreshed manually. To refresh the information,click Refresh Stats.

Note: This option is available only on NetScaler nCore builds.

Viewing a Content Switching Virtual Server Configuration by Using the Visualizer

31

Page 32: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

9. To copy configuration details for an element to a document or spreadsheet, click theicon for that element, click Related Tasks, click Copy Properties, and then paste theinformation into a document.

10. To export the entire configuration that is displayed in the Visualizer to an applicationtemplate file, click the icon for the content switching virtual server, click RelatedTasks, and then click Create Template. When creating the application template, youcan configure variables in some policy expressions and actions. For more informationabout creating the application template file and configuring variables for a template,see .

Viewing a Content Switching Virtual Server Configuration by Using the Visualizer

32

Page 33: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

33

Dynamic Load Balancing Virtual ServerSelection for Content Switching

The dynamic load balancing (LB) virtual server selection for content switching (CS) featureenables you to dynamically select a LB virtual server. This feature enables you to analyzethe incoming request and accordingly direct it to the correct load balancing virtual server.The target LB virtual server is determined at the run time using an expression in the actionof the content switching policy.

An action can contain a complex string builder expression to determine the destination LBvirtual server. Using complex action expressions helps in simplifying the configuration. Onlythe expressions that return non-Boolean values are supported. To configure dynamic LBvirtual server selection feature, you need to:

• Create a content switching action for dynamic load balancing virtual server selection

• Create a CS policy with an action

• Bind the policy to a content switching virtual server

Note: For a policy configured with an action, the state update option returns incorrectvirtual server state information. The state update option determines the state based onthe state of LB virtual server attached to the CS virtual server. In the case of a contentswitching policy with an action, the LB virtual server is determined at the run time usingthe action expression and hence the state returned is always returned as down.

Note: Content switching policies configured with action do not support SNMP.

Note: You cannot verify whether the string builder expression will evaluate to theconfigured LB virtual server while configuring the policy.

Page 34: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

34

Creating a content switching action fordynamic LB virtual server selection

Before creating a content switching policy that enables you to determine the target loadbalancing virtual server dynamically, you must create an action. When you configure thepolicy, you attach the required action. This section describes how to create and manage acontent switching action for dynamic load balancing virtual server selection. The expressionin the action parameter is used at the runtime to determine the load balancing virtualserver to which the traffic is directed.

To create an action by using the command lineinterface

At the command prompt, type:

add cs action <name> -targetLBVserver <string-expression>

Example

add cs action -targetVserverExpr 'HTTP.REQ.URL.QUERY.VALUE("id")'

Parameters for creating an actionname

Name for the content switching action.

targetLBVserver

String expression that returns the target load balancing virtual server.

Page 35: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To create an action by using the configuration utility1. In the navigation pane, expand Content Switching, and then click Action.

2. In the details pane, click Add.

3. In the Create Content Switching Action dialog box, in the Name text box, type the nameof the action (for example, act11).

4. In the Target VServer Expression field, specify the expression.

5. Click Evaluate to verify the expression.

6. Click Create, and then click Close.

To view information about an action by using thecommand line interface

At the command prompt, type:

show cs action [<name>]

Example

show cs action

show cs action act1

Parameters for viewing an actionname

Name for the content switching action.

To view information about an action by using theconfiguration utility

1. All the actions are displayed in the details pane.

2. Select an action and click Open to view it.

Creating a content switching action for dynamic LB virtual server selection

35

Page 36: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To rename an action by using the command lineinterface

At the command prompt, type:

rename cs action <name> <new-name>

Example

rename cs action act1 act2

Parameters for renaming an actionname

Existing name for the content switching action.

new-name

New name for the content switching action.

To rename an action by using the configuration utility1. In the navigation pane, expand Content Switching, and then click Action.

2. In the details pane, select the action you want to rename and then click Rename.

3. In the Rename Content Switching Action dialog box, in the Name* text box, type thenew name of the policy.

4. Click Ok to rename the selected action.

To remove an action by using the command lineinterface

At the command prompt, type:

rm cs action <name>

Example

rename cs action act1 act2

Creating a content switching action for dynamic LB virtual server selection

36

Page 37: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Parameters for removing an actionname

Name for the content switching action.

To remove an action by using the configuration utility1. In the navigation pane, expand Content Switching, and then click Action.

2. In the details pane, select the action you want to remove and then click Remove.

3. In the Proceed dialog box, click Yes to remove the selected action.

To modify an action by using the command lineinteface

At the command prompt, type:

set cs action <name> -targetLBVserver <string-expression>

Example

set cs action -targetVserverExpr 'HTTPS.REQ.URL.QUERY.VALUE("id")'

Parameters for modifying an actionname

Name for the content switching action.

targetLBVserver

String expression that returns the target load balancing virtual server.

Creating a content switching action for dynamic LB virtual server selection

37

Page 38: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To modify an action by using the configuration utility1. In the navigation pane, expand Content Switching, and then click Action.

2. In the details pane, click Open.

3. In the Configure Content Switching Action dialog box, update the expression in theTarget VServer Expression field.

4. Click Evaluate to verify the expression.

5. Click Create, and then click Close.

Creating a content switching action for dynamic LB virtual server selection

38

Page 39: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

39

Configuring Content Switching Policies

A content switching policy defines a type of request that is to be directed to a loadbalancing virtual server. These policies are applied in the order of the priorities assigned tothem or (if you are using NetScaler classic policies and do not assign priorities when bindingthem) in the order in which the policies were created.

The policies can be:

• Domain-based policies. The NetScaler appliance compares the domain of an incomingURL with the domains specified in the policies. The appliance then returns the mostappropriate content. Domain-based policies must be classic policies; default syntaxpolicies are not supported for this type of content switching policy.

• URL-based policies. The appliance compares an incoming URL with the URLs specifiedin the policies. The appliance then returns the most appropriate URL-based content,which is usually the longest matching configured URL. URL-based policies must beclassic policies; default syntax policies are not supported for this type of contentswitching policy.

• Rule-based policies. The appliance compares incoming data to expressions specified inthe policies. You create rule-based policies by using either a classic expression or adefault syntax expression. Both classic and default syntax policies are supported forrule-based content switching policies.

Note: A rule based policy can be configured with an optional action. A policy with anaction can be bound to multiple virtual servers or policy labels.

If you set a priority when binding your policies to the content switching virtual server,the policies are evaluated in order of priority. If you do not set specific priorities whenbinding your policies, the policies are evaluated in the order in which they werecreated.

For information about NetScaler classic policies and expressions, see "Configuring ClassicPolicies and Expressions." For information about Default Syntax policies, see "ConfiguringDefault Syntax Expressions."

To create a content switching policy by using thecommand line interface

At the command prompt, type one of the following commands:

• add cs policy <policyName> -domain <domain>

• add cs policy <policyName> -url <URLValue>

• add cs policy <policyName> -rule <RULEValue>

• add cs policy <policyName> -rule <RULEValue> -action <actionName>

Page 40: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Example

add cs policy Policy-CS-1 -url "/sports/*"

add cs policy Policy-CS-1 -domain "example.com"

add cs policy Policy-CS-1 -rule "CLIENT.IP.SRC.SUBNET(24).EQ(10.217.84.0)"

add cs policy Policy-CS-2 -rule "SYS.TIME.BETWEEN(GMT 2009 Nov,GMT 2009 Dec)"

add cs policy Policy-CS-3 -rule "http.req.method.eq(GET)" -action act1

Parameters for configuring content switching policiespolicyName (Name)

Name for the content switching policy. Must begin with an ASCII alphanumeric orunderscore (_) character, and must contain only ASCII alphanumeric, underscore, hash(#), period (.), space, colon (:), at sign (@), equal sign (=), and hyphen (-) characters. Ifthe name includes one or more spaces, enclose the name in double or single quotationmarks (for example, “my policy” or ‘my policy’).

Cannot be changed after the policy is created.

domain (Domain)

The domain in the URL. The NetScaler appliance uses the domain to choose the correctcontent for each incoming request.

URLValue (URL)

An absolute or relative URL. The NetScaler appliance uses the URL to choose the correctcontent for each incoming request.

RULEValue (Expression)

A classic or default syntax policy expression that defines the appropriate content foreach request.

action (Action)

Name of the content switching action to be used by the policy.

Configuring Content Switching Policies

40

Page 41: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To create a content switching policy by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Policies.

2. In the details pane, click Add.

3. In the Create Content Switching Policy dialog box, in the Name text box, type the nameof the policy (for example, Policy-CS-1).

4. Choose the type of policy that you want to create, and configure the policy.

• To create a domain-based policy, in the Domain text box, type the domain (forexample, example.com).

• To create a URL-based policy, click URL, and in the Value text box, type anabsolute or relative URL (for example, http://www.example.com/sports, or just/sports).

• To create a rule-based policy, click Configure, and do the following:

a. In the Create Expression dialog box, choose the expression syntax you want touse.

• If you want to use default syntax, accept the default and proceed to thenext step.

• If you want to use classic syntax, click Switch to Classic Syntax.

The Expression portion of the dialog box changes to match your choice. Thedefault syntax Expression view has fewer elements than does the classicsyntax Expression view. In the default syntax Expression view, instead of apreview window, a button provides access to an expression evaluator. Theevaluator evaluates the expression you entered, to verify that it is valid,and displays an analysis of the expression's effect.

b. Enter your policy expressions.

• If you are using classic syntax and need further instructions, see ConfiguringClassic Policies and Expressions.

• If you are using the default syntax and need further instructions, seeConfiguring Default Syntax Expressions.

5. Click Create, and then click Close. The policy you created appears in the ContentSwitching Policies pane.

Configuring Content Switching Policies

41

Page 42: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

42

Binding Policies to a Content SwitchingVirtual Server

After you create your content switching virtual server and policies, you bind each policy tothe content switching virtual server. When binding the policy to the content switchingvirtual server, you specify the target load balancing virtual server.

Note: If your content switching policy uses a default syntax rule, you can configure acontent switching action for the policy. If you configure an action, you must specify thetarget load balancing virtual server when you are configuring the action, not when youare binding the policy to the content switching virtual server. For more information aboutconfiguring a content switching action, see Configuring a Content Switching Action.

To bind a policy to a content switching virtual serverand select a target load balancing virtual server byusing the command line interface

At the command prompt, type:

bind cs vserver <name>[-lbvserver<string> -targetLBVServer<string> -policyname <string>-priority <positive_integer>] [-gotoPriorityExpression <expression>] [-type ( REQUEST |RESPONSE )] [-invoke (<labelType> <labelName>) ]

Example

bind cs vserver csw-vip2 -policyname csw-ape-policy2 -priority 14 -gotoPriorityExpression NEXT

bind cs vserver csw-vip3 -policyname rewrite-policy1 -priority 17 -gotoPriorityExpression 'q.header("a").count' -flowtype REQUEST -invoke policylabel label1

bind cs vserver Vserver-CS-1 Vserver-LB-1 -policyname Policy-CS-1 -priority 20

Note: The parameters, target load balancing virtual server (targetVserver), go to priorityexpression (gotoPriorityExpression), and invoke method (invoke) cannot be used if apolicy has an action.

Page 43: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To bind a policy to a content switching virtual serverand select a target load balancing virtual server byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, double-click the virtual server for which you want to bind the policy(for example, Vserver-CS-1).

3. In the Configure Virtual Server (Content Switching) dialog box, on the Policies tab, clickInsert Policy. A list of existing policies appears in the Policy Name drop-down list, Youcan either select an existing policy or create a new policy:

• Select an existing policy that you previously created to bind to the virtual server.

• Select New Policy from the Policy Name drop-down list to create a new contentswitching policy. After you create a new policy, it is automatically bound to thevirtual server.

4. Click OK.

Binding Policies to a Content Switching Virtual Server

43

Page 44: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

44

Customizing the Basic Content SwitchingConfiguration

After you configure a basic content switching setup, you might need to customize it to meetyour requirements. If your web servers are UNIX-based and rely on case sensitivepathnames, you can configure case sensitivity for policy evaluation. You can also setprecedence for evaluation of the content switching policies that you configured. If youwant to configure content switching for a specific a virtual LAN, you can configure acontent switching virtual server with a listen policy.

Page 45: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

45

Configuring Case Sensitivity for PolicyEvaluation

You can configure the content switching virtual server to treat URLs as case sensitive inURL-based policies. When case sensitivity is configured, the NetScaler appliance considerscase when evaluating policies. For example, if case sensitivity is off, the URLs /a/1.htmand /A/1.HTM are treated as identical. If case sensitivity is on, those URLs are treated asseparate and can be switched to different targets.

To configure case sensitivity by using the commandline interface

At the command prompt, type:

set cs vserver <name> -caseSensitive (ON|OFF)

Example

set cs vserver Vserver-CS-1 -caseSensitive ON

Parameters for configuring case sensitivityvServerName

The name of the content switching virtual server that you are configuring. The namemust not exceed 127 characters, and the leading character must be a number or letter.The following characters are also allowed: @ _ - . (period) : (colon) # and space ( ).

caseSensitive

The URL lookup case option on the content switching vserver. If case sensitivity of acontent switching virtual server is set to 'ON', the URLs /a/1.html and /A/1.HTML aretreated differently and may have different targets (set by content switching policies).

If case sensitivity is set to 'OFF', the URLs /a/1.html and /A/1.HTML are treated thesame, and will be switched to the same target.

Possible values: ON, OFF

Default value: ON

Page 46: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure case sensitivity by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure casesensitivity (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Advanced tab,select Case Sensitivity check box, and then click OK.

Configuring Case Sensitivity for Policy Evaluation

46

Page 47: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

47

Setting the Precedence for PolicyEvaluation

Precedence refers to the order in which policies that are bound to a virtual server areevaluated. You do not normally have to configure precedence: the default precedenceworks correctly in many cases. If you want to make sure that one policy or set of policies isapplied first, however, and another policy or set of policies is applied only if the first setdoes not match a request, you can configure either URL-based precedence or rule-basedprecedence.

Precedence with URL-Based PoliciesIf there are multiple matching URLs for the incoming request, the precedence (priority) forURL-based policies is:

1. Domain and exact URL

2. Domain, prefix, and suffix

3. Domain and suffix

4. Domain and prefix

5. Domain only

6. Exact URL

7. Prefix and suffix

8. Suffix only

9. Prefix only

10. Default

If you configure precedence based on URL, the request URL is compared to the configuredURLs. If none of the configured URLs match the request URL, then rule-based policies arechecked. If the request URL does not match any rule-based policies, or if the content groupselected for the request is down, then the request is processed as follows:

• If you configure a default group for the content switching virtual server, then therequest is forwarded to the default group.

• If the configured default group is down or if no default group is configured, then an“HTTP 404 Not Found” error message is sent to the client.

Note: You should configure URL-based precedence if the content type (for example, images) is the same for all clients. However, if different types of content must be served

Page 48: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

based on client attributes (such as Accept-Language), you must use rule-basedprecedence.

Precedence with Rule-Based PoliciesIf you configure precedence based on rules, which is the default setting, the request istested on the basis of the rule-based policies you have configured. If the request does notmatch any rule-based policies, or if the content group selected for the incoming request isdown, the request is processed in the following manner:

• If a default group is configured for the content switching virtual server, the request isforwarded to the default group.

• If the configured default group is down or if no default group is configured, an “HTTP404 Not Found” error message is sent to the client.

To configure precedence by using the command line

interfaceAt the command prompt, type:

set cs vserver <name> -precedence ( RULE | URL )

Example

set cs vserver Vserver-CS-1 -precedence RULE

Parameters for configuring precedencevServerName

The name of the content switching virtual server that you are configuring. The namemust not exceed 127 characters, and the leading character must be a number or letter.The following characters are also allowed: @ _ - . (period) : (colon) # and space ( ).

precedence

The type of precedence to use for both RULE-based and URL-based policies on thecontent switching virtual server. With the precedence set to RULE, incoming requests areevaluated against the rule-based content switching policies. If none of the rules match,the URL in the request is evaluated against the URL-based content switching policies.Possible values: RULE, URL. Default: RULE.

Setting the Precedence for Policy Evaluation

48

Page 49: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure precedence by using the configuration utility1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configureprecedence, (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Advanced tab,under Precedence, click Rule or URL, and then click OK.

Setting the Precedence for Policy Evaluation

49

Page 50: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

50

Configuring per-VLAN Wildcarded VirtualServers

If you want to configure content switching for traffic on a specific virtual local areanetwork (VLAN), you can create a wildcarded virtual server with a listen policy thatrestricts it to processing traffic only on the specified VLAN.

To configure a wildcarded virtual server that listens toa specific VLAN by using the command line interface

At the command prompt, type:

add cs vserver <name> <serviceType> IPAddress * Port * -listenpolicy <expression>[-listenpriority <positive_integer>]

Example

add cs vserver Vserver-CS-vlan1 ANY * * -listenpolicy "CLIENT.VLAN.ID.EQ(2)" -listenpriority 10

Parameters for configuring per-VLAN wildcardedvirtual servers

name

Name of the virtual server. The name must not exceed 127 characters, and the leadingcharacter must be a number or letter. The following characters are also allowed: @ _ - .(period) : (colon) # and space ( ).

IPAddress

IP address of the virtual server. For wildcarded virtual servers bound to VLANs, this isalways *.

type

Behavior of the service. Select one of the following service types: HTTP, SSL, TCP, FTP,RTSP, SSL_TCP, UDP, DNS, SIP_UDP, ANY, RADIUS, RDP, MYSQL, MSSQL.

port

Port on which the virtual server listens for client connections. The port number must bein the range 0-65535. For wildcarded virtual servers bound to VLANs, the setting is

Page 51: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

normally *.

listenpriority

The priority assigned to the listen policy. This can be any positive integer. Priority isevaluated in reverse order; the lower the number, the higher the priority assigned to thelisten policy.

rule

The policy rule to use to identify the VLAN that you want this virtual server to listen to.This rule is:

CLIENT.VLAN.ID.EQ(<integer>)

For <integer>, substitute the ID number assigned to the VLAN.

Configuring per-VLAN Wildcarded Virtual Servers

51

Page 52: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure a wildcarded virtual server that listens toa specific VLAN by using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, do one of the following:

• To create a new virtual server, click Add.

• To modify an existing virtual server, select the virtual server, and then click Open.3. In the Create Virtual Server or Configure Virtual Server dialog box, on the Services tab,

type or select values for the following parameters:

• Name*—name

• Protocol*—type

• IP address*—IPAddress

• Port—port* A required parameter

4. In the Advanced tab, expand Listen Policy, and then type or select values for thefollowing parameters:

• Listen Priority*—priority

• Listen Policy Rule*—rule* A required parameter

5. Click Create or OK, depending on whether you are creating a new virtual server ormodifying an existing virtual server.

6. Click Close. The virtual server that you created now appears in the Virtual Serverspage.

7. To remove a virtual server, in the Virtual Servers pane select the virtual server, andthen click Remove.

After you have created this virtual server, you bind it to one or more services as describedin Binding Services to the Virtual Server.

Configuring per-VLAN Wildcarded Virtual Servers

52

Page 53: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

53

Protecting the Content Switching Setupagainst Failure

Content switching may fail when the content switching virtual server goes DOWN or fails tohandle excessive traffic, or for other reasons. To reduce the chances of failure, you cantake the following measures to protect the content switching setup against failure:

• Configure a backup content switching virtual server.

• Configure spillover for preventing the overloading of the primary and diverting excesstraffic to the backup virtual server.

• Specify a redirect URL, the URL to which the content is switched if both the primaryand backup content switching virtual servers are DOWN.

• Enable the State Update option for marking a content switching virtual server as DOWNwhen the load balancing virtual server is DOWN.

• Flush the surge queues when the queues become too long.

Page 54: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

54

Configuring a Redirection URL

You can configure a redirect URL to communicate the status of the NetScaler appliance inthe event that a content switching virtual server of type HTTP or HTTPS is DOWN orDISABLED. This URL can be local or remote.

Redirect URLs can be absolute URLs or relative URLs. If the configured redirect URLcontains an absolute URL, the HTTP redirect is sent to the configured location, regardlessof the URL specified in the incoming HTTP request. If the configured redirect URL containsonly the domain name (relative URL), the HTTP redirect is sent to a location afterappending the incoming URL to the domain configured in the redirect URL.

Note: If a content switching virtual server is configured with both a backup virtual serverand a redirect URL, the backup virtual server takes precedence over the redirect URL. Aredirect URL is used when the primary and backup virtual servers are down.

When redirection is configured and the content switching virtual server is unavailable, theappliance issues an HTTP 302 redirect to the user’s browser.

To configure a redirect URL for when the contentswitching virtual server is unavailable by using thecommand line interface

At the command prompt, type:

set cs vserver <name> -redirectURL <URLValue>

Example

set cs vserver Vserver-CS-1 -redirectURL http://www.newdomain.com/mysite/maintenance

Parameters for configuring a redirect URLvServerName

The name of the content switching virtual server that you are configuring. Thisalphanumeric string is required and cannot be changed after the virtual server iscreated. The name must not exceed 127 characters, and the leading character must be anumber or letter. The following characters are also allowed: @ _ - . (period) : (colon) #and space ( ).

URLValue

URL to which traffic is redirected if the content switching virtual server becomesunavailable. This value must not exceed 127 characters. The domain specified in the URL

Page 55: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

must not match the domain specified in the domain name argument of a contentswitching policy. If the same domain is specified in both arguments, the request isredirected continuously to the same unavailable virtual server in the NetScaler, and theuser cannot get the requested content.

To configure a redirect URL for when the contentswitching virtual server is unavailable by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure a redirectURL (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Advanced tab, inthe Redirect URL text box, type the redirect URL (for example,http://www.newdomain.com/mysite/maintenance).

4. Click OK.

Configuring a Redirection URL

55

Page 56: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

56

Configuring a Backup Virtual Server

If the primary content switching virtual server is marked DOWN or DISABLED, the NetScalerappliance can direct requests to a backup content switching virtual server. It can also senda notification message to the client regarding the site outage or maintenance. The backupcontent switching virtual server is a proxy and is transparent to the client.

When configuring the backup virtual server, you can specify the configuration parameterDisable Primary When Down to ensure that, when the primary virtual server comes back up,it remains the secondary until you manually force it to take over as the primary. This isuseful if you want to ensure that any updates to the database on the server for the backupare preserved, enabling you to synchronize the databases before restoring the primaryvirtual server.

You can configure a backup content switching virtual server when you create a contentswitching virtual server or when you change the optional parameters of an existing contentswitching virtual server. You can also configure a backup content switching virtual serverfor an existing backup content switching virtual server, thus creating cascaded backupcontent switching virtual servers. The maximum depth of cascaded backup contentswitching virtual servers is 10. The appliance searches for a backup content switchingvirtual server that is up and accesses that content switching virtual server to deliver thecontent.

Note: If a content switching virtual server is configured with both a backup contentswitching virtual server and a redirect URL, the backup content switching virtual servertakes precedence over the redirect URL. The redirect is used when the primary andbackup virtual servers are down.

To set up a backup content switching virtual server byusing the command line interface

At the command prompt, type:

set cs vserver <name> -backupVserver <string> -disablePrimaryOnDown (ON|OFF)

Example

set cs vserver Vserver-CS-1 -backupVserver Vserver-CS-2 -disablePrimaryOnDown ON

Parameters for configuring a backup virtual serverprimaryVServer

The name of the primary virtual server for which you are configuring a backup. Thisalphanumeric string is required and cannot be changed after the virtual server is

Page 57: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

created. The name must not exceed 127 characters, and the leading character must be anumber or letter. The following characters are also allowed: @ _ - . (period) : (colon) #and space ( ).

backupVServer

The name of the backup virtual server that you are configuring. This alphanumeric stringis required and cannot be changed after the virtual server is created. The name must notexceed 127 characters, and the leading character must be a number or letter. Thefollowing characters are also allowed: @ _ - . (period) : (colon) # and space ( ).

You can create a virtual server and specify the name, IP address, port, and type asdescribed in Creating Content Switching Virtual Servers. You can use the name of thecontent switching virtual server as a backup content switching virtual server.

disablePrimaryOnDown

Configures the appliance to leave the former primary virtual server as secondary untilyou manually set it to take over as the primary. Possible Values: ON, OFF. Default: OFF.

To set up a backup content switching virtual server byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to set up a backupcontent switching virtual server (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, click the Advanced tab.

4. In the Backup Virtual Server list, select the backup virtual server (for example,Vserver-CS-2).

5. If you want to configure the backup server to remain as the primary server after theprimary virtual server is brought back up, select the Disable Primary When Down checkbox.

6. Click OK.

Configuring a Backup Virtual Server

57

Page 58: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

58

Diverting Excess Traffic to a BackupVirtual Server

The spillover option diverts new connections arriving at a content switching virtual serverto a backup content switching virtual server when the number of connections to thecontent switching virtual server exceeds the configured threshold value. The thresholdvalue is dynamically calculated, or you can set the value. The number of establishedconnections (in case of TCP) at the virtual server is compared with the threshold value.When the number of connections reaches the threshold, new connections are diverted tothe backup content switching virtual server.

If the backup content switching virtual servers reach the configured threshold and areunable to take the load, the primary content switching virtual server diverts all requests tothe redirect URL. If a redirect URL is not configured on the primary content switchingvirtual server, subsequent requests are dropped.

To configure a content switching virtual server todivert new connections to a backup virtual server byusing the command line interface

At the command prompt, type:

set cs vserver <name> -soMethod <methodType> -soThreshold <thresholdValue>-soPersistence <persistenceValue> -soPersistenceTimeout <timeoutValue>

Example

set cs vserver Vserver-CS-1 -soMethod Connection -soThreshold 1000 -soPersistence enabled -soPersistenceTimeout 2

Parameters for configuring spillovervServerName

The name of the content switching virtual server for which you are configuring spillover.This alphanumeric string is required and cannot be changed after the virtual server iscreated. The name must not exceed 127 characters, and the leading character must be anumber or letter. The following characters are also allowed: @ _ - . (period) : (colon) #and space ( ).

soMethod

Type of spillover used to divert traffic to the backup content switching virtual server when the virtual server reaches the spillover threshold. The valid options for this

Page 59: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

parameter are: CONNECTION, BANDWIDTH, and NONE. For more information about howeach of these methods work, see Load Balancing.

soThreshold

For the CONNECTION spillover type, the Threshold value is the maximum number ofconnections a virtual server can handle before spillover. For the BANDWIDTH spillovertype, the Threshold value is the amount of incoming and outgoing traffic (in kilobits persecond) that a virtual server can handle before spillover occurs. The minimum value is 1,and the maximum value is 4294967294.

soPersistence

The spillover persistence state. If you enable spillover persistence, the NetScalermaintains sourceIP-based persistence over primary virtual server and backup contentswitching virtual servers. The valid options for this parameter are: ENABLED andDISABLED. The default value is DISABLED.

soPersistenceTimeout

This value sets the timeout for spillover persistence. The default value is 2 minutes. Theminimum value is 2 minutes, and the maximum value is 1440 minutes.

To set a content switching virtual server to divert newconnections to a backup virtual server by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure spillover(for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Advanced tab,under Spillover, in the Method list, select the type of spillover, and in Threshold textbox, type the threshold value (for example, Connection and 1000).

4. Select the Persistence check box and, in Persistence Time-out (min) text box, type thetimeout value (for example, 2).

5. Click OK.

Diverting Excess Traffic to a Backup Virtual Server

59

Page 60: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

60

Configuring the State Update Option

The content switching feature enables the distribution of client requests across multipleservers on the basis of the specific content presented to the users. For efficient contentswitching, the content switching virtual server distributes the traffic to the load balancingvirtual servers according to the content type, and the load balancing virtual serversdistribute the traffic to the physical servers according to the specified load balancingmethod.

For smooth traffic management, it is important for the content switching virtual server toknow the status of the load balancing virtual servers. The state update option helps to markthe content switching virtual server DOWN if the load balancing virtual server bound to it ismarked DOWN. A load balancing virtual server is marked DOWN if all the physical serversbound to it are marked DOWN.

When State Update is disabled:

The status of the content switching virtual server is marked as UP. It remains UP even ifthere is no bound load balancing virtual server that is UP.

When State Update is enabled:

When you add a new content switching virtual server, initially, its status is shown as DOWN.When you bind a load balancing virtual server whose status is UP, the status of the contentswitching virtual server becomes UP.

If more than one load balancing virtual server is bound and if one of them is specified asthe default, the status of the content switching virtual server reflects the status of thedefault load balancing virtual server.

If more than one load balancing virtual server is bound without any of them being specifiedas the default, the status of the content switching virtual server is marked UP only if all thebound load balancing virtual servers are UP.

To configure the state update option by using thecommand line interface

At the command prompt, type:

add cs vserver <name> <protocol> <ipAddress> <port> -stateUpdate ENABLED

Example

add cs vserver csw_vserver HTTP 10.18.250.154 80 -stateupdate ENABLED -cltTimeout 180

Page 61: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Parameters for configuring state update optionvServerName

Name of the content switching virtual server. This alphanumeric string is required andcannot be changed after the content switching virtual server is created. The name mustnot exceed 127 characters, and the leading character must be a number or letter. Thefollowing characters are also allowed: @ _ - . (period) : (colon) # and blank space.

ipAddress

IP address of the virtual server. This IP address (VIP) is usually a public IP address towhich the clients send connection requests.

port

Port on which the virtual server listens for client connections. The port number must bebetween 0-65535.

protocol

Protocol of the requests processed by the content switching virtual server. Possiblevalues: HTTP, TCP, UDP, FTP, SSL, SSL_TCP, RTSP, DNS, SIP-UDP, ANY.

stateUpdate

Status of the content switching virtual server according to the status of the bound loadbalancing virtual server. Possible values: ENABLED, DISABLED. DEFAULT: DISABLED.

Configuring the State Update Option

61

Page 62: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure the state update option by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, do one of the following:

• To add a virtual server, click Add.

• To modify a virtual server, select the server, and click Open.3. In the Create Virtual Server (Content Switching) dialog box, specify values for the

following parameters, which correspond to parameters described in "Parameters forconfiguring content switching" as shown:

• Name-vServerName

• IP Address-ipAddress

Note: If you need to enter an IPv6 address, select the IPv6 check box before youenter the address.

• Port-port

• Protocol-protocol4. On the Advanced tab, select the State Update check box.

5. Click Create.

6. Select the new virtual server, click Open, and verify the settings.

Configuring the State Update Option

62

Page 63: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

63

Flushing the Surge Queue

When a physical server receives a surge of requests, it becomes slow to respond to theclients that are currently connected to it, which leaves users dissatisfied and disgruntled.Often, the overload also causes clients to receive error pages. To avoid such overloads, theNetScaler appliance provides features such as surge protection, which controls the rate atwhich new connections to a service can be established.

The appliance does connection multiplexing between clients and physical servers. When itreceives a client request to access a service on a server, the appliance looks for an alreadyestablished connection to the server that is free. If it finds a free connection, it uses thatconnection to establish a virtual link between the client and the server. If it does not findan existing free connection, the appliance establishes a new connection with the server,and establishes a virtual link between client and the server. However, if the appliancecannot establish a new connection with the server, it sends the client request to a surgequeue. If all the physical servers bound to the load balancing or content switching virtualserver reach the upper limit on client connections (max client value, surge protectionthreshold or maximum capacity of the service), the appliance cannot establish a connectionwith any server. The surge protection feature uses the surge queue to regulate the speed atwhich connections are opened with the physical servers. The appliance maintains adifferent surge queue for each service bound to the virtual server.

The length of a surge queue increases whenever a request comes for which the appliancecannot establish a connection, and the length decreases whenever a request in the queuegets sent to the server or a request gets timed out and is removed from the queue.

If the surge queue for a service or service group becomes too long, you may want to flushit. You can flush the surge queue of a specific service or service group, or of all the servicesand service groups bound to a load balancing virtual server. Flushing a surge queue does notaffect the existing connections. Only the requests present in the surge queue get deleted.For those requests, the client has to make a fresh request.

You can also flush the surge queue of a content switching virtual server. If a contentswitching virtual server forwards some requests to a particular load balancing virtualserver, and the load balancing virtual server also receives some other requests, when youflush the surge queue of the content switching virtual server, only the requests receivedfrom this content switching virtual server are flushed; the other requests in the surge queueof the load balancing virtual server are not flushed.

Note: You cannot flush the surge queues of cache redirection, authentication, VPN orGSLB virtual servers or GSLB services.

Note: Do not use the Surge Protection feature if Use Source IP (USIP) is enabled.

To flush a surge queue by using the command lineinterface

The flush ns surgeQ command works in the following manner:

Page 64: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

• You can specify the name of a service, service group, or virtual server whose surgequeue has to be flushed.

• If you specify a name while executing the command, surge queue of the specified entitywill be flushed. If more than one entity has the same name, the appliance flushes surgequeues of all those entities.

• If you specify the name of a service group, and a server name and port while executingthe command, the appliance flushes the surge queue of only the specified service groupmember.

• You cannot directly specify a service group member (<serverName> and <port>) withoutspecifying the name of the service group (<name>) and you cannot specify <port>without a <serverName>. Specify the <serverName> and <port> if you want to flush thesurge queue for a specific service group member.

• If you execute the command without specifying any names, the appliance flushes thesurge queues of all the entities present on the appliance.

• If a service group member is identified with a server name, you must specify the servername in this command; you cannot specify its IP address.

At the command prompt, type:

flush ns surgeQ [-name <name>] [-serverName <serverName> <port>]

Examples

1.flush ns surgeQ –name SVC1ANZGB –serverName 10.10.10.1 80The above command flushes the surge queue of the service or virtual server that is named SVC1ANZGB and has IP address as 10.10.102.flush ns surgeQThe above command flushes all the surge queues on the appliance.

Parameters for flushing a surge queuename

Name of a virtual server, service or service group

serverName

Name of a service group member

Flushing the Surge Queue

64

Page 65: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

65

Managing a Content Switching Setup

After a content switching setup is configured, it may require periodic changes. Whenoperating systems or software are updated, or hardware wears out and is replaced, you mayneed to take down your setup. Load on your setup may increase, requiring additionalresources. You may also modify the configuration to improve performance.

These tasks may require unbinding policies from the content switching virtual server, ordisabling or removing content switching virtual servers. After you have made changes toyour setup, you may need to re-enable servers and rebind policies. You might also want torename your virtual servers.

Page 66: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

66

Unbinding Policies from the ContentSwitching Virtual Server

When you unbind a content switching policy from its virtual server, the virtual server nolonger includes that policy when determining where to direct requests.

To unbind a policy from a content switching virtualserver by using the command line interface

At the command prompt, type:

unbind cs vserver <name> -policyname <string>

Example

unbind cs vserver Vserver-CS-1 -policyname Policy-CS-1

Parameters for unbinding content switching policiesvServerName

The name of the content switching virtual server from which you are unbinding thepolicy. This alphanumeric string is required and cannot be changed after the virtualserver is created. The name must not exceed 127 characters, and the leading charactermust be a number or letter. The following characters are also allowed: @ _ - . (period) :(colon) # and space ( ).

policyName

The name of the policy that you are unbinding.

Page 67: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To unbind a policy from a content switching virtualserver by using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server form which you want to unbind the policy(for example, Vserver-CS-1), and click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Policies tab, inthe Active column, clear the check box next to the policy that you want to unbind fromthe virtual server (for example, Policy-CS-1).

4. Click OK.

Unbinding Policies from the Content Switching Virtual Server

67

Page 68: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

68

Removing Content Switching VirtualServers

You normally remove a content switching virtual server only when you no longer require thevirtual server. When you remove a content switching virtual server, the NetScaler appliancefirst unbinds all policies from the content switching virtual server, and then removes it.

To remove a content switching virtual server by usingthe command line interface

At the command prompt, type:

rm cs vserver <name>@

Example

rm cs vserver Vserver-CS-1

To remove a content switching virtual server by usingthe configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to remove (for example,Vserver-CS-1), and then click Remove.

3. In the Remove dialog box, click Yes.

Page 69: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

69

Disabling and Re-Enabling ContentSwitching Virtual Servers

Content switching virtual servers are enabled by default when you create them. You candisable a content switching virtual server for maintenance. If you disable the contentswitching virtual server, the state of the content switching virtual server changes to Out ofService. While out of service, the content switching virtual server does not respond torequests.

To disable or re-enable a virtual server by using thecommand line interface

At the command prompt, type one of the following commands:

• disable cs vserver <name>@

• enable cs vserver <name>@

Example

disable cs vserver Vserver-CS-1

enable cs vserver Vserver-CS-1

To disable or re-enable a virtual server by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to disable (for example,Vserver-CS-1).

3. Disable or re-enable the virtual server by clicking Disable or Enable, and then clickingYes to confirm your choice.

Page 70: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

70

Renaming Content Switching VirtualServers

You can rename a content switching virtual server without unbinding it. The new name ispropagated automatically to all affected parts of the NetScaler configuration.

To rename a virtual server by using the command lineinterface

At the command prompt, type:

rename cs vserver <name>@ <newName>@

Example

rename cs vserver Vserver-CS-1 Vserver-CS-2

To rename a virtual server by using the configurationutility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server that you want to rename (for example,Vserver-CS-1).

3. Click Rename.

4. In the Name text box, type a new name for the virtual server.

5. Click OK to save your changes.

Page 71: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

71

Managing Content Switching Policies

You can modify an existing policy by configuring rules or changing the URL of the policy, oryou can remove a policy. You can create different policies based on the URL. URL-basedpolicies can be of different types, as described in the following table.

Table 1. Examples of URL-Based Policies

Type of URL-Based Policy Specifies

Domain and Exact URL Requests must match the configureddomain name and configured URL (an exactprefix match if only the prefix isconfigured; or an exact match of the prefixand suffix if both the prefix and suffix areconfigured).

Example:

add cs policy Policy-CS-1 -url/sports/tennis/index.html -domain"www.domainxyz.com"

Domain and Wild Card URL Requests must match the exact domainname and a partial prefix of the configuredURL.

Example:

add cs policy Policy-CS-1 -url /*.jsp-domain "www.domainxyz.com"

Domain Only Requests need match only the configureddomain name.

Example:

add cs policy Policy-CS-1 -domain"www.domainxyz.com"

Page 72: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

The Exact URL The incoming URL must exactly match theURL specified by the policy. If only a URLprefix rule is configured, there must be anexact prefix match with the incoming URL.If a URL prefix and suffix-based rule isconfigured, there should be an exactmatch of the prefix and suffix with theincoming URL.

Example:

add cs policy Policy-CS-1 -url/sports/tennis/index.html

Prefix Only (Wild Card URL) All the incoming URLs must start with theconfigured prefix.

Example:

add cs policy Policy-CS-1 -url /sports*

sports/*” matches all URLs under /sports“/sports*” matches all URLs whose prefixmatch “/sports” starting from thebeginning of a URL

Suffix Only (Wild Card URL) All incoming URLs must end with theconfigured URL suffix.

Example:

add cs policy Policy-CS-1 -url /*.jsp

“/*.jsp” matches all URLs whose fileextension is “jsp”

Prefix and Suffix (Wild Card URL) All incoming URLs must start with theconfigured prefix and end with theconfigured suffix.

Example:

add cs policy Policy-CS-1 -url/sports/*.jsp

Note: You can configure rule-based content switching using classical policy expressions oradvanced policy expressions. For more information about configuring policy expressions,see "Policy Configuration and Reference."

To modify, remove, or rename a policy by using thecommand line interface

At the command prompt, type one of the following commands:

Managing Content Switching Policies

72

Page 73: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

• set cs policy <policyName> [-domain <domainValue>] [-rule <ruleValue>] [-url<URLValue>]

• rm cs policy <policyName>

Example

set cs policy Policy-CS-1 -domain "www.domainxyz.com"

set cs policy Policy-CS-1 -rule "CLIENT.IP.SRC.SUBNET(22).EQ(10.100.148.0)"

set cs policy Policy-CS-2 -rule "SYS.TIME.BETWEEN(GMT 2010 Jun,GMT 2010 Jul)"

set cs policy Policy-CS-1 -url /sports/*

rm cs policy Policy-CS-1

Parameters for configuring content switching policiespolicyName

newPolicyName

New name for the content switching policy.

domain

The domain name. The alphanumeric string can range from 3 to 63 characters, and canconsist of any characters that are allowed in a domain name.

rule

A NetScaler advanced policy expression that defines which requests to forward to aparticular content switching virtual server.

url

A URL or partial URL that enables the NetScaler appliance to choose requests to forwardto a particular content switching server.

Managing Content Switching Policies

73

Page 74: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To modify, remove, or rename a policy by using theconfiguration utility

1. In the navigation pane, expand Content Switching, and then click Policies.

2. In the details pane, select the policy that you want to modify (for example,Policy-CS-1).

3. Modify, remove, or rename the policy.

• To modify the policy, click Open and then make the changes that you want. Forexample, you can type a new domain name in the Domain text box. Then, click Yesto confirm your changes.

• To remove the policy, click Remove, and then click Yes to confirm your choice.

• To rename the policy, click Rename, and specify the new name in the Name textfield in the Rename CSW Policy dialog box, and then click OK.

4. In the Configure Content Switching Policies dialog box, in the Domain text box, type thedomain name (for example, www.domainxyz.com).

5. Click OK.

Managing Content Switching Policies

74

Page 75: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

75

Modifying a Content SwitchingConfiguration by Using the Visualizer

You can use the Visualizer to modify a load balancing virtual server to which the contentswitching virtual server is bound. You can also modify a service or group of similar services,or a monitor. For more information, see "The Load Balancing Visualizer."

Page 76: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

76

Managing Client Connections

To ensure efficient management of client connections, you can configure the contentswitching virtual servers on the NetScaler appliance to use the following features:

• Redirecting client requests to a cache

• Enabling delayed cleanup of virtual server connections

• Rewriting ports and protocols for redirection

• Inserting the IP address and port of a virtual server in the request header

• Setting a time-out value for idle client connections

• Configuring the ICMP Response. You can configure the NetScaler to send ICMP responsesto PING requests according to your settings. On the IP address corresponding to thevirtual server, set the ICMP RESPONSE to VSVR_CNTRLD, and on the virtual server, setthe ICMP VSERVER RESPONSE.

The following settings can be made on a virtual server:

• When you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, NetScaleralways responds.

• When you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, NetScalerresponds even if one virtual server is UP.

• When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others,NetScaler responds even if one virtual server set to ACTIVE is UP.

Page 77: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

77

Redirecting Client Requests to a Cache

The NetScaler cache redirection feature redirects HTTP requests to a cache. You cansignificantly reduce the burden of responding to HTTP requests and improve your Web siteperformance through proper implementation of the cache redirection feature.

A cache stores frequently requested HTTP content. When you configure cache redirectionon a virtual server, the NetScaler appliance sends cacheable HTTP requests to the cacheand non-cacheable HTTP requests to the origin Web server. For more information on cacheredirection, see "Cache Redirection."

To configure cache redirection on a virtual server byusing the command line interface

At the command prompt, type:

set cs vserver <name> -cacheable <Value>

Example

set cs vserver Vserver-CS-1 -cacheable yes

Parameters for configuring cache redirectionvServerName

The name of the virtual server that you are configuring.

cacheable

Route virtual server requests to the cache redirection virtual server before sending themto the configured servers. Possible values: YES, NO. Default: NO.

Page 78: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure cache redirection on a virtual server byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure cacheredirection (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, on the Advanced tab,select the Cache Redirection check box.

4. Click OK.

Redirecting Client Requests to a Cache

78

Page 79: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

79

Enabling Delayed Cleanup of VirtualServer Connections

Under certain conditions, you can configure the down state flush setting to terminateexisting connections when a service or a virtual server is marked DOWN. Terminatingexisting connections frees resources and in certain cases speeds recovery of overloadedload balancing setups.

To configure the down state flush setting on a virtualserver by using the command line interface

At the command prompt, type:

set cs vserver <name> -downStateFlush <Value>

Example

set cs vserver Vserver-CS-1 -downStateFlush enabled

Parameters for configuring down state flushvServerName

The name of the virtual server that you are configuring.

downStateFlush

Perform delayed cleanup of connections on the virtual server. Possible values: ENABLED,DISABLED. Default: ENABLED.

To configure the down state flush setting on a virtualserver by using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure down stateflush (for example, Vserver-CS-1), and click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, click the Advanced tab.

4. Select the Down state flush check box, and then click OK.

Page 80: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

Enabling Delayed Cleanup of Virtual Server Connections

80

Page 81: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

81

Rewriting Ports and Protocols forRedirection

Virtual servers and the services that are bound to them may use different ports. When aservice responds to an HTTP connection with a redirect, you may need to configure theNetScaler appliance to modify the port and the protocol to ensure that the redirection goesthrough successfully. You do this by enabling and configuring the redirectPortRewritesetting.

To configure HTTP redirection on a virtual server byusing the command line interface

At the command prompt, type:

set cs vserver <name> -redirectPortRewrite <Value>

Example

set cs vserver Vserver-CS-1 -redirectPortRewrite enabled

Parameters for redirect port rewritevServerName

The name of the virtual server that you are configuring.

redirectPortRewrite

State of port rewrite while performing HTTP redirect. Possible values: ENABLED andDISABLED. Default: DISABLED.

Page 82: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To configure HTTP redirection on a virtual server byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure HTTPredirection (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, click the Advanced tab.

4. Select the Redirect Port Rewrite check box, and then click OK.

Rewriting Ports and Protocols for Redirection

82

Page 83: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

83

Inserting the IP Address and Port of aVirtual Server in the Request Header

If you have multiple virtual servers that communicate with different applications on thesame service, you must configure the NetScaler appliance to add the IP address and portnumber of the appropriate virtual server to the HTTP requests that are sent to that service.This setting allows applications running on the service to identify the virtual server thatsent the request.

If the primary virtual server is down and the backup virtual server is up, the configurationsettings of the backup virtual server are added to the client requests. If you want the sameheader tag to be added, regardless of whether the requests are from the primary virtualserver or backup virtual server, you must configure the required header tag on both virtualservers.

Note: This option is not supported for wildcarded virtual servers or dummy virtualservers.

To insert the IP address and port of the virtual serverin the client requests by using the command lineinterface

At the command prompt, type:

set cs vserver <name> -insertVserverIPPort <vServerIPPORT>

Example

set cs vserver Vserver-CS-1 -insertVserverIPPort 10.201.25.136:80

Parameters for virtual server IP port insertionvServerName

The name of the virtual server that you are configuring.

insertVserverIPPort

Virtual IP address and port header insertion option for the virtual server.

VIPADDR-Header contains the virtual server IP address and port number without anytranslation.

Page 84: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

If VIPADDR is not specified, the header is inserted with the name specified in the defaultheader tag vip-header and the virtual server IP and port are inserted in the request withthe default header tag vipHeader.

If VIPADDR is specified, the header is inserted with the user-specified name in vipHeader.The virtual server IP and port are inserted in the request with the user-specified headertag vipHeader.

OFF- The virtual IP and port header insertion option is disabled. The virtual server andport number are not inserted.

V6TOV4MAPPING - If the virtual server uses an IPv6 address and the server uses IPv4, thissetting maps the virtual server address and port to the IPv4 address.

Possible values: OFF, VIPADDR, and V6TOV4MAPPING. Default: OFF.

To insert the IP address and port of the virtual serverin the client requests by using the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to configure virtualserver port insertion (for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, click the Advanced tab.

4. In the Vserver IP Port Insertion list, select the VIPADDR or V6TOV4MAPPING, and thentype the port header in a text box next to Vserver IP Port Insertion box.

5. Click OK.

Inserting the IP Address and Port of a Virtual Server in the Request Header

84

Page 85: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

85

Setting a Time-out Value for Idle ClientConnections

You can configure a virtual server to terminate any idle client connections after aconfigured time-out period elapses. When you configure this setting, the NetScalerappliance waits for the time you specify and, if the client is idle after that time, it closesthe client connection.

To set a time-out value for idle client connections byusing the command line interface

At the command prompt, type:

set cs vserver <name> -cltTimeout <Value>

Example

set cs vserver Vserver-CS-1 -cltTimeout 100

Parameters for setting the client time-out valuevServerName

The name of the virtual server that you are configuring.

cltTimeout

Idle time (in seconds) after which the client connection is terminated. The default valuesare:

• 180 seconds for HTTP/SSL-based services.

• 9000 seconds for other TCP-based services.

• 180 seconds for DNS-based services.

• 180 seconds for other UDP-based services.Maximum value: 31536000.

Page 86: NetScaler 9.3 Content Switching - · PDF fileA content switching configuration consists of a content switching virtual server, a load balancing setup consisting of load balancing virtual

To set a time-out value for idle client connections byusing the configuration utility

1. In the navigation pane, expand Content Switching, and then click Virtual Servers.

2. In the details pane, select the virtual server for which you want to set a time-out value(for example, Vserver-CS-1), and then click Open.

3. In the Configure Virtual Server (Content Switching) dialog box, click the Advanced tab.

4. In the Client Time-out (secs) text box, type the time-out value (for example, 100).

5. Click OK.

Setting a Time-out Value for Idle Client Connections

86