Citrix - Netscaler - v12 Administration Guide
Citrix - Netscaler - v12 Administration Guide
Contents
Access a NetScaler 15
Command line interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
NetScaler GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
System settings 30
Network interfaces 37
Virtual LANs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Link aggregate channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Clock synchronization 39
DNS configuration 40
Add a name server by using the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Add a name server by using the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
SNMP configuration 41
Add SNMP managers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Add SNMP traps listeners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Configure SNMP alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Verify configuration 46
Configuration checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Topology configuration checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Server configuration checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Software features configuration checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Access checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Firewall checklist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Load balancing 50
Enable load balancing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Configure services and a virtual server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Persistence settings 52
Configure persistence based on cookies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Configure persistence based on server IDs in URLs . . . . . . . . . . . . . . . . . . . . . . . 56
Features at a glance 87
FAQs 98
This section provides the frequently asked questions on the following NetScaler features . . 99
AppFlow 99
Clustering 104
Debugging 113
Hardware 114
SSL 139
Application Layer Gateway for FTP, ICMP, and TFTP Protocols 180
Application Layer Gateway for FTP, ICMP, and TFTP Protocols 261
Application Layer Gateway for FTP, ICMP, and TFTP Protocols 291
Load Balance Control-Plane Traffic that is based on Diameter, SIP, and SMPP Protocols 349
SIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
SMPP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Diameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
Provide DNS Infrastructure/Traffic Services, such as, Load Balancing, Caching, and Log-
ging for Telecom Service Providers 350
Provide Subscriber Load Distribution Using GSLB Across Core-Networks of a Telecom Ser-
vice Provider 351
Licensing 357
SNMP 373
Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Packet Engine CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Throughput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 375
Optimized/Bypass connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Scalability 379
Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
Configuring TCP Optimization in a NetScaler T1000 Cluster . . . . . . . . . . . . . . . . . . 380
Setting Up the Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Distributing Traffic Across Cluster Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
Configuring VLAN and IP Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Configuring TCP Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Configuring Dynamic Routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Licensing 419
NetScaler appliance in a Private Cloud Managed by Microsoft Windows Azure Pack and
Cisco ACI 465
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Creating a NetScaler appliance Load Balancer in a Plan in the Service Management Portal
(Admin Portal) 466
Configuring a NetScaler appliance Load Balancer by Using the Service Management Portal
(Tenant Portal) 467
Configure VPX instances to use single root I/O virtualization (SR-IOV) network interfaces 476
Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Assign SR-IOV VFs to the VPX instance by using the XenServer host . . . . . . . . . . . . . . 477
Unassign SR-IOV VFs to the VPX instance by using the XenServer host . . . . . . . . . . . . . 478
Configuring VLAN on the SR-IOV Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Configure VLAN on the SR-IOV interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Migrating the NetScaler VPX from E1000 to SR-IOV or VMXNET3 Network Interfaces 491
Configure a NetScaler VPX instance to use PCI passthrough network interface 492
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Configure passthrough devices on a host . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
Configure passthrough devices on a NetScaler VPX instance . . . . . . . . . . . . . . . . . . 493
Provision the NetScaler VPX instance by using the Virtual Machine Manager 510
Check prerequisites for auto-provisioning a NetScaler VPX instance . . . . . . . . . . . . . . 511
Provision the NetScaler VPX instance by using a RAW image . . . . . . . . . . . . . . . . . . 512
Provision the NetScaler VPX instance by using a QCOW2 image . . . . . . . . . . . . . . . . 513
Enable auto-provisioning by attaching a CDROM drive . . . . . . . . . . . . . . . . . . . . . 513
Add additional interfaces to the NetScaler VPX instance by using Virtual Machine Manager . 513
Configure a NetScaler VPX instance to use PCI passthrough network interfaces 519
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Provision the NetScaler VPX instance by using the virsh program 520
Add additional interfaces to NetScaler VPX instance using virsh program . . . . . . . . . . . 522
Configure a NetScaler VPX instance on KVM to use OVS DPDK-based host interfaces 530
Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Install DPDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Build and install OVS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Create an OVS bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Attach physical interface to the OVS bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Attach vhost-user ports to the OVS data path . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Provision a KVM-VPX with OVS-DPDK-based vhost-user ports . . . . . . . . . . . . . . . . . 533
Points to note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Prerequisites 545
Configure a high-availability setup with multiple IP addresses and NICs by using Power-
Shell commands 584
Configure HA-INC nodes by using PowerShell Ccmmands . . . . . . . . . . . . . . . . . . . 585
Configure a high-availability setup with a single IP address and a single NIC 597
Before you begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Summary of steps to configure a NetScaler VPX instance in a high-availability Mode . . . . . 598
Configure internal and external load balancers . . . . . . . . . . . . . . . . . . . . . . . . . 598
Configure a health probe on the load balancer . . . . . . . . . . . . . . . . . . . . . . . . . 599
Configure a backend pool on the load balancer . . . . . . . . . . . . . . . . . . . . . . . . . 600
Configure a NAT rule on the load balancer . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
Configure a load balancing rule on the load balancer . . . . . . . . . . . . . . . . . . . . . . 601
Configure NetScaler VPX high availability with the Azure external load balancer . . . . . . . 601
Configure NetScaler VPX high availability with the Azure internal load balancer . . . . . . . 601
Access the NetScaler VPX instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Configure multiple IP addresses for a NetScaler VPX instance in standalone mode by using
PowerShell commands 617
Use case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
Configure multiple Azure VIPs for a standalone or high availability VPX instance 624
Deploy a NetScaler VPX in standalone mode . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Deploying NetScaler VPX in High Availability Mode . . . . . . . . . . . . . . . . . . . . . . . 631
Azure ARM components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
Licensing 661
Troubleshooting 686
Resources for troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
Troubleshooting issues related to the installation, upgrade, and downgrade processes . . . 686
FAQs 690
To configure and bind session policies by using the configuration utility . . . . . . . . . . . 744
Prerequisites 777
To create a server and service by using the command line . . . . . . . . . . . . . . . . . . . 777
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
To create a traffic management virtual server by using the command line . . . . . . . . . . 778
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
To create an authentication virtual server by using the command line . . . . . . . . . . . . 779
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
To configure a traffic management virtual server to use an authentication profile . . . . . . 780
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
AppExpert 841
Viewing AppExpert Applications and Configuring Entities by Using the Application Visualizer880
Configuring services, service groups, and load balancing Parameters for an application unit 914
Viewing AppExpert Applications and Configuring Entities by Using the Application Visualizer925
AppQoE 926
Use Case: ESI Support for Fetching and Updating Content Dynamically 966
Enabling Rewrite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 966
Creating an HTTP Callout on the NetScaler Appliance . . . . . . . . . . . . . . . . . . . . . 966
Configuring the rewrite action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 967
Creating the rewrite policy and binding it globally . . . . . . . . . . . . . . . . . . . . . . . 967
How string matching works with pattern sets and data sets 978
Variables 984
Variables Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
Advanced policy expressions: working with dates, times, and numbers 1108
Generate the day of the week, as a string, in short and long formats 1124
Expression prefixes for numeric data other than date and time 1125
Advanced policy expressions: Parsing HTTP, TCP, and UDP data 1128
Expressions for HTTP status codes and numeric HTTP payload data other than dates 1153
Operations for HTTP, HTML, and XML encoding and “safe” characters 1167
Expressions for evaluating a DNS message and identifying its carrier protocol 1174
Advanced policy expressions: IP and MAC addresses, throughput, VLAN IDs 1187
Expressions for IP Addresses and IP Subnets . . . . . . . . . . . . . . . . . . . . . . . . . . 1187
Expressions for MAC addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1192
Expressions for Numeric Client and Server Data . . . . . . . . . . . . . . . . . . . . . . . . 1193
Responder 1284
Comparison between Rewrite and Responder options . . . . . . . . . . . . . . . . . . . . . 1285
Troubleshooting 1307
Resources for Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1308
Troubleshooting Responder Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1308
Rewrite 1309
Comparison between Rewrite and Responder options . . . . . . . . . . . . . . . . . . . . . 1310
AppFlow 1385
How AppFlow Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1385
Introduction 1415
Signatures 1450
Protection options for your application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1451
Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1452
Highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1452
Using the command line to configure the XML SQL Injection Check . . . . . . . . . . . . . . 1576
Using the GUI to configure the XMLSQL injection security check . . . . . . . . . . . . . . . . 1577
Using the log feature with the XML SQL injection check . . . . . . . . . . . . . . . . . . . . 1579
Statistics for the XML SQL injection violations . . . . . . . . . . . . . . . . . . . . . . . . . . 1580
Profiles 1592
Built-in profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593
User-defined profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593
Exporting and importing App Firewall profiles with the GUI . . . . . . . . . . . . . . . . . . 1603
Highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1604
Debugging tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1604
Policies 1619
Imports 1634
HTML error object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1634
XML error object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1636
XML Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1636
WSDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1637
Appendices 1666
Memory 1681
Checking allocated and used memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1683
Learning 1684
Signatures 1686
Getting started with signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1686
Tips for using signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1686
Best practices for using signatures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1687
Miscellaneous 1688
References 1689
Disable the use the proxy port setting for transparent caching 1717
View the statistics of a cache redirection virtual server by using the monitoring and dash-
board utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741
Clustering 1759
Removing a node from a cluster deployed using cluster link aggregation 1827
To remove a node from a cluster that uses cluster link aggregation as the traffic distribution
mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1827
Monitoring cluster setup using SNMP MIB with SNMP link 1830
Configuring SNMP MIB on CLIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1830
Monitor static route (MSR) support for inactive nodes in a spotted cluster configuration 1843
Common interfaces for client and server and dedicated interfaces for backplane 1856
Common switch for client and server and dedicated switch for backplane 1860
FAQs 1875
Troubleshooting 1935
Resources for Troubleshooting Content Switching . . . . . . . . . . . . . . . . . . . . . . . 1935
Troubleshooting Content Switching Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . 1936
DataStream 1937
How DataStream Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1938
To reset the password of a database user by using the command line interface . . . . . . . . 1939
To reset the password of database users by using the configuration utility . . . . . . . . . . 1940
To remove a database user by using the configuration utility . . . . . . . . . . . . . . . 1940
Use Case 2: Configuring the Token Method of Load Balancing for DataStream 1949
To configure this example by using the command line interface . . . . . . . . . . . . . . . . 1950
To configure this example by using the configuration utility . . . . . . . . . . . . . . . . . . 1950
Cache EDNS0 client subnet data when the NetScaler appliance is in proxy mode 2021
Enable caching of ECS responses by using the CLI . . . . . . . . . . . . . . . . . . . . . . . 2022
Limit the number of subnets that can be cached per domain by using the CLI . . . . . . . . 2022
Configure DNSSEC for a zone for which the NetScaler is a DNS proxy server 2032
Configure DNSSEC for a zone-less DNS proxy server configuration . . . . . . . . . . . . . . 2033
Configure DNSSEC for a partial zone ownership configuration . . . . . . . . . . . . . . . . . 2033
Use case: Deployment of domain name based autoscale service group 2161
Deployment scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2162
Example of a complete parent-child configuration using the metrics exchange protocol 2208
site1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2209
site1_child1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2210
site1_child2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2210
site2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2211
site2_child1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2212
site2_child2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2212
To set the secondary virtual server as the backup virtual server by using the configuration
utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2226
Configure a load balancing method that does not include a policy 2291
To set the load balancing method by using the command line interface . . . . . . . . . . . . 2291
To set the load balancing method by using the configuration utility . . . . . . . . . . . . . . 2292
To designate a vserver as a master vserver by using the command line interface . . . . . . . 2315
To designate a vserver as a master vserver by using the GUI . . . . . . . . . . . . . . . . . . 2315
Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2315
Troubleshooting 2326
Customize the hash algorithm for persistence across virtual servers 2329
To change the use-port-number global setting by using the CLI . . . . . . . . . . . . . . . . 2330
To change the use-port-number global setting by using the GUI . . . . . . . . . . . . . . . . 2330
To create a new service and specify a hash identifier for a service by using the CLI . . . . . . 2330
To specify a hash identifier for an existing service by using the CLI . . . . . . . . . . . . . . 2331
To specify a hash identifier while adding a service group member . . . . . . . . . . . . . . . 2331
To specify a hash identifier for a service by using the GUI . . . . . . . . . . . . . . . . . . . 2332
To specify a hash identifier for an already configured service group member by using the GUI 2332
Configure the MySQL and Microsoft SQL server version setting 2336
To set the Microsoft SQL server version parameter by using the CLI . . . . . . . . . . . . . . 2336
To set the MySQL server version parameter by using the CLI . . . . . . . . . . . . . . . . . . 2337
To set the MySQL or Microsoft SQL server version parameter by using the GUI . . . . . . . . 2337
Insert IP address and port of a virtual server in the request header 2385
To insert the IP address and port of the virtual server in the client requests by using the CLI 2385
To insert the IP address and port of the virtual server in the client requests by using the GUI 2385
To set a time-out value for idle client connections by using the GUI . . . . . . . . . . . . . . 2393
Use a source port from a specified port range for backend communication 2397
To specify a source port range or ranges by using the CLI . . . . . . . . . . . . . . . . . . . . 2398
To specify a source port range or ranges by using the GUI . . . . . . . . . . . . . . . . . . . 2398
Use IPv6 link local addresses on server side of a load balancing setup 2400
Gradually stepping up the load on a new service with virtual server–level slow start 2402
Manual slow start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2403
Automated slow start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2405
Set the slow start parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2407
Use source IP address of the client when connecting to the server 2426
To enable USIP mode for a service by using the CLI . . . . . . . . . . . . . . . . . . . . . . . 2426
To enable USIP mode for a service by using the GUI . . . . . . . . . . . . . . . . . . . . . . 2426
Configure automatic state transition based on percentage health of bound services 2436
To configure percentage based automatic state transition by using the CLI . . . . . . . . . . 2436
To configure percentage based automatic state transition by using the GUI . . . . . . . . . . 2436
To enable the ENTITY-STATE alarm by using the CLI . . . . . . . . . . . . . . . . . . . . . . 2436
To enable the ENTITY-STATE alarm by using the GUI . . . . . . . . . . . . . . . . . . . . . . 2437
To specify the validate credentials option on an XD-DDC monitor by using the command line
interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2459
To configure an XD-DDC monitor with the validate credentials option by using the configu-
ration utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2460
Ignore the upper limit on client connections for monitor probes 2489
To set the Skip MaxClients for Monitor Connections option by using the command line interface2490
To set the Skip MaxClients for Monitor Connections option by using the configuration utility 2490
Use case 2: Configure rule based persistence based on a name-value pair in a TCP byte stream2537
Use case 3: Configure load balancing in direct server return mode 2540
To configure the load balancing method and redirection mode for a sessionless virtual
server by using the command line interface . . . . . . . . . . . . . . . . . . . . . . . . 2541
To configure the load balancing method and redirection mode for a sessionless virtual
server by using the configuration utility . . . . . . . . . . . . . . . . . . . . . . . . . . 2542
To configure a service to use source IP address by using the command line interface . . . . 2542
To configure a service to use source IP address by using the configuration utility . . . . . . . 2542
Use case 6: Configure load balancing in DSR mode for IPv6 networks by using the TOS field 2549
To configure load balancing in DSR Mode using TOS, perform the following steps on the ap-
pliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2550
To configure load balancing in DSR Mode using TOS by using the command line interface . . 2550
To enable USIP mode by using the configuration utility . . . . . . . . . . . . . . . . . . . . 2551
To create services by using the configuration utility . . . . . . . . . . . . . . . . . . . . . . 2551
To create a load balancing virtual server and bind services by using the configuration utility 2551
Use case 7: Configure load balancing in DSR mode by using IP Over IP 2551
Configure a load balancing virtual server . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2552
Configure services for IP over IP DSR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2553
Using the Client IP address in the Outer Header of Tunnel Packets . . . . . . . . . . . . . . 2554
Decapsulator configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2555
Use case 10: Load balancing of intrusion detection system servers 2558
To enable MAC-based forwarding by using the command line interface . . . . . . . . . . . . 2559
To enable MAC-based forwarding by using the configuration utility . . . . . . . . . . . . . . 2560
To configure LB method and redirection mode for a sessionless virtual server by using the
command line interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2560
To configure LB method and redirection mode for a sessionless virtual server by using the
configuration utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2560
To set a service to use source IP address by using the command line interface . . . . . . . . 2560
To set a service to use source IP address by using the configuration utility . . . . . . . . . . 2561
Use case 11: Isolating network traffic using listen policies 2561
How network paths are isolated . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2562
Configuration Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2563
Use case 14: ShareFile wizard for load balancing Citrix ShareFile 2570
To configure a NetScaler appliance for load balancing Citrix ShareFile . . . . . . . . . . . . 2571
Troubleshooting 2572
Resources for Troubleshooting Load Balancing . . . . . . . . . . . . . . . . . . . . . . . . . 2572
Troubleshooting Load Balancing Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2573
Networking 2580
IP Addressing 2581
INAT 2605
Configure INAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2606
DNS64 2614
Points to Consider for a DNS64 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 2616
Configuration Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2617
RNAT 2624
Before you begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2625
Configure RNAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2625
Monitor RNAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2627
Configure RNAT6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2628
Monitor RNAT6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2629
Log Start Time and Connection Closure Reasons in RNAT Log Entries . . . . . . . . . . . . . 2630
Stateful Connection Failover for RNAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2631
Removing RNAT Sessions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2632
IP Tunnels 2642
Configure IP Tunnels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2643
Customizing IP Tunnels Globally . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2643
GRE Payload Options in a GRE IP Tunnel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2645
IPv6 Traffic through GRE IPV4 Tunnels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2646
Send Response Traffic Through an IP-IP Tunnel . . . . . . . . . . . . . . . . . . . . . . . . . 2647
Interfaces 2649
Monitor the Bridge Table and Changing the Aging time 2689
Use Case 3 – Coexistence of Jumbo and Non-Jumbo flows on the Same Set of Interfaces 2721
Configuration Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2724
IP Routing 2745
VXLAN 2824
How VXLANs Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2824
VXLAN Use Case: Load Balancing across Datacenters . . . . . . . . . . . . . . . . . . . . . . 2825
Points to Consider for Configuring VXLANs . . . . . . . . . . . . . . . . . . . . . . . . . . . 2828
Configuration Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2828
Support of IPv6 Dynamic Routing Protocols on VXLANs . . . . . . . . . . . . . . . . . . . . 2830
Extending VLANs from Multiple Enterprises to a Cloud using VXLAN-VLAN Maps . . . . . . . 2831
Variables 2837
Global variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2838
Local variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2838
Expressions 2838
Arithmetic operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2839
Relational operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2839
Logical operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2840
Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2840
Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2841
Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2841
Assignment 2842
Tables 2842
Table constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843
Table usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843
Table as arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2844
Tables as records . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2844
Functions 2849
Protocol behavior callback functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2849
Policy extension functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2850
Local function definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851
Function body and return . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851
Function calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2852
Iterator functions and generic for loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2852
Protocol extensions - traffic pipeline for user defined TCP client and server behaviors 2867
Add a custom protocol by using protocol extensions . . . . . . . . . . . . . . . . . . . . . . 2867
Tutorial – Add MQTT protocol to the NetScaler appliance by using protocol extensions 2873
Optimization 2908
Troubleshooting 3001
Resources for troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3001
Reputation 3016
IP reputation 3017
Using the Command Line to Configure the IP Reputation Feature . . . . . . . . . . . . . . . 3020
Using the GUI to Configure the IP Reputation Feature . . . . . . . . . . . . . . . . . . . . . 3022
Highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3023
Debugging Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3023
Diffie-Hellman (DH) parameters generation and achieving PFS with DHE 3143
Generate DH parameters by using the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3143
Generate DH parameters by using the GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3144
Achieve perfect forward secrecy with DHE . . . . . . . . . . . . . . . . . . . . . . . . . . . 3144
Optimize DH parameters generation by using the CLI . . . . . . . . . . . . . . . . . . . . . . 3144
Optimize DH parameters generation by using the GUI . . . . . . . . . . . . . . . . . . . . . 3144
Limitations 3220
Terminology 3220
Provision a new instance or modify an existing instance and assign a partition 3222
Provision a new instance or modify an existing instance . . . . . . . . . . . . . . . . . . . . 3223
Configure the HSM for an instance on an SDX 14030/14060/14080 FIPS appliance 3223
Initialize the FIPS card . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3224
Initialize the FIPS card by using the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3224
Create a FIPS key for an instance on an SDX 14030/14060/14080 FIPS appliance 3226
Create a FIPS key by using the CLI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3227
Prerequisites 3232
Limitations 3248
Appendix 3249
Prerequisites 3252
Limitations 3262
Appendix 3263
Run the script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3263
Create a certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3263
FAQ 3266
Troubleshooting 3266
Resources for troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3267
Troubleshooting SSL issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3267
Decrypting TLS1.3 traffic from packet trace . . . . . . . . . . . . . . . . . . . . . . . . . . . 3267
Security 3288
Troubleshooting 3303
Resources for troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3303
Troubleshooting content filtering issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3303
Bind the monitor and policy to the service by using the GUI . . . . . . . . . . . . . . . . . . 3315
SureConnect 3324
System 3355
SNMP 3421
Configuring a CloudBridge Connector tunnel between a datacenter and Azure cloud 3536
How CloudBridge Connector tunnel works . . . . . . . . . . . . . . . . . . . . . . . . . . . 3536
Example of CloudBridge Connector tunnel configuration and data flow . . . . . . . . . . . . 3537
Points to consider for a CloudBridge Connector tunnel configuration . . . . . . . . . . . . . 3538
Configuring the CloudBridge Connector tunnel . . . . . . . . . . . . . . . . . . . . . . . . . 3539
Monitoring the CloudBridge Connector tunnel . . . . . . . . . . . . . . . . . . . . . . . . . 3545
Configuring a CloudBridge Connector tunnel between a NetScaler appliance and Cisco IOS
device 3547
Example of CloudBridge Connector tunnel configuration and data flow . . . . . . . . . . . . 3547
Points to Consider for a CloudBridge Connector tunnel configuration . . . . . . . . . . . . . 3548
Configuring Cisco IOS device for the CloudBridge Connector tunnel . . . . . . . . . . . . . . 3549
Configuring the NetScaler appliance for the CloudBridge Connector tunnel . . . . . . . . . 3554
Monitoring the CloudBridge Connector Tunnel . . . . . . . . . . . . . . . . . . . . . . . . . 3557
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Release notes describe how the software has changed in a particular build, and the issues known to
exist in that build.
The release notes document includes all or some of the following sections:
• What’s New: The enhancements and other changes released in the build.
• Fixed Issues: The issues that are fixed in the build.
• Known Issues: The issues that exist in the build.
• Points to Note: The important aspects to keep in mind while using the build.
• Limitations: The limitations that exist in the build.
Note
• The [# XXXXXX] labels under the issue descriptions are internal tracking IDs used by the
NetScaler team.
• These release notes do not document security related fixes. For a list of security related
fixes and advisories, see the Citrix security bulletin.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Intended for system and network administrators who install and configure complex networking equip-
ment, this section of the library describes initial set-up and basic configuration of the NetScaler.
The NetScaler product is an application switch that performs application-specific traffic analysis to
intelligently distribute, optimize, and secure Layer 4-Layer 7 (L4–L7) network traffic for web applica-
tions. For example, a NetScaler bases load balancing decisions on individual HTTP requests instead
of on long-lived TCP connections, so that the failure or slowdown of a server is managed much more
quickly and with less disruption to clients. The ADC feature set can be broadly categorized as consist-
ing of switching features, security and protection features, and server-farm optimization features.
Switching features
When deployed in front of application servers, a NetScaler ensures optimal distribution of traffic by
the way in which it directs client requests. Administrators can segment application traffic according
to information in the body of an HTTP or TCP request, and on the basis of L4–L7 header information
such as URL, application data type, or cookie. Numerous load balancing algorithms and extensive
server health checks improve application availability by ensuring that client requests are directed to
the appropriate servers.
The NetScaler security and protection features protect web applications from Application Layer
attacks. An ADC appliance allows legitimate client requests and can block malicious requests.
It provides built-in defenses against denial-of-service (DoS) attacks and supports features that
protect against legitimate surges in application traffic that would otherwise overwhelm the servers.
An available built-in firewall protects web applications from Application Layer attacks, including
buffer overflow exploits, SQL injection attempts, cross-site scripting attacks, and more. In addition,
the firewall provides identity theft protection by securing confidential corporate information and
sensitive customer data.
Optimization features
Optimization features offload resource-intensive operations, such as Secure Sockets Layer (SSL) pro-
cessing, data compression, client keep-alive, TCP buffering, and the caching of static and dynamic
content from servers. This improves the performance of the servers in the server farm and therefore
speeds up applications. An ADC appliance supports several transparent TCP optimizations, which
mitigate problems caused by high latency and congested network links, accelerating the delivery of
applications while requiring no configuration changes to clients or servers.
A policy defines specific details of traffic filtering and management on a NetScaler. It consists of two
parts: the expression and the action. The expression defines the types of requests that the policy
matches. The action tells the ADC appliance what to do when a request matches the expression. As an
example, the expression might be to match a specific URL pattern to a type of security attack, with the
action being to drop or reset the connection. Each policy has a priority, and the priorities determine
the order in which the policies are evaluated.
When an ADC appliance receives traffic, the appropriate policy list determines how to process the
traffic. Each policy on the list contains one or more expressions, which together define the criteria
that a connection must meet to match the policy.
For all policy types except Rewrite policies, a NetScaler apppliance implements only the first policy
that a request matches, not any additional policies that it might also match. For Rewrite policies,
the ADC appliance evaluates the policies in order and, in the case of multiple matches, performs the
associated actions in that order. Policy priority is important for getting the results you want.
Depending on requirements, you can choose to configure multiple features. For example, you might
choose to configure both compression and SSL offload. As a result, an outgoing packet might be com-
pressed and then encrypted before being sent to the client.
The following figure shows the DataStream packet flow in the NetScaler appliance. DataStream is
supported for MySQL and MS SQL databases.
The following figure shows the DataStream packet flow in the NetScaler appliance. DataStream is sup-
ported for MySQL and MS SQL databases. For information about the DataStream feature, see DataS-
tream.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A NetScaler appliance resides between the clients and the servers, so that client requests and server
responses pass through it. In a typical installation, virtual servers configured on the appliance provide
connection points that clients use to access the applications behind the appliance. In this case, the
appliance owns public IP addresses that are associated with its virtual servers, while the real servers
are isolated in a private network. It is also possible to operate the appliance in a transparent mode as
an L2 bridge or L3 router, or even to combine aspects of these and other modes.
A NetScaler appliance logically residing between clients and servers can be deployed in either of two
physical modes: inline and one-arm. In inline mode, multiple network interfaces are connected to
different Ethernet segments, and the appliance is placed between the clients and the servers. The
appliance has a separate network interface to each client network and a separate network interface
to each server network. The appliance and the servers can exist on different subnets in this configura-
tion. It is possible for the servers to be in a public network and the clients to directly access the servers
through the appliance, with the appliance transparently applying the L4-L7 features. Usually, virtual
servers (described later) are configured to provide an abstraction of the real servers. The following
figure shows a typical inline deployment.
In one-arm mode, only one network interface of the appliance is connected to an Ethernet segment.
The appliance in this case does not isolate the client and server sides of the network, but provides ac-
cess to applications through configured virtual servers. One-arm mode can simplify network changes
needed for NetScaler installation in some environments.
For examples of inline (two-arm) and one-arm deployment, see Understanding Common Network
Topologies.
NetScaler as an L2 device
A NetScaler appliance functioning as an L2 device is said to operate in L2 mode. In L2 mode, the ADC
appliance forwards packets between network interfaces when all of the following conditions are met:
• The packets are destined to another device’s media access control (MAC) address.
By default, all network interfaces are members of a pre-defined VLAN, VLAN 1. Address Resolution
Protocol (ARP) requests and responses are forwarded to all network interfaces that are members of
the same VLAN. To avoid bridging loops, L2 mode must be disabled if another L2 device is working in
parallel with the NetScaler appliance.
For information about how the L2 and L3 modes interact, see Packet forwarding modes.
For information about configuring L2 mode, see the “Enable and disable layer 2 mode” section in
Packet forwarding modes.
A NetScaler appliance can function as a packet forwarding device, and this mode of operation is
called L3 mode. With L3 mode enabled, the appliance forwards any received unicast packets that are
destined for an IP address that does not belong to the appliance, if there is a route to the destination.
The appliance can also route packets between VLANs.
In both modes of operation, L2 and L3, the appliance generally drops packets that are in:
• Multicast frames
• Unknown protocol frames destined for an appliance’s MAC address (non-IP and non-ARP)
• Spanning Tree protocol (unless BridgeBPDUs is ON)
For information about how the L2 and L3 modes interact, see Packet forwarding modes.
For information about configuring the L3 mode, see Packet forwarding modes.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A NetScaler appliance is usually deployed in front of a server farm and functions as a transparent TCP
proxy between clients and servers, without requiring any client-side configuration. This basic mode of
operation is called Request Switching technology and is the core of NetScaler functionality. Request
Switching enables an appliance to multiplex and offload the TCP connections, maintain persistent
connections, and manage traffic at the request (application layer) level. This is possible because the
appliance can separate the HTTP request from the TCP connection on which the request is delivered.
Depending on the configuration, an appliance might process the traffic before forwarding the request
to a server. For example, if the client attempts to access a secure application on the server, the appli-
ance might perform the necessary SSL processing before sending traffic to the server.
To facilitate efficient and secure access to server resources, an appliance uses a set of IP addresses
collectively known as NetScaler-owned IP addresses. To manage your network traffic, you assign
NetScaler-owned IP addresses to virtual entities that become the building blocks of your configura-
tion. For example, to configure load balancing, you create virtual servers to receive client requests
and distribute them to services, which are entities representing the applications on your servers.
To function as a proxy, a NetScaler appliance uses a variety of IP addresses. The key NetScaler-owned
IP addresses are:
The NSIP address is the IP address for management and general system access to the appliance
itself, and for communication between appliances in a high availability configuration.
A VIP address is the IP address associated with a virtual server. It is the public IP address to which
clients connect. An appliance managing a wide range of traffic may have many VIPs configured.
A SNIP address is used in connection management and server monitoring. You can specify mul-
tiple SNIP addresses for each subnet. SNIP addresses can be bound to a VLAN.
• IP Set
An IP set is a set of IP addresses, which are configured on the appliance as SNIP . An IP set is iden-
tified with a meaningful name that helps in identifying the usage of the IP addresses contained
in it.
• Net Profile
A net profile (or network profile) contains an IP address or an IP set. A net profile can be bound to
load balancing or content switching virtual servers, services, service groups, or monitors. Dur-
ing communication with physical servers or peers, the appliance uses the addresses specified
in the profile as source IP addresses.
Because a NetScaler appliance functions as a TCP proxy, it translates IP addresses before sending
packets to a server. When you configure a virtual server, clients connect to a VIP address on the
NetScaler appliance instead of directly connecting to a server. As determined by the settings on the
virtual server, the appliance selects an appropriate server and sends the client’s request to that server.
By default, the appliance uses a SNIP address to establish connections with the server, as shown in
the following figure.
In the absence of a virtual server, when an appliance receives a request, it transparently forwards the
request to the server. This is called the transparent mode of operation. When operating in transparent
mode, an appliance translates the source IP addresses of incoming client requests to the SNIP address
but does not change the destination IP address. For this mode to work, L2 or L3 mode has to be
configured appropriately.
For cases in which the servers need the actual client IP address, the appliance can be configured to
modify the HTTP header by inserting the client IP address as an additional field, or configured to use
the client IP address instead of a SNIP address for connections to the servers.
The configuration of a NetScaler appliance is typically built up with a series of virtual entities that serve
as building blocks for traffic management. The building block approach helps separate traffic flows.
Virtual entities are abstractions, typically representing IP addresses, ports, and protocol handlers for
processing traffic. Clients access applications and resources through these virtual entities. The most
commonly used entities are virtual servers and services. Virtual servers represent groups of servers
in a server farm or remote network, and services represent specific applications on each server.
Most features and traffic settings are enabled through virtual entities. For example, you can configure
an appliance to compress all server responses to a client that is connected to the server farm through
a particular virtual server. To configure the appliance for a particular environment, you need to iden-
tify the appropriate features and then choose the right mix of virtual entities to deliver them. Most
features are delivered through a cascade of virtual entities that are bound to each other. In this case,
the virtual entities are like blocks being assembled into the final structure of a delivered application.
You can add, remove, modify, bind, enable, and disable the virtual entities to configure the features.
The following figure shows the concepts covered in this section.
In the example shown in the following figure, the NetScaler appliance is configured to function as a
load balancer. For this configuration, you need to configure virtual entities specific to load balancing
and bind them in a specific order. As a load balancer, an appliance distributes client requests across
several servers and thus optimizes the utilization of resources.
The basic building blocks of a typical load balancing configuration are services and load balancing
virtual servers. The services represent the applications on the servers. The virtual servers abstract the
servers by providing a single IP address to which the clients connect. To ensure that client requests
are sent to a server, you need to bind each service to a virtual server. That is, you must create services
for every server and bind the services to a virtual server. Clients use the VIP address to connect to
a NetScaler appliance. When the appliance receives client requests sent to the VIP address, it sends
them to a server determined by the load balancing algorithm. Load balancing uses a virtual entity
called a monitor to track whether a specific configured service (server plus application) is available to
receive requests.
In addition to configuring the load balancing algorithm, you can configure several parameters that af-
fect the behavior and performance of the load balancing configuration. For example, you can config-
ure the virtual server to maintain persistence based on source IP address. The appliance then directs
all requests from any specific IP address to the same server.
A virtual server is a named NetScaler entity that external clients can use to access applications hosted
on the servers. It is represented by an alphanumeric name, virtual IP (VIP) address, port, and protocol.
The name of the virtual server is of only local significance and is designed to make the virtual server
easier to identify. When a client attempts to access applications on a server, it sends a request to the
VIP instead of the IP address of the physical server. When the appliance receives a request at the VIP
address, it terminates the connection at the virtual server and uses its own connection with the server
on behalf of the client. The port and protocol settings of the virtual server determine the applications
that the virtual server represents. For example, a web server can be represented by a virtual server
and a service whose port and protocol are set to 80 and HTTP, respectively. Multiple virtual servers
can use the same VIP address but different protocols and ports.
Virtual servers are points for delivering features. Most features, like compression, caching, and SSL
offload, are normally enabled on a virtual server. When the appliance receives a request at a VIP ad-
dress, it chooses the appropriate virtual server by the port on which the request was received and its
protocol. The appliance then processes the request as appropriate for the features configured on the
virtual server.
In most cases, virtual servers work in tandem with services. You can bind multiple services to a vir-
tual server. These services represent the applications running on physical servers in a server farm.
After the appliance processes requests received at a VIP address, it forwards them to the servers as
determined by the load balancing algorithm configured on the virtual server. The following figure
illustrates these concepts.
Figure 4. Multiple Virtual Servers with a Single VIP Address
The preceding figure shows a configuration consisting of two virtual servers with a common VIP ad-
dress but different ports and protocols. Each of the virtual servers has two services bound to it. The
services s1 and s2 are bound to VS_HTTP and represent the HTTP applications on Server 1 and Server
2. The services s3 and s4 are bound to VS_SSL and represent the SSL applications on Server 2 and
Server 3 (Server 2 provides both HTTP and SSL applications). When the appliance receives an HTTP
request at the VIP address, it processes the request as specified by the settings of VS_HTTP and sends
it to either Server 1 or Server 2. Similarly, when the appliance receives an HTTPS request at the VIP
address, it processes it as specified by the settings of VS_SSL and it sends it to either Server 2 or Server
3.
Virtual servers are not always represented by specific IP addresses, port numbers, or protocols. They
can be represented by wildcards, in which case they are known as wildcard virtual servers. For ex-
ample, when you configure a virtual server with a wildcard instead of a VIP, but with a specific port
number, the appliance intercepts and processes all traffic conforming to that protocol and destined
for the predefined port. For virtual servers with wildcards instead of VIPs and port numbers, the ap-
pliance intercepts and processes all traffic conforming to the protocol.
Virtual servers can be grouped into the following categories:
• Load balancing virtual server
Receives and redirects requests to an appropriate server. Choice of the appropriate server is
based on which of the various load balancing methods the user configures.
• Cache redirection virtual server
Redirects client requests for dynamic content to origin servers, and requests for static content to
cache servers. Cache redirection virtual servers often work in conjunction with load balancing
virtual servers.
• Content switching virtual server
Directs traffic to a server on the basis of the content that the client has requested. For example,
you can create a content switching virtual server that directs all client requests for images to a
server that serves images only. Content switching virtual servers often work in conjunction with
load balancing virtual servers.
• Virtual private network (VPN) virtual server
Decrypts tunneled traffic and sends it to intranet applications.
Receives and decrypts SSL traffic, and then redirects to an appropriate server. Choosing the
appropriate server is similar to choosing a load balancing virtual server.
Understanding services
Services represent applications on a server. While services are normally combined with virtual
servers, in the absence of a virtual server, a service can still manage application-specific traffic.
For example, you can create an HTTP service on a NetScaler appliance to represent a web server
application. When the client attempts to access a web site hosted on the web server, the appliance
intercepts the HTTP requests and creates a transparent connection with the web server.
In service-only mode, an appliance functions as a proxy. It terminates client connections, uses a SNIP
address to establish a connection to the server, and translates the source IP addresses of incoming
client requests to a SNIP address. Although the clients send requests directly to the IP address of
the server, the server sees them as coming from the SNIP address. The appliance translates the IP
addresses, port numbers, and sequence numbers.
A service is also a point for applying features. Consider the example of SSL acceleration. To use this
feature, you must create an SSL service and bind an SSL certificate to the service. When the appliance
receives an HTTPS request, it decrypts the traffic and sends it, in clear text, to the server. Only a limited
set of features can be configured in the service-only case.
Services use entities called monitors to track the health of applications. Every service has a default
monitor, which is based on the service type, bound to it. As specified by the settings configured on
the monitor, the appliance sends probes to the application at regular intervals to determine its state.
If the probes fail, the appliance marks the service as down. In such cases, the appliance responds
to client requests with an appropriate error message or re-routes the request as determined by the
configured load balancing policies.
1.
2. Citrix ADC
3. NetScaler 12.0
January 3, 2019
Contributed by:
C
The NetScaler product line optimizes delivery of applications over the internet and private networks,
combining application-level security, optimization, and traffic management into a single, integrated
appliance. You can install a NetScaler appliance in your server room and route all connections to your
managed servers through it. The NetScaler features that you enable and the policies you set are then
applied to incoming and outgoing traffic.
A NetScaler appliance can be integrated into any network as a complement to existing load balancers,
servers, caches, and firewalls. It requires no additional client or server side software, and can be con-
figured using the NetScaler web-based GUI and CLI configuration utilities.
NetScaler hardware is available in a variety of platforms that have a range of hardware specifications:
NetScaler Editions
• Standard
• Enterprise
• Platinum
The Standard and Advanced editions have limited features available. Feature licenses are required for
all editions.
For more information about NetScaler software editions, see the NetScaler Editions datasheet.
For information about how to obtain and install licenses, see Licensing.
See the following compatibility matrix tables for all NetScaler hardware platforms and the software
releases supported on these platforms:
Supported browsers
To access the NetScaler GUI, your workstation must have a supported web browser.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
To use the SDX appliance, you must complete the following tasks by following the instructions given
in the resources provided in table. Complete the tasks in the sequence given.
Task
Description
Read the caution and danger information you need to know, before installing the product.
Unpack your appliance and ensure all parts were delivered, prepare the site and rack, and follow basic
electrical safety precautions before you install your new appliance.
Rack mount the appliance, install transceivers (if available), and connect the appliance to the network
and a power source.
Configure the initial settings of the NetScaler appliance by using the GUI or the serial console.
Follow the steps given in the following documentations to complete these tasks:
1.
2. Citrix ADC
3. NetScaler 12.0
Access a NetScaler
Contributed by:
C
A NetScaler appliance has both a command line interface (CLI) and a graphical user interface (GUI).
The GUI includes a configuration utility for configuring the appliance and a statistical utility, called
Dashboard. For initial access, all appliances ship with the default NetScaler IP address (NSIP) of
192.168.100.1 and default subnet mask of 255.255.0.0. You can assign a new NSIP and an associated
subnet mask during initial configuration.
If you encounter an IP address conflict when deploying multiple NetScaler units, check for the follow-
ing possible causes:
• Did you select an NSIP that is an IP address already assigned to another device on your network?
• Did you assign the same NSIP to multiple NetScaler appliances?
• The NSIP is reachable on all physical ports. The ports on a NetScaler are host ports, not switch
ports.
CLI Console N
CLI and GUI Ethernet Y
You can access the CLI either locally, by connecting a workstation to the console port, or remotely, by
connecting through secure shell (SSH) from any workstation on the same network.
The appliance has a console port for connecting to a computer workstation. To log on to the appliance,
you need a serial crossover cable and a workstation with a terminal emulation program.
To log on to the CLI through the console port, follow these steps:
1. Connect the console port to a serial port on the workstation. For more information, see Connect
the console cable.
2. On the workstation, start HyperTerminal or any other terminal emulation program. If the lo-
gon prompt does not appear, you may need to press ENTER one or more times to display it.
3. Log on by using the administrator credentials. The command prompt (>) appears on the work-
station monitor.
The SSH protocol is the preferred remote access method for accessing an appliance remotely from any
workstation on the same network. You can use either SSH version 1 (SSH1) or SSH version 2 (SSH2.)
If you do not have a working SSH client, you can download and install any of the following SSH client
programs:
• PuTTY
“http://www.chiark.greenend.org.uk/~sgtatham/putty/”
“http://www.vandyke.com/products/securecrt/”
These programs have been tested by the Citrix NetScaler team, which has verified that they work cor-
rectly with a NetScaler appliance. Other programs may also work correctly, but have not been tested.
To verify that the SSH client is installed properly, use it to connect to any device on your network that
accepts SSH connections.
1 login as: nsroot
2
3
4 Using keyboard-interactive authentication.
5
6
7 Password:
8
9
10 Last login: Tue Jun 16 10:37:28 2009 from 10.102.29.9
11
12
13
14
15
16 Done
17
18
19 >
NetScaler GUI
Important
A certificate-key pair is required for HTTPS access to the Citric ADC GUI. On the ADC, a certificate-
key pair is automatically bound to the internal services. On an MPX or SDX appliance, the default
key size is 1024 bytes, and on a VPX instance, the default key size is 512 bytes. However, most
browsers today do not accept a key that is less than 1024 bytes. As a result, HTTPS access to the
VPX configuration utility is blocked.
Additionally, if a license is not present on an MPX appliance when it starts, and you add a license later
and restart the appliance, you might lose the certificate binding.
Citrix recommends that you install a certificate-key pair of at least 1024 bytes on a NetScaler for HTTPS
access to the GUI, and that you install an appropriate license before starting the ADC.
The graphical user interface includes a configuration utility and a statistical utility, called Dashboard,
either of which you access through a workstation connected to an Ethernet port on the appliance.
The system requirements for the workstation running the GUI are as follows:
Your workstation must have a supported web browser to access the configuration utility and Dash-
board.
Operating System:
Windows 7
Browser: Internet Explorer (version 9, 10, and 11), Mozilla Firefox (version 3.6.25 and above), Google
Chrome (latest).
Operating System:
Windows 64 bit
Browser: Internet Explorer (version 8, 9, 10, and 11), Google Chrome (version latest)
Operating System:
MAC
Browser: Mozilla Firefox (version 3.6.25 and above), Safari (version 5.1.3 and above), Google Chrome
(version latest)
Once you log on to the configuration utility, you can configure the appliance through a graphical in-
terface that includes context-sensitive help.
1. Open your web browser and enter the NetScaler IP (NSIP) as an HTTP address. If you have not
yet set up the initial configuration, enter the default NSIP (http://192.168.100.1). The Citrix Lo-
gon page appears.
Note: If you have two NetScaler appliances in a high availability setup, make sure that you do
not access the GUI by entering the IP address of the secondary NetScaler appliance. If you do
so and use the GUI to configure the secondary appliance, your configuration changes will not
be applied to the primary NetScaler appliance.
3. In the Password text box, type the administrative password you assigned to the nsroot account
during initial configuration and click Login. The Configuration Utility page appears.
If you need to access the online help, select Help from the Help menu at the top right corner.
Dashboard, the statistical utility, is a browser-based application that displays charts and tables on
which you can monitor the performance of a NetScaler appliance.
1. Open your web browser and enter the NSIP as an HTTP address. The Citrix Logon page appears.
2. In the User Name text box, type nsroot.
3. In the Password text box, type the administrative password you assigned to the nsroot account
during initial configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
For initial configuration of a NetScaler MPX appliance, see Initial Configuration of a Citrix MPX appli-
ance.
For initial configuration of a Citrix SDX appliance, see Initial Configuration of a Citrix SDX appliance.
NITRO API
You can use the NITRO API to configure the NetScaler appliance. NITRO exposes its functionality
through Representational State Transfer (REST) interfaces. Therefore, NITRO applications can be de-
veloped in any programming language. Additionally, for applications that must be developed in Java
or .NET or Python, NITRO APIs are exposed through relevant libraries that are packaged as separate
Software Development Kits (SDKs). For more information, see NITRO API.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can deploy two NetScaler appliances in a high availability configuration, where one unit actively
accepts connections and manages servers while the secondary unit monitors the first. The NetScaler
appliance that is actively accepting connections and managing the servers is called a primary unit and
the other one is called a secondary unit in a high availability configuration. If there is a failure in the
primary unit, the secondary unit becomes the primary and begins actively accepting connections.
Each NetScaler appliance in a high availability pair monitors the other by sending periodic messages,
called heartbeat messages or health checks, to determine the health or state of the peer node. If
a health check for a primary unit fails, the secondary unit retries the connection for a specific time
period. For more information about high availability, see High Availability. If a retry does not succeed
by the end of the specified time period, the secondary unit takes over for the primary unit in a process
called failover. The following figure shows two high availability configurations, one in one-arm mode
and the other in two-arm mode.
In one-arm configuration, both NS1 and NS2 and servers S1, S2, and S3 are connected to the switch.
In two-arm configuration, both NS1 and NS2 are connected to two switches. The servers S1, S2, and S3
are connected to the second switch. The traffic between client and the servers passes through either
NS1 or NS2.
To set up a high availability environment, configure one ADC appliance as primary and another as
secondary. Perform the following tasks on each of the ADC appliances:
• Add a node.
• Disable high availability monitoring for unused interfaces.
Add a Node
A node is a logical representation of a peer NetScaler appliance. It identifies the peer unit by ID and
NSIP. An appliance uses these parameters to communicate with the peer and track its state. When
you add a node, the primary and secondary units exchange heartbeat messages asynchronously. The
node ID is an integer that must not be greater than 64.
Through CLI
To add a node by using the command line interface, follow these steps:
At the command prompt, type the following commands to add a node and verify that the node has
been added:
Example
Through GUI
Verify that the node you added appears in the list of nodes in the Nodes tab.
The high availability monitor is a virtual entity that monitors an interface. You must disable the moni-
tor for interfaces that are not connected or being used for traffic. When the monitor is enabled on an
interface whose status is DOWN, the state of the node becomes NOT UP. In a high availability configu-
ration, a primary node entering a NOT UP state might cause a high availability failover. An interface is
marked DOWN under the following conditions:
Through CLI
To disable the high availability monitor for an unused interface by using the command line interface,
follow these steps:
At the command prompt, type the following commands to disable the high availability monitor for an
unused interface and verify that it is disabled:
Example
When the high availability monitor is disabled for an unused interface, the output of the show
interface command for that interface does not include “HAMON.”
Through GUI
To disable the high availability monitor for unused interfaces by using the GUI, follow these steps:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A certificate-key pair is required for HTTPS access to the configuration utility and for secure remote
procedure calls. RPC nodes are internal system entities used for system-to-system communication of
configuration and session information. One RPC node exists on each appliance. This node stores the
password, which is checked against the one provided by the contacting appliance. To communicate
with other NetScaler appliances, each appliance requires knowledge of the other appliances, includ-
ing how to authenticate on the other appliance. RPC nodes maintain this information, which includes
the IP addresses of the other NetScaler appliances and the passwords used to authenticate on each.
On a NetScaler MPX appliance virtual appliance, a certificate-key pair is automatically bound to the
internal services. On a FIPS appliance, a certificate-key pair must be imported into the hardware secu-
rity module (HSM) of a FIPS card. To do so, you must configure the FIPS card, create a certificate-key
pair, and bind it to the internal services.
1. Initialize the hardware security module (HSM) on the FIPS card of the appliance. For information
about initializing the HSM, see Configure the HSM.
2. If the appliance is part of a high availability setup, enable the SIM. For information about en-
abling the SIM on the primary and secondary appliances, see “Configure FIPS appliances in a
high availability setup.
3. Import the FIPS key into the HSM of the FIPS card of the appliance. At the command prompt,
type:
5. Bind the certificate-key created in the previous step to the following internal services. At the
command prompt, type:
1. Initialize the hardware security module (HSM) on the FIPS card of the appliance. For information
about initializing the HSM, see Configure the HSM.
2. If the appliance is part of a high availability setup, enable the secure information system (SIM).
For information about enabling the SIM on the primary and secondary appliances, see Config-
ure FIPS appliances in a high availability setup.
3. Import the FIPS key into the HSM of the FIPS card of the appliance. For more information about
importing a FIPS key, see the Import an existing FIPS key section.
10. Select nshttps-127.0.0.1-443 from the list, and then click Open.
11. On the SSL Settings tab, in the Available pane, select the certificate created in step 7, click Add,
and then click OK.
12. Select nshttps-::11-443 from the list, and then click Open.
13. On the SSL Settings tab, in the Available pane, select the certificate created in step 7, click Add,
and then click OK.
1. Initialize the hardware security module (HSM) on the FIPS card of the appliance. For information
about initializing the HSM, see Configure the HSM.
2. Enable the secure information system (SIM). For information about enabling the SIM on the pri-
mary and secondary appliances, see Csee Configure FIPS appliances in a high availability setup.
3. Import the FIPS key into the HSM of the FIPS card of the appliance. At the command prompt,
type:
5. Bind the certificate-key pair to the following internal services. At the command prompt, type:
1. Initialize the hardware security module (HSM) on the FIPS card of the appliance. For information
about initializing the HSM, see Configure the HSM.
2. Enable the secure information system (SIM). For information about enabling the SIM on the pri-
mary and secondary appliances, Configure FIPS appliances in a high availability setup.
3. Import the FIPS key into the HSM of the FIPS card of the appliance. For more information about
importing a FIPS key, the Import an existing FIPS key section.
4. Navigate to Traffic Management > SSL > Certificates.
5. In the details pane, click Install.
6. In the Install Certificate dialog box, type the certificate details.
7. Click Create, and then click Close.
8. Navigate to Traffic Management > Load Balancing > Services.
9. In the details pane, on the Action tab, click Internal Services.
10. Select nsrpcs-127.0.0.1-3008 from the list, and then click Open.
11. On the SSL Settings tab, in the Available pane, select the certificate created in step 7, click Add,
and then click OK.
12. Select nskrpcs-127.0.0.1-3009 from the list, and then click Open.
13. On the SSL Settings tab, in the Available pane, select the certificate created in step 7, click Add,
and then click OK.
14. Select nsrpcs-::11-3008 from the list, and then click Open.
15. On the SSL Settings tab, in the Available pane, select the certificate created in step 7, click Add,
and then click OK.
16. Click OK.
17. Navigate to System > Network > RPC.
18. In the details pane, select the IP address, and click Open.
19. In the Configure RPC Node dialog box, select Secure.
20. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
As described in the “Physical deployment mode” section in Where does a NetScaler appliance fit in the
network?, you can deploy the NetScaler appliance either inline between the clients and servers or in
one-arm mode. Inline mode uses a two-arm topology, which is the most common type of deployment.
In a two-arm topology, one network interface is connected to the client network and another network
interface is connected to the server network, ensuring that all traffic flows through the appliance. This
topology might require you to reconnect your hardware and also might result in a momentary down-
time. The basic variations of two-arm topology are multiple subnets, typically with the appliance on
a public subnet and the servers on a private subnet, and transparent mode, with both the appliance
and the servers on the public network.
One of the most commonly used topologies has the NetScaler appliance inline between the clients
and the servers, with a virtual server configured to handle the client requests. This configuration is
used when the clients and servers reside on different subnets. In most cases, the clients and servers
reside on public and private subnets, respectively.
For example, consider an appliance deployed in two-arm mode for managing servers S1, S2, and S3,
with a virtual server of type HTTP configured on the appliance, and with HTTP services running on the
servers. The servers are on a private subnet and a SNIP is configured on the appliance to communicate
with the servers. The Use SNIP (USNIP) option must be enabled on the appliance so that it uses the
SNIP instead of the MIP.
As shown in the following figure, the VIP is on public subnet 217.60.10.0, and the NSIP, the servers, and
the SNIP are on private subnet 192.168.100.0/24.
To deploy a NetScaler appliance in two-arm mode with multiple subnets, follow these steps:
1. Configure the NSIP and default gateway, as described in Configuring the NetScaler IP Address
(NSIP).
Use transparent mode if the clients need to access the servers directly, with no intervening virtual
server. The server IP addresses must be public because the clients need to be able to access them.
In the example shown in the following figure, a NetScaler appliance is placed between the client and
the server, so the traffic must pass through the appliance. You must enable L2 mode for bridging the
packets. The NSIP and MIP are on the same public subnet, 217.60.10.0/24.
1. Configure the NSIP and default gateway, as described in Configuring the NetScaler IP Address
(NSIP).
2. Enable L2 mode, as described in Enabling and Disabling Layer 2 Mode.
3. Configure the default gateway of the managed servers as the MIP.
4. Connect the network interfaces to the appropriate ports on the switch.
The two basic variations of one-arm topology are with a single subnet and with multiple subnets.
You can use a one-arm topology with a single subnet when the clients and servers reside on the same
subnet. For example, consider a NetScaler appliance deployed in one-arm mode for managing servers
S1, S2, and S3. A virtual server of type HTTP is configured on an ADC appliance, and HTTP services are
running on the servers. As shown in the following figure, the NetScaler IP address (NSIP), the Mapped
IP address (MIP), and the server IP addresses are on the same public subnet, 217.60.10.0/24.
To deploy a NetScaler appliance in one-arm mode with a single subnet, follow these steps:
1. Configure the NSIP and the default gateway, as described in, as described in Configuring the
NetScaler IP Address (NSIP).
2. Configure the virtual server and the services, as described in Creating a Virtual Server section
and Configuring Services section.
You can use a one-arm topology with multiple subnets when the clients and servers reside on the dif-
ferent subnets. For example, consider a NetScaler appliance deployed in one-arm mode for managing
servers S1, S2, and S3, with the servers connected to switch SW1 on the network. A virtual server of
type HTTP is configured on the appliance, and HTTP services are running on the servers. These three
servers are on the private subnet, so a subnet IP address (SNIP) is configured to communicate with
them. The Use Subnet IP address (USNIP) option must be enabled so that the appliance uses the
SNIP instead of a MIP. As shown in the following figure, the virtual IP address (VIP) is on public subnet
217.60.10.0/24; the NSIP, SNIP, and the server IP addresses are on private subnet 192.168.100.0/24.
To deploy a NetScaler appliance in one-arm mode with multiple subnets, follow these steps:
1. Configure the NSIP and the default gateway, as described in Configuring the NetScaler IP Ad-
dress (NSIP).
2. Configure the SNIP and enable the USNIP option, as described in Configuring Subnet IP Ad-
dresses.
3. Configure the virtual server and the services, as described in Creating a Virtual Server section
and Configuring Services section.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Once your initial configuration is in place, you can configure settings to define the behavior of the
NetScaler appliance and facilitate connection management. You have a number of options for han-
dling HTTP requests and responses. Routing, bridging, and MAC based forwarding modes are avail-
able for handling packets not addressed to the NetScaler appliance. You can define the characteristics
of your network interfaces and can aggregate the interfaces. To prevent timing problems, you can syn-
chronize the Citrix clock with a Network Time Protocol (NTP) server. The NetScaler appliance can op-
erate in various DNS modes, including as an authoritative domain name server (ADNS). You can set up
SNMP for system management and customize syslog logging of system events. Before deployment,
verify that your configuration is complete and correct.
1.
2. Citrix ADC
3. NetScaler 12.0
System settings
Contributed by:
C
Configuration of system settings includes basic tasks such as configuring HTTP ports to enable con-
nection keep-alive and server offload, setting the maximum number of connections for each server,
and setting the maximum number of requests per connection. You can enable client IP address inser-
tion for situations in which a proxy IP address is not suitable, and you can change the HTTP cookie
version.
You can also configure a NetScaler appliance to open FTP connections on a controlled range of ports
instead of ephemeral ports for data connections. This improves security, because opening all ports
on the firewall is insecure. You can set the range anywhere from 1,024 to 64,000.
Before deployment, go through the verification checklists to verify your configuration. To configure
HTTP parameters and the FTP port range, use the NetScaler GUI.
You can modify the types of HTTP parameters described in the following table.
Specifies: The web server HTTP ports used by your managed servers. If you specify the ports, the
appliance performs request switching for any client request that has a destination port matching a
specified port.
Note: If an incoming client request is not destined for a service or a virtual server that is specif-
ically configured on the appliance, the destination port in the request must match one of the
globally configured HTTP ports. This allows the appliance to perform connection keep-alive and
server off-load.
Parameter Type: Limits
Specifies: The maximum number of connections to each managed server, and the maximum num-
ber of requests sent over each connection. For example, if you set Max Connections to 500, and the
appliance is managing three servers, it can open a maximum of 500 connections to each of the three
servers. By default, the appliance can create an unlimited number of connections to any of the servers
it manages. To specify an unlimited number of requests per connection, set Max Requests to 0.
Note: If you are using the Apache HTTP server, you must set Max Connections equal to the value
of the MaxClients parameter in the Apache httpd.conf file. Setting this parameter is optional for
other web servers.
Specifies: Enable/disable insertion of the client’s IP address into the HTTP request header. You can
specify a name for the header field in the adjacent text box. When a web server managed by an ap-
pliance receives a mapped IP address or a subnet IP address, the server identifies it as the client’s
IP address. Some applications need the client’s IP address for logging purposes or to dynamically
determine the content to be served by the web server.
You can enable insertion of the actual client IP address into the HTTP header request sent from the
client to one, some, or all servers managed by the appliance. You can then access the inserted ad-
dress through a minor modification to the server (using an Apache module, ISAPI interface, or NSAPI
interface).
Specifies: The HTTP cookie version to use when COOKIEINSERT persistence is configured on a virtual
server. The default, version 0, is the most common type on the Internet. Alternatively, you can specify
version 1.
Specifies: Options for handling certain types of requests, and enable/disable logging of HTTP error
responses.
To set the FTP port range by using the GUI, follow these steps:
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The NetScaler appliance can either route or bridge packets that are not destined for an IP address
owned by the appliance (that is, the IP address is not the NSIP, a MIP, a SNIP, a configured service,
or a configured virtual server). By default, L3 mode (routing) is enabled and L2 mode (bridging) is
disabled, but you can change the configuration. The following flow chart shows how the appliance
evaluates packets and either processes, routes, bridges, or drops them.
An appliance can use the following modes to forward the packets it receives:
Layer 2 mode controls the Layer 2 forwarding (bridging) function. You can use this mode to configure
a NetScaler appliance to behave as a Layer 2 device and bridge the packets that are not destined for
it. When this mode is enabled, packets are not forwarded to any of the MAC addresses, because the
packets can arrive on any interface of the appliance and each interface has its own MAC address.
With Layer 2 mode disabled (which is the default), the appliance drops packets that are not destined
for one of its MAC address. If another Layer 2 device is installed in parallel with the appliance, Layer
2 mode must be disabled to prevent bridging (Layer 2) loops. You can use the configuration utility or
the command line to enable Layer 2 mode.
Note: The appliance does not support spanning tree protocol. To avoid loops, if you enable L2 mode,
do not connect two interfaces on the appliance to the same broadcast domain.
At the command prompt, type the following commands to enable/disable Layer 2 mode and verify
that it has been enabled/disabled:
• enable ns mode <Mode>
• disable ns mode <Mode>
• show ns mode
Examples
> enable ns mode l2
Done
> show ns mode
Mode Acronym Status
——- ——- ——
1) Fast Ramp FR ON
2) Layer 2 mode L2 ON
.
.
.
Done
>
> disable ns mode l2
Done
> show ns mode
Mode Acronym Status
——- ——- ——
1) Fast Ramp FR ON
2) Layer 2 mode L2 OFF
.
.
.
Done
>
Layer 3 mode controls the Layer 3 forwarding function. You can use this mode to configure a NetScaler
appliance to look at its routing table and forward packets that are not destined for it. With Layer 3
mode enabled (which is the default), the appliance performs route table lookups and forwards all
packets that are not destined for any appliance-owned IP address. If you disable Layer 3 mode, the
appliance drops these packets.
At the command prompt, type the following commands to enable/disable Layer 3 mode and verify
that it has been enabled/disabled:
• show ns mode
Examples
.
Done
>
You can use MAC-based forwarding to process traffic more efficiently and avoid multiple-route or ARP
lookups when forwarding packets, because the NetScaler appliance remembers the MAC address of
the source. To avoid multiple lookups, the appliance caches the source MAC address of every connec-
tion for which it performs an ARP lookup, and it returns the data to the same MAC address.
MAC-based forwarding is useful when you use VPN devices because the appliance ensures that all
traffic flowing through a particular VPN passes through the same VPN device.
At the command prompt, type the following commands to enable/disable MAC-based forwarding
mode and verify that it has been enabled/disabled:
• <enable ns mode <Mode>
• <disable ns mode <Mode>
• <show ns mode
Example
“‘ pre codeblock
1.
2. Citrix ADC
3. NetScaler 12.0
Network interfaces
Contributed by:
C
The NetScaler interfaces are numbered in slot/port notation. In addition to modifying the characteris-
tics of individual interfaces, you can configure virtual LANs to restrict traffic to specific groups of hosts.
You can also aggregate links into high-speed channels.
Virtual LANs
The NetScaler appliance supports (Layer 2) port and IEEE802.1Q tagged virtual LANs (VLANs). VLAN
configurations are useful when you need to restrict traffic to certain groups of stations. You can con-
figure a network interface to belong to multiple VLANs by using IEEE 802.1q tagging.
You can bind your configured VLANs to IP subnets. The ADC appliance (if it is configured as the default
router for the hosts on the subnets) then performs IP forwarding between these VLANs.
The NetScaler appliance supports the following types of VLANs.
• Default VLAN
By default, the network interfaces on a NetScaler appliance are included in a single, port-based
VLAN as untagged network interfaces. This default VLAN has a VID of 1 and exists permanently.
It cannot be deleted, and its VID cannot be changed.
• Port-Based VLANs
A set of network interfaces that share a common, exclusive, Layer 2 broadcast domain define
the membership of a port-based VLAN. You can configure multiple port-based VLANs. When
you add an interface to a new VLAN as an untagged member, it is automatically removed from
the default VLAN.
• Tagged VLAN
A network interface can be a tagged or untagged member of a VLAN. Each network interface is an
untagged member of only one VLAN (its native VLAN). The untagged network interface forwards
the frames for the native VLAN as untagged frames. A tagged network interface can be a part
of more than one VLAN. When you configure tagging, be sure that both ends of the link have
matching VLAN settings. You can use the configuration utility to define a tagged VLAN (nsvlan)
that can have any ports bound as tagged members of the VLAN. Configuring this VLAN requires
a reboot of the ADC appliance and therefore must be done during initial network configuration.
Link aggregation combines incoming data from multiple ports into a single high speed link. Configur-
ing the link aggregate channel increases the capacity and availability of the communication channel
between a NetScaler appliance and other connected devices. An aggregated link is also referred to as
a channel.
When a network interface is bound to a channel, the channel parameters have precedence over the
network interface parameters. A network interface can be bound to only one channel. Binding a net-
work interface to a link aggregate channel changes the VLAN configuration. That is, binding network
interfaces to a channel removes them from the VLANs that they originally belonged to and adds them
to the default VLAN. However, you can bind the channel back to the old VLAN, or to a new one. For
example, if you have bound network interfaces 1/2 and 1/3 to a VLAN with ID 2, and then you bind
them to link aggregate channel LA/1, the network interfaces are moved to the default VLAN, but you
can bind them to VLAN 2.
Note: You can also use Link Aggregation Control Protocol (LACP) to configure link aggregation. For
more information, see Configuring Link Aggregation by Using the Link Aggregation Control Protocol.
1.
2. Citrix ADC
3. NetScaler 12.0
Clock synchronization
Contributed by:
C
You can configure your NetScaler appliance to synchronize its local clock with a Network Time Proto-
col (NTP) server. This ensures that its clock has the same date and time settings as the other servers
on your network. NTP uses User Datagram Protocol (UDP) port 123 as its transport layer. You have
to add NTP servers in the NTP configuration file so that the appliance periodically gets updates from
these servers.
If you do not have a local NTP server, you can find a list of public, open access, NTP servers at the
official NTP site at http://www.ntp.org.
2. At the shell prompt, copy the ntp.conf file from the /etc directory to the /nsconfig directory. If
the file already exists in the /nsconfig directory, make sure that you remove the following entries
from the ntp.conf file:
restrict localhost
restrict 127.0.0.2
These entries are required only if you want to run the device as a time server. However, this
feature is not supported on the NetScaler appliance.
3. Edit /nsconfig/ntp.conf by typing the IP address for the desired NTP server under the file’s server
and restrict entries.
4. Create a file named rc.netscaler in the /nsconfig directory, if the file does not already exist in the
directory.
This entry starts the ntpd service, checks the ntp.conf file, and logs messages in the /var/log
directory.
Note: If the time difference between the NetScaler appliance and the time server is more than
1000 sec, the ntpd service terminates with a message to the ADC log. To avoid this, you need to
start ntpd with the
-g option, which forcibly syncs the time. Add the following entry in
/nsconfig/rc.netscaler:
If you do not want to forcibly sync the time when there is a large difference, you can set the date
manually and then start ntpd again. You can check the time difference between the appliance
and the time server by running the following command in the shell:
Note: If you want to start time synchronization before you restart the appliance, enter the fol-
lowing command (which you added to the rc.netscaler file in step 5) at the shell prompt:
1.
2. Citrix ADC
3. NetScaler 12.0
DNS configuration
Contributed by:
C
You can configure a NetScaler appliance to function as an Authoritative Domain Name Server (ADNS),
DNS proxy server, End Resolver, or Forwarder. You can add DNS resource records such as SRV Records,
AAAA Records, A Records, MX Records, NS Records, CNAME Records, PTR Records, and SOA Records.
Also, the appliance can balance the load on external DNS servers.
A common practice is to configure an appliance as a forwarder. For this configuration, you need to
add external name servers. After you have added the external servers, you should verify that your
configuration is correct.
You can add, remove, enable, and disable external name servers. You can create a name server by
specifying its IP address, or you can configure an existing virtual server as the name server.
When adding name servers, you can specify IP addresses or virtual IP addresses (VIPs). If you use
IP addresses, the appliance load balances requests to the configured name servers in a round robin
manner. If you use VIPs, you can specify any load balancing method.
At the command prompt, type the following commands to add a name server and verify the configu-
ration:
Example
“‘ pre codeblock
“‘
1.
2. Citrix ADC
3. NetScaler 12.0
SNMP configuration
January 6, 2019
Contributed by:
C
The Simple Network Management Protocol (SNMP) network management application, running on
an external computer, queries the SNMP agent on the NetScaler appliance. The agent searches the
management information base (MIB) for data requested by the network management application and
sends the data to the application.
SNMP monitoring uses traps messages and alarms. SNMP traps messages are asynchronous events
that the agent generates to signal abnormal conditions, which are indicated by alarms. For example,
if you want to be informed when CPU utilization is above 90 percent, you can set up an alarm for that
condition. The following figure shows a network with a NetScaler appliance that has SNMP enabled
and configured.
The SNMP agent on a NetScaler appliance supports SNMP version 1 (SNMPv1), SNMP version 2 (SN-
MPv2), and SNMP version 3 (SNMPv3). Because it operates in bilingual mode, the agent can handle
SNMPv2 queries, such as Get-Bulk, and SNMPv1 queries. The SNMP agent also sends traps compliant
with SNMPv2 and supports SNMPv2 data types, such as counter64. SNMPv1 managers (programs on
other servers that request SNMP information from the ADC appliance) use the NS-MIB-smiv1.mib file
when processing SNMP queries. SNMPv2 managers use the NS-MIB-smiv2.mib file.
To configure SNMP, you specify which managers can query the SNMP agent, add SNMP trap listeners
that will receive the SNMP trap messages, and configure SNMP Alarms.
You can configure a workstation running a management application that complies with SNMP version
1, 2, or 3 to access an appliance. Such a workstation is called an SNMP manager. If you do not specify
an SNMP manager on the appliance, the appliance accepts and responds to SNMP queries from all IP
addresses on the network. If you configure one or more SNMP managers, the appliance accepts and
responds to SNMP queries from only those specific IP addresses. When specifying the IP address of
an SNMP manager, you can use the netmask parameter to grant access from entire subnets. You can
add a maximum of 100 SNMP managers or networks. To add an SNMP manager by using the CLI
At the command prompt, type the following commands to add an SNMP manager and verify the con-
figuration:
Example:
Done
1) 10.102.29.5 255.255.255.255
Done
>
1. In the navigation pane, expand System, expand SNMP, and then click Managers.
2. In the details pane, click Add.
3. In the Add SNMP Manager dialog box, in the IP Address text box, type the IP address of the
workstation running the management application (for example, 10.102.29.5).
4. Click Create, and then click Close.
5. Verify that the SNMP manager you added appears in the Details section at the bottom of the
pane.
After configuring the alarms, you need to specify the trap listener to which the appliance will send the
trap messages. Apart from specifying parameters like IP address and the destination port of the trap
listener, you can specify the type of trap (either generic or specific) and the SNMP version.
You can configure a maximum of 20 trap listeners for receiving either generic or specific traps.
At the command prompt, type the following command to add an SNMP trap and verify that it has been
added:
Example
1. In the navigation pane, expand System, expand SNMP, and then click Traps.
2. In the details pane, click Add.
3. In the Create SNMP Trap Destination dialog box, in the Destination IP Address text box, type the
IP address (for example, 10.102.29.3).
4. Click Create and then click Close.
5. Verify that the SNMP trap you added appears in the Details section at the bottom of the pane.
You configure alarms so that the appliance generates a trap message when an event corresponding to
one of the alarms occurs. Configuring an alarm consists of enabling the alarm and setting the severity
level at which a trap is generated. There are five severity levels: Critical, Major, Minor, Warning, and
Informational. A trap is sent only when the severity of the alarm matches the severity specified for the
trap.
Some alarms are enabled by default. If you disable an SNMP alarm, the appliance will not generate
trap messages when corresponding events occur. For example, if you disable the Login-Failure SNMP
alarm, the appliance will not generate a trap message when a login failure occurs.
At the command prompt, type the following commands to enable or disable an alarm and verify that
it has been enabled or disabled:
Example
At the command prompt, type the following commands to set the severity of the alarm and verify that
the severity has been set correctly:
Example
1. In the navigation pane, expand System, expand SNMP, and then click Alarms.
2. In the details pane, select an alarm (for example, LOGIN-FAILURE), and then click Open.
3. In the Configure SNMP Alarm dialog box, to enable the alarm, select Enabled in the State drop-
down list. To disable the alarm, select Disabled.
4. In the Severity drop-down list, select a severity option (for example, Major).
5. Click OK, and then click Close.
6. Verify that the parameters for the SNMP alarm you configured are correctly configured by view-
ing the Details section at the bottom of the pane.
1.
2. Citrix ADC
3. NetScaler 12.0
Verify configuration
Contributed by:
C
After you’ve finished configuring your system, complete the following checklists to verify your config-
uration.
Configuration checklist
_________________________________________
• If the NetScaler appliance is in a public-private topology, reverse NAT has been configured.
• The failover (high availability) settings configured on the ADC appliance resolve in a one arm or
two-arm configuration. All unused network interfaces have been disabled:
_________________________________________
• If the ADC appliance is placed behind an external load balancer, then the load balancing policy
on the external load balancer is not “least connection.”
The load balancing policy configured on the external load balancer is:
_________________________________________
• If the ADC appliance is placed in front of a firewall, the session time-out on the firewall is set to
a value greater than or equal to 300 seconds.
Note: The TCP idle connection timeout on a NetScaler appliance is 360 seconds. If the timeout
on the firewall is also set to 300 seconds or more, then the appliance can perform TCP connec-
tion multiplexing effectively because connections will not be closed earlier.
• The default gateway has been set to the correct value. (The default gateway should either be a
NetScaler appliance or upstream router.) The default gateway is:
_________________________________________
• The server port settings (speed, duplex, flow control, monitoring) are the same as the switch
port settings.
_________________________________________
• If the Microsoft® Internet Information Server is used, buffering is enabled on the server.
• If an Apache Server is used, the MaxConn (maximum number of connections) parameter is con-
figured on the server and on the NetScaler appliance.
The MaxConn (maximum number of connections) value that has been set is:
_________________________________________
• If a Netscape Enterprise Server is used, the maximum requests per connection parameter is set
on the NetScaler appliance. The maximum requests per connection value that has been set is:
_________________________________________
• Does the Layer 2 mode feature need to be disabled? (Disable if another Layer 2 device is working
in parallel with a NetScaler appliance.)
_________________________________________
• Does the MAC-based forwarding feature need to be disabled? (If the MAC address used by return
traffic is different, it should be disabled.)
_________________________________________
• <Does host-based reuse need to be disabled? (Is there virtual hosting on the servers?)
_________________________________________
_________________________________________
Access checklist
Note: When you are using the ping utility, ensure that the pinged server has ICMP ECHO enabled,
or your ping will not succeed.
Firewall checklist
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The load balancing feature distributes client requests across multiple servers to optimize resource
utilization. In a real-world scenario with a limited number of servers providing service to a large num-
ber of clients, a server can become overloaded and degrade the performance of the server farm. A
NetScaler appliance uses load balancing criteria to prevent bottlenecks by forwarding each client re-
quest to the server best suited to handle the request when it arrives.
To configure load balancing, you define a virtual server to proxy multiple servers in a server farm and
balance the load among them.
When a client initiates a connection to the server, a virtual server terminates the client connection and
initiates a new connection with the selected server, or reuses an existing connection with the server,
to perform load balancing. The load balancing feature provides traffic management from Layer 4 (TCP
and UDP) through Layer 7 (FTP, HTTP, and HTTPS).
The NetScaler appliance uses a number of algorithms, called load balancing methods, to determine
how to distribute the load among the servers. The default load balancing method is the Least Connec-
tions method.
A typical load balancing deployment consists of the entities described in the following figure.
• Virtual server. An entity that is represented by an IP address, a port, and a protocol. The virtual
server IP address (VIP) is usually a public IP address. The client sends connection requests to
this IP address. The virtual server represents a bank of servers.
1.
2. Citrix ADC
3. NetScaler 12.0
Load balancing
January 6, 2019
Contributed by:
C
To configure load balancing, you must first create services. Then, you create virtual servers and bind
the services to the virtual servers. By default, the NetScaler appliance binds a monitor to each service.
After binding the services, verify your configuration by making sure that all of the settings are correct.
Note: After you deploy the configuration, you can display statistics that show how the entities in
the configuration are performing. Use the statistical utility or the
stat lb vserver <vserverName> command.
Optionally, you can assign weights to a service. The load balancing method then uses the assigned
weight to select a service. For getting started, however, you can limit optional tasks to configuring
some basic persistence settings, for sessions that must maintain a connection to a particular server,
and some basic configuration-protection settings.
The following flow chart illustrates the sequence of the configuration tasks.
Before configuring load balancing, make sure that the load balancing feature is enabled.
At the command prompt, type the following commands to enable load balancing and verify that it is
enabled:
• enable feature lb
• show feature
Example
“‘ pre codeblock
enable feature lb
Done
show feature
When you have identified the services you want to load balance, you can implement your initial load
balancing configuration by creating the service objects, creating a load balancing virtual server, and
binding the service objects to the virtual server.
At the command prompt, type the following commands to implement and verify the initial configura-
tion:
Example
1.
2. Citrix ADC
3. NetScaler 12.0
Persistence settings
Contributed by:
C
You must configure persistence on a virtual server if you want to maintain the states of connections
on the servers represented by that virtual server (for example, connections used in e-commerce). The
appliance then uses the configured load balancing method for the initial selection of a server, but
forwards to that same server all subsequent requests from the same client.
If persistence is configured, it overrides the load balancing methods once the server has been selected.
If the configured persistence applies to a service that is down, the appliance uses the load balancing
methods to select a new service, and the new service becomes persistent for subsequent requests
from the client. If the selected service is in an Out Of Service state, it continues to serve the outstand-
ing requests but does not accept new requests or connections. After the shutdown period elapses,
the existing connections are closed. The following table lists the types of persistence that you can
configure.
Persistence
TypeHeader
1 HTTP HTTPS TCP UDP/IP SSL_Bridge
Persistence
TypeHeader
1 HTTP HTTPS TCP UDP/IP SSL_Bridge
When you enable persistence based on cookies, the the NetScaler appliance adds an HTTP cookie
into the Set-Cookie header field of the HTTP response. The cookie contains information about the
service to which the HTTP requests must be sent. The client stores the cookie and includes it in all
subsequent requests, and the ADC uses it to select the service for those requests. You can use this
type of persistence on virtual servers of type HTTP or HTTPS.
The NetScaler appliance inserts the cookie <NSC_XXXX>= <ServiceIP> <ServicePort>
where:
• <<NSC_XXXX> is the virtual server ID that is derived from the virtual server name.
• <<ServiceIP> is the hexadecimal value of the IP address of the service.
• <<ServicePort> is the hexadecimal value of the port of the service.
The ADC encrypts ServiceIP and ServicePort when it inserts a cookie, and decrypts them when it re-
ceives a cookie.
Note: If the client is not allowed to store the HTTP cookie, the subsequent requests do not have the
HTTP cookie, and persistence is not honored.
By default, the ADC appliance sends HTTP cookie version 0, in compliance with the Netscape specifi-
cation. It can also send version 1, in compliance with RFC 2109.
You can configure a timeout value for persistence that is based on HTTP cookies. Note the following:
• If HTTP cookie version 0 is used, the NetScaler appliance inserts the absolute Coordinated Uni-
versal Time (GMT) of the cookie’s expiration (the expires attribute of the HTTP cookie), calcu-
lated as the sum of the current GMT time on an ADC appliance, and the timeout value.
• If an HTTP cookie version 1 is used, the ADC appliance inserts a relative expiration time (Max-Age
attribute of the HTTP cookie). In this case, the client software calculates the actual expiration
time.
Note: Most client software currently installed (Microsoft Internet Explorer and Netscape browsers)
understand HTTP cookie version 0; however, some HTTP proxies understand HTTP cookie version 1.
If you set the timeout value to 0, the ADC appliance does not specify the expiration time, regardless
of the HTTP cookie version used. The expiration time then depends on the client software, and such
cookies are not valid if that software is shut down. This persistence type does not consume any system
resources. Therefore, it can accommodate an unlimited number of persistent clients.
Example:
At the command prompt, type the following commands to configure persistence based on cookies
and verify the configuration:
Example:
The NetScaler appliance can maintain persistence based on the server IDs in the URLs. In a technique
called URL passive persistence, the ADC extracts the server ID from the server response and embeds
it in the URL query of the client request. The server ID is an IP address and port specified as a hexadec-
imal number. The ADC extracts the server ID from subsequent client requests and uses it to select the
server.
URL passive persistence requires configuring either a payload expression or a policy infrastructure
expression specifying the location of the server ID in the client requests. For more information about
expressions, see “Policy Configuration and Reference.”
Note: If the server ID cannot be extracted from the client requests, server selection is based on the
load balancing method.
Example: Payload Expression
The expression, URLQUERY contains sid= configures the system to extract the server ID from
the URL query of a client request, after matching token sid=. Thus, a request with the URL
http://www.citrix.com/index.asp?\&sid;=c0a864100050 is directed to the server with the IP ad-
dress10.102.29.10 and port 80.
The timeout value does not affect this type of persistence, which is maintained as long as the server
ID can be extracted from the client requests. This persistence type does not consume any system
resources, so it can accommodate an unlimited number of persistent clients.
At the command prompt, type the following commands to configure persistence based on server IDs
in URLs and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure URL redirection to provide notifications of virtual server malfunctions, and you can
configure backup virtual servers to take over if a primary virtual server becomes unavailable.
You can configure a redirect URL to communicate the status of the appliance in the event that a vir-
tual server of type HTTP or HTTPS is down or disabled. This URL can be a local or remote link. The
appliance uses HTTP 302 redirect.
Redirects can be absolute URLs or relative URLs. If the configured redirect URL contains an absolute
URL, the HTTP redirect is sent to the configured location, regardless of the URL specified in the incom-
ing HTTP request. If the configured redirect URL contains only the domain name (relative URL), the
HTTP redirect is sent to a location after appending the incoming URL to the domain configured in the
redirect URL.
Note: If a load balancing virtual server is configured with both a backup virtual server and a redirect
URL, the backup virtual server takes precedence over the redirect URL. In this case, a redirect is used
when both the primary and backup virtual servers are down.
To configure a virtual server to redirect client requests to a URL by using the CLI
At the command prompt, type the following commands to configure a virtual server to redirect client
requests to a URL and verify the configuration:
Example
“‘ pre codeblock
“‘
To configure a virtual server to redirect client requests to a URL by using the GUI
4. <Verify that the redirect URL you configured for the server appears in the Details section at the
bottom of the pane.
If the primary virtual server is down or disabled, the appliance can direct the connections or client
requests to a backup virtual server that forwards the client traffic to the services. The appliance can
also send a notification message to the client regarding the site outage or maintenance. The backup
virtual server is a proxy and is transparent to the client.
You can configure a backup virtual server when you create a virtual server or when you change the
optional parameters of an existing virtual server. You can also configure a backup virtual server for an
existing backup virtual server, thus creating a cascaded backup virtual server. The maximum depth
of cascading backup virtual servers is 10. The appliance searches for a backup virtual server that is up
and accesses that virtual server to deliver the content.
You can configure URL redirection on the primary for use when the primary and the backup virtual
servers are down or have reached their thresholds for handling requests.
Note: If no backup virtual server exists, an error message appears, unless the virtual server is config-
ured with a redirect URL. If both a backup virtual server and a redirect URL are configured, the backup
virtual server takes precedence.
At the command prompt, type the following commands to configure a backup server and verify the
configuration:
Example
“‘ pre codeblock
.
Backup: vserver-LB-2
.
.
.
Done
“‘
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In a load balancing setup, the NetScaler appliances are logically located between the client and the
server farm, and they manage traffic flow to the servers.
The following figure shows the topology of a basic load balancing configuration.
The virtual server selects the service and assigns it to serve client requests. Consider the scenario in
the preceding figure, where the services service-HTTP-1 and service-HTTP-2 are created and bound
to the virtual server named virtual server-LB-1. Virtual server-LB-1 forwards the client request to ei-
ther service-HTTP-1 or service-HTTP-2. The system selects the service for each request by using the
Least Connections load balancing method. The following table lists the names and values of the basic
entities that must be configured on the system.
The following figure shows the load balancing sample values and required parameters that are de-
scribed in the preceding table.
The following tables list the commands used to configure this load balancing setup by using the com-
mand line interface.
Task Command
For more information about the initial configuration tasks, see Setting Up Basic Load Balancing.
Task Command
Task Command
Task Command
For more information about configuring persistence, see Choosing and Configuring Persistence Set-
tings. For information about configuring a virtual server to redirect a client request to a URL and set-
ting up a backup virtual server, see Configuring Features to Protect the Load Balancing Configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Compression is a popular means of optimizing bandwidth usage, and most web browsers support
compressed data. If you enable the compression feature, the NetScaler appliance intercepts requests
from clients and determines whether the client can accept compressed content. After receiving the
HTTP response from the server, the appliance examines the content to determine whether it is com-
pressible. If the content is compressible, the appliance compresses it, modifies the response header
to indicate the type of compression performed, and forwards the compressed content to the client.
NetScaler compression is a policy-based feature. A policy filters requests and responses to identify re-
sponses to be compressed, and specifies the type of compression to apply to each response. The appli-
ance provides several built-in policies to compress common MIME types such as text/html, text/plain,
text/xml, text/css, text/rtf, application/msword, application/vnd.ms-excel, and application/vnd.ms-
powerpoint. You can also create custom policies. The appliance does not compress compressed MIME
types such as application/octet-stream, binary, bytes, and compressed image formats such as GIF and
JPEG.
To configure compression, you must enable it globally and on each service that will provide responses
that you want compressed. If you have configured virtual servers for load balancing or content switch-
ing, you should bind the polices to the virtual servers. Otherwise, the policies apply to all traffic that
passes through the appliance.
The following flow chart shows the sequence of tasks for configuring basic compression in a load bal-
ancing setup.
Note: The steps in the above figure assume that load balancing has already been configured.
Enable compression
By default, compression is not enabled. You must enable the compression feature to allow compres-
sion of HTTP responses that are sent to the client.
At the command prompt, type the following commands to enable compression and verify the config-
uration:
In addition to enabling compression globally, you must enable it on each service that will deliver files
to be compressed.
At the command prompt, type the following commands to enable compression on a service and verify
the configuration:
24
25 Use Source IP: NO
26
27
28 Client Keepalive(CKA): NO
29
30
31 Access Down Service: NO
32
33
34 TCP Buffering(TCPB): NO
35
36
37 HTTP Compression(CMP): YES
38
39
40 Idle timeout: Client: 180 sec Server: 360 sec
41
42
43 Client IP: DISABLED
44
45
46 Cacheable: NO
47
48
49 SC: OFF
50
51
52 SP: OFF
53
54
55 Down state flush: ENABLED
56
57
58
59
60
61 1) Monitor Name: tcp-default
62
63
64 State: DOWN Weight: 1
65
66
67 Probes: 1095 Failed [Total: 1095 Current: 1095]
68
69
70 Last response: Failure - TCP syn sent, reset received.
71
72
73 Response Time: N/A
74
75
76 Done
If you bind a policy to a virtual server, the policy is evaluated only by the services associated with
that virtual server. You can bind compression policies to a virtual server either from the Configure
Virtual Server (Load Balancing) dialog box or from the Compression Policy Manager dialog box. This
topic includes instructions to bind compression policies to a load balancing virtual server by using
the Configure Virtual Server (Load Balancing) dialog box. For information about how you can bind a
compression policy to a load balancing virtual server by using the Compression Policy Manager dialog
box, see Configuring and Binding Policies with the Policy Manager.
To bind or unbind a compression policy to a virtual server by using the command line
At the command prompt, type the following commands to bind or unbind a compression policy to a
load balancing virtual server and verify the configuration:
Example:
To bind or unbind a compression policy to a load balancing virtual server by using the GUI
• To unbind a compression policy, click the name of the policy you want to unbind from the
virtual server, and then click Unbind Policy.
5. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The NetScaler SSL offload feature transparently improves the performance of web sites that conduct
SSL transactions. By offloading CPU-intensive SSL encryption and decryption tasks from the local
web server to the appliance, SSL offloading ensures secure delivery of web applications without the
performance penalty incurred when the server processes the SSL data. Once the SSL traffic is de-
crypted, it can be processed by all standard services. The SSL protocol works seamlessly with various
types of HTTP and TCP data and provides a secure channel for transactions using such data.
To configure SSL, you must first enable it. Then, you configure HTTP or TCP services and an SSL virtual
server on the appliance, and bind the services to the virtual server. You must also add a certificate-
key pair and bind it to the SSL virtual server. If you use Outlook Web Access servers, you must create
an action to enable SSL support and a policy to apply the action. An SSL virtual server intercepts
incoming encrypted traffic and decrypts it by using a negotiated algorithm. The SSL virtual server
then forwards the decrypted data to the other entities on the appliance for appropriate processing.
For detailed information about SSL offloading, see SSL offload and acceleration.
To configure SSL, you must first enable it. Then, you must create an SSL virtual server and HTTP or TCP
services on the NetScaler appliance. Finally, you must bind a valid SSL certificate and the configured
services to the SSL virtual server.
An SSL virtual server intercepts incoming encrypted traffic and decrypts it using a negotiated algo-
rithm. The SSL virtual server then forwards the decrypted data to the other entities on the NetScaler
appliance for appropriate processing.
The following flow chart shows the sequence of tasks for configuring a basic SSL offload setup.
You should enable the SSL feature before configuring SSL offload. You can configure SSL-based enti-
ties on the appliance without enabling the SSL feature, but they will not work until you enable SSL.
At the command prompt, type the following commands to enable SSL Offload and verify the configu-
ration:
29
30 10) Global Server Load Balancing GSLB ON . .
31
32
33 Done >
A service on the appliance represents an application on a server. Once configured, services are in the
disabled state until the appliance can reach the server on the network and monitor its status. This
topic covers the steps to create an HTTP service.
Note: For TCP traffic, perform the procedures in this and the following topics, but create TCP services
instead of HTTP services.
At the command prompt, type the following commands to add a HTTP service and verify the configu-
ration:
•
• show service <name>
Example:
6
7 > show service SVC_HTTP1
8
9
10 SVC_HTTP1 (10.102.29.18:80) - HTTP
11
12
13 State: UP
14
15
16 Last state change was at Wed Jul 15 06:13:05 2009
17
18
19 Time since last state change: 0 days, 00:00:15.350
20
21
22 Server Name: 10.102.29.18
23
24
25 Server ID : 0 Monitor Threshold : 0
26
27
28 Max Conn: 0 Max Req: 0 Max Bandwidth: 0 kbits
29
30
31 Use Source IP: NO
32
33
34 Client Keepalive(CKA): NO
35
36
37 Access Down Service: NO
38
39
40 TCP Buffering(TCPB): NO
41
42
43 HTTP Compression(CMP): YES
44
45
46 Idle timeout: Client: 180 sec Server: 360 sec
47
48
49 Client IP: DISABLED
50
51
52 Cacheable: NO
53
54
55 SC: OFF
56
57
58 SP: OFF
59
60
61 Down state flush: ENABLED
62
63
64
65
66
67 1) Monitor Name: tcp-default
68
69
70 State: UP Weight: 1
71
72
73 Probes: 4 Failed [Total: 0 Current: 0]
74
75
76 Last response: Success - TCP syn+ack received.
77
78
79 Response Time: N/A
80
81
82 Done
5. Click Create, and then click Close. The HTTP service you configured appears in the Services
page.
6. Verify that the parameters you configured are correctly configured by selecting the service and
viewing the Details section at the bottom of the pane.
In a basic SSL offloading setup, the SSL virtual server intercepts encrypted traffic, decrypts it, and
sends the clear text messages to the services that are bound to the virtual server. Offloading CPU-
intensive SSL processing to the appliance allows the back-end servers to process a greater number of
requests.
At the command prompt, type the following commands to create an SSL-based virtual server and
verify the configuration:
Example:
19
20
21 Effective State: DOWN Client Idle Timeout: 180 sec
22
23
24 Down state flush: ENABLED
25
26
27 Disable Primary Vserver On Down : DISABLED
28
29
30 No. of Bound Services : 0 (Total) 0 (Active)
31
32
33 Configured Method: LEASTCONNECTION Mode: IP
34
35
36 Persistence: NONE
37
38
39 Vserver IP and Port insertion: OFF
40
41
42 Push: DISABLED Push VServer: Push Multi Clients: NO Push Label Rule:
Done
Caution: To ensure secure connections, you must bind a valid SSL certificate to the SSL-based
virtual server before you enable it.
After decrypting the incoming data, the SSL virtual server forwards the data to the services that you
have bound to the virtual server.
Data transfer between the appliance and the servers can be encrypted or in clear text. If the data
transfer between the appliance and the servers is encrypted, the entire transaction is secure from
end to end. For more information about configuring the system for end-to-end security, see [sSSL
offload and acceleration.
At the command prompt, type the following commands to bind service to the SSL virtual server and
verify the configuration:
Example:
20
21 Effective State: DOWN Client Idle
22
23
24 Timeout: 180 sec
25
26
27 Down state flush: ENABLED Disable Primary Vserver On Down :
28
29
30 DISABLED No. of Bound Services : 1 (Total) 0 (Active)
31
32
33 Configured Method: LEASTCONNECTION Mode: IP Persistence: NONE Vserver
IP and
34
35
36 Port insertion: OFF Push: DISABLED Push VServer: Push Multi Clients:
NO Push Label Rule:
37
38
39
40
41
42 1) SVC_HTTP1 (10.102.29.18: 80) - HTTP
43
44
45 State: DOWN Weight: 1
46
47
48 Done
An SSL certificate is an integral element of the SSL Key-Exchange and encryption/decryption process.
The certificate is used during SSL handshake to establish the identity of the SSL server. You can use
a valid, existing SSL certificate that you have on the NetScaler appliance, or you can create your own
SSL certificate. The appliance supports RSA/DSA certificates of up to 4096 bits.
Note: Citrix recommends that you use a valid SSL certificate that has been issued by a trusted
certificate authority. Invalid certificates and self-created certificates are not compatible with all
SSL clients.
Before a certificate can be used for SSL processing, you must pair it with its corresponding key. The
certificate key pair is then bound to the virtual server and used for SSL processing.
At the command prompt, type the following commands to create a certificate key pair and verify the
configuration:
Example:
After you have paired an SSL certificate with its corresponding key, you must bind the certificate key
pair to the SSL virtual server so that it can be used for SSL processing. Secure sessions require estab-
lishing a connection between the client computer and an SSL-based virtual server on the appliance.
SSL processing is then carried out on the incoming traffic at the virtual server. Therefore, before en-
abling the SSL virtual server on the appliance, you need to bind a valid SSL certificate to the SSL virtual
server.
Bind an SSL certificate key pair to a virtual server by using the CLI
At the command prompt, type the following commands to bind an SSL certificate key pair to a virtual
server and verify the configuration:
Example:
26
27 Cipher Redirect: ENABLED
28
29
30 SSLv2 Redirect: ENABLED
31
32
33 ClearText Port: 0
34
35
36 Client Auth: DISABLED
37
38
39 SSL Redirect: DISABLED
40
41
42 Non FIPS Ciphers: DISABLED
43
44
45 SSLv2: DISABLED SSLv3: ENABLED TLSv1: ENABLED
46
47
48
49
50
51 1) CertKey Name: CertKey-SSL-1 Server Certificate
52
53
54 1) Cipher Name: DEFAULT
55
56
57 Description: Predefined Cipher Alias
58
59
60 Done
Bind an SSL certificate key pair to a virtual server by using the GUI
3. In the Configure Virtual Server (SSL Offload) dialog box, on the SSL Settings tab, under Available,
select the certificate key pair that you want to bind to the virtual server (for example, Certkey-
SSL-1), and then click Add.
4. Click OK.
5. Verify that the certificate key pair that you selected appears in the Configured area.
If you use Outlook Web Access (OWA) servers on your NetScaler appliance, you must configure the
appliance to insert a special header field, FRONT-END-HTTPS: ON, in HTTP requests directed to the
OWA servers, so that the servers generate URL links as https:// instead of http://.
Note: You can enable OWA support for HTTP-based SSL virtual servers and services only. You cannot
apply it for TCP-based SSL virtual servers and services.
Before you can enable Outlook Web Access (OWA) support, you must create an SSL action. SSL actions
are bound to SSL policies and triggered when incoming data matches the rule specified by the policy.
At the command prompt, type the following commands to create an SSL action to enable OWA support
and verify the configuration:
Example:
8
9 > show SSL action Action-SSL-OWA
10
11
12 Name: Action-SSL-OWA
13
14
15 Data Insertion Action: OWA
16
17
18 Support: ENABLED
19
20
21 Done
SSL policies are created by using the policy infrastructure. Each SSL policy has an SSL action bound
to it, and the action is carried out when incoming traffic matches the rule that has been configured in
the policy.
At the command prompt, type the following commands to configure an SSL policy and verify the con-
figuration:
Example:
After you configure an SSL policy for Outlook Web Access, bind the policy to a virtual server that will
intercept incoming Outlook traffic. If the incoming data matches any of the rules configured in the
SSL policy, the policy is triggered and the action associated with it is carried out.
At the command prompt, type the following commands to bind an SSL policy to an SSL virtual server
and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Features at a glance
Contributed by:
C
To understand the order in which the features perform their processing, see Processing Order of Fea-
tures section.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
SSL Offloading
Transparently offloads SSL encryption and decryption from web servers, freeing server resources to
service content requests. SSL places a heavy burden on an application’s performance and can render
many optimization measures ineffective. SSL offload and acceleration allow all the benefits of Citrix
Request Switching technology to be applied to SSL traffic, ensuring secure delivery of web applica-
tions without degrading end-user performance.
Compares incoming packets to Access Control Lists (ACLs). If a packet matches an ACL rule, the action
specified in the rule is applied to the packet. Otherwise, the default action (ALLOW) is applied and
the packet is processed normally. For the appliance to compare incoming packets to the ACLs, you
have to apply the ACLs. All ACLs are enabled by default, but you have to apply them in order for the
NetScaler appliance to compare incoming packets against them. If an ACL is not required to be a part
of the lookup table, but still needs to be retained in the configuration, it should be disabled before the
ACLs are applied. An ADC appliance does not compare incoming packets to disabled ACLs.
Load Balancing
Load balancing decisions are based on a variety of algorithms, including round robin, least connec-
tions, weighted least bandwidth, weighted least packets, minimum response time, and hashing based
on URL, domain source IP, or destination IP. Both the TCP and UDP protocols are supported, so the
NetScaler appliance can load balance all traffic that uses those protocols as the underlying carrier (for
example, HTTP, HTTPS, UDP, DNS, NNTP, and general firewall traffic). In addition, the ADC appliance
can maintain session persistence based on source IP, cookie, server, group, or SSL session. It allows
users to apply custom Extended Content Verification (ECV) to servers, caches, firewalls and other in-
frastructure devices to ensure that these systems are functioning properly and are providing the right
content to users. It can also perform health checks using ping, TCP, or HTTP URL, and the user can
create monitors based on Perl scripts.
To provide high-scale WAN optimization, the CloudBridge appliances deployed at data centers can be
load balanced through NetScaler appliances. The bandwidth and number of concurrent sessions can
be improved significantly.
Traffic Domains
Traffic domains provide a way to create logical ADC partitions within a single NetScaler appliance.
They enable you to segment network traffic for different applications. You can use traffic domains
to create multiple isolated environments whose resources do not interact with each other. An appli-
cation belonging to a specific traffic domain communicates only with entities, and processes traffic,
within that domain. Traffic belonging to one traffic domain cannot cross the boundary of another traf-
fic domain. Therefore, you can use duplicate IP addresses on the appliance as long as an addresses is
not duplicated within the same domain.
Network address translation (NAT) involves modification of the source and/or destination IP ad-
dresses, and/or the TCP/UDP port numbers, of IP packets that pass through the NetScaler appliance.
Enabling NAT on the appliance enhances the security of your private network, and protects it from
a public network such as the Internet, by modifying your network’s source IP addresses when data
passes through the NetScaler appliance.
The NetScaler appliance supports the following types of network address translation:
INAT: In Inbound NAT (INAT), an IP address (usually public) configured on the NetScaler appliance lis-
tens to connection requests on behalf of a server. For a request packet received by the appliance on a
public IP address, the ADC replaces the destination IP address with the private IP address of the server.
In other words, the appliance acts as a proxy between clients and the server. INAT configuration in-
volves INAT rules, which define a 1:1 relationship between the IP address on the NetScaler appliance
and the IP address of the server.
RNAT: In Reverse Network Address Translation (RNAT), for a session initiated by a server, the NetScaler
appliance replaces the source IP address in the packets generated by the server with an IP address
(type SNIP) configured on the appliance. The appliance thereby prevents exposure of the server’s IP
address in any of the packets generated by the server. An RNAT configuration involves an RNAT rule,
which specifies a condition. The appliance performs RNAT processing on those packets that match
the condition.
Stateless NAT46 Translation: Stateless NAT46 enables communication between IPv4 and IPv6 net-
works, by way of IPv4 to IPv6 packet translation and vice versa, without maintaining any session infor-
mation on the NetScaler appliance. A stateless NAT46 configuration involves an IPv4-IPv6 INAT rule
and an NAT46 IPv6 prefix.
Stateful NAT64 Translation: The stateful NAT64 feature enables communication between IPv4 clients
and IPv6 servers through IPv6 to IPv4 packet translation, and vice versa, while maintaining session
information on the NetScaler appliance. A stateful NAT64 configuration involves an NAT64 rule and
an NAT64 IPv6 prefix.
NetScaler appliances support Multipath TCP (MPTCP). MPTCP is a TCP/IP protocol extension that iden-
tifies and uses multiple paths available between hosts to maintain the TCP session. You must enable
MPTCP on a TCP profile and bind it to a virtual server. When MPTCP is enabled, the virtual server func-
tions as an MPTCP gateway and converts MPTCP connections with the clients to TCP connections that
it maintains with the servers.
Content Switching
Determines the server to which to send the request on the basis of configured content switching poli-
cies. Policy rules can be based on the IP address, URL, and HTTP headers. This allows switching de-
cisions to be based on user and device characteristics such as who the user is, what type of agent is
being used, and what content the user requested.
Extends the traffic management capabilities of a NetScaler to include distributed Internet sites and
global enterprises. Whether installations are spread across multiple network locations or multiple
clusters in a single location, the NetScaler maintains availability and distributes traffic across them. It
makes intelligent DNS decisions to prevent users from being sent to a site that is down or overloaded.
When the proximity-based GSLB method is enabled, the NetScaler can make load balancing decisions
based on the proximity of the client’s local DNS server (LDNS) in relation to different sites. The main
benefit of the proximity-based GSLB method is faster response time resulting from the selection of
the closest available site.
Dynamic Routing
Enables routers to obtain topology information, routes, and IP addresses from neighboring routers
automatically. When dynamic routing is enabled, the corresponding routing process listens to route
updates and advertises routes. The routing processes can also be placed in passive mode. Routing
protocols enable an upstream router to load balance traffic to identical virtual servers hosted on two
standalone NetScaler units using the Equal Cost Multipath technique.
Load balances multiple WAN links and provides link failover, further optimizing network performance
and ensuring business continuity. Ensures that network connections remain highly available, by
applying intelligent traffic control and health checks to distribute traffic efficiently across upstream
routers. Identifies the best WAN link to route both incoming and outbound traffic based on policies
and network conditions, and protects applications against WAN or Internet link failure by providing
rapid fault detection and failover.
TCP Optimization
You can use TCP profiles to optimize TCP traffic. TCP profiles define the way that NetScaler virtual
servers process TCP traffic. Administrators can use the built-in TCP profiles or configure custom pro-
files. After defining a TCP profile, you can bind it to a single virtual server or to multiple virtual servers.
Some of the key optimization features that can be enabled by TCP profiles are:
• TCP keep-alive—Checks the operational status of the peers at specified time intervals to prevent
the link from being broken.
• Selective Acknowledgment (SACK)— Improves the performance of data transmission, especially
in long fat networks (LFNs).
• TCP window scaling— Allows efficient transfer of data over long fat networks (LFNs).
CloudBridge Connector
DataStream
The NetScaler DataStream feature provides an intelligent mechanism for request switching at the
database layer by distributing requests on the basis of the SQL query being sent.
When deployed in front of database servers, a NetScaler ensures optimal distribution of traffic from
the application servers and Web servers. Administrators can segment traffic according to information
in the SQL query and on the basis of database names, user names, character sets, and packet size.
You can configure load balancing to switch requests according to load balancing algorithms, or you
can elaborate the switching criteria by configuring content switching to make a decision based on SQL
query parameters, such as user name, database names, and command parameters. You can further
configure monitors to track the states of database servers.
The advanced policy infrastructure on the NetScaler appliance includes expressions that you can
use to evaluate and process the requests. The advanced expressions evaluate traffic associated
with MySQL database servers. You can use request-based expressions (expressions that begin with
MYSQL.CLIENT and MYSQL.REQ) in advanced policies to make request switching decisions at the
content switching virtual server bind point and response-based expressions (expressions that begin
with MYSQL.RES) to evaluate server responses to user-configured health monitors.
• TCP Buffering
Buffers the server’s response and delivers it to the client at the client’s speed, thus offloading
the server faster and thereby improving the performance of web sites.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Detects and stops malicious distributed denial-of-service (DDoS) attacks and other types of malicious
attacks before they reach your servers, preventing them from affecting network and application per-
formance. The NetScaler appliance identifies legitimate clients and elevates their priority, leaving
suspect clients unable to consume a disproportionate percentage of resources and cripple your site.
The appliance provides application-level protection from the following types of malicious attacks:
The appliance aggressively defends against these types of attacks by preventing the allocation of
server resources for these connections. This insulates servers from the overwhelming flood of packets
associated with these events.
The appliance also protects network resources from ICMP based attacks by using ICMP rate limiting
and aggressive ICMP packet inspection. It performs strong IP reassembly, drops a variety of suspicious
and malformed packets, and applies Access Control Lists (ACLs) to site traffic for further protection.
Content Filtering
Provides protection from malicious attacks for web sites at the Layer 7 level. The appliance inspects
each incoming request according to user-configured rules based on HTTP headers, and performs the
action the user configured. Actions can include resetting the connection, dropping the request, or
sending an error message to the user’s browser. This allows the appliance to screen unwanted re-
quests and reduces your servers’ exposure to attacks.
This feature can also analyze HTTP GET and POST requests and filter out known bad signatures, al-
lowing it to defend your servers against HTTP-based attacks.
Responder
Functions like an advanced filter and can be used to generate responses from the appliance to
the client. Some common uses of this feature are generation of redirect responses, user defined
responses, and resets.
Rewrite
Modifies HTTP headers and body text. You can use the rewrite feature to add HTTP headers to an HTTP
request or response, make modifications to individual HTTP headers, or delete HTTP headers. It also
enables you to modify the HTTP body in requests and responses.
When the appliance receives a request or sends a response, it checks for rewrite rules, and if applicable
rules exist, it applies them to the request or response before passing it on to the web server or client
computer.
Priority Queuing
Prioritizes user requests to ensure that the most important traffic is serviced first during surges in
request volume. You can establish priority based on request URLs, cookies, or a variety of other fac-
tors. The appliance places requests in a three-tier queue based on their configured priority, enabling
business-critical transactions to flow smoothly even during surges or site attacks.
Surge Protection
Regulates the flow of user requests to servers and controls the number of users that can simultane-
ously access the resources on the servers, queuing any additional requests once your servers have
reached their capacity. By controlling the rate at which connections can be established, the appliance
blocks surges in requests from being passed on to your servers, thus preventing site overload.
Citrix Gateway
Application Firewall
Protects applications from misuse by hackers and malware, such as cross site scripting attacks, buffer
overflow attacks, SQL injection attacks, and forceful browsing, by filtering traffic between each pro-
tected web server and users that connect to any web site on that web server. The application firewall
examines all traffic for evidence of attacks on web server security or misuse of web server resources,
and takes the appropriate action to prevent these attacks from succeeding.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
NetScaler Insight Center is a high performance collector that provides end-to-end user experi-
ence visibility across Web and HDX (ICA) traffic. It collects HTTP and ICA AppFlow records gen-
erated by NetScaler ADC appliances and populates analytical reports covering Layer 3 to Layer
7 statistics. NetScaler Insight Center provides in-depth analysis for the last five minutes of real-
time data, and for historical data collected for the last one hour, one day, one week, and one
month.
HDX (ICA) analytic dashboard enables you to drill down from HDX Users, Applications, Desktops,
and even from gateway-level information. Similarly, HTTP analytics provide a bird’s eye view
of Web Applications, URLs Accessed, Client IP Addresses and Server IP Addresses, and other
dashboards. The administrator can drill down and identify the pain points from any of these
dashboards, as appropriate for the use case.
Support for application performance monitoring based on end user experience. This solution
leverages the HTML injection feature to obtain various time values, which are used by EdgeSight
server for analysis and report generation. EdgeSight for NetScaler provides a way to monitor the
performance benefits of a NetScaler and determine potential bottlenecks in a network.
The NetScaler appliance is a central point of control for all application traffic in the data center.
It collects flow and user-session level information valuable for application performance mon-
itoring, analytics, and business intelligence applications. AppFlow transmits this information
by using the Internet Protocol Flow Information eXport (IPFIX) format, which is an open Inter-
net Engineering Task Force (IETF) standard defined in RFC 5101. IPFIX (the standardized version
of Cisco’s NetFlow) is widely used to monitor network flow information. AppFlow defines new
Information Elements to represent application-level information.
Using UDP as the transport protocol, AppFlow transmits the collected data, called flow records,
to one or more IPv4 collectors. The collectors aggregate the flow records and generate real-time
or historical reports.
AppFlow provides visibility at the transaction level for HTTP, SSL, TCP, and SSL_TCP flows. You
can sample and filter the flow types that you want to monitor.
To limit the types of flows to monitor, by sampling and filtering the application traffic, you can
enable AppFlow for a virtual server. AppFlow can also provide statistics for the virtual server.
You can also enable AppFlow for a specific service, representing an application server, and mon-
itor the traffic to that application server.
• Stream Analytics
The performance of your web site or application depends on how well you optimize the delivery
of the most frequently requested content. Techniques such as caching and compression help ac-
celerate the delivery of services to clients, but you need to be able to identify the resources that
are requested most frequently, and then cache or compress those resources. You can identify
the most frequently used resources by aggregating real-time statistics about website or applica-
tion traffic. Statistics such as how frequently a resource is accessed relative to other resources
and how much bandwidth is consumed by those resources help you determine whether those
resources need to be cached or compressed to improve server performance and network uti-
lization. Statistics such as response times and the number of concurrent connections to the
application help you determine whether you must enhance server-side resources.
If the web site or application does not change frequently, you can use products that collect
statistical data, and then manually analyze the statistics and optimize the delivery of content.
However, if you do not want to perform manual optimizations, or if your web site or applica-
tion is dynamic in nature, you need infrastructure that can not only collect statistical data but
can also automatically optimize the delivery of resources on the basis of the statistics. On the
NetScaler appliance, this functionality is provided by the Stream Analytics feature. The feature
operates on a single NetScaler appliance and collects run-time statistics on the basis of crite-
ria that you define. When used with NetScaler policies, the feature also provides you with the
infrastructure that you need for automatic, real-time traffic optimization.
1.
2. Citrix ADC
3. NetScaler 12.0
FAQs
Contributed by:
C
This section provides the frequently asked questions on the following NetScaler
features
• Admin Partition
• AppFlow
• Call Home
• Clustering
• Connection Management
• Content Switching
• Debugging
• Hardware
• High Availability
• Integrated Caching
• Installing, Upgrading, and Downgrading
• Load Balancing
• NetScaler GUI
• SSL
1.
2. Citrix ADC
3. NetScaler 12.0
AppFlow
Contributed by:
C
AppFlow is supported on NetScaler appliances running version 9.3 and above with nCore build.
AppFlow transmits information in the Internet Protocol Flow Information eXport (IPFIX) format,
which is an open Internet Engineering Task Force (IETF) standard defined in RFC 5101. IPFIX (the
standardized version of Cisco’s NetFlow) is widely used to monitor network flow information.
A collector receives flow records generated by the NetScaler appliance. To be able to send flow
records, you must specify at least one collector. You can specify up to four. You can remove unused
collectors.
Use NetScaler version 9.3.49.5 or higher, and remember that AppFlow is available in only the
nCore builds.
Port 4739. It is the default UDP port the AppFlow collector uses for listening on IPFIX messages.
If the user changes the default port, that port should be opened on the firewall.
When you add an AppFlow collector by using the add appflowCollector command, you can spec-
ify the port to be used.
You can configure up to four AppFlow collectors at a time on the NetScaler appliance. Please
note that the maximum number of collectors that can be configured on a NetScaler appliance
is four.
1.
2. Citrix ADC
3. NetScaler 12.0
Call Home
Contributed by:
C
Call Home monitors, and notifies critical events on a NetScaler appliance. By enabling Call
Home, you can automate the error notification process. You not only avoid calling Citrix sup-
port, raise a service request, and upload system data before Citrix support can troubleshoot the
issue, but also identify and resolve issues before it occurs.
Yes, Call Home is enabled by default on the appliance. If you upgrade to the latest software from
an older version where Call Home was disabled by default, the upgrade process automatically
enables the feature. If you later choose to disable it, the updated setting is remembered for all
further upgrades. For information, see Call Home.
Note: If your NetScaler appliance does not have an Internet connectivity, you can configure
a proxy server through which NetScaler can generate system logs and upload it to the Citrix
Technical Support server (CIS).
Call Home feature is enabled by default on all NetScaler platforms and all appliance models
(MPX, VPX, and SDX).
• Should I configure SNMP alarm for Call Home to notify error conditions?
No, you need not configure SNMP for Call Home to monitor error conditions, because SNMP
and Call Home uploads are independent of each other. If you want to be notified each time
an error condition occurs, you can configure the CALLHOME-UPLOAD-EVENT SNMP alarm to
generate an SNMP alert whenever a Call Home upload happens. The SNMP alert notifies the
local administrator about the occurrences of critical events.
For all critical hardware-related events, Call Home automatically creates a service request to
Citrix. For other errors, after you review the system logs, you can contact the Citrix Technical
Support team to open a service request for further investigation. For more information, see
http://support.citrix.com/article/CTX126172.
No, Call Home does not require a separate license. You can enable it in all NetScaler platform
licenses.
• What data does Call Home send to Citrix Support server and how frequently is it sent?
Call Home collects and sends two types of data to CIS. They are:
– Basic System information (running NetScaler version, deployment mode (standalone, HA,
cluster), hardware details and so on). It is sent at the time of Call Home registration and
as part of periodic heartbeats. The heartbeat is sent once every 30 days, but you can con-
figure this interval anywhere from 1 to 30 days. However, a value of less than 5 days is not
recommended, because frequent uploads are usually not very useful.
– An abbreviated version of show tech support bundle when there is an error condition. It is
sent upon the first occurrence of a particular error condition since the appliance was last
started. That is, a reoccurrence of same error condition does not trigger another upload
unless the appliance was rebooted after the previous occurrence.
• Can Call Home generate and upload system logs through a proxy server?
Yes. If your NetScaler appliance does not have direct Internet connectivity, you can configure a
proxy server and upload system logs to Citrix Technical Support server (CIS).
Unfortunately, you cannot review Call Home data before it is sent to CIS. Call Home does not col-
lect any other data in addition to the data that you will provide when contacting Citrix support
team.
Call Home provides data security and privacy in the following ways:
1.
2. Citrix ADC
3. NetScaler 12.0
Clustering
Contributed by:
C
1.
2. Citrix ADC
3. NetScaler 12.0
Connection Management
November 2, 2018
Contributed by:
C
An admin connection establishes a connection to the NetScaler IP (NSIP) address and allows
administrators to configure and monitor the NetScaler appliance.
• What are the types of admin connections?
There are two types of admin connections:
– SSH connection – Admin users use an SSH client to logon through the NetScaler IP (NSIP)
address.
– NITRO API connection – Admin users use NITRO API’s to automate the logon process to
NetScaler appliance.
Note: Admin users can also log on through the NetScaler GUI to log on, by using a browser
to connect to the NSIP address. The GUI internally opens a NITRO API connection. There-
fore, a GUI session is equivalent to a NITRO API connection, and FAQs related to NITRO API
apply to GUI.
• How many concurrent admin connections are allowed on a NetScaler appliance?
The appliance allows up to 20 concurrent admin connections.
• Which login credentials are required for an admin logon?
Admin logon requires a user name and a password.
Note: An authentication key can be used instead of a password.
• Which external authentication methods does a NetScaler appliance support?
The appliance supports the following external authentication methods:
– RADIUS
– LDAP
– TACACS
• What is a client?
A client is a device (laptop or desktop), used by admin user to open an admin connection.
• What is a session token?
A session token is a unique identifier that the NetScaler appliance issues to a client that sends
a NITRO API logon request.
– API clients can reuse the session token, if it has not expired, for subsequent API requests
on new TCP connections
– GUI clients internally open NITRO API connections and keep the session token active for
the duration of the GUI session.
• What is an active session on a NetScaler appliance?
A CLI session is considered active if the session has not expired and has an open SSH connection
with a NetScaler appliance.
A NITRO API session is considered active if the session token timeout has not expired on the
NetScaler appliance.
Every time the NetScaler appliance receives an admin connection request (SSH or NITRO API),
it checks the number of admin connections it has open. If the number is lower than 20, a new
connection is opened.
The connection counter (nsconfigd_cur_clients) reflects the number of active connections. This
counter is incremented when a client opens new connection to the appliance, and is decre-
mented when a connection is closed.
• Which counter reflects the number of active tokens on the NetScaler appliance?
The
configd_cur_tokens counter reflects the number of active tokens on NetScaler appliance.
The NetScaler appliance immediately closes the client (CLI, API, and GUI) connection if it en-
counters errors on a connection.
• Does a CLI or GUI session on a connection to the management address count against the
admin connection limit?
Yes, all CLI and GUI connections are TCP based connections, and every TCP connection to the
management address counts against the admin connection limit.
A NITRO session counts against the admin connection limit if there is an open TCP connection
using the session token issued by the NetScaler appliance.
• What is the default timeout period for API, GUI, and CLI sessions on NetScaler appliance?
The following table lists the default timeout period for API, GUI and CLI sessions on the NetScaler
appliance:
• How can you set the CLI sessions time out on a NetScaler appliance?
The CLI session timeout can be configured by executing the following command at the CLI
prompt:
• How do you override the default timeout period when using the NITRO API?
You can override the default timeout period for a NITRO API by setting the timeout duration in
the “timeout” field of the login object. If the session timeout is set to zero, the session token
has an infinite timeout.
Note: An infinite timeout is not advisable, because sessions that do not time out continue to
count against the admin connection count.
• What happens if a user account is deleted from the NetScaler appliance after an admin
session is created?
For internal system users, NetScaler appliance closes the existing CLI or NITRO API session.
• Can NITRO API clients use a single session token to open multiple admin connections on
the NetScaler appliance?
Yes. Each such connection counts against the admin connection limit.
• If management access is enabled for a MIP or SNIP address, do admin connections to that
address count against the limit for the number of admin connections?
Yes, admin connections to management address (MIP or SNIP) count against the admin connec-
tion limit on NetScaler appliance.
• Can a NetScaler admin log on to the NetScaler appliance after the maximum connections
limit is reached?
Yes. One additional admin connection is allowed after the maximum connection limit is
reached.
• Can NITRO API endpoints open multiple admin connections on NetScaler the appliance?
Yes, NITRO API endpoints can open multiple admin connections and exhaust the concurrent ad-
min connection limit on a NetScaler appliance. In such situations, an additional SSH/CLI con-
nection is allowed and the admin can force closure of old API sessions, or reduce the session
timeout duration for the existing API sessions.
Yes, a client can open multiple API session by repeatedly logging on. For example, the client
might log back on after a reboot.
Note: Repeated client logons count against the admin connection limit on NetScaler appliance.
• Can API clients use the entire API session token limit?
Yes, API clients can use the entire API session token limit, provided by repeatedly logging on
without using a previously issued token.
Note: If a client’s session timeout is zero, the token is valid forever. Repeated logons using new
session tokens can count against the limit for API session tokens.
No, CLI sessions are not counted against the API session token limit.
• What is connection limit and API session limit applicable for various NetScaler releases?
The following table lists the maximum concurrent admin connection and active API session lim-
its applicable for various NetScaler releases:
Maximum 20 20 20 20
number of
concurrent
admin
connections
Maximum 1000 20 1000 1000
number of active
API sessions*
Note:
– API sessions are considered active if they have not timed out. For example, if 500 API
sessions were created but 100 have expired, 400 API sessions are active.
– An API session need not open a TCP connection to the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
Content Switching
Contributed by:
C
Yes. You can use the Content switching feature of the NetScaler appliance with the load balanc-
ing feature of the NetScaler appliance or a non-NetScaler load balancing appliance. However,
when using the non-NetScaler load balancing appliance, make sure that you create a load bal-
ancing virtual server on the NetScaler appliance and bind it to the non-NetScaler load balancing
appliance as a service.
• How is a Content switching virtual server different from a load balancing virtual server?
A Content switching virtual server is capable only of sending the client requests to other virtual
servers. It does not communicate with the servers.
A Load balancing virtual server balances the client load among servers and communicates with
the servers. It monitors server availability and can be used to apply different load balancing
algorithms to distribute the traffic load.
Content switching is a method used to direct client requests for specific types of content to
targeted servers by way of load balancing virtual servers. You can direct the client requests to
the servers best suited to handle them. This result in reduced overheads to process the client
requests on the servers.
• I want to implement the Content switching feature of the NetScaler appliance to direct the
client requests. What types of client request can I direct by using the Content switching
feature?
You can direct only HTTP, HTTPS, FTP, TCP, Secure TCP, and RTSP client requests by using the
Content switching feature. To direct HTTPS client requests, you must configure the SSL offload
feature on the appliance.
• I want to create Content switching rules on the NetScaler appliance. What are the various
elements of the client request on which I can create a content switching rule?
You can create the content switching rules based on the following elements and their values in
the client request:
– URL
– URL tokens
– HTTP version
– HTTP Headers
– Source IP address of the client
– Client version
– Destination TCP port
• I understand that the content switching feature of the NetScaler appliance helps enhance
the performance of the network. Is this correct?
Yes. You can direct the client requests you the servers best suited to handle them. The result is
reduced overhead for processing the client requests on the servers.
• Which feature of the NetScaler appliance should I configure on the NetScaler appliance to
enhance the site manageability and response time to the client requests?
You can configure the content switching feature of the NetScaler appliance to enhance the site
manageability and response time to the client request. This feature enables you to create con-
tent groups within the same domain name and IP address. This approach is flexible, unlike the
common approach of explicitly partitioning the content into different domain names and IP ad-
dresses, which are visible to the user.
Multiple partitions dividing a Web site into various domain names and IP addresses force the
browser to create a separate connection for each domain it finds when rendering and fetching
the content of a web page. These additional WAN connections degrade the response time for
the web page.
• I have hosted a web site on a web server farm. What advantages does the NetScaler content
switching feature offer for this type of setup?
The content switching feature provides the following advantages on a NetScaler appliance in a
site that is based in a web server farm:
– Manage the site content by creating a content group within the same domain and IP ad-
dress.
– Enhance the response time to client requests by using the content group within the same
domain and IP address.
– Avoid the need for full content replication across domains.
– Enable application-specific content partitioning. For example, you can direct client re-
quests to a server that handles only dynamic content or only static content, as appropriate
for the request.
– Support multi-homing of multiple domains on the same server and use the same IP ad-
dress.
– Reuse connections to the servers.
• I want to implement the content switching feature on the NetScaler appliance. I want to
direct the client requests to the various servers after evaluating the various parameters
of each request. What approach should I follow to implement this setup when configuring
the content switching feature?
You can use policy expressions to create policies for the content switching feature. An expres-
sion is a condition evaluated by comparing the qualifiers of the client request to an operand
by using an operator. You can use the following parameters of the client request to create an
expression:
Following is a complete list of the operators that you can use to create an expression:
– == (equals)
– != (not equals)
– EXISTS
– NOT EXISTS
– CONTAINS
– NOT CONTAINS
– GT (greater than)
– LT (less than)
You can also create various (OR) operators. You can also
rules, which are logical use parenthesis to create
aggregations of a set of nested and complex rules.
expressions. You can combine
multiple expressions to create
rules. To combine
expressions, you can use the
&& (AND) and
• I want to configure a rule based policy along with a URL based policy for the same content
switching virtual server. Is it possible to create both types of policies for the same content
switching virtual server?
Yes. You can create both type of policies for the same content switching virtual server. However,
be sure to assign priorities to set an appropriate precedence for the policies.
• I want to create content switching policies that evaluate the domain name, along with a
prefix and suffix of a URL, and direct the client requests accordingly. Which type of content
switching policy should I create?
You can create a Domain and Exact URL policy. When this type of policy is evaluated, the
NetScaler appliance selects a content group if the complete domain name and the URL in
the client request match the ones configured. The client request must match the configured
domain name and exactly match the prefix and suffix of the URL if they are configured.
• I want to create content switching policies that evaluate the domain name, along with a
partial prefix and suffix of URL, and direct the client requests accordingly. Which type of
content switching policy should I create?
You can create a Domain and Wildcard URL policy for the content switching virtual server. When
this type of policy is evaluated, the NetScaler appliance selects a content group if the request
matches the complete domain name and partially matches the URL prefix.
• What is a Wildcard URL policy?
You can use wildcards to evaluate partial URLs in client requests to the URL you have configured
on the NetScaler appliance. You can use wildcards in the following types of URL-based policies:
– Prefix only. For example, the /sports/* expression matches all URLs available under the
/sports URL. Similarly, the /sports* expression matches all URLs whose prefix is /sports .
– Suffix only. For example the /*.jsp expression matches all URLs with a file extension of jsp.
– Prefix and Suffix. For example, the /sports/*.jsp expression matches all URLs under the
/sports/ URL that also have the jsp file extension. Similarly, the /sports*.jsp expression
matches all URLs with a prefix of /sports* and a file extension of jsp.
• What is a Domain and Rule policy?
When you create a Domain and Rule policy, the client request must match the complete domain
and the rule configured on the NetScaler appliance.
• What is the default precedence set for evaluating policies?
By default, the rule based policies are evaluated first.
• If some of the content is the same for all client requests, what type of precedence should I
use for evaluating policies?
If some of the content is same for all the users and different content should be served on the
basis of client attributes, you can use URL-based precedence for policy evaluation.
• What policy expression syntaxes are supported in content switching?
Content switching supports two types of policy expressions:
– Classic Syntax- Classic syntax in content switching starts with the keyword REQ and is
more advanced than the default syntax. Classic policies cannot be bound to an action.
Therefore, the target load balancing virtual server can be added only after binding the con-
tent switching virtual server.
– Default Syntax: Default syntax generally starts with key word HTTP and is easier to config-
ure. A target load balancing virtual server action can be bound to a Default Syntax policy,
and the policy can be used on multiple content switching virtual servers.
Yes. You can bind a single content switching policy to multiple virtual servers by using policies
with defined actions. Content switching policies that use an action can be bound to multiple
content switching virtual servers because the target load balancing virtual server is no longer
specified in the content switching policy. The ability to bind a single policy to multiple content
switching virtual servers helps to further reduce the size of the content switching configuration.
For more information, see the following Knowledge Center articles and eDocs topics:
– See CTX122918 - How to Bind the Same Content Switching Policy to Two Content Switching
vServers on a NetScaler Appliance.
– See CTX122736 - How to Bind the Same Advanced Policy to Multiple Content Switching
Virtual Servers using Policy Labels.
– Configuring a Content Switching Action.
No. As of now NetScaler does not support policies using classic syntax expressions with actions.
The target load balancing virtual server should be added when binding the policy instead of
defining it in an action.
1.
2. Citrix ADC
3. NetScaler 12.0
Debugging
Contributed by:
C
• How can I determine the interface (CLI, GUI, or API) through which an operation was per-
formed?
The NetScaler keeps track of the interfaces through which operations are performed. You can
view this information in syslogs (in the NetScaler GUI, navigate to
Configuration > System > Auditing > Audit Messages > Syslog messages) or in the ns.log (located
at the /var/log/ directory) file.
For example, operations that are performed through the API are flagged as “API CMD_EXECUTED.”
1.
2. Citrix ADC
3. NetScaler 12.0
Hardware
Contributed by:
C
1.
2. Citrix ADC
3. NetScaler 12.0
High Availability
Contributed by:
C
• What are the various ports used to exchange the HA-related information between the
nodes in an HA configuration?
In an HA configuration, both nodes use the following ports to exchange HA related information:
Configurations implemented with the following commands are neither propagated nor synced
to the secondary node:
– All node specific HA configuration commands. For example, add ha node, set ha node, and
bind ha node.
– All Interface related configuration commands. For example, set interface and unset inter-
face.
– All channel related configuration commands. For example, add channel, set channel, and
bind channel.
The following configurations are neither synced nor propagated. Each node has its own.
– MIPs
– SNIPs
– VLANs
– Routes (except LLB routes)
– Route monitors
– RNAT rules (except any RNAT rule with VIP as the NAT IP)
– Dynamic routing configurations.
– The incarnation number of the primary node, received by the secondary, does not match
that of the secondary node.
Note: Both nodes in an HA configuration maintain a counter called
incarnation number, which counts the number of configurations in the node’s configura-
tion file. Each node sends its incarnation number to each other node in the heartbeat
messages. The incarnation number is not incremented for the following commands:
* All HA configuration related commands. For example, add ha node, set ha node, and
bind ha node.
* All Interface related commands. For example, set interface and unset interface.
* All channel-related commands. For example, add channel, set channel, and bind
channel.
– The secondary node comes up after a restart.
– The primary node becomes secondary after a failover.
• Does a configuration added to the secondary node get synchronized on the primary?
No, a configuration added to the secondary node is not synchronized to the primary.
• What could be the reason for both nodes claiming to be the primary in an HA configuration?
The most likely reason is that the primary and secondary nodes are both healthy but the sec-
ondary does not receive the heartbeat packets from the primary. The problem could be with
the network between the nodes.
• Does an HA configuration run into any issues if you deploy the two nodes with different
system clock settings?
Different system-clock settings on the two nodes can cause the following issues:
– The time stamps in the log file entries do not match. This situation makes it difficult to
analyze the log entries for any issues.
– After a failover, you might have problems with any type of cookie based persistence for
load balancing. A significant difference between the times can cause a cookie to expire
sooner than expected, resulting in termination of the persistence session.
– Similar considerations apply to any time related decisions on the nodes.
• What are the conditions for failure of the force HA sync command?
• What are the conditions for failure of the sync HA files command?
• In an HA configuration, if the secondary node takes over as the primary, does it switch back
to secondary status if the original primary comes back online?
No. After the secondary node takes over as the primary, it remains as primary even if the original
primary node comes back online again. To interchange the primary and secondary status of the
nodes, run the
force failover command.
• What are the conditions for failure of the force failover command?
1.
2. Citrix ADC
3. NetScaler 12.0
Integrated Caching
Contributed by:
C
Content Groups
The behavior of the DEFAULT content group is exactly the same as any other group. The only
attribute that makes the DEFAULT content group special is that if an object is being cached and
no content group has been created, the object is cached in the DEFAULT group.
You can send any cache-control header the browser. There is a content group level option, -
cacheControl, which enables you to specify the cache-control header that you want to be in-
serted in the response to the browser.
Minhit is an integer value specifying the minimum number of hits to a cache policy before the
object is cached. This value is configurable at the content group level. Following is the syntax
to configure this value from the NetScaler command line.
add/set cache contentGroup <Content_Group_Name> [-minHits <Integer>]
The expireAtLastByte option enables the integrated cache to expire the object as soon as it has
been downloaded. Only requests that are outstanding requests at that time are served from
cache. any new requests are sent to the server. This setting is useful when the object is fre-
quently modified, as in the case of stock quotes. This expiry mechanism works along with the
Flash Cache feature. To configure expireAtLastByte option, run the following command from
the NetScaler command line:
Cache policy
Policies determine which transactions are cacheable and which are not. Additionally, policies
add or override the standard HTTP caching behavior. Policies determine an action, such as
CACHE or NOCACHE, depending on the specific characteristics of the request or response. If a
response matches policy rules, the object in the response is added to the content group con-
figured in the policy. If you have not configured a content group, the object is added to the
DEFAULT content group.
• What is a miss?
A miss occurs when a request or response does not match any cache policy. A miss can also
occur if the request or response matches a cache policy but some override of RFC behavior pre-
vents the object from being stored in the cache.
• I have configured Integrated Caching feature of the NetScaler appliance. When adding the
following policy, an error message appears. Is there any error in the command?
In the preceding command, the expression should be within the quotation marks. Without quo-
tation marks, the operator is considered to be the pipe operator.
Memory Requirements
• What are the commands that I can run on the NetScaler appliance to check the memory
allocated to cache?
To display the memory allocated for cache in the NetScaler appliance, run any of the following
commands from the NetScaler command line:
In the output, check the value of the Memory usage limit parameter. This is the maximum
memory allocated for cache.
In the output, check the values of the Memory usage and Memory usage limit parameters
indicating the memory used and allocated for the individual content group.
• My NetScaler appliance has 2 GB of memory. Is there any recommended memory limit for
cache?
For any model of the NetScaler appliance, you can allocate half of the memory to the cache.
However, Citrix recommends allocating a little less than half of the memory, because of internal
memory dependency. You can run the following command to allocate 1 GB of memory to cache:
Yes. Even though you allocate memory for the integrated cache globally by running the
set cache parameter –memlimit<Integer>, you can allocate memory to individual content
groups by running the
set cache <Content_Group_Name> –memLimit <Integer> command. The maximum memory
you can allocate to content groups (combined) cannot exceed the memory you have allocated
to the integrated cache.
• What is the dependency of memory between integrated cache and TCP buffer?
If the NetScaler appliance has 2 GB memory, then the appliance reserves approximately 800 to
900 MB of memory and remaining is allocated to FreeBSD operating system. Therefore, you can
allocate up to 512 MB of memory to integrated cache and the rest is allocated to TCP buffer.
• Does it affect the caching process if I do not allocate global memory to the integrated
cache?
If you do not allocate memory to integrated cache, all requests are sent to the server. To make
sure that you have allocated memory to the integrated cache, run the
show cache parameter command. Actually no objects will be cached if global memory is 0, so
this needs to be set first.
Verification commands
You can use either of the following options to display the statistics for cache:
– stat cache
• What is the command that I can run to display the characteristics of an object stored in
cache?
If the object stored in the cache is, for example, GET //10.102.12.16:80/index.html, you can dis-
play the details about the object by running the following command from the NetScaler com-
mand line of the appliance:
Yes. It is mandatory to specify the group name as a parameter to display the parameterized
objects in cache. For example, consider that you have added the following policies with the
same rule:
In this case, for the multiple requests, if policy p1 is evaluated, its hit counter is incremented and
the policy stores the object in the g1 group, which has hit parameters. Therefore, you have to
run the following command to display the objects from the cache:
Similarly, for another set of multiple requests, if policy p2 is evaluated, its hit counter is incre-
mented and the policy stores the object in the g2 group, which does not have hit parameters.
Therefore, you have to run the following command to display the objects from the cache:
• I notice that there are some blank entries in the output of the nscachemgr command. What
are those entries?
Consider the following sample output of the nscachemgr command. The blank entries in this
output are highlighted in bold face for your reference:
1 root@ns# /netscaler/nscachemgr -a
2 //10.102.3.89:80/image8.gif
3 //10.102.3.97:80/staticdynamic.html
4 //10.102.3.97:80/
5 //10.102.3.89:80/image1.gif
6 //10.102.3.89:80/file5.html
7 //10.102.3.96:80/
8 //10.102.3.97:80/bg_logo_segue.gif
9 //10.102.3.89:80/file500.html
10 //10.102.3.92:80/
11 //10.102.3.96:80/cgi-bin/rfc/ccProxyReval.pl
12 Total URLs in IC = 10
The blank entries in the output are due to the default caching properties for GET / HTTP/1.1.
Flushing Objects
You can identify an object uniquely by its complete URL. To flush such object, you can perform
any of the following tasks:
– Flush cache
– Flush content group
– Flush the specific object
To flush the specific object, you have to specify the query parameters. You specify the
invalParam parameter to flush the object. This parameter applies only to a query.
Yes. When you make any changes to the cache configuration, all the SET cache commands in-
herently flush the appropriate content groups.
• I have updated the objects on the server. Do I need to flush the cached objects?
Yes. When you update objects on the server, you must flush the cached objects, or at least the
relevant objects and content groups. The integrated cache is not affected by an update to the
server. It continues to serve the cached objects until they expire.
Flash Cache
The phenomenon of Flash crowds occurs when a large number of clients access the same con-
tent. The result is a sudden surge in traffic toward the server. The Flash Cache feature enables
the NetScaler appliance to improve performance in such situation by sending only one request
to the server. All other requests are queued on the appliance and the single response is served
to all of the requests. You can use either of the following commands to enable the Fast Cache
feature:
The number of Flash Cache clients depends on the availability of resources on the NetScaler
appliance.
Default Behaviour
The NetScaler appliance never proactively receives objects on expiry. This is true even for the
negative objects. The first access after expiry triggers a request to the server.
• Does the integrated cache add clients to the queue for serving even before it starts receiv-
ing the response?
Yes. The integrated cache adds clients to the queue for serving even before it starts receiving
the response.
• What is the default value for the Verify cached object using parameter of the cache config-
uration?
• Does the NetScaler appliance create log entries in the log files?
Yes. The NetScaler appliance creates log entries in the log files.
• What happens to objects that are currently stored in cache and are being accessed though
SSL VPN?
Objects stored in the cache and accessed regularly are served as cache hits when accessed
through SSL VPN.
• What happens to objects stored in the cache when accessed through SSL VPN and later
accessed through a regular connection?
The objects stored through the SSL VPN access are served as a hit when accessed through the
regular connection.
• When using weblogging, how do I differentiate entries that indicate response served from
cache from those served by the server?
For responses served from the integrated cache, the server log field contains the value IC. For
responses served from a server, the server log field contains the value sent by the server. Fol-
lowing is a sample log entry for an integrated caching transaction:
“10.102.1.52 - “Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0; .NET CLR 1.0.3705)” “GET /”
200 0 “IC” 10.102.1.45”
Along with a client request, the response logged is the one sent to the client and not necessarily
the one sent by the server.
Miscellaneous
By configuring relexpiry and absexpiry, it means that you are overriding the header irrespec-
tive of what appears in the header. You can configure different expiry setting and the content
group level. With relexpiry, expiration of the header is based on the time at which the object
was received by the NetScaler. With absexpiry, expiration is based on the time configured on
the NetScaler. Relexpiry is configured in terms of seconds. Absexpiry is a time of day.
The weakpos and heuristic are like fall back values. If there is an expiry header, it is considered
only if the last-modified header is present. The NetScaler appliance sets expiry on the basis of
the last-modified header and the heuristic parameter. The heuristic expiry calculation deter-
mines the time to expiry by checking the last-modified header. Some percentage of the dura-
tion since the object was last modified is used as time to expiry. The heuristic of an object that
remains unmodified for longer periods of time and is likely to have longer expiry periods. The
–heurExpiryParam specifies what percentage value to use in this calculation. Otherwise, the
appliance uses the weakpos value.
If there is some parameter that is in name-value form and does not have the full URL query, or
the appliance receives the parameter in a cookie header or POST body, consider configuring
dynamic caching. To configure dynamic caching, you have to configure hitParams parameter.
On the NetScaler appliance, the %HEXHEX encoding is supported in the parameter names. In
the names that you specify for hitParams or invalParams, you can specify a name that contains
%HEXHEX encoding in the names. For example, name, nam%65, and n%61m%65 are equiva-
lent.
1 POST /data2html.asp?param1=value1¶m2=¶m3¶m4=value4
2 HTTP/1.1
3 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
4 application/vnd.ms-powerpoint, application/vnd.ms-excel,
5 application/msword, application/x-shockwave-flash, */*
6 Referer: http://10.102.3.97/forms.html
7 Accept-Language: en-us
8 Content-Type: application/x-www-form-urlencoded
9 Accept-Encoding: gzip, deflate
10 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
11 Host: 10.102.3.97
12 Content-Length: 153
13 Connection: Keep-Alive
14 Cache-Control: no-cache
15 Cookie: ASPSESSIONIDQGQGGRNY=NNLLKDADEENOAFLCCDGFGDMO
16 S1=This+text+is+only+text%2C+not+more+and+not+less%2C+%0D%0Ajust+
text+to+be+itself%2C+namely+%22Text%22+to+be+posted+as+text
+%28what+else...%29&B1=Submit
In the above request, you can use S1 and B1, highlighted in bold face for your reference, as
hitParams depending on your requirements. Additionally, if you use -matchCookies YES in
the ASPSESSIONIDQGQGGRNY content group, then you can also use these parameters as
hitParams.
• What happens to the queued clients if the response is not cacheable?
If the response is not cacheable, all of the clients in the queue receive the same response that
the first client receives.
• Can I enable the Poll every time (PET) and Flash Cache features on the same content group?
No. You cannot enable PET and Flash Cache on the same content group. The integrated cache
does not perform AutoPET function on Flash Cache content groups. The PET feature ensures
that the integrated cache does not serve a stored object without consulting the server. You can
configure PET explicitly for a content group.
• When are the log entries created for the queued clients?
The log entries are created for the queued clients soon after the appliance receives the response
header. The log entries are created only if the response header does not make the object non-
cacheable.
• What is the meaning of the DNS, HOSTNAME, and HOSTNAME_AND_IP values of the Verify
cached object using parameter of the cache configuration?
• I have set weakNegRelExpiry to 600, which is 10 minutes. I noticed that 404 responses are
not getting cached. What is the reason?
This completely depends on your configuration. By default, 404 responses are cached for 10
minutes. If you want all 404 responses to be fetched form the server, specify–weakNegRelExpiry
0. You can fine tune the –weakNegRelExpiry to a desired value, such as higher or lower to get the
404 responses cached appropriately. If you have configured –absExpiry for positive responses,
then it might not yield desired results.
• When the user accesses the site by using the Mozilla Firefox browser, the updated content is
served. However, when the user accesses the site by using the Microsoft Internet Explorer
browser, stale content is served. What could be the reason?
The Microsoft Internet Explorer browser might be taking the content from its local cache instead
of the NetScaler integrated cache. The reason could be that the Microsoft Internet Explorer
browser is not respecting the expiry related header in the response.
To resolve this issue, you can disable the local cache of the Internet Explorer and clear the offline
content. After clearing the offline content, the browser should display the updated content
Check to see if the server time and NS time are in sync. And the weakPosrelexpiry limit set
should bear the time difference between NS and server as shown below
root@ns180# date
Verify that memory is allocated to the integrated cache and that the allocation is greater than
zero.
There is no command line or GUI option for setting the cache counters to zero, and flushing the
cache does not do so either. Rebooting the box automatically sets these counters to zero.
1.
2. Citrix ADC
3. NetScaler 12.0
October 3, 2018
Contributed by:
C
This is section, you’ll find answers to the following questions. Scroll down to see the answers.
• I want to change the SSH port (22) on the NetScaler appliance to some other port. Is it possible
to change the SSH port on the appliance?
• I want to log on to the NetScaler appliance without entering the password. Is it possible to
configure SSH on the appliance to allow that?
• What is the procedure to reset the NetScaler appliance BIOS? Under what circumstances should
I reset the BIOS?
• I need to reset the NetScaler appliance to the factory defaults. What procedure should I follow?
• After I upgraded the Citrix ADC release on the appliance, the appliance still displays the earlier
release/build. What could be the reason?
• Since I upgraded the Citrix ADC release on the appliance, the LCD display on the front panel
of the appliance displays the out of service message or does not display anything. How can I
resolve this issue?
• I have upgraded the Citrix ADC release/build. However, after the upgrade process, the appliance
fails to start. Can I downgrade the appliance’s software to the previous release/build?
• After upgrading the Citrix ADC release on the appliance, I accidently deleted the kernel file from
the /flash directory. As a result, I am not able to start the appliance. Is there a method for starting
the appliance in this situation?
• After upgrading the appliance software to Citrix ADC release 10.0, I am not able to log on to the
appliance, and the following message is appears:
login: nsroot Password: connect: No such file or directory nsnet_connect: No such file or direc-
tory Login incorrect
I tried to resolve this issue by using the password recovery procedure, but I was not successful.
Have I done something incorrectly?
• During an upgrade of a high availability pair, the following message appears repeatedly:
ns sshd[5035]: error: Invalid username or password
What could be the reason?
• I want to change the netmask of the NetScaler IP address on a Citrix ADC appliance. Can I do so
without causing an outage?
• I have configured a High Availability pair of Citrix ADC appliances. After upgrading the software
release from a beta release to a final release, I noticed that some of the appliance configurations
are missing. Can I retrieve the lost configurations?
• Can I upgrade a Citrix ADC appliance directly from release 10.0 to 10.5, or should I upgrade to
10.1 first and then to 10.5?
• Can the primary appliance and secondary appliance have separate builds?
• Can both the appliances in an High Availability (HA) pair be upgraded at the same time?
• Does Citrix support firmware upgrades in the amazon AWS cloud?
• Can I upgrade the Citrix ADC instance independently of the SDX version?
• Can I use the FTP server to upgrade the Citrix ADC appliance?
• Is the procedure for upgrading the Citrix ADC appliance with GSLB configurations different from
an upgrade of an appliance that is not involved in GSLB?
Downgrade
• I have received a Citrix ADC appliance with the latest Citrix ADC release installed on it. However,
I want to downgrade the software release. Can I do so?**
• When downgrading the Citrix ADC release, I followed the instructions. However, the appliance
displays the following message:
1 root@LBCOL03B# ./installns
2 installns version (10.0-47.7) kernel (ns-10.0-47.7.gz)
3 Note:
4 Installation may pause for up to 3 minutes while data is written to the
flash.
5 Caution:
6 Do not interrupt the installation process.
7 Doing so may cause the system to become unusable.
8 Installation will proceed in 5 seconds, CTRL-C to abort
9 No Valid Netscaler Version Detected
10 root@LBCOL03B#
A NetScaler appliance uses Zebos as the routing suite. The zebos.conf file available in a NetScaler
release is the configuration file for Zebos.
I want to change the SSH port (22) on the NetScaler appliance to some other port. Is it possible
to change the SSH port on the appliance?
Yes. You can change the SSH port on the NetScaler appliance by editing the sshd_config file in the
/nsconfig directory. If the file does not exist in the /nsconfig directory, copy it from the /etc directory.
In the sshd_config file, edit the entry for Port 22 to Port <Number>, where <Number> is the target port
number. If you do not want to restart the appliance and make the changes effective, terminate the
sshd process by using the kill command, and then restart the process.
The flash directory is missing from the NetScaler appliance. What procedure should I follow to
mount the flash directory?
Hit [Enter] to boot immediately, or any other key for command prompt. Booting [kernel] in 10
seconds…” Hit space and you should see the following prompt:
Type ‘?’ for a list of commands, ‘help’ for more detailed help.
boot –s
6. From the shell prompt, run the following command to verify that the flash directory is mounted:
1 df -kh
I want to log on to the NetScaler appliance without entering the password. Is it possible to con-
figure SSH on the appliance to allow that?
Yes. You can configure SSH on the NetScaler appliance to log on without a password. However, you
must provide your user name. To configure SSH for logging in without a password, do the following:
1. Run the following command to generate the public and private keys:
1 \# ssh-keygen -t rsa
2. Run the following command to copy the id_rsa.pub file to the .ssh directory of the remote host
that you want to log on to:
5. Run the following commands to add the public key of the client to the known public keys:
What is the procedure to reset the NetScaler appliance BIOS? Under what circumstances should
I reset the BIOS?
2. Start the appliance and press Delete as soon as the boot-up process starts.
Pressing Delete during the POST process displays the appliance’s BIOS settings.
4. Select the Load Optimal Defaults option. The Load Optimal Settings message box appears.
5. Select OK.
6. Make the following changes to the BIOS settings on the various tabs:
Tab
9. Select OK to confirm.
10. Verify that the appliance starts cleanly and the serial console displays output after the appliance
starts.
1 You need to reset BIOS when the serial console does not respond. This
usually happens after you upgrade the appliance and the serial
console is disabled. However, you can still access the appliance by
using the telnet or SSH utility.
I need to reset the NetScaler appliance to the factory defaults. What procedure should I follow?
To reset the NetScaler appliance to the factory defaults, you need to reset two environments: the
NetScaler application environment and the base FreeBSD environment.
To reset the NetScaler application environment of the appliance to the factory defaults, do the follow-
ing:
If the appliance does not receive any packets, it reports a hang condition, because on a network it is
very unlikely not to receive any packets. However, if the appliance is plugged into quite interface, you
can ignore this error message.
After I upgraded the NetScaler release on the appliance, the appliance still displays the earlier
release/build. What could be the reason?
The appliance displays the software version number from the /flash/boot/loader.conf file. If the ker-
nel entry for the current NetScaler release is missing from that file, the appliance displays the last
NetScaler release version for which the entry was available.
To resolve this issue, do the following:
(You can expect the entry for the kernel of the release/build that you just installed to be missing
from the file.)
3. Open the loader.conf file in a text editor, such as the vi editor, and update the kernel entry for
the new release/build.
Since I upgraded the NetScaler release on the appliance, the LCD display on the front panel of the
appliance displays the out of service message or does not display anything. How can I resolve
this issue?
1 /netscaler/nslcd ‒ k
I have upgraded the NetScaler release/build. However, after the upgrade process, the appliance
fails to start. Can I downgrade the appliance’s software to the previous release/build?
Yes. You can start the appliance with the kernel.old kernel file. When you restart the appliance, press
the F1 key as soon as the appliance console displays the Press F1 message. Type kernel.old and press
Enter.
After upgrading the NetScaler release on the appliance, I accidently deleted the kernel file from
the /flash directory. As a result, I am not able to start the appliance. Is there a method for starting
the appliance in this situation?
Yes. You can start the appliance by using the kernel.GENERIC kernel file, as follows:
1. When you restart the appliance, press the F1 key as soon as the appliance console displays the
Press F1 message.
2. Type kernel.GENERIC and press Enter.
3. Login as the root user.
4. Reinstall the NetScaler release.
5. Restart the appliance.
After upgrading the appliance software to NetScaler release 10.0, I am not able to log on to the
appliance, and the following message is appears:
1 ‘‘‘
2 login: nsroot
3 Password:
4 connect: No such file or directory
I tried to resolve this issue by using the password recovery procedure, but I was not successful.
Have I done something incorrectly?
You cannot resolve this issue by using the password recovery procedure. NetScaler releases 8.0 and
later use the new licensing system, based on the Imgrd daemon, which runs during the startup pro-
cedure. For this daemon to work properly, the host name of NetScaler appliance, which is set in the
/nsconfig/rc.conf file, must be resolved by a name server to the NetScaler IP address. Alternately, you
can create a hosts file in the /nsconfig directory and add the 127.0.0.1 <Host_Name> entry in file.
Additionally, make sure that you have copied the license files to the /nsconfig/license/ directory.
During an upgrade of a high availability pair, the following message appears repeatedly:
This error message appears when the appliances involved in the high availability pairing have either
a different NetScaler release or a different builds of the same release installed. The appliances can
have different version installed if you have upgraded or downgraded one appliance but not the other.
I want to change the netmask of the NetScaler IP address on a NetScaler appliance. Can I do so
without causing an outage?
Changing the netmask of the NetScaler IP might result in a short outage. Make sure that you change
the netmask on the secondary appliance, and then break the high availability pairing. Check the func-
tionality of the appliance. If everything works as expected, rebuild the high availability pairing.
To change the netmask on the appliance, run the configns command from the CLI prompt, and then
choose the second option in the menu.
I have configured a High Availability pair of NetScaler appliances. After upgrading the software
release from a beta release to a final release, I noticed that some of the appliance configurations
are missing. Can I retrieve the lost configurations?
1 save config
2
3 shell
4
Can I upgrade a NetScaler appliance directly from release 10.0 to 10.5, or should I upgrade to 10.1
first and then to 10.5?
You can directly upgrade a NetScaler appliance regardless of the version or the build number.
Can the primary appliance and secondary appliance have separate builds?
Recommended practice is to use the same version and build number on both the primary and the
secondary appliance.
Can both the appliances in an High Availability (HA) pair be upgraded at the same time?
No. In an HA pair, first upgrade the secondary node and then upgrade the primary node.
Yes.
It is not required to upgrade the SDX version when the NetScaler appliance is upgraded. However,
some features might not work.
No. You must first download the firmware from the Citrix download site, save it on your local computer
and then upgrade the appliance.
Is the procedure for upgrading the NetScaler appliance with GSLB configurations different from
an upgrade of an appliance that is not involved in GSLB?
No. The upgrade procedure is similar to the basic upgrade procedure. The only difference is that you
can upgrade the standalone or HA appliances on different sites in a phased manner.
Downgrade
I have received a NetScaler appliance with the latest NetScaler release installed on it. However,
I want to downgrade the software release. Can I do so?
No. If you attempt to downgrade the software release, the appliance might not work as expected,
because the ns.conf file of the later release might not be compatible with the earlier release, and the
appliance might restore to the factory settings.
When downgrading the NetScaler release, I followed the instructions. However, the appliance
displays the following message:
1 root@LBCOL03B# ./installns
2 installns version (10.0-47.7) kernel (ns-10.0-47.7.gz)
3 Note:
4 Installation may pause for up to 3 minutes while data is written to the
flash.
5 Caution:
6 Do not interrupt the installation process.
7 Doing so may cause the system to become unusable.
8 Installation will proceed in 5 seconds, CTRL-C to abort
9 No Valid Netscaler Version Detected
10 root@LBCOL03B#
The rollback procedure is similar to the basic upgrade procedure. Select the target build that you
want to roll back to and perform the downgrade.Before rolling back to a different release, Citrix rec-
ommends that you create a copy of your current configuration files. To downgrade from a release, see
Downgrading a NetScaler Standalone Appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
Load Balancing
Contributed by:
C
• What are the various load balancing policies I can create on the NetScaler appliance?
You can create the following types of load balancing policies on the NetScaler appliance:
– Least Connections
– Round Robin
– Least response time
– Least bandwidth
– Least packets
– URL hashing
– Domain name hashing
– Source IP address hashing
– Destination IP address hashing
– Source IP - Destination IP hashing
– Token
– LRTM
• Can I achieve the Web farm security by implementing load balancing using the NetScaler
appliance?
Yes. You can achieve Web farm security by implementing load balancing using the NetScaler
appliance. NetScaler appliance enables you to implement the following options of the load
balancing feature:
– IP Address hiding: Enables you to install the actual servers to be on private IP address
space for security reasons and for IP address conservation. This process is transparent to
the end-user because the NetScaler appliance accepts requests on behalf of the server.
While in the address hiding mode, the appliance completely isolates the two networks.
Therefore, a client can access a service running on the private subnet, such as FTP or a
Telnet server, through a different VIP on the appliance for that service.
– Port Mapping: Enables the actual TCP services to be hosted on non-standard ports for
security reasons. This process is transparent to the end-user as the NetScaler appliance
accepts requests on behalf of the server on the standard advertised IP address and port
number.
• What are various devices that I can use to load balance with a NetScaler appliance?
You can load balance following devices with a NetScaler appliance:
– Server farms
– Caches or Reverse Proxies
– Firewall devices
– Intrusion detection systems
– SSL offload devices
– Compression devices
– Content Inspection servers
• Why should I implement the load balancing feature for the website?
You can implement the Load balancing feature for the website to take the following advantages:
– Reduce the response time: When you implement the load balancing feature for the web-
site, one of the major benefits is the boost you can look forward to in load time. With two
or more servers sharing the load of the web traffic, each of the servers runs less traffic
load than a single server alone. This means there are more resources available to fulfill
the client requests. This results in a faster website.
– Redundancy: Implementing the load balancing feature introduces a bit of redundancy.
For example, if the website is balanced across three servers and one of them does not re-
spond at all, the other two can keep running and the website visitors do not even notice
any downtime. Any load balancing solution immediately stops sending traffic to the back-
end server that is not available.
• Why do I need to disable the Mac Based Forwarding (MBF) option for Link Load Balancing
(LLB)?
– If you enable the MBF option, the NetScaler appliance considers that the incoming traffic
from the client and the outgoing traffic to the same client flow through the same upstream
router. However, the LLB feature requires that the best path be chosen for the return traffic.
– Enabling the MBF option breaks this topology design by sending the outgoing traffic
through the router that forwarded the incoming client traffic.
• What are the various persistence types available on the NetScaler appliance?
– Source IP
– Cookie insert
– SSL session ID
– URL passive
– Custom Server ID
– Rule
– DESTIP
1.
2. Citrix ADC
3. NetScaler 12.0
NetScaler GUI
January 6, 2019
Contributed by:
C
• When I use Firefox to compare two NetScaler configurations, the browser seems to freeze?
Firefox will eventually display the differences in the configurations, but the process takes a con-
siderable amount of time if there are more than 1000 differences. Use Chrome for a faster re-
sponse.
• I am using a MAC Safari browser to upgrade a NetScaler appliance. On the upgrade wizard,
when I click the Browse button to choose the build file from the appliance, the dialog box
does not show any files or folders. Also, when I navigate back to the root folder, the dialog
box displays the top level folder, but I cannot browse it. What should I do?
On the Safari browser, click the Settings icon and navigate to Preferences > Security > Manage
Website Settings > Java, and then change value of the When visiting other websites setting to
Run in unsafe mode.
• I am using HTTP to access the NetScaler GUI. Which port should I open?
Open TCP port 80 when using HTTP to access the NetScaler GUI.
• I am using HTTPS to access the NetScaler GUI. Which port should I open?
Open TCP port 443 when using HTTPS to access the NetScaler GUI.
• With which browsers is the NetScaler GUI compatible for different operating systems?
• When I access the NetScaler GUI by using Internet Explorer version 8 or 9, the browser dis-
plays only a grey bar at the top of the screen. What should I do?
The browser might be set in compatibility mode. To disable compatibility mode, go to Tools >
Compatibility View Settings and clear the Display all websites in Compatibility View check
box.
• Even after I disable compatibility mode in Internet Explorer version 8 or 9, the NetScaler
GUI does not appear. What should I do?
Make sure that the browser mode and document mode in the browser are set to the same ver-
sion. To view the configuration, press F12. Set the values to either Internet Explorer 8 or Internet
Explorer 9.
• After logging into the NetScaler appliance, the page appears blank. What should I do?
Make sure you have disabled the Protected mode in your browser settings. If this is enabled,
the Java Script is causing the NetScaler user interface screen to appear blank.
2. Go to Security tab settings, click Restricted sites zone to disable Enable Protected Mode
check box.
• When I access the NetScaler GUI by using Internet Explorer version 9, the utility displays
the following error message: “You are not logged in. Please login.” What should I do?
Make sure that the cookies are not blocked in your Interner Explorer settings. Go to Tools >
Internet Options. Click the Privacy tab, and then under Settings, make sure that the slider is
set to Medium or any lower value.
1.
2. Citrix ADC
3. NetScaler 12.0
SSL
Contributed by:
C
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Information and Communication Technology (ICT) is about bringing the Internet user closer to the
apps and data. The latest datacenter technologies have enabled the user, apps and data to be located
anywhere. A user can access apps and data from the office or from home, or from a location such as
an airport. The apps and data can be located either on the enterprise’s premises, in a public or private
cloud, or on a hybrid host. The result has been on only increased productivity, but also reduced costs
of ownership and maintenance.
Service provides offer the core infrastructure needed for carrying the user’s apps and data over the
network. Because the core infrastructure serves millions of subscribers and a wide variety of apps
and data, requirements for scale and protocol support are very high. The core infrastructure handles
two major types of traffic: data plane and control plane. Each of these planes has its own scale and
protocol-support requirements.
The data plane is the part of the core infrastructure that carries user apps and data from end to end,
that is, between end-user equipment and the application server. The number of users accessing apps
and data is in the thousands of millions, so throughput and IP-addressing requirements are very high.
Every user in the network must be uniquely identifiable. Only then can the service provider control
the traffic, monitor network usage, deliver user-specific services, and log information correctly. Many
of the today’s client devices and application servers support IPv6 natively. The core infrastructure
must not only support a mix of IPv4 and IPv6 clients and servers, but also provide the technologies
for cross-communication between IPv4 and IPv6. Finally, a service provider is measured by the quality
of service (directly related to end-user experience) and the availability of service without disruptions.
The data plane should be resilient enough to provide both quality and availability at the same time.
The control-plane infrastructure manages user traffic and maintains the business and network opera-
tions services. The most important of the many protocols that run in this plane are Diameter, Radius,
and SMPP. Diameter is a base protocol over which several other function-specific protocols have been
developed. For example:
• Gx interface between the Policy and Charging Enforcement Function (PCEF) and the Policy and
Charging Rules Function (PCRF)
• Gy interface between the Online Charging System (OCS) and the Cisco Packet Data Network
Gateway (PGW)/Policy and Charging Enforcement Function (PCEF)
The volume of control plane traffic is in direct proportion to user activity. To manage the control plane
traffic, service providers use several ADC functionalities, such as load balancing and content switch-
ing. They need fine-grain control of control plane traffic, which equals data-plane traffic in complexity.
Service providers must meet demanding service-level agreements (SLAs), and are scrutinized thor-
oughly by regulators for compliance. Adhering to requirements while managing the data and con-
trol plane traffic requires a service provider to keep its infrastructure nimble, within budget, easily
upgradable, and flexible. As the most powerful and advanced ADCs in the market today, NetScaler
ADC products are a natural fit for the service-provider environment.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Note
The Internet’s phenomenal growth has resulted in a shortage of public IPv4 addresses. Large Scale
NAT (LSN/CGNAT) provides a solution to this issue, maximizing the use of available public IPv4 ad-
dresses by sharing a few public IPv4 addresses among a large pool of Internet users.
LSN translates private IPv4 addresses into public IPv4 addresses. It includes network address and
port translation methods to aggregate many private IP addresses into fewer public IPv4 addresses.
LSN is designed to handle NAT on a large scale. The NetScaler LSN feature is very useful for Internet
Service Providers (ISPs) and carriers providing millions of translations to support a large number of
users (subscribers) and at very high throughput.
LSN Architecture
The LSN architecture of an ISP using Citrix products consists of subscribers (Internet users) in private
address spaces accessing the Internet through a NetScaler appliance deployed in ISP’s core network.
Subscribers are connected to the ISP through the ISP’s access network. Usually, subscribers for com-
mercial use of the Internet are directly connected to the ISP’s access network. Serving those sub-
scribers requires only one level of NAT (NAT44).
The NetScaler appliance receives all subscriber packets destined to the Internet. The appliance is con-
figured with a pool of pre-defined NAT IP addresses to use for LSN. The NetScaler appliance uses its
LSN feature to translate the source IP address (private) and port of the packet to the NAT IP address
(public) and NAT port, and then sends the packet to its destination on the Internet. The appliance
maintains a record of all active sessions that use the LSN feature. These sessions are called LSN ses-
sions. The NetScaler appliance also maintains the mappings between subscriber IP address and port,
and NAT IP address and port, for each session. These mappings are called LSN mappings. From LSN
sessions and LSN mappings, the NetScaler appliance recognizes a response packet (received from the
Internet) belonging to a particular session. The appliance translates the destination IP address and
port of the response packet from NAT IP address:port to the subscriber IP address:port, and sends the
translated packet to the subscriber.
The following describes some of the LSN features supported on NetScaler appliance:
The NetScaler appliance allocates NAT IP addresses and ports, from its pre-defined NAT resource pool,
to subscribers to translate their packets for transmission to external hosts (Internet). The NetScaler
appliance supports the following types of NAT IP address and port allocation for subscribers:
• Deterministic. The NetScaler appliance allocates a NAT IP address and a block of ports to each
subscriber. The appliance sequentially allocates NAT resources to these subscribers. It assigns
the first block of ports on the beginning NAT IP address to the beginning subscriber IP address.
The next range of ports is assigned to the next subscriber, and so on, until the NAT address does
not have enough ports for the next subscriber. At that point, the first port block on the next NAT
address is assigned to the subscriber, and so on.
The NetScaler appliance logs the allocated NAT IP address and the port block for a subscriber.
For a connection, a subscriber can be identified just by its mapped NAT IP address and port
block. Because of this reason, the NetScaler appliance does not log any LSN session created
or deleted. If the entire block of ports is being used, the NetScaler appliance drops any new
connection from the subscriber.
• Dynamic. The NetScaler appliance allocates a random NAT IP address and a port from the LSN
NAT pool for a subscriber’s connection. When port block allocation is enabled in the configu-
ration, the appliance allocates a random NAT IP address and a block of ports for a subscriber
when it initiates a connection for the first time. The NetScaler appliance then allocates this NAT
IP address and one of the ports from the allocated block to each subsequent connection from
this subscriber. If the entire block of ports is being used, the appliance allocates a new random
port block to the subscriber when it initiates a new connection. One of the port in the new port
block is allocated for the new connection.
IP Pooling
The following NAT resource allocation options are available for subsequent sessions of a subscriber
who was allocated a random NAT IP address and port for an existing session.
• Paired. The NetScaler appliance allocates the same NAT IP address for all sessions asso-
ciated with the same subscriber. When no more ports are available for that address, the
appliance drops any new connections from the subscriber. This option is needed for proper
functioning of certain applications that require creation of multiple sessions on the same
source IP address (for example in peer-to-peer applications that use RTP or RTCP protocol.
• Random. The NetScaler appliance allocates random NAT IP addresses, from the pool, for differ-
ent sessions associated with the same subscriber.
The NetScaler appliance can reuse an existing LSN map for new connections originating from the same
subscriber IP address and port. The NetScaler LSN feature supports the following types of LSN map-
ping reuse:
1. Endpoint Independent. The NetScaler appliance reuses the LSN mapping for subsequent pack-
ets sent from the same subscriber IP address and port (X:x) to any external IP address and
port. This type of LSN map reuse is useful for proper functioning of VOIP and peer-to-peer appli-
cations.
2. Address dependent. The NetScaler appliance reuses the LSN mapping for subsequent packets
sent from the same subscriber IP address and port (X:x) to the same external IP address (Y),
regardless of the external port.
3. Address port dependent. The NetScaler appliance reuses the LSN mapping for subsequent
packets sent from the same internal IP address and port (X:x) to the same external IP address
and port (Y:y) while the mapping is still active.
LSN Filtering
The NetScaler appliance can filter packets from external hosts based on the active LSN sessions and
LSN mappings. Consider an example of an LSN mapping that includes the mapping of subscriber
IP:port (X:x), NAT IP:port (N:n), and external host IP:port (Y:y). The NetScaler LSN feature supports the
following types of filtering:
1. Endpoint Independent. The NetScaler appliance filters out only those packets that are not des-
tined to NAT IP:port (N:n), which represents subscriber IP:port (X:x), regardless of the external
host IP address and port source (Z:z). The NetScaler appliance forwards any packets destined
to X:x. In other words, sending packets from the subscriber to any external IP address is suffi-
cient to allow packets from any external host to the subscriber. This type of filtering is useful
for proper functioning of VOIP and peer-to-peer applications.
2. Address dependent. The NetScaler appliance filters out packets not destined to NAT IP:port
(N:n), which represents subscriber IP:port (X:x). In addition, the appliance filters out packets
from external host IP address and port (Y:y) destined for N:n if the subscriber has not previously
sent packets to Y:anyport (external port independent). In other words, receiving packets from
a specific external host requires that the subscriber first send packets to that specific external
host’s IP address.
3. Address port dependent. The NetScaler appliance filters out packets not destined to NAT
IP:port (N:n), which represents subscriber IP:port (X:x). In addition, the appliance filters out
packets from external host IP address and port (Y:y) destined for N:n if the subscriber has not
previously sent packets to Y:y. In other words, receiving packets from a specific external host
requires that the subscriber first send packets to that specific external IP address and port.
Quotas
The NetScaler appliance can limit the number of NAT ports and sessions for each subscriber to ensure
fair distribution of resources among subscribers. The NetScaler appliance can also limit the number
of session for a subscriber group to ensure fair distribution of resources among different subscriber
groups.
• Port quota. The NetScaler appliance can limit the LSN NAT ports to be used at a time by each
subscriber for a specified protocol. For example, you could limit each subscriber to a maxi-
mum of 500 TCP NAT ports. When the LSN NAT mappings for a subscriber reach the limit, the
NetScaler appliance does not allocate additional NAT ports of the specified protocol to that sub-
scriber.
• Subscriber Session Limit. The number of concurrent session for a subscriber can be more than
it port quota. The NetScaler appliance can limit the LSN sessions allowed for each subscriber
for a specified protocol. When the number of LSN sessions reaches the limit for a subscriber, the
NetScaler appliance does not allow the subscriber to open additional sessions of the specified
protocol.
• Group Session Limit. The NetScaler appliance can limit the total number of LSN sessions al-
lowed for a subscriber group for a specified protocol. When the total number of LSN sessions
reaches the limit for a group for a specified protocol, the NetScaler appliance does not allow any
subscriber of the group to open additional sessions of the specified protocol. For example, You
limit a group to a maximum of 10000 UDP sessions. When the total number of UDP sessions for
this group reaches 10000, the NetScaler appliance does not allow any subscriber of the group
to open additional UDP sessions.
For some Application layer protocols, the IP addresses and protocol port numbers are also communi-
cated in the packet’s payload. Application Layer Gateway for a protocol parses the packet’s payload
and does necessary changes to ensure that the protocol continues to work over LSN.
• FTP
• ICMP
• TFTP
• PPTP
• SIP
• RTSP
Hairpin Support
The NetScaler appliance supports communication between subscribers or internal hosts using NAT
IP addresses. This type of communication between two subscribers using NAT IP addresses is called
hairpin flow. Hairpin flow is enabled by default, and you cannot disable it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
• Make sure that you understand the different components of Large Scale NAT, described in RFCs
6888, 5382, 5508, and 4787.
• Endpoint independent mapping (EIM) and endpoint independent filtering (EIF) are disabled by
default. These options must be enabled for proper functioning of VoIP and peer-to-peer (P2P)
applications.
• Logging LSN: Following are the consideration points for logging LSN information:
– Citrix recommends logging the LSN information on external log servers instead of on the
NetScaler appliance. Logging on external servers facilitates optimal performance when
the appliance creates large numbers of LSN log entries (in order of millions).
– Citrix recomends using SYSLOG over TCP, or NSLOG. By default SYSLOG uses UDP, and
NSLOG uses only TCP to transfer log information to the log servers. TCP is more reliable
than UDP for transferring complete data.
– The following limitations apply to SYSLOG over TCP:
* The Syslog over TCP solution does not provide authentication, integrity check, and
privacy.
* The NetScaler appliance relies on the TCP protocol to provide confirmation of SYSLOG
message delivery to external log servers.
• High Availability: Following are the consideration points for high availability of NetScaler ap-
pliances for LSN:
– Citrix recommends configuring the LSN feature in a high availability deployment of two
NetScaler appliances for uninterrupted and seamless operation of all LSN sessions.
– In a high availability deployment, Citrix recommends:
* Setting the SYNC VLAN parameter for dedicating a VLAN for all HA related communi-
cation.
* Synchronizing the symmetric RSS key of the primary node to the secondary node for
stateful synchronization of a large number of LSN mappings and sessions.
* Binding the subnet of LSN IP addresses to a VLAN to avoid flooding of GARP broadcasts
on all VLANs after a failover.
– In a high availability deployment of NetScaler appliances, ALG-related sessions are not
mirrored to the secondary appliance.
• Application Layer Gateways (ALGs): Following are the consideration points related for ALGs
on a NetScaler appliance:
– The following are not supported for SIP ALG:
* Multicast IP addresses
* Encrypted SDP
* SIP messages over TLS
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
1. Set the global LSN parameters. Global parameters include the amount of NetScaler memory
reserved for the LSN feature and synchronization of LSN sessions in a high availability setup.
2. Create an LSN client entity and bind subscribers to it. An LSN client entity is a set of sub-
scribers on whose traffic you want the NetScaler appliance to perform LSN. The client entity
includes IPv4 addresses and extended ACL rules for identifying subscribers. An LSN client can
be bound to only one LSN group. The command line interface has two commands for creating
an LSN client entity and binding a subscriber to the LSN client entity. The configuration utility
combines these two operations on a single screen.
3. Create an LSN pool and bind NAT IP addresses to it. An LSN pool defines a pool of NAT IP ad-
dresses to be used by the NetScaler appliance to perform LSN. The pool is assigned parameters,
such as port block allocation and NAT type (Deterministic or Dynamic). An LSN pool bound to
an LSN group applies to all subscribers of an LSN client entity bound to the same group. Only
LSN Pools and LSN groups with the same NAT type settings can be bound together. Multiple LSN
pools can be bound to an LSN group. For Dynamic NAT, an LSN pool can be bound to multiple
LSN groups. For Deterministic NAT, pools bound to an LSN group cannot be bound to other LSN
groups. The command line interface has two commands for creating an LSN pool and binding
NAT IP addresses to the LSN pool. The configuration utility combines these two operations on
a single screen.
4. (Optional) Create an LSN Transport Profile for a specified protocol. An LSN transport pro-
file defines various timeouts and limits, such as maximum LSN sessions and maximum ports
usage, that a subscriber can have for a given protocol. You bind an LSN transport profile for
each protocol (TCP, UDP, and ICMP) to an LSN group. A profile can be bound to multiple LSN
groups. A profile bound to an LSN group applies to all subscribers of an LSN client bound to
the same group. By default, one LSN transport profile with default settings for TCP, UDP, and
ICMP protocols is bound to an LSN group during its creation. This profile is called default trans-
port profile. An LSN transport profile that you bind to an LSN group overrides the default LSN
transport profile for that protocol.
5. (Optional) Create an LSN Application Profile for a specified protocol and bind a set of des-
tination ports to it. An LSN application profile defines the LSN mapping and LSN filtering con-
trols of a group for a given protocol and for a set of destination ports. For a set of destination
ports, you bind an LSN profile for each protocol (TCP, UDP, and ICMP) to an LSN group. A profile
can be bound to multiple LSN groups. An LSN application profile bound to an LSN group applies
to all subscribers of an LSN client bound to the same group. By default, one LSN application pro-
file with default settings for TCP, UDP, and ICMP protocols for all destination ports is bound to
an LSN group during its creation. This profile is called a default application profile. When you
bind an LSN application profile, with a specified set of destination ports, to an LSN group, the
bound profile overrides the default LSN application profile for that protocol at that set of desti-
nation ports. The command line interface has two commands for creating an LSN application
profile and binding a set of destination ports to the LSN application profile. The configuration
The following table lists the maximum numbers of different LSN entities and bindings that can be
created on a NetScaler appliance. These limits are also subject to memory available on the NetScaler
appliance.
To bind a network address or an ACL rule to an LSN client by using the command line interface
To bind an IP address range to an LSN pool by using the command line interface
Note: For removing LSN IP addresses from an LSN pool, use the unbind lsn pool command.
To bind an application protocol port range to an LSN application profile by using the command
line interface
To bind LSN profiles and LSN pools to an LSN group by using the command line interface
To configure an LSN client and bind an IPv4 network address or an ACL rule by using the configuration
utility
Navigate to System > Large Scale NAT > Clients, and add a client and then bind an IPv4 network
address or an ACL rule to the client.
To configure an LSN pool and bind NAT IP addresses by using the configuration utility
Navigate to System > Large Scale NAT > Pools, and add a pool and then bind an NAT IP address or a
range of NAT IP addresses to the pool.
To configure an LSN group and bind an LSN client, pools, transport profiles, and application profiles
by using the configuration utility
Navigate to System > Large Scale NAT > Groups, and add a group and then bind an LSN client, pools,
transport profiles, and application profiles to the group.
– clientname
Name for the LSN client entity. Must begin with an ASCII alphanumeric or underscore (_)
character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.),
space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after
the LSN client is created. The following requirement applies only to the CLI: If the name
includes one or more spaces, enclose the name in double or single quotation marks (for
example, “lsn client1” or ‘lsn client1’).
– clientname
Name for the LSN client entity. Must begin with an ASCII alphanumeric or underscore (_)
character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.),
space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after
the LSN client is created. The following requirement applies only to the CLI: If the name
includes one or more spaces, enclose the name in double or single quotation marks (for
example, “lsn client1” or ‘lsn client1’).
– network
IPv4 address(es) of the LSN subscriber(s) or subscriber network(s) on whose traffic you
want the NetScaler appliance to perform Large Scale NAT.
– netmask
Subnet mask for the IPv4 address specified in the Network parameter.
– td
ID of the traffic domain on which this subscriber or the subscriber network (as specified
by the network parameter) belongs.
If you do not specify an ID, the subscriber or the subscriber network becomes part of the
default traffic domain.
Default value: 0
Minimum value: 0
– aclname
Name(s) of any configured extended ACL(s) whose action is ALLOW. The condition spec-
ified in the extended ACL rule identifies the traffic from an LSN subscriber for which the
NetScaler appliance is to perform large scale NAT. Maximum Length: 127
– poolname
Name for the LSN pool. Must begin with an ASCII alphanumeric or underscore (_) char-
acter, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space,
colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the LSN
pool is created. The following requirement applies only to the CLI: If the name includes
one or more spaces, enclose the name in double or single quotation marks (for example,
“lsn pool1” or ‘lsn pool1’).
– nattype
Type of NAT IP address and port allocation (from the LSN pools bound to an LSN group)
for subscribers (of the LSN client entity bound to the LSN group):
* Dynamic—Allocate a random NAT IP address and a port from the LSN NAT pool for a
subscribers connection. If port block allocation is enabled (in LSN pool) and a port
block size is specified (in the LSN group), the NetScaler appliance allocates a random
NAT IP address and a block of ports for a subscriber when it initiates a connection
for the first time. The appliance allocates this NAT IP address and a port (from the
allocated block of ports) for different connections from this subscriber. If all the ports
are allocated (for different subscribers connections) from the subscribers allocated
port block, the appliance allocates a new random port block for the subscriber. Only
LSN Pools and LSN groups with the same NAT type settings can be bound together.
Multiples LSN pools can be bound to an LSN group.
– portblockallocation
Allocate a random NAT port block, from the available NAT port pool of an NAT IP address,
for each subscriber when the NAT allocation is set as Dynamic NAT. For any connection ini-
tiated from a subscriber, the NetScaler appliance allocates a NAT port from the subscribers
allocated NAT port block to create the LSN session.
You must set the port block size in the bound LSN group. For a subscriber, if all the ports
are allocated from the subscribers allocated port block, the NetScaler appliance allocates
a new random port block for the subscriber.
For Deterministic NAT, this parameter is enabled by default, and you cannot disable it.
– portrealloctimeout
The waiting time, in seconds, between deallocating LSN NAT ports (when an LSN mapping
is removed) and reallocating them for a new LSN session. This parameter is necessary in
order to prevent collisions between old and new mappings and sessions. It ensures that
all established sessions are broken instead of redirected to a different subscriber. This is
not applicable for ports used in:
* Deterministic NAT
* Address-Dependent filtering and Address-Port-Dependent filtering
* Dynamic NAT with port block allocation
Default value: 0
– maxPortReallocTmq
Maximum number of ports for which the port reallocation timeout applies for each NAT IP
address. In other words, the maximum deallocated-port queue size for which the reallo-
cation timeout applies for each NAT IP address.
When the queue size is full, the next port deallocated is reallocated immediately for a new
LSN session.
– poolname
Name for the LSN pool. Must begin with an ASCII alphanumeric or underscore (_) char-
acter, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space,
colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the LSN
pool is created. The following requirement applies only to the CLI: If the name includes
one or more spaces, enclose the name in double or single quotation marks (for example,
“lsn pool1” or ‘lsn pool1’).
– lsnip
IPv4 address or a range of IPv4 addresses to be used as NAT IP address(es) for LSN.
After the pool is created, these IPv4 addresses are added to the NetScaler appliance as
NetScaler owned IP address of type LSN. An LSN IP address associated with an LSN pool
cannot be shared with other LSN pools. IP addresses specified for this parameter must
not already exist on the NetScaler appliance as any NetScaler owned IP addresses. In the
command line interface, separate the range with a hyphen. For example: 10.102.29.30-
10.102.29.189. You can later remove some or all the LSN IP addresses from the pool, and
add IP addresses to the LSN pool.
– transportprofilename
Name for the LSN transport profile. Must begin with an ASCII alphanumeric or underscore
(_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.),
space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the
LSN transport profile is created. The following requirement applies only to the CLI: If the
name includes one or more spaces, enclose the name in double or single quotation marks
(for example, “lsn transport profile1” or ‘lsn transport profile1’).
– transportprotocol
– sessiontimeout
Timeout, in seconds, for an idle LSN session. If an LSN session is idle for a time that exceeds
this value, the NetScaler appliance removes the session.
This timeout does not apply for a TCP LSN session when a FIN or RST message is received
from either of the endpoints.
Minimum value: 60
– finrsttimeout
Timeout, in seconds, for a TCP LSN session after a FIN or RST message is received from one
of the endpoints.
f a TCP LSN session is idle (after the NetScaler appliance receives a FIN or RST message)
for a time that exceeds this value, the NetScaler appliance removes the session.
Since the LSN feature of the NetScaler appliance does not maintain state information of
any TCP LSN sessions, this timeout accommodates the transmission of the FIN or RST,
and ACK messages from the other endpoint so that both endpoints can properly close the
connection.
Default value: 30
– portquota
Maximum number of LSN NAT ports to be used at a time by each subscriber for the speci-
fied protocol. For example, each subscriber can be limited to a maximum of 500 TCP NAT
ports. When the LSN NAT mappings for a subscriber reach the limit, the NetScaler appli-
ance does not allocate additional NAT ports for that subscriber.
Default value: 0
Minimum value: 0
– sessionquota
Maximum number of concurrent LSN sessions allowed for each subscriber for the spec-
ified protocol. When the number of LSN sessions reaches the limit for a subscriber, the
NetScaler appliance does not allow the subscriber to open additional sessions.
Default value: 0
Minimum value: 0
– portpreserveparity
Enable port parity between a subscriber port and its mapped LSN NAT port. For example,
if a subscriber initiates a connection from an odd numbered port, the NetScaler appliance
allocates an odd numbered LSN NAT port for this connection. You must set this parameter
for proper functioning of protocols that require the source port to be even or odd num-
bered, for example, in peer-to-peer applications that use RTP or RTCP protocol.
– portpreserverange
If a subscriber initiates a connection from a well-known port (0-1023), allocate a NAT port
from the well-known port range (0-1023) for this connection. For example, if a subscriber
initiates a connection from port 80, the NetScaler appliance can allocate port 100 as the
NAT port for this connection.
This parameter applies to dynamic NAT without port block allocation. It also applies to
Deterministic NAT if the range of ports allocated includes well-known ports.
When all the well-known ports of all the available NAT IP addresses are used in different
subscribers connections (LSN sessions), and a subscriber initiates a connection from a
well- known port, the NetScaler appliance drops this connection.
– syncheck
Silently drop any non-SYN packets for connections for which there is no LSN-NAT session
present on the NetScaler appliance.
If you disable this parameter, the NetScaler appliance accepts any non-SYN packets and
creates a new LSN session entry for this connection.
Following are some reasons for the NetScaler appliance to receive such packets:
* LSN session for a connection existed but the NetScaler appliance removed this ses-
sion because the LSN session was idle for a time that exceeded the configured session
timeout.
* Such packets can be a part of a DoS attack.
– appsprofilename
Name for the LSN application profile. Must begin with an ASCII alphanumeric or under-
score (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), pe-
riod (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed
after the LSN application profile is created. The following requirement applies only to the
CLI: If the name includes one or more spaces, enclose the name in double or single quota-
tion marks (for example, “lsn application profile1” or ‘lsn application profile1’).
– transportprotocol
Name of the protocol for which the parameters of this LSN application profile applies.
– ippooling
NAT IP address allocation options for sessions associated with the same subscriber.
* Paired—The NetScaler appliance allocates the same NAT IP address for all sessions
associated with the same subscriber. When all the ports of a NAT IP address are used
in LSN sessions (for same or multiple subscribers), the NetScaler appliance drops any
new connection from the subscriber.
* Random—The NetScaler appliance allocates random NAT IP addresses, from the
pool, for different sessions associated with the same subscriber.
– mapping
Type of LSN mapping to apply to subsequent packets originating from the same subscriber
IP address and port.
Consider an example of an LSN mapping that includes the mapping of the subscriber
IP:port (X:x), NAT IP:port (N:n), and external host IP:port (Y:y).
– filtering
Consider an example of an LSN mapping that includes the mapping of subscriber IP:port
(X:x), NAT IP:port (N:n), and external host IP:port (Y:y).
independent). In other words, receiving packets from a specific external host requires
that the subscriber first send packets to that specific external host’s IP address.
* ADDRESS PORT DEPENDENT (the default)—Filters out packets not destined to sub-
scriber IP address and port (X:x). In addition, the NetScaler appliance filters out pack-
ets from Y:y destined for the subscriber (X:x) if the subscriber has not previously sent
packets to Y:y. In other words, receiving packets from a specific external host requires
that the subscriber first send packets first to that external IP address and port.
– tcpproxy
Enable TCP proxy, which enables the NetScaler appliance to optimize the TCP traffic by
using Layer 4 features.
– td
ID of the traffic domain through which the NetScaler appliance sends the outbound traffic
after performing LSN.
If you do not specify an ID, the appliance sends the outbound traffic through the default
traffic domain, which has an ID of 0.
– appsprofilename
Name for the LSN application profile. Must begin with an ASCII alphanumeric or under-
score (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), pe-
riod (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed
after the LSN application profile is created. The following requirement applies only to the
CLI: If the name includes one or more spaces, enclose the name in double or single quota-
tion marks (for example, “lsn application profile1” or ‘lsn application profile1’).
– lsnport
Port numbers or range of port numbers to match against the destination port of the incom-
ing packet from a subscriber. When the destination port is matched, the LSN application
profile is applied for the LSN session. Separate a range of ports with a hyphen. For exam-
ple, 40-90.
– groupname
Name for the LSN group. Must begin with an ASCII alphanumeric or underscore (_) char-
acter, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space,
colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the LSN
group is created. The following requirement applies only to the CLI: If the name includes
one or more spaces, enclose the name in double or single quotation marks (for example,
“lsn group1” or ‘lsn group1’).
– clientname
Name of the LSN client entity to be associated with the LSN group. You can associate only
one LSN client entity with an LSN group. You cannot remove this association or replace
with another LSN client entity once the LSN group is created.
– nattype
Type of NAT IP address and port allocation (from the bound LSN pools) for subscribers:
identified without any need for logging. For a connection, a subscriber can be iden-
tified based only on the NAT IP address and port, and the destination IP address and
port.
* Dynamic—Allocate a random NAT IP address and a port from the LSN NAT pool for a
subscriber’s connection. If port block allocation is enabled (in LSN pool) and a port
block size is specified (in the LSN group), the NetScaler appliance allocates a random
NAT IP address and a block of ports for a subscriber when it initiates a connection
for the first time. The appliance allocates this NAT IP address and a port (from the
allocated block of ports) for different connections from this subscriber. If all the ports
are allocated (for different subscribers connections) from the subscribers allocated
port block, the appliance allocates a new random port block for the subscriber.
– portblocksize
To set this parameter for Dynamic NAT, you must enable the port block allocation param-
eter in the bound LSN pool. For Deterministic NAT, the port block allocation parameter is
always enabled, and you cannot disable it.
In Dynamic NAT, the NetScaler appliance allocates a random NAT port block, from the avail-
able NAT port pool of an NAT IP address, for each subscriber. For a subscriber, if all the
ports are allocated from the subscribers allocated port block, the appliance allocates a
new random port block for the subscriber.
– logging
Log mapping entries and sessions created or deleted for this LSN group. The NetScaler
appliance logs LSN sessions for this LSN group only when both logging and session logging
parameters are enabled.
The appliance uses its existing syslog and audit log framework to log LSN information. You
must enable global level LSN logging by enabling the LSN parameter in the related NSLOG
action and SYLOG action entities. When the Logging parameter is enabled, the NetScaler
appliance generates log messages related to LSN mappings and LSN sessions of this LSN
group. The appliance then sends these log messages to servers associated with the NSLOG
action and SYSLOG actions entities.
A log message for an LSN mapping entry consists of the following information:
– sessionLogging
Log sessions created or deleted for the LSN group. The NetScaler appliance logs LSN ses-
sions for this LSN group only when both logging and session logging parameters are en-
abled.
– sessionSync
In a high availability (HA) deployment, synchronize information of all LSN sessions related
to this LSN group with the secondary node. After a failover, established TCP connections
and UDP packet flows are kept active and resumed on the secondary node (new primary).
For this setting to work, you must enable the global session synchronization parameter.
– snmptraplimit
Maximum number of SNMP Trap messages that can be generated for the LSN group in one
minute.
Default value: 100
Minimum value: 0
Maximum value: 10000
– ftp
Enable Application Layer Gateway (ALG) for the FTP protocol. For some application-layer
protocols, the IP addresses and protocol port numbers are usually communicated in the
packets payload. When acting as an ALG, the appliance changes the packets payload to
ensure that the protocol continues to work over LSN.
Note: The NetScaler appliance also includes ALG for ICMP and TFTP protocols. ALG for the
ICMP protocol is enabled by default, and there is no provision to disable it. ALG for the
TFTP protocol is disabled by default. ALG is enabled automatically for an LSN group when
you bind a UDP LSN application profile, with endpoint-independent-mapping, endpoint-
independent filtering, and destination port as 69 (well-known port for TFTP), to the LSN
group.
Possible values: ENABLED, DISABLED
Default value: ENABLED
For Deterministic NAT, pools bound to an LSN group cannot be bound to other LSN groups.
For Dynamic NAT, pools bound to an LSN group can be bound to multiple LSN groups.
Maximum Length: 127
– transportprofilename
Name of the LSN transport profile to bind to the specified LSN group. Bind a profile for
each protocol for which you want to specify settings.
By default, one LSN transport profile with default settings for TCP, UDP, and ICMP protocols
is bound to an LSN group during its creation. This profile is called a default transport.
An LSN transport profile that you bind to an LSN group overrides the default LSN transport
profile for that protocol. Maximum Length: 127
– appsprofilename
Name of the LSN application profile to bind to the specified LSN group. For each set of
destination ports, bind a profile for each protocol for which you want to specify settings.
By default, one LSN application profile with default settings for TCP, UDP, and ICMP pro-
tocols for all destination ports is bound to an LSN group during its creation. This profile is
called a default application profile.
When you bind an LSN application profile, with a specified set of destination ports, to an
LSN group, the bound profile overrides the default LSN application profile for that protocol
at that set of destination ports. Maximum Length: 127
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The following are examples of configuring LSN through command line interface.
Create a simple LSN configuration with a single subscriber network, single LSN NAT IP address,
and default settings:
Create an LSN configuration with an extended ACL for identifying LSN subscribers:
19 Done
20
21 bind lsn pool LSN-POOL-2 203.0.113.5-203.0.113.10
22
23 Done
24
25 add lsn group LSN-GROUP-2 -clientname LSN-CLIENT-2
26
27 Done
28
29 bind lsn group LSN-GROUP-2 -poolname LSN-POOL-2
30
31 Done
Create an LSN configuration with endpoint-independent mapping for HTTP protocol (port 80)
and address-port dependent mapping for SSH protocol (port 22). Also, restrict each subscriber
to use a maximum of 1000 NAT ports for TCP protocol and 100 NAT ports for UDP protocol. Re-
strict each subscriber to have a maximum of 2000 concurrent sessions for TCP protocol. Restrict
the group to have a maximum of 30000 concurrent sessions for TCP protocol:
63 Done
42
43 Done
44
45 bind lsn group LSN-GROUP-4 -poolname LSN-POOL-4
46
47 Done
48
49 add lsn appsprofile LSN-APPS-WELLKNOWNPROFILE-4 TCP -mapping ENDPOINT-
INDEPENDENT
50
51 Done
52
53 bind lsn appsprofile LSN-APPS-WELLKNOWN-PORTS-PROFILE-4 1- 1023
54
55 Done
56
57 bind lsn group LSN-GROUP-4 -applicationprofilename LSN-APPS-WELLKNOWN-
PORTS-PROFILE-4
58
59 Done
Create an LSN configuration with sharing of NAT resources among multiple LSN groups. In this
example, LSN pool LSN-POOL-5 is shared with LSN groups LSN-GROUP-5 and LSN-GROUP-6:
22
23 Done
24
25 add lsn client LSN-CLIENT-6
26
27 Done
28
29 bind lsn client LSN-CLIENT-6 -network 192.0.16.0 -netmask 255.255.255.0
30
31 Done
32
33 add lsn pool LSN-POOL-6
34
35 Done
36
37 bind lsn pool LSN-POOL-6 203.0.113.15-203.0.113.18
38
39 Done
40
41 add lsn group LSN-GROUP-6 -clientname LSN-CLIENT-6
42
43 Done
44
45 bind lsn group LSN-GROUP-6 -poolname LSN-POOL-6
46
47 Done
48
49 bind lsn group LSN-GROUP-6 -poolname LSN-POOL-5
50
51 Done
Create an LSN configuration with multiple subscriber networks having the same network ad-
dress but each network belonging to a different traffic domain. Also, restrict the outbound traf-
fic related to HTTP protocol (port 80), sending it through a particular traffic domain (td 5):
26
27 Done
28
29 bind lsn group LSN-GROUP-8 -poolname LSN-POOL-8
30
31 Done
32
33 add lsn appsprofile LSN-APPS-HTTP-PROFILE-8 TCP -td 5
34
35 Done
36
37 bind lsn appsprofile LSN-APPS-HTTP-PROFILE-8 80
38
39 Done
40
41 bind lsn group LSN-GROUP-8 -applicationprofilename LSN-APPS-HTTP-
PROFILE-8
42
43 Done
Create an LSN configuration that restricts the outbound traffic of a specific protocol (TCP), send-
ing it through a particular traffic domain (td 5). With endpoint-independent filtering, receive
inbound traffic related to this protocol (TCP) on any traffic domain:
Create an LSN configuration that restricts outbound HTTP (port 80) traffic, sending it through a
particular traffic domain (td 10). With address-dependent filtering, receive inbound traffic re-
lated to this protocol (HTTP) on the specified traffic domain (td 10):
27 Done
28
29 bind lsn appsprofile LSN-APPS-PROFILE-10 80
30
31 Done
32
33 bind lsn group LSN-GROUP-10 -approfile LSN-APPS-PROFILE-10
34
35 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance supports manual creation of a one-to-one LSN mapping between a sub-
scriber IP address:port and a NAT IP address:port. Static LSN mappings are useful in cases where you
want to ensure that the connections initiated to a NAT IP:Port maps to the subscriber IP address:Port.
For example, Web servers located in the internal network.
Navigate to System > Large Scale NAT > Static, and add a new static mapping.
Name for the LSN static mapping entry. Must begin with an ASCII alphanumeric or underscore (_)
character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon
(:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the LSN group is created.
The following requirement applies only to the CLI: If the name includes one or more spaces, enclose
the name in double or single quotation marks (for example, “lsn static1” or ‘lsn static1’). This is a
mandatory argument. Maximum Length: 127
transportprotocol
Protocol for the LSN mapping entry. This is a mandatory argument. Possible values: TCP, UDP, ICMP
subscrIP
IPv4 address of an LSN subscriber for the LSN mapping entry. This is a mandatory argument.
subscrPort
Port of the LSN subscriber for the LSN mapping entry. This is a mandatory argument. Maximum value:
65535
td
ID of the traffic domain to which the subscriber belongs. If you do not specify an ID, the subscriber
is assumed to be a part of the default traffic domain. Default value: 0, Minimum value: 0, Maximum
value: 4094
natIP
IPv4 address, already existing on the NetScaler appliance as type LSN, to be used as NAT IP address
for this mapping entry.
natPort
destIP
dsttd
ID of the traffic domain through which the destination IP address for this LSN mapping entry is reach-
able from the NetScaler appliance. If you do not specify an ID, the destination IP address is assumed
to be reachable through the default traffic domain, which has an ID of 0. Default value: 0, Minimum
value: 0, Maximum value: 4094
A static mapping entry is usually a one-to-one LSN mapping between a subscriber IP address:port and
a NAT IP address:port. A one-to-one static LSN mapping entry exposes only one port of the subscriber
to the Internet.
Some situations might require exposing all ports (64K) of a subscriber to the Internet (for example,
a server hosted on an internal network and running a different service on each port). To make these
internal services accessible through the Internet, you have to expose all the ports of the server to
the Internet.
One way to meet this requirement is to add 64K one-to-one static mapping entries, one mapping
entry for each port. Creating 64K entries is very cumbersome and a big task. Also, this large number
of configuration entries might lead to performance issues in the NetScaler appliance.
Another simple method is to use wildcard ports in a static mapping entry. You just need to create
one static mapping entry with NAT-port and subscriber-port parameters set to the wildcard charac-
ter (*), and the protocol parameter set to ALL, to expose all the ports of a subscriber to the Internet.
For a subscriber’s inbound or outbound connections matching a wildcard static mapping entry, the
subscriber’s port does not change after the NAT operation.
When a subscriber-initiated connection to the Internet matches a wildcard static mapping entry, the
NetScaler appliance assigns a NAT port that has the same number as the subscriber port from which
the connection is initiated. Similarly, an Internet host gets connected to a subscriber’s port by con-
necting to the NAT port that has the same number as the subscriber’s port.
Configuring the NetScaler appliance to Provide Access to All Ports of an IPv4 Subscriber
To configure the NetScaler appliance to provide access to all ports of an IPv4 subscriber, create a wild-
card static map with the following mandatory parameter settings:
• Protocol=ALL
• Subscriber port = *
• NAT port = *
In a wildcard static map, unlike in a one-to-one static map, setting the NAT IP parameter is mandatory.
Also, the NAT IP address assigned to a wildcard static map cannot be used for any other subscribers.
To create a wildcard static map by using the command line interface
At the command prompt, type:
Sample Configuration
In the following sample configuration of a wildcard static map, all ports of a subscriber whose IP ad-
dress is 192.0.2.10 are made accessible through NAT IP 203.0.11.33.
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
• FTP
• ICMP
• TFTP
• PPTP
• SIP
• RTSP
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can enable or disable ALG for the FTP protocol for an LSN configuration by enabling or disabling
the FTP option of the LSN group of the LSN configuration.
ALG for the ICMP protocol is enabled by default, and there is no provision to disable it.
ALG for the TFTP protocol is disabled by default. TFTP ALG is enabled automatically for an LSN configu-
ration when you bind a UDP LSN application profile, with endpoint-independent-mapping, endpoint-
independent filtering, and destination port as 69 (well-known port for TFTP), to the LSN group.
1 add ns acl LSN-ACL-1 ALLOW -srcIP 192.0.2.30-192.0.2.100
2
3 Done
4
5 apply acls
6
7 Done
8
9 add lsn client LSN-CLIENT-1
10
11 Done
12
13 bind lsn client LSN-CLIENT-1 ‒ aclname LSN-ACL
14
15 Done
16
17 add lsn pool LSN-POOL-1
18
19 Done
20
21 bind lsn pool LSN-POOL-1 203.0.113.10
22
23 Done
24
25 add lsn group LSN-GROUP-1 -clientname LSN-CLIENT-1 -FTP ENABLED
26
27 Done
28
29 bind lsn group LSN-GROUP-1 -poolname pool1 LSN-POOL-1
30
31 Done
1 add lsn client LSN-CLIENT-2
2
3 Done
4
5 bind lsn client LSN-CLIENT-2 -network 198.51.100.0 -netmask 255
.255.255.0
6
7 Done
8
9 add lsn pool LSN-POOL-2
10
11 Done
12
13 bind lsn pool LSN-POOL-2 203.0.113.10-203.0.113.11
14
15 Done
16
17 add lsn group LSN-GROUP-2 -clientname LSN-CLIENT-2
18
19 Done
20
21 bind lsn group LSN-GROUP-2 -poolname pool1 LSN-POOL-2
22
23 Done
24
25 add lsn appsprofile LSNAPPSPROFILE-TFTP-2 UDP -mapping ENDPOINT-
INDEPENDENT ‒ filtering ENDPOINT-INDEPENDENT
26
27 Done
28
29 bind lsn appsprofile LSNAPPSPROFILE-TFTP-2 69
30
31 Done
32
33 bind lsn group LSN-GROUP-1 -applicationprofilename LSNAPPSPROFILE-TFTP
-2
34
35 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance supports Application Layer Gateways (ALGs) for the Point-to-Point Tunneling
Protocol (PPTP).
PPTP is a network protocol that enables secure transfer of data from a remote client to an enterprise
server by creating a tunnel across TCP/IP-based data networks. PPTP encapsulates PPP packets into
IP packets for transmission over the Internet. PPTP establishes a tunnel for each communicating
PPTP network server (PNS)-PPTP Access Concentrator (PAC) pair. After the tunnel is set up, enhanced
generic routing encapsulation (GRE) is used to exchange PPP packets. A call ID in the GRE header
indicates the session to which a particular PPP packet belongs.
The NetScaler appliance recognizes PPTP packets that arrive on the default TCP port, 1723. The appli-
ance parses PPTP control packets, translates the call ID, and assigns a NAT IP address. For two-way
data communication between the client and server, the NetScaler appliance creates an LSN session
entry based on the server call ID, and an LSN session based on the client call ID. The appliance then
parses the GRE data packets and translates call IDs on the basis of the two LSN session entries.
For PPTP protocol, the NetScaler appliance also includes timeout setting for any idle PPTP LSN ses-
sions. If a PPTP LSN session is idle for a time that exceeds the timeout setting, the NetScaler appliance
removes the session.
Limitations:
Configuring PPTP ALG on the NetScaler appliance consist of the following tasks:
• Create an LSN configuration and enable PPTP ALG on it. In an LSN configuration, the LSN group
includes the PPTP ALG setting. For instructions on creating an LSN configuration, see Configu-
ration Steps for LSN.
• (Optional) Set the global timeout for idle PPTP LSN sessions.
To set the global timeout for idle PPTP LSN sessions by using the CLI
1 set appAlgParam -pptpGreIdleTimeout <positive_integer>
2
3 show appAlgParam
Example:
In the following sample LSN configuration, PPTP ALG is enabled for subscribers in the 192.0.2.0/24
network.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Using Large Scale NAT (LSN) with Session Initiation Protocol (SIP) is complicated, because SIP mes-
sages contain IP addresses in the SIP headers as well as in the SIP body. When LSN is used with SIP,
the SIP headers contain information about the caller and the receiver, and the device translates this
information to hide it from the outside network. The SIP body contains the Session Description Proto-
col (SDP) information, which includes IP addresses and port numbers for transmission of the media.
• RFC 3261
• RFC 3581
• RFC 4566
• RFC 4475
How IP address translation is performed depends on the type and direction of the message. A message
can be any of the following:
• Inbound request
• Outbound response
• Outbound request
• Inbound response
For an outgoing message, the private IP address and port number of the SIP client are replaced with
the NetScaler owned public IP address and port number, called the LSN pool IP address and port num-
ber, specified during LSN configuration. For an incoming message, the LSN pool IP address and the
port number are replaced with the private address of the client. If the message contains any public IP
addresses, the NetScaler SIP ALG retains them. Also, a pinhole is created on the:
• LSN pool IP address and port on behalf of the private client, so that the messages that arrive at
this IP address and port from the public network are treated as SIP messages.
• Public IP address and port on behalf of the public clients, so that the messages that arrive at
this IP address and port from the private network are treated as SIP messages.
When a SIP message is sent out across the network, the SIP Application Layer Gateway (ALG) collects
information from the message and translates the IP addresses in the following headers into LSN pool
IP addresses:
• Via
• Contact
• Route
• Record-Route
In the following sample SIP request message, LSN replaces the IP addresses in the header fields to
hide them from the outside network.
“‘ pre codeblock
INVITE [email protected] SIP/2.0 Via: SIP/2.0/UDP 192.170.1.161:62914 From: [email protected]
To: [email protected] Call-ID: [email protected] Contact: [email protected] Route:
<sip:[email protected]:5060> Record-Route: <sip:[email protected]:5060>
1 When a message containing SDP information arrives, the SIP ALG collects
information from the message and translates the IP addresses in the
following fields into LSN pool IP addresses and port numbers:
2
3 - c= (connection information)
4
5 This field can appear at the session or media level. It appears in
the following format:
6
7 ‘c=<network-type><address-type><connection-address>‘
8
9 If the destination IP address is a unicast IP address, the SIP ALG
creates pinholes by using the IP address and port numbers
specified in the m= field.
10
11 - m= (media announcement)
12
13 This field appears at the media level and contains the description
of the media. It appears in the following format:
14
15 ‘m=<media><port><transport><fmt list>‘
16
17 - a= (information about the media field)
18
19 This field can appear at the session or media level, in the
following format:
20
21 ‘a=<attribute>‘
22
23 ‘a=<attribute>:<value>‘
24
25 The following excerpt from a sample SDP section shows the fields that
are translated for resource allocation.
26
27 o=user 2344234 55234434 IN IP4 10.150.20.3
28
29 c=IN IP4 10.150.20.3
30
31 m=audio 43249 RTP/AVP 0
32
33 The following table shows how SIP payload is translated.
34 ||||
35 |-|-|-|
36 |Inbound Request (from public to private)|To:|None|
37 ||From:|None|
38 ||Call-ID:|None|
39 ||Via:|None|
40 ||Request-URI:|Replace LSN pool IP address with private IP address|
41 ||Contact:|None|
42 ||Record-Route|None|
43 ||Route:|None|
44 |Outbound Response (from private to public)|To:|None|
45 ||From:|None|
46 ||Call-ID:|None|
47 ||Via:|None|
48 ||Request-URI:|Replace private IP address with LSN pool IP address|
49 ||Contact:|Replace private IP address with LSN pool IP address|
50 ||Record-Route|None|
51 ||Route:|None|
52 |Outbound Request (from private to public)|To:|None|
53 ||From:|None|
54 ||Call-ID:|None|
55 ||Via:|Replace private IP address with LSN pool IP address|
56 ||Request-URI:|None|
57 ||Contact:|Replace private IP address with LSN pool IP address|
58 ||Record-Route|None|
59 ||Route:|None
60 |Inbound Response (from public to private)|To:|None|
61 ||From:|None|
62 ||Call-ID:|None|
63 ||Via:|Replace LSN pool IP address with private IP address|
64 ||Request-URI:|None|
65 ||Contact:|Retain public IP address, if present|
66 ||Record-Route|None|
67 ||Route:|None|
68
69 ## Limitations of SIP ALG
70
71 A SIP ALG has the following limitations:
72
internal to the external network. The SIP ALG performs NAT on the IP
addresses and port numbers in the Via, Contact, Route, and Record-
Route SIP header fields, replacing them with the LSN pool IP address
and port number. LSN stores these mappings for subsequent SIP
messages in the SIP call. The SIP ALG then opens separate pinholes
in the NetScaler configuration to allow SIP and media through the
NetScaler appliance on the dynamically assigned ports specified in
the SDP and SIP headers. When a 200 OK message arrives at the
NetScaler, it is captured by one of the created pinholes. The SIP
ALG replaces the SIP header, restoring the original Contact, Via,
Route, and Record-Route SIP fields, and then forwards the message to
the internal SIP client.
101
102 ### Incoming Calls
103
104 A SIP incoming call is initiated with a SIP INVITE message from the
external client to the internal network. The SIP registrar forwards
the INVITE message to the SIP client in the internal network, using
the pinhole that was created when the Internal SIP client registered
with the SIP registrar.
105
106 The SIP ALG performs NAT on the LSN IP addresses and port numbers in
the Via, Contact, Route, and Record-Route SIP header fields,
translating them to the IP address and port number of the internal
SIP client, and forwards the request to the SIP client. When the 200
OK response message sent by the internal SIP client arrives at the
NetScaler appliance, the SIP ALG performs NAT on the IP addresses
and port numbers in the Via, Contact, Route, and Record-Route SIP
header fields, translating them to the LSN pool IP address and port
number, forwards the response message to the SIP registrar, and then
opens a pinhole in the outbound direction for further SIP
communication.
107
108 ### Call Termination
109
110 The BYE message terminates a call. When the device receives a BYE
message, it translates the header fields in the message just as it
does for any other message. But because a BYE message must be
acknowledged by the receiver with a 200 OK, the ALG delays call
teardown for 15 seconds to allow time for transmission of the 200 OK
.
111
112 ### Call Between Clients in the Same Network
113
114 When both client A and client B in the same network initiate a call,
the SIP messages are routed through the SIP proxy in the outside
network. The SIP ALG processes the INVITE from client A as a normal
outgoing call. Since client B is in the same network, the SIP proxy
sends the INIVITE back to the NetScaler appliance. The SIP ALG
examines the INIVITE message, determines that it contains the NAT IP
address of client A, and replaces that address with the private IP
address of client A before sending the message to client B. Once the
call is established between the clients, the NetScaler is not
involved in the media transmission between the clients.
115
116 ## More LSN SIP Scenarios: SIP Proxy Inside the Private Network
117
118 If you want to host the SIP Proxy server inside the private network,
Citrix recommends that you do one of the following:
119
120 - Configure a static LSN Mapping for the private SIP proxy. For more
information, see [Configuring Static LSN Maps](/en-us/netscaler/12/
netscaler-support-for-telecom-service-providers/lsn-introduction/
configuration-steps-lsn.html). Make sure that the NAT port is the
same as the port configured in the SIP ALG profile.
121 - Configure the SIP Proxy server inside a demilitarized zone (DMZ).
122
123 Figure 1. SIP Call Registration
124
125 
126
127 Figure 2. SIP Incoming Call Flow
128
129 
130
131 Figures 1 and 2 show the following scenarios:
132
133 - Scenario 1 — SIP client in the private network registers with the SIP
proxy server in the same network. ALG operations are not performed,
because the SIP client and SIP proxy server are in the same network
.
134 - Scenario 2 — SIP client in the public network registers with the SIP
proxy server in the private network. The REGISTER message from the
public SIP client is sent to the NetScaler appliance by using the
static LSN mapping configured on the appliance, and the appliance
creates a pinhole for further SIP operations.
135 - Scenario 3 — SIP Incoming call flow. A SIP incoming call is
initiated with a SIP INVITE message from the external to the
1 **Response:**
add lsn appsprofile app_tcp TCP -ippooling PAIRED -mapping ENDPOINT-INDEPENDENT -filtering
ENDPOINT-INDEPENDENT
1 - Create a SIP ALG profile and make sure that you define either the
source port range or destination port range.
2
3 **Example:**
2
3 **Example:**
Done
Done
Done
Done
add lsn appsprofile app_tcp TCP -ippooling PAIRED -mapping ENDPOINT-INDEPENDENT -filtering
ENDPOINT-INDEPENDENT
Done
add lsn appsprofile app_udp UDP -ippooling PAIRED -mapping ENDPOINT-INDEPENDENT -filtering
ENDPOINT-INDEPENDENT
Done
Done
Done
Done
Done
Done
Done
Done
Done
Done
Done
“‘
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Real Time Streaming Protocol (RTSP) is an application-level protocol for the transfer of real-time me-
dia data. Used for establishing and controlling media sessions between end points, RTSP is a control
channel protocol between the media client and the media server. The typical communication is be-
tween a client and a streaming media server.
Streaming media from a private network to a public network requires translating IP addresses and
port numbers over the network. NetScaler functionality includes an Application Layer Gateway (ALG)
for RTSP, which can be used with Large Scale NAT (LSN) to parse the media stream and make any
necessary changes to ensure that the protocol continues to work over the network.
How IP address translation is performed depends on the type and direction of the message, and the
type of media supported by the client-server deployment. Messages are translated as follows:
• Outbound request—Private IP address to NetScaler owned public IP address called an LSN pool
IP address.
• Inbound response—LSN pool IP address to private IP address.
• Inbound request—No translation.
• Outbound response—Private IP address to LSN pool IP address.
The following figure shows an RTSP SETUP request flow. Typically, a SETUP request specifies how a
single media stream must be transported. The request contains the media stream URL and a transport
specifier. This specifier typically includes one local port for receiving RTP data (audio or video), and
another for receiving RTCP data (meta information). The server reply usually confirms the chosen
parameters and fills in the missing parts, such as the server’s chosen ports. Each media stream must
be configured by using the SETUP command before an aggregate play request can be sent.
In a typical RTSP communication, the media client in the public network sends a SETUP request to
the media server in the private network. RSTP ALG intercepts the request and, in the media stream,
replaces the public IP address and port number with the LSN pool IP address and LSN port number.
The following figure shows the translation performed by a NetScaler appliance in the media stream
for an outbound request:
The media server in the private network uses the LSN pool IP address and LSN port number to send
a 200 OK response to the media client in the public network. The NetScaler RTSP ALG intercepts the
response and replaces the LSN pool IP address and LSN port number with the public IP address and
port number of the media client. The following figure shows the translation performed by a NetScaler
appliance in the media stream for an inbound response:
Configure RTSP ALG as part of the LSN configuration. For instructions on configuring LSN, see Config-
uration Steps for LSN. While configuring LSN, make sure that you:
• Set the NAT Type as DETERMINSTIC or DYNAMIC while adding the LSN pool.
• Set the following parameters while adding the LSN application profile:
– IP Pooling = PAIRED
– Address and Port Mapping = ENDPOINT-INDEPENDENT
– Filtering = ENDPOINT-INDEPENDENT
• Create a RTSP ALG profile and bind the RTSP ALG profile to the LSN group
Sample RTSP ALG Configuration:
The following sample configuration shows how to create a simple LSN configuration with a single sub-
scriber network, single LSN NAT IP address, and RTSP ALG settings:
28
29 bind lsn appsprofile app1 1-65535
30
31 Done
32
33 bind lsn appsprofile app2 1-65535
34
35 Done
36
37 add lsn rtspalgprofile rtspalgprofiledefault -rtspIdleTimeout 1000 -
rtspportrange 554
38
39 Done
40
41 add lsn group group1 -clientname client1 -nattype DETERMINISTIC -
portblocksize 512 -rtspalg ENABLED
42
43 Done
44
45 bind lsn group group1 -poolname pool1
46
47 Done
48
49 bind lsn group group1 -appsprofilename app1
50
51 Done
52
53 bind lsn group group1 -appsprofilename app2
54
55 Done
56
57 bind lsn group group1 -rtspalgprofilename rtspalgprofiledefault
58
59 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
If communication between two network devices (for example, client and server) uses the IPSec pro-
tocol, IKE traffic (which is over UDP) uses port fields, but Encapsulating Security Payload (ESP) traffic
does not. If a NAT device on the path assigns the same NAT IP address (but different ports) to two
or more clients at the same destination, the NAT device is unable to distinguish and properly route
the return ESP traffic does not contain port information. Therefore, IPSec ESP traffic fails at the NAT
device.
NAT-Traversal (NAT-T) capable IPSec endpoints detect the presence of an intermediate NAT device
during IKE phase 1 and switch to UDP port 4500 for all subsequent IKE and ESP traffic (encapsulat-
ing ESP in UDP). Without NAT-T support on the peer IPSec endpoints, IPSec protected ESP traffic is
transmitted without any UDP encapsulation. Therefore, IPSec ESP traffic fails at the NAT device.
The NetScaler appliance supports IPSec application layer gateway (ALG) functionality for large scale
NAT configurations. The IPSec ALG processes IPSec ESP traffic and maintains session information so
that the traffic does not fail when the IPSec endpoints do no support NAT-T (UDP encapsulation of ESP
traffic).
An IPSec ALG monitors IKE traffic between a client and the server, and permits only one IKE phase 2
message exchange between the client and the server at any given time.
Once the two-way ESP packets are received for a particular flow, the IPSec ALG creates a NAT session
for this particular flow so that subsequent ESP traffic can flow smoothly. The ESP traffic is identified
by Security Parameters Indexes (SPIs), which are unique for a flow and for each direction. An IPSec
ALG uses ESP SPIs in place of source and destination ports for performing large scale NAT.
If a gate receives no traffic, it times out. After both gates time out, another IKE phase 2 exchange is
permitted.
• ESP Gate Timeout. Maximum time that the NetScaler appliance blocks an IPSec ALG gate for
a particular client on a specific NAT IP address for a given server if no two-way ESP traffic is
exchanged between the client and the server.
• IKE Session Timeout. Maximum time that the NetScaler appliance keeps the IKE session infor-
mation before removing it if there is no IKE traffic for that session.
• ESP Session Timeout. Maximum time that NetScaler appliance keeps the ESP session informa-
tion before removing it if there is no ESP traffic for that session.
Before you start configuring IPSec ALG, consider the following points:
• You must understand the different components of IPSec protocol.
• IPSec ALG is not supported for DS-Lite and Large scale NAT64 configurations.
• IPSec ALG is not supported for hairpin LSN flow.
• IPSec ALG does not work with RNAT configurations.
• IPSec ALG is not supported inNetScaler clusters.
Configuration Steps
Configuring IPSec ALG for large scale NAT44 on a NetScaler appliance consists of the following tasks:
• Create an LSN application profile and bind it to the LSN configuration. Set the following
parameters while configuring an application profile:
– Protocol=UDP
– IP Pooling = PAIRED
– Port=500
Bind the application profile to the LSN group of an LSN configuration. For instructions on creating an
LSN configuration, see Configuration Steps for LSN.
• Create an IPSec ALG profile. An IPSec profile includes various IPSec timeouts, such as IKE ses-
sion timeout, ESP session timeout, and ESP gate timeout. You bind an IPSec ALG profile to an
LSN group. An IPSec ALG profile has the following default settings:
– IKE session timeout = 60 minutes
– ESP session timeout = 60 minutes
– ESP gate timeout = 30 seconds
• Bind the IPSec ALG profile to the LSN configuration. IPSec ALG is enabled for an LSN configu-
ration when you bind an IPSec ALG profile to the LSN configuration. Bind the IPSec ALG profile
to the LSN configuration by setting the IPSec ALG profile parameter to the name of the created
profile in the LSN group. An IPSec ALG profile can be bound to multiple LSN groups, but an LSN
group can have only one IPSec ALG profile.
To bind destination port to the LSN application profile by using the command line interface
To bind an LSN application profile to an LSN group by using the command line interface
2
3 show lsn group <name>
To create an LSN application profile and bind it to an LSN configuration by using the GUI
Navigate to System > Large Scale NAT > Profiles, click Application tab, add an LSN application profile
and bind it to an LSN group.
Navigate to System > Large Scale NAT > Profiles, click IPSEC ALG tab, and then add an IPSec ALG
profile.
1. Navigate to System > Large Scale NAT > LSN Group, open the LSN group.
2. In Advanced Settings, click + IPSEC ALG Profile to bind the created IPSec ALG profile to the
LSN group.
Sample Configuration
In the following sample large scale NAT44 configuration, IPSec ALG is enabled for subscribers in the
192.0.2.0/24 network. IPSec ALG profile IPSECALGPROFILE-1 with various IPSec timeout settings is
created and is bound to LSN group LSN Group -1.
Sample configuration:
16
17 add lsn appsprofile LSN-APPSPROFILE-1 UDP -ippooling PAIRED
18
19 Done
20
21 bind lsn appsprofile LSN-APPSPROFILE-1 500
22
23 Done
24
25 add ipsecalg profile IPSECALGPROFILE-1 -ikeSessionTimeout 45 ‒
espSessionTimeout 40 ‒ espGateTimeout 20 -connfailover ENABLED
26
27 Done
28
29 bind lsn group LSN-GROUP-1 -appsprofilename LSN-APPSPROFILE-1
30
31 Done
32
33 bind lsn group LSN-GROUP-1 -poolname LSN-POOL-1
34
35 Done
36
37 bind lsn group LSN-GROUP-1 - ipsecAlgProfile IPSECALGPROFILE-1
38
39 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
You can log LSN information to diagnose, troubleshoot problems, and to meet legal requirements.
You can monitor the performance of the LSN feature by using LSN statistical counters and displaying
current LSN sessions.
Logging LSN
Logging LSN information is one of the important functions required by the ISPs to meet legal require-
ments and for identifying the source of traffic at any given time.
A NetScaler appliance logs LSN mapping entries and the LSN sessions created or deleted for each
LSN group. You can control logging of LSN information for an LSN group by using the logging and
session logging parameters of the LSN group. These are group level parameters and are disabled by
default. The NetScaler appliance logs LSN sessions for an LSN group only when both logging and
session logging parameters are enabled.
The following table displays the logging behavior for an LSN group for various settings of logging and
session logging parameters.
A log message for an LSN mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced.
• Time stamp
• Entry type (MAPPING)
• Whether the LSN mapping entry was created or deleted
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID might be present, depending on the following
conditions:
– Destination IP address and port are not logged for Endpoint-Independent mapping.
– Only the destination IP address is logged for Address-Dependent mapping. The port is not
logged.
– Destination IP address and port are logged for Address-Port-Dependent mapping.
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced.
• Time stamp
• Entry type (SESSION)
• Whether the LSN session is created or removed
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The appliance uses its existing syslog and audit log framework to log LSN information. You must en-
able global level LSN logging by enabling the LSN parameter in the related NSLOG action and SYLOG
action entities. When the Logging parameter is enabled, the NetScaler appliance generates log mes-
sages related to LSN mappings and LSN sessions of this LSN group. The appliance then sends these
log messages to servers associated with the NSLOG action and SYSLOG action entities.
For logging LSN information, Citrix recommends:
• Logging the LSN information on external log servers instead of on the NetScaler appliance.
Logging on external servers facilitates optimal performance when the appliance creates large
amounts of LSN log entries (in order of millions).
• Using SYSLOG over TCP, or NSLOG. By default SYSLOG uses UDP, and NSLOG uses only
TCP to transfer log information to the log servers. TCP is more reliable than UDP for transfer-
ring complete data.
Note:
– The SYSLOG generated on NetScaler appliance are dynamically sent to the external log
servers.
– When using SYSLOG over TCP, if the TCP connection is down or the SYSLOG server is busy,
then the NetScaler appliances stores the logs in buffer and send the data once the connec-
tion is active.
For more information about configuring logging, see Audit Logging.
Configuring LSN logging consists of the following tasks:
• Configuring the NetScaler appliance for logging. This task involves creating and setting vari-
ous entities and parameters of the NetScaler appliance:
– Create a SYSLOG or NSLOG audit logging configuration. Creating an audit logging con-
figuration involves the following tasks:
* Create a NSLOG or SYSLOG audit action and enable the LSN parameter. Audit actions
specify the IP addresses of log servers.
* Create a SYSLOG or NSLOG audit policy and bind the audit action to the audit pol-
icy. Audit actions specify the IP addresses of log servers. Optionally, you can set the
transport method for log messages that are sent to the external log servers. By de-
fault UDP is selected, you can set the transport method as TCP for a reliable transport
mechanism.Bind the audit policy to system global.
* Create a SYSLOG or NSLOG audit policy and bind the audit action to the audit policy.
* Bind the audit policy to system global.
Note: For an existing audit logging configuration, just enable the LSN parameter for
logging LSN information in the server specified by the audit action.
– Enable logging and session logging parameters. Enable logging and session logging
parameters either as you add LSN groups or after you have created the groups. The
NetScaler appliance generates log messages related to these LSN groups and sends them
to the server of those audit actions that have the LSN parameter enabled.
• Configuring log servers. This task involves installing SYSLOG or NSLOG packages on the de-
sired servers. This task also involves specifying the NSIP address of the NetScaler appliance in
the configuration file of SYSLOG or NSLOG. Specifying the NSIP address enables the server to
identify the log information sent by the NetScaler appliance for storing them in a log file.
To create a SYSLOG server action for LSN logging by using the command line interface
To create a SYSLOG server policy for LSN logging by using the command line interface
To bind a SYSLOG server policy to system global for LSN logging by using the command line in-
terface
To configure a SYSLOG server action for LSN logging by using the configuration utility
1. Navigate to Systems > Auditing > Syslog and, on the Servers tab, add a new auditing server or
edit an existing server.
2. To enable LSN logging, select the Large Scale NAT Logging option.
3. (Optional) To enable SYSLOG over TCP, select the TCP Logging option.
To configure a SYSLOG server policy for LSN logging by using the configuration utility
Navigate to Systems > Auditing > Syslog and, on the Policies tab, add a new policy or edit an existing
policy.
To bind a SYSLOG server policy to system global for LSN logging by using the configuration utility
To create a NSLOG server action for LSN logging by using the command line interface
To create a NSLOG server policy for LSN logging by using the command line interface
To bind a NSLOG server policy to system global for LSN logging by using the command line inter-
face
To configure a NSLOG server action for LSN logging by using the configuration utility
1. Navigate to Systems > Auditing > Nslog and, on the Servers tab, add a new auditing server or,
edit an existing server.
2. To enable LSN logging, select the Large Scale NAT Logging option.
To configure a NSLOG server policy for LSN logging by using the configuration utility
Navigate to Systems > Auditing > Nslog and, on the Policies tab, add a new policy or edit an existing
policy.
To bind a NSLOG server policy to system global for LSN logging by using the configuration utility
Example
The following configuration specifies two SYSLOG and two NSLOG servers for storing log entries in-
cluding LSN logs. LSN Logging is configured for LSN groups LSN-GROUP-2 and LSN-GROUP-3.
The NetScaler appliance generates log messages related to LSN mappings and LSN sessions of these
LSN groups, and sends them to the specified log servers.
The following configuration specifies SYSLOG configuration for sending log messages to
the external SYSLOG server 192.0.2.10 using TCP.
The following table displays sample LSN log entries of each type stored on the configured log servers.
These LSN log entries are generated by a NetScaler appliance whose NSIP address is 10.102.37.115.
Minimal Logging
Deterministic LSN configurations and Dynamic LSN configurations with port block significantly re-
duces the LSN log volume. For these two types of configuration, the NetScaler appliance allocates
a NAT IP address and a block of ports to a subscriber. The NetScaler appliance generates a log mes-
sage for a port block at the time of allocation to a subscriber. The NetScaler appliance also generates
a log message when a NAT IP address and port block is freed. For a connection, a subscriber can be
identified just by its mapped NAT IP address and port block. Because of this reason, the NetScaler ap-
pliance does not log any LSN session created or deleted. The appliance also neither logs any mapping
entry created for a session nor when the mapping entry gets removed.
The minimal logging feature for deterministic LSN configurations and dynamic LSN configurations
with port block is enabled by default and there is no provision to disable it. In other words, the
NetScaler appliance automatically do minimal logging for deterministic LSN configurations and dy-
namic LSN configurations with port block. There is no option available for disabling this feature. The
appliance sends the log messages to all the configured log servers.
A log message for each port block consists of the following information:
Consider an example of a simple deterministic LSN configuration for four subscribers having the IP
address 192.0.17.1, 192.0.17.2, 192.0.17.3, and 192.0.17.4.
In this LSN configuration, the port block size is set to 32768 and LSN NAT IP address pool has IP ad-
dresses in the range 203.0.113.19-203.0.113.23.
The NetScaler appliance sequentially preallocates, from the LSN NAT IP pool and on the basis of the
set port block size, an LSN NAT IP address and a block of ports to each subscriber. It assigns the first
block of ports (1024-33791) on the beginning NAT IP address (203.0.113.19) to the beginning subscriber
IP address (192.0.17.1). The next range of ports is assigned to the next subscriber, and so on, until the
NAT address does not have enough ports for the next subscriber. At that point, the first port block on
the next NAT IP address is assigned to the subscriber, and so on. The appliance logs the NAT IP address
and the block of ports allocated for each subscriber.
The NetScaler appliance does not log any LSN session created or deleted for these subscribers. The
appliance generates the following log messages for the LSN configuration.
When you remove the LSN configuration, the allocated NAT IP address and block of ports is freed from
each subscriber. The appliance logs NAT IP address and block of ports freed from each subscriber.
The appliance generates the following log messages for each subscriber when you remove the LSN
configuration.
“‘ pre codeblock
1) 03/23/2015:00:33:57 GMT Informational 0-PPE-0 : default LSN LSN_DETERMINISTIC 79201706 0 :
Dtrstc FREE Client 12.0.0.238, NatInfo 50.0.0.2:58368 to 58879
2) 03/23/2015:00:33:57 GMT Informational 0-PPE-0 : default LSN LSN_DETERMINISTIC 79201707 0 :
Dtrstc FREE Client 12.0.0.239, NatInfo 50.0.0.2:58880 to 59391
3) 03/23/2015:00:33:57 GMT Informational 0-PPE-0 : default LSN LSN_DETERMINISTIC 79201708 0 :
Dtrstc FREE Client 12.0.0.240, NatInfo 50.0.0.2:59392 to 59903
1 ### Minimal Logging for Dynamic LSN Configuration with Port Block
2
3 Consider an example of a simple dynamic LSN configuration with port
block for any subscriber in the network 192.0.2.0/24. In this LSN
configuration, the port block size is set to 1024 and LSN NAT IP
address pool has IP addresses in the range 203.0.113.3-203.0.113.4.
Done
bind lsn pool LSN-POOL-1 203.0.113.3-203.0.113.4
Done
add lsn group LSN-GROUP-1 -clientname LSN-CLIENT-1 -portblocksize 1024
Done
bind lsn group LSN-GROUP-1 -poolname pool1 LSN-POOL-1
Done
1 Once there are no more sessions left that is using the allocated NAT IP
address and one of the ports in the allocated port block, the
allocated NAT IP address and block of ports is freed from the
subscriber. The NetScaler logs that the NAT IP address and the block
of ports is freed from the subscriber. The appliance generates the
following log messages for the subscriber, having the IP address
192.0.2.1 , when no more sessions are left that is using the
allocated NAT IP address ( 203.0.113.3 ) and a port from the
allocated port block ( 1024-2047 ). The log message shows that the
NAT IP address and port block are freed from the subscriber.
3 The NetScaler appliance send its SYSLOG events and messages to all the
configured external log servers. This results in storing redundant
messages and makes monitoring difficult for system administrators.
To address this issue, the NetScaler appliance offers load balancing
algorithms that can load balance the SYSLOG messages among the
external log servers for better maintenance and performance. The
supported load balancing algorithms include RoundRobin,
LeastBandwidth, CustomLoad, LeastConnection, LeastPackets, and
AuditlogHash.
4
5 ### Load balancing of SYSLOG servers using the command line interface
6
7 Add a service and specify the service type as SYSLOGTCP or SYSLOGUDP.
Bind lb vserver
1 Add a SYSLOG action and specify the load balancing server name that has
SYSLOGTCP or SYSLOGUDP as service type.
add syslogpolicy
1 Bind the SYSLOG policy to the system global for the policy to take
effect.
6
7 1. Add a load balancing virtual server, specify the service type as
SYSLOGTCP or SYSLOGTCP, and load balancing method as AUDITLOGHASH.
8
9 Navigate to Traffic Management > Virtual Servers, click Add and
select SYLOGTCP or SYSLOGUDPas protocol.
10
11 1. Bing the service to the load balancing virtual server to the
service.
12
13 Bing the service to the load balancing virtual server.
14
15 Navigate to Traffic Management > Virtual Servers, select a virtual
server and then selectAUDITLOGHASH in the Load Balancing Method.
16
17 1. Add a SYSLOG action and specify the load balancing server name that
has SYSLOGTCP or SYSLOGUDP as service type.
18
19 Navigate to System > Auditing, click Servers and add a server by
selecting LB Vserver option inServers.
20
21 1. Add a SYSLOG policy by specifying the rule and action.
22
23 Navigate to System > Syslog, click Policies and add a SYSLOG policy
.
24
25 1. Bind the SYSLOG policy to the system global for the policy to take
effect.
26
27 Navigate to System > Syslog, select a SYSLOG policy and
click Action, and then click Global Bindings and bind the policy
to system global.
28
29 **Example:**
30
31 The following configuration specifies load balance of SYSLOG messages
among the external log servers using the AUDITLOGHASH as load
balancing method. The NetScaler appliance generates SYSLOG events
and messages that are load balanced amongst the services, service1,
service2, and service 3.
Done
of any HTTP requests related to the LSN group. The appliance then
sends the log messages to the configured log servers.
13
14 An HTTP header log profile can be bound to multiple LSN groups but an
LSN group can have only one HTTP header log profile.
15
16 ### To create an HTTP header log profile by using the the command line
interface
17
18 At the command prompt, type:
1 ### To bind an HTTP header log profile to an LSN group by using the the
command line interface
2
3 At the command prompt, type:
1 ### Example
2
3 In the following example of an LSN configuration, HTTP header log
profile HTTP-Header-LOG-1 is bound to LSN group LSN-GROUP-1. The log
profile has all the HTTP attributes (URL, HTTP method, HTTP version
, and HOST IP address) enabled for logging so that all these
attributes are logged for any HTTP requests from subscribers (in the
network 192.0.2.0/24) related to the LSN group.
1 The NetScaler generates the following HTTP header log message when one
of the subscriber belonging to the LSN configuration example sends
an HTTP request.
2
3 The log message tells us that a client having the IP address 192.0.2.33
sends an HTTP request to URL example.com using HTTP method GET and
HTTP version 1.1.
03/19/2015:16:24:04 GMT Informational 0-PPE-1 : default LSN Message 59 0 : “LSN Client IP:TD
10.102.37.118:0 URL: example.com Host: 192.0.2.33 Version: HTTP1.1 Method: GET”
1 **Sample Configuration:**
2
3 In this example of LSN configuration, the LSN log profile has the log
subscriber ID parameter enabled. The profile is bound to LSN group
LSN-GROUP-9. MSISDN information is included in the LSN session and
LSN mapping logs for connections from mobile subscribers (in the
network 192.0.2.0/24).
Done
add lsn client LSN-CLIENT-9
Done
bind lsn client LSN-CLIENT-9 -network 192.0.2.0 -netmask 255.255.255.0
Done
add lsn pool LSN-POOL-9
Done
bind lsn pool LSN-POOL-9 203.0.113.3-203.0.113.4
Done
add lsn group LSN-GROUP-9 -clientname LSN-CLIENT-9
Done
bind lsn group LSN-GROUP-9 -poolname LSN-POOL-9
Done
bind lsn group LSN-GROUP-9 -logprofilename LOG-PROFILE-MSISDN-9
Done
4
5 Note: When more than a million LSN sessions exist on the NetScaler
appliance, Citrix recommends displaying selected LSN sessions
instead of all by using the selection parameters.
6
7 ### Configuration Using the Command Line Interface
8
9 #### To display all LSN sessions by using the command line interface
10
11 At the command prompt, type:
1 ##### Example
2
3 To display all LSN sessions existing on a NetScaler
4
5 
6
7 To display all LSN sessions related to an LSN client entity LSN-CLIENT
-2
8
9 
10 Done
11
12 To display all LSN sessions that uses 203.0.113.5 as the NAT IP address
13
14 
15
16 ### Configuration Using the Configuration Utility
17
18 #### To display all or selected LSN sessions by using the configuration
utility
19
20 1. Navigate to System > Large Scale NAT > Sessions, and click the
NAT44 tab.
21 1. For displaying LSN sessions on the basis of selection parameters,
click Search.
22
23 ### Parameter Descriptions (of commands listed in the CLI procedure)
24
25 -
26 show lsn session
27
28 -
29 clientname
30
31 Name of the LSN Client entity. Maximum Length: 127
32
33 -
34 network
35
36 IP address or network address of subscriber(s).
37
38 -
39 netmask
40
41 Subnet mask for the IP address specified by the network
parameter.
42
43 Default value: 255.255.255.255
44
45 -
46 td
47
48 Traffic domain ID of the LSN client entity.
49
50 Default value: 0
51
52 Minimum value: 0
53
54 Maximum value: 4094
55
56 -
57 natIP
58
59 Mapped NAT IP address used in LSN sessions.
60
61 ## Displaying LSN Statistics
62
63 You can display statistics related to the LSN feature for evaluating
the performance of the LSN feature or to troubleshoot problems. You
can display a summary of statistics of the LSN feature or of a
stat lsn
1 #### Example
stat lsn
Done
stat lsn group LSN-GROUP-1
20
21 -
22 ntimes
23
24 The number of times, in intervals of seven seconds, the
statistics should be displayed.
25
26 Default value: 1
27
28 -
29 logFile
30
31 The name of the log file to be used as input.
32
33 -
34 clearstats
35
36 Clear the statsistics / counters
37
38 Possible values: basic, full
39
40 ## Compact Logging
41
42 Logging LSN information is one of the important functions needed by
ISPs to meet legal requirements and be able to identify the source
of traffic at any given time. This eventually results in a huge
volume of log data, requiring the ISPs to make large investments to
maintain the logging infrastructure.
43
44 Compact logging is a technique for reducing the log size by using a
notational change involving short codes for event and protocol names
. For example, C for client, SC for session created, and T for TCP.
Compact logging results in an average of 40 percent reduction in
log size.
45
46 The following examples of NAT44 mapping creation log entries show the
advantage of compact logging.
47
48 |-|-|
49
50 |Default logging format|02/02/2016:01:13:01 GMT Informational 0-PPE-2 :
default LSN LSN_ADDRPORT_MAPPING 85 0 : A&PDM CREATED ClientIP:Port
:TD1.1.1.1:6500:0,NatIP:NatPort8.8.8.8:47902, DestinationIP:Port:TD2
.2.2.2:80:0, Protocol: TCP|
51 |Compact logging format|02/02/2016:01:14:57 GMT Info 0-PE2:default LSN
87 0:A&PDMC|C-1.1.1.1:6500:0|N-8.8.8.9:51066|D-2.2.2.2:80:0|T|
52
53 ## Configuration Steps
54
55 Perform the following tasks for logging LSN information in compact
format:
56
57 - **Create an LSN log profile.** An LSN log profile includes the Log
Compact parameter, which specifies whether to or not to log
information in compact format for an LSN configuration.
58 - **Bind the LSN log profile to an LSN group of an LSN configuration
.** Bind the created LSN log profile to an LSN group of an LSN
configuration by setting the Log Profile Name parameter to the
created LSN log profile name. All sessions and mappings for this LSN
group are logged in compact format.
59
60 ### To create an LSN log profile by using the CLI
61
62 At the command prompt, type:
1 **Sample configuration:**
Done
add lsn client LSN-CLIENT-9
Done
bind lsn client LSN-CLIENT-9 -network 192.0.2.0 -netmask 255.255.255.0
Done
add lsn pool LSN-POOL-9
Done
bind lsn pool LSN-POOL-9 203.0.113.3-203.0.113.4
Done
add lsn group LSN-GROUP-9 -clientname LSN-CLIENT-9
Done
bind lsn group LSN-GROUP-9 -poolname LSN-POOL-9
Done
bind lsn group LSN-GROUP-9 –logProfileName LOG-PROFILE-COMPACT-9
Done
1 ## IPFIX Logging
2
3 The NetScaler appliance supports sending information about LSN events
in Internet Protocol Flow Information Export (IPFIX) format to the
configured set of IPFIX collector(s). The appliance uses the
existing AppFlow feature to send LSN events in IPFIX format to the
IPFIX collectors.
4
5 IPFIX based logging is available for the following large scale NAT44
related events:
6
7 - Creation or deletion of an LSN session.
8 - Creation or deletion of an LSN mapping entry.
9 - Allocation or de-allocation of port blocks in the context of
deterministic NAT.
10 - Allocation or de-allocation of port blocks in the context of dynamic
NAT.
11 - Whenever subscriber session quota is exceeded.
12
13 ### Points to Consider before you Configure IPFIX logging
14
15 Before you start configuring IPSec ALG, consider the following points:
16
17 - You must configure the AppFlow feature and IPFIX collector(s) on the
NetScaler appliance. For instructions, see Configuring the AppFlow
feature topic.
18
19 ### Configuration Steps
20
21 Perform the following tasks for logging LSN information in IPFIX format
:
22
23 - **Enable LSN logging in the AppFlow configuration**. Enable the LSN
logging parameter as part of AppFlow configuration.
24 - **Create an LSN log profile**. An LSN log profile includes the IPFIX
parameter that enables or disables the log information in IPFIX
format.
25 - **Bind the LSN log profile to an LSN group of an LSN configuration
**. Bind the LSN log profile to one or multiple LSN group(s). Events
related to the bound LSN group will be logged in IPFIX format.
26
27 #### To enable LSN logging in the AppFlow configuration by using the
CLI
28
29 At the command prompt, type:
1 #### To create an LSN log profile by using the CLIAt the command prompt
2
3 At the command prompt, type:
Navigate to System > Large Scale NAT > Profiles, click Log tab, and then add a log profile.
To bind the LSN log profile to an LSN group of an LSN configuration by using the GUI
1. Navigate to System > Large Scale NAT > LSN Group, open the LSN group.
2. In Advanced Settings, click + Log Profile to bind the created Log profile to the LSN group.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
STUN Timeout
Contributed by:
C
STUN (Session Traversal Utilities for NAT) enables an end host operating behind a NAT device to dis-
cover its NAT IP address and NAT port allocated by the NAT device. Interactive communication ap-
plications (for example real-time voice, video, and messaging) running on these hosts use the STUN
protocol for discovering NAT IP address and port information. This information is used by these appli-
cations to connect to their peer applications in the Internet. STUN protocol includes servers, known
as STUN servers, residing in the Internet. Using the STUN protocol, an application of an end host
sends a request to a known STUN server, which in turn then embeds the NAT IP address and port in
the payload of its response packet.
The application then notifies the peer applications that it is reachable at the NAT IP address and the
port of the LSN mapping entry created for the STUN session. It notifies by embedding the NAT IP ad-
dress and port in the payload of the packets sent to the peer applications. For making the application
reachable at the same LSN mapping entry for any external application, full Cone NAT (endpoint In-
dependent mapping and Endpoint Independent filtering) is enabled for the LSN configuration on the
NetScaler appliance.
The NetScaler detects an LSN session of type STUN if the request packets are destined to TCP or UDP
port 3478, and then marks the created mapping entry of type STUN. The NetScaler applies a time-
out called, STUN timeout, to the created STUN LSN mapping entry. A STUN timeout is the maximum
time that the NetScaler maintains an idle STUN LSN mapping entry since it was last used by any LSN
session. If the STUN LSN mapping session is unused for a time that exceeds the STUN timeout, the
NetScaler removes the mapping entry.
For an application on a subscriber that use STUN LSN mapping entry to stay available to other peer
applications on the Internet, the application periodically sends keep-alive messages to the NetScaler
appliance so that the STUN LSN mapping entry does not timeout. A higher frequency of keep-alive
messages can have an affect on the performance a subscriber, especially, if the subscriber is a mo-
bile device. A higher value of STUN timeout reduces the frequency of keep-alive messages from a
subscriber.
ALGs on the NetScaler appliance do not apply to an LSN session that use a STUN LSN mapping en-
try because NAT IP address and NAT port are communicated in payload of the packets related to the
session.
For subscribers’ applications that use STUN protocol, the LSN configuration must have the following
settings:
• STUN timeout. In an LSN configuration, the LSN group includes the STUN timeout setting.
• Endpoint-independent mapping and endpoint-independent filtering for STUN protocol ports.
For instructions on creating an LSN configuration, see Configuration Steps for LSN.
Example:
The following sample LSN configuration applies to applications that use STUN protocol over TCP or
UDP. STUN timeout is set to 10 mins. Endpoint-independent mapping and endpoint-independent fil-
tering is set for the STUN TCP port (3748) and the STUN UDP port (3748).
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
SYN idle timeout is the timeout for establishing TCP connections that use LSN on the NetScaler appli-
ance. If a TCP session is not established within the configured timeout period, the NetScaler removes
the session. SYN idle timeout is useful in providing protection against SYN flood attacks. In an LSN
configuration, the LSN group entity includes the SYN idle timeout setting.
Example:
In the following sample LSN configuration, SYN idle timeout is set to 30 secs for TCP connections re-
lated to subscribers from the 192.0.2.0/24 network.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
An LSN configuration takes precedence over any load balancing configuration by default. For over-
riding the large scale networking (LSN) configuration with the load balancing configuration for traffic
matching both configurations, create a net profile with Override LSN parameter enabled and bind
this profile to the virtual server of the load balancing configuration. USNIP or USIP settings of the load
balancing configuration are applied to the traffic, instead of applying the LSN IP address of the LSN
configuration.
This option is useful in an LSN deployment that includes NetScaler appliances and value added ser-
vices, such as firewall and optimization devices. In this type of deployment, the ingress traffic on the
NetScaler appliance is required to pass through these value-added services before an LSN configura-
tion on the appliance is applied to the traffic. For the NetScaler appliance to send the ingress traffic
to a value added service, a load balancing configuration is created and override LSN is enabled on
the appliance. The load balancing configuration includes value added services, represented as load
balancing services, bound to a virtual server of type ANY. The virtual server is configured with listen
policies for identifying the traffic to be sent to the value added service.
To enable override lsn while adding a net profile, at the command prompt, type
To enable override lsn while adding a net profile, at the command prompt, type
In the following sample configuration, net profile NETPROFILE-OVERRIDELSN-1 has override LSN op-
tion enabled and is bound to load balancing virtual server LBVS-1.
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can remove any unwanted or inefficient LSN sessions from the NetScaler appliance. The appli-
ance immediately releases resources (such as NAT IP address, port, and memory) allocated for these
sessions, making the resources available for new sessions. The appliance also drops all the subse-
quent packets related to these removed sessions. You can remove all or selected LSN sessions from
the NetScaler appliance.
Example
Clear all LSN sessions related to a subscriber network (192.0.2.0) of LSN client entity LSN-CLIENT-2
belonging to traffic domain 100
Navigate to System > Large Scale NAT > Sessions, and click Flush Sessions.
– clientname
– network
– netmask
– td
Default value: 0
Minimum value: 0
– natIP
– natPort
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance send its SYSLOG events and messages to all the configured external log
servers. This results in storing redundant messages and makes monitoring difficult for system
administrators. To address this issue, the NetScaler appliance offers load balancing algorithms
that can load balance the SYSLOG messages among the external log servers for better maintenance
and performance. The supported load balancing algorithms include RoundRobin, LeastBandwidth,
CustomLoad, LeastConnection, LeastPackets, and AuditlogHash.
Add a load balancing virtual server, specify the service type as SYSLOGTCP or SYSLOGTCP, and load
balancing method as AUDITLOGHASH.
1. Add a SYSLOG action and specify the load balancing server name that has SYSLOGTCP or SYS-
LOGUDP as service type.
Bind the SYSLOG policy to the system global for the policy to take effect.
4. Add a SYSLOG action and specify the load balancing server name that has SYSLOGTCP or SYS-
LOGUDP as service type.
Navigate to System > Auditing, click Servers and add a server by selecting LB Vserver option
inServers.
Navigate to System > Syslog, click Policies and add a SYSLOG policy.
6. Bind the SYSLOG policy to the system global for the policy to take effect.
Navigate to System > Syslog, select a SYSLOG policy and click Action, and then click Global Bind-
ings and bind the policy to system global.
Example:
The following configuration specifies load balance of SYSLOG messages among the external log
servers using the AUDITLOGHASH as load balancing method. The NetScaler appliance generates
SYSLOG events and messages that are load balanced amongst the services, service1, service2, and
service 3.
Limitations:
The NetScaler appliance does not support an external load balancing virtual server load balancing the
SYSLOG messages among the log servers.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
NetScaler appliances now support Port Control Protocol (PCP) for large scale NAT (LSN). Many of an
ISP’s subscriber applications must be accessible from Internet (for example, Internet of Things (IOT)
devices, such as an IP camera that provides surveillance over the Internet). One way to meet this
requirement is to create static large scale NAT (LSN) maps. But for a very large number of subscribers,
creating static LSN NAT maps is not a feasible solution.
Port Control Protocol (PCP) enables a subscriber to request specific LSN NAT mappings for itself
and/or for other 3rd party devices. The large scale NAT device creates an LSN map and sends it to the
subscriber. The subscriber sends the remote devices on the Internet the NAT IP address:NAT port at
which they can connect to the subscriber.
Applications usually send frequent keep-alive messages to the large scale NAT device so that their LSN
mappings do not time out. PCP helps reduce the frequency of such keep-alive messages by enabling
the applications to learn the timeout settings of the LSN mappings. This helps reduce bandwidth
consumption on the ISP’s access network and battery consumption on mobile devices.
PCP is a client-server model and runs over the UDP transport protocol. A NetScaler appliance imple-
ments the PCP server component and is compliant with RFC 6887.
Configuration Steps
• (Optional) Create a PCP profile. A PCP profile includes settings for PCP related parameters (for
example, to listen for mapping and peer PCP requests). A PCP profile can be bound to a PCP
server. A PCP profile bound to a PCP server applies all its settings to the PCP server. A PCP profile
can be bound to multiple PCP servers. By default, one PCP profile with default parameters
settings is bound to all PCP servers. A PCP profile that you bind to a PCP server overrides the
default PCP profile settings for that server. A default PCP profile has the following parameter
settings:
– Mapping: Enabled
– Peer: Enabled
– Minimum map life: 120 seconds
– Maximum max life: 86400 seconds
– Announce count: 10
– Third Party: Disabled
• Create a PCP server and bind a PCP profile to it. Create a PCP server on the NetScaler appliance
to listen for PCP related requests and messages from the subscribers. A Subnet IP (SNIP) address
must be assigned to a PCP server to access it. By default, a PCP server listens on port 5351.
• Bind the PCP server to an LSN group of an LSN configuration. Bind the created PCP server to an
LSN group of an LSN configuration by setting the PCP Server parameter to specify the created
PCP server. The created PCP server can be accessed only by the subscribers of this LSN group.
Note
A PCP server for a large scale NAT configuration does not serve requests from subscribers that
are identified from ACL rules.
In the following sample configuration, PCP server PCP-SERVER-9, with default PCP settings, is
bound to LSN group LSN-GROUP-9. PCP-SERVER-9 serves PCP requests from subscribers in network
192.0.2.0/24.
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Dual-Stack Lite
January 6, 2019
Contributed by:
C
Because of the shortage of IPv4 addresses, and the advantages of IPv6 over IPv4, many ISPs have
started transitioning to IPv6 infrastructure. But during the transition, ISPs must continue to support
IPv4 along with IPv6, because most of the public Internet still uses only IPv4, and many subscribers
do not support IPv6.
Dual Stack Lite (DS-Lite) is an IPv6 transition solution for ISPs with IPv6 infrastructure to connect their
IPv4 subscribers to the Internet. DS-Lite uses IPv4-in-IPv6 tunneling to send a subscriber’s IPv4 packet
through a tunnel on the IPv6 access network to the ISP. The IPv6 packet is decapsulated to recover the
subscriber’s IPv4 packet and is then sent to the Internet after NAT address and port translation and
other LSN related processing. The response packets traverse through the same path to the subscriber.
The NetScaler appliance implements the AFTR component of a DS-Lite deployment and is compliant
with RFC 6333.
Architecture
The Dual-Stack Lite architecture for an ISP consists of the following components:
• Basic Bridging Broadband (B4). Basic Bridging broadband, or B4, is a device or component
that resides in the subscriber premises. Typically, B4 is a component in the CPE devices in
the subscriber premises. IPv4 subscribers are connected to the IPv6-only ISP access network
through the CPE device containing the B4 component. The main function of the B4 is to initiate
an IPv6 tunnel between B4 and an address family transition router (AFTR) in order to send or re-
ceive subscriber IPv4 request or response packets over the tunnel. B4 includes an IPv6 address
known as the B4 tunnel endpoint address. B4 uses this address to source IPv6 packets to AFTR
and receive packets from AFTR.
• Address family transition router (AFTR). AFTR is a device or component residing in the ISP’s
core network. AFTR terminates the IPv6 tunnel from the B4 device. In other words, the IPv6 tun-
nel is formed between B4 in the subscriber premise and AFTR in ISP core network. AFTR decap-
sulates IPv6 packets received from B4 to recover the subscribers’ original IPv4 packets. AFTR
sends the IPv4 packets to the LSN device or component. LSN routes the IPv4 packets to their
destination after performing NAT address and port translation (NAT 44) and other LSN related
processing. AFTR includes an IPv6 address known as the AFTR tunnel endpoint address. AFTR
uses this address to source IPv6 packets to B4 and receive IPv6 packets from B4. The NetScaler
appliance implements the AFTR component.
• Softwire. The IPv6 tunnel created between B4 and AFTR is called a softwire.
The DS-Lite architecture of an ISP using a NetScaler appliance consists of subscribers in private ad-
dress spaces accessing the Internet through a NetScaler appliance deployed in ISP’s core network.
IPv4 subscribers are connected to a CPE device that includes the DS-Lite B4 functionality. The CPE
device is connected to the ISP core network through ISP’s IPv6-only access network. The NetScaler
appliance contains the DS-Lite AFTR and LSN functionality.
IPv4 subscribers connected to the CPE device are assigned private IPv4 addresses either manually
or through DHCP server running on the CPE device. On the CPE device, the AFTR tunnel endpoint
address is specified manually or through DHCPv6. Configuration of CPE devices is vendor specific
and therefore outside the scope of this documentation.
Upon receiving a request packet that is from an IPv4 subscriber and destined to a location on the In-
ternet, the B4 component of the CPE device encapsulates the IPv4 packet in an IPv6 packet and sends
it to the NetScaler appliance in the ISP core network. The NetScaler appliance‘s AFTR functionality
decapsulates the IPv6 packet to recover the subscriber’s original IPv4 packet. The LSN functionality
of the NetScaler appliance translates the source IP address and port of the IPv4 packet to an NAT IP
address and NAT port selected from the configured NAT pool, and then sends the packet to its desti-
nation on the Internet.
The appliance maintains a record of all active sessions that use the AFTR and LSN functionalities.
These sessions are called DS-Lite sessions. The NetScaler appliance also maintains the mappings
between B4 IPv6 address, subscriber IPv4 address and port, and NAT IPv4 address and port, for each
DS-Lite session. These mappings are called DS-Lite LSN mappings. From DS-Lite session entries and
DS-Lite LSN mapping entries, the NetScaler appliance recognizes a response packet (received from
the Internet) as belonging to a particular DS-Lite session.
When the NetScaler appliance receives a response packet belonging to a particular DS-Lite session,
the appliance’s LSN functionality translates the destination IP address and port of the response packet
from NAT IP address and port to the subscriber IP address and port, the AFTR functionality encapsu-
lates the resulting packet in an IPv6 packet and sends it to the CPE device. The B4 functionality of
the CPE device decapsulates the IPv6 packet to recover the IPv4 response packet, and then sends the
IPv4 packet to the subscriber.
Example
Consider an example of a DS-Lite deployment consisting of NetScaler NS-1 in an ISP’s core network,
CPE device B4-CPE-1 in a subscriber premise, and a single IPv4 subscriber SUB-1. B4-CPE-1 supports
the B4 functionality of DS-Lite feature.
1. IPv4 subscriber SUB-1 sends a request to (http://www.example.com/). The IPv4 packet has:
• Destination port = 80
2. Upon receiving the IPv4 request packet, B4-CPE-1 encapsulates it in the payload of an IPv6 packet
and then sends the IPv6 packet to NS-1. The IPv6 packet has:
3. When NS-1 receives the IPv6 packet, the AFTR module decapsulates the packet by removing the
IPv6 headers. The resulting packet is SUB-1’s original IPv4 request packet.
4. The LSN module of NS-1 translates the source IP address and port of the packet to an NAT IP
address and NAT port selected from the configured NAT pool. The translated IPv4 packet has:
5. The LSN module also creates an LSN mapping and session entry for this DS Lite session. The
mapping includes the following information:
6. NS-1 sends the resulting IPv4 packet to its destination on the Internet.
7. The server for www.example.com processes the request packet and sends a response packet. The
IPv4 response packet has:
8. Upon receiving the IPv4 packet, NS-1 examines the LSN mapping and session entries and finds
that the IPv4 response packet belongs to a DS Lite session. The LSN module of NS-1 translates the
destination IP address and port. The IPv4 packet now has:
9. The AFTR module of NS-1 encapsulates the IPv4 packet in an IPv6 packet and then sends the IPv6
packet to B4-CPE-1. The IPv6 packet has:
10. Upon receiving the packet, B4-CPE-1 decapsualtes the IPv6 packet by removing the IPv6 headers,
and then sends the resulting IPv4 packet to CL-1.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
1. You must understand the different components of DS-Lite, described in RFC 6333.
2. A DS-lite configuration on a NetScaler appliance uses the LSN commands sets. In a DS-Lite configu-
ration, the LSN client entity specifies the IPv6 address or IPv6 network address or ACL6 rules for iden-
tifying the traffic from the B4 device. A DS-Lite configuration also includes an IPv6 profile, which spec-
ifies the IPv6 address AFTR component on a NetScaler appliance. For more information on NetScaler
LSN feature, see Large Scale NAT.
3. For a DS-Lite configuration, the NetScaler appliance supports LSN for IPv4 packets that belong to
one of the following protocols only. The NetScaler appliance drops IPv4 packets belonging to other
protocols:
• TCP
• UDP
• ICMP
• ICMP
• FTP
• TFTP
• Session Initiation Protocol (SIP)
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Configuring DS-Lite
Contributed by:
C
A DS-lite configuration on a NetScaler appliance uses the LSN commands sets. In a DS-Lite configura-
tion, the LSN client entity specifies the IPv6 address or IPv6 network address or ACL6 rules for iden-
tifying the traffic from the B4 device. For more information on the NetScaler LSN feature, see Large
Scale NAT. A DS-Lite configuration also includes an IPv6 profile, which specifies the IPv6 address (of
type SNIP6) of the DS-Lite AFTR component on a NetScaler appliance.
Set the global LSN parameters. Global parameters include the amount of NetScaler memory re-
served for the LSN feature and synchronization of LSN sessions in a high availability setup.
• Create an LSN client entity for identifying traffic from B4 CPE devices. The LSN client entity
refers to a set of DS-Lite B4 devices. The client entity includes IPv6 addresses or IPv6 network
address or ACL6 rules for identifying the traffic from these B4 devices. An LSN client can be
bound to only one LSN group. The command line interface has two commands for creating
an LSN client entity and binding a subscriber to the LSN client entity. The configuration utility
combines these two operations on a single screen.
• Create an LSN pool and bind NAT IP addresses to it. An LSN pool defines a pool of NAT IP
addresses to be used by the NetScaler appliance to perform LSN. The command line interface
has two commands for creating an LSN pool and binding NAT IP addresses to the LSN pool. The
configuration utility combines these two operations on a single screen.
• Create an LSN IP6 profile. An LSN IP6 profile defines the IPv6 address of the DS-Lite AFTR
component on the NetScaler appliance. The IPv6 address must be one of the NetScaler owned
IPv6 address of type SNIP6.
• (Optional) Create an LSN Transport Profile for a specified protocol. An LSN transport profile
defines various timeouts and limits, such as maximum LSN sessions and maximum ports usage
that a subscriber can have for a given protocol. You bind an LSN transport profile for each pro-
tocol (TCP, UDP, and ICMP) to an LSN group. A profile can be bound to multiple LSN groups.
A profile bound to an LSN group applies to all subscribers of an LSN client bound to the same
group. By default, one LSN transport profile with default settings for TCP, UDP, and ICMP pro-
tocols is bound to an LSN group during its creation. This profile is called the default transport
profile. An LSN transport profile that you bind to an LSN group overrides the default LSN trans-
port profile for that protocol.
• (Optional) Create an LSN Application Profile for a specified protocol and bind a set of desti-
nation ports to it. An LSN application profile defines the LSN mapping and LSN filtering controls
of a group for a given protocol and for a set of destination ports. For a set of destination ports,
you bind an LSN profile for each protocol (TCP, UDP, and ICMP) to an LSN group. A profile can be
bound to multiple LSN groups. An LSN application profile bound to an LSN group applies to all
subscribers of an LSN client bound to the same group. By default, one LSN application profile
with default settings for TCP, UDP, and ICMP protocols for all destination ports is bound to an
LSN group during its creation. This profile is called a default application profile. When you bind
an LSN application profile, with a specified set of destination ports, to an LSN group, the bound
profile overrides the default LSN application profile for that protocol at that set of destination
ports. The command line interface has two commands for creating an LSN application profile
and binding a set of destination ports to the LSN application profile. The configuration utility
combines these two operations on a single screen.
• Create an LSN Group and bind LSN pools, LSN IPv6 profile, (optional) LSN transport pro-
files, and (optional) LSN application profiles to the LSN group. An LSN group is an entity
consisting of an LSN client, an LSN IPv6 profile, LSN pool(s), LSN transport profile(s), and LSN
application profiles(s). A group is assigned parameters, such as port block size and logging of
LSN sessions. The parameter settings apply to all the subscribers of an LSN client bound to the
LSN group. Only one LSN IPv6 profile can be bound to an LSN group, and an LSN IPv6 profile
bound to an LSN group cannot be bound to other LSN groups. Only LSN Pools and LSN groups
with the same NAT type settings can be bound together. Multiples LSN pools can be bound to
an LSN group. Only one LSN client entity can be bound to an LSN group, and an LSN client en-
tity bound to an LSN group cannot be bound to other LSN groups. The command line interface
has two commands for creating an LSN group and binding LSN pools, LSN transport profiles,
and LSN application profiles to the LSN group. The configuration utility combines these two
operations in a single screen.
To bind an IPv6 network or an ACL6 rule to an LSN client by using the command line interface:
To bind an IP address range to an LSN pool by using the command line interface:
Note: For removing LSN IP addresses from an LSN pool, use the unbind lsn pool command.
1 add lsn ip6profile <name> ‒ type DS-Lite ‒ network6 < ipv6_addr|*s >
2
3 show lsn ip6profile
2
3 show lsn transportprofile
To bind an application protocol port range to an LSN application profile by using the command
line interface:
To bind LSN protocol profiles and LSN pools to an LSN group by using the command line interface:
To configure an LSN client and bind an IPv6 network address or an ACL6 rule by using the con-
figuration utility:
Navigate to System > Large Scale NAT > Clients, and add a client and then bind an IPv6 network
address or an ACL6 rule to the client.
To configure an LSN pool and bind NAT IP addresses by using the configuration utility:
Navigate to System > Large Scale NAT > Pools, and add a pool and then bind an NAT IP address or a
range of NAT IP addresses to the pool.
Navigate to System > Large Scale NAT > Profiles, click the IPv6 tab, and assign an IPv6 address for
DS-Lite AFTR.
To configure an LSN group and bind an LSN client, an LSN IPv6 profile, pools, transport profiles,
and application profiles by using the configuration utility:
Navigate to System > Large Scale NAT > Groups, and add a group and then bind an LSN client, an
LSN IPv6 profile, pools, transport profiles, and application profiles to the group.
14 Done
You can log DS-Lite information to diagnose or troubleshoot problems, and to meet legal require-
ments. The NetScaler appliance supports all LSN logging features for logging DS-Lite information.
For configuring DS-Lite logging, use the procedures for configuring LSN logging, described at Logging
and Monitoring LSN.
A log message for a DS-Lite LSN mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (MAPPING)
• Whether the DS-Lite LSN mapping entry was created or deleted
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID might be present, depending on the following
conditions:
– Destination IP address and port are not logged for Endpoint-Independent mapping.
– Only the destination IP address is logged for Address-Dependent mapping. The port is not
logged.
– Destination IP address and port are logged for Address-Port-Dependent mapping.
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (SESSION)
• Whether the DS-Lite session is created or removed
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The following table shows sample DS-Lite log entries of each type stored on the configured log servers.
These log entries are generated by a NetScaler appliance whose NSIP address is 10.102.37.115.You can
log DS-Lite information to diagnose or troubleshoot problems, and to meet legal requirements. The
NetScaler appliance supports all LSN logging features for logging DS-Lite information. For configuring
DS-Lite logging, use the procedures for configuring LSN logging, described at Logging and Monitoring
LSN.
A log message for a DS-Lite LSN mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (MAPPING)
• Whether the DS-Lite LSN mapping entry was created or deleted
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID might be present, depending on the following
conditions:
– Destination IP address and port are not logged for Endpoint-Independent mapping.
– Only the destination IP address is logged for Address-Dependent mapping. The port is not
logged.
– Destination IP address and port are logged for Address-Port-Dependent mapping.
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (SESSION)
• Whether the DS-Lite session is created or removed
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The following table shows sample DS-Lite log entries of each type stored on the configured log servers.
These log entries are generated by a NetScaler appliance whose NSIP address is 10.102.37.115.
You can display the current DS-Lite sessions for detecting any unwanted or inefficient sessions on the
NetScaler appliance. You can display all or some DS-Lite sessions, on the basis of selection parame-
ters.
Example:
The following sample ouput displays all DS-Lite sessions existing on a NetScaler appliance:
1. Navigate to System > Large Scale NAT > Sessions, and click the DS-Lite tab.
2. For displaying DS-Lite sessions on the basis of selection parameters, click Search.
You can remove any unwanted or inefficient DS-Lite sessions from the NetScaler appliance. The ap-
pliance immediately releases the resources (such as NAT IP address, port, and memory) allocated for
these sessions, making the resources available for new sessions. The appliance also drops all the sub-
sequent packets related to these removed sessions. You can remove all or selected DS-Lite sessions
from the NetScaler appliance.
1. Navigate to System > Large Scale NAT > Sessions, and click the DS-Lite tab.
2. Click Flush Sessions.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance supports manual creation of DS-Lite LSN mappings, which contain the map-
ping between the following information:
Static DS-Lite LSN mappings are useful in cases where you want to ensure that the connections initi-
ated to a NAT IP address and port map to the subscriber IP address and port through the specified B4
device (for example, web servers located in the internal network).
Note: This feature is supported in release 11.0 build 64.x and later.
Parameter Descriptions
• name
Name for the LSN static mapping entry. Must begin with an ASCII alphanumeric or underscore (_)
character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon
(:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the LSN group is created.
The following requirement applies only to the CLI: If the name includes one or more spaces, enclose
the name in double or single quotation marks (for example, “ds-lite lsn static1” or ‘ds-lite lsn static1’).
This is a mandatory argument. Maximum Length: 127
• transportprotocol
• subscrIP
• subscrPort
• Network6
• td
ID of the traffic domain to which the B4 device belongs. The IPv6 address of the B4 device is specified
in the network6 paramter. If you do not specify an ID, the B4 device is assumed to be a part of the
default traffic domain.
• natIP
IPv4 address, already existing on the NetScaler appliance as type LSN, to be used as NAT IP address
for this mapping entry.
• natPort
• destIP
• dsttd
ID of the traffic domain through which the destination IP address for this DS-Lite LSN mapping entry
is reachable from the NetScaler appliance. If you do not specify an ID, the destination IP address is
assumed to be reachable through the default traffic domain, which has an ID of 0.
Navigate to System > Large Scale NAT > Static, and add a new DS-Lite static LSN mapping.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Deterministic NAT allocation for DS-Lite LSN deployments is a type of NAT resource allocation in which
the NetScaler appliance pre-allocates, from the LSN NAT IP pool and on the basis of the specified
port block size, an LSN NAT IP address and a block of ports to each subscriber (subscriber behind B4
device).
Note: This feature is supported in release 11.0 build 64.x and later.
The appliance sequentially allocates NAT resources to these subscribers. It assigns the first block of
ports on the beginning NAT IP address to the beginning subscriber IP address. The next range of ports
is assigned to the next subscriber, and so on, until the NAT address does not have enough ports for the
next subscriber. At that point, the first port block on the next NAT address is assigned to the subscriber,
and so on.
The NetScaler appliance logs the allocated NAT IP address and the port block for a subscriber. For a
connection, a subscriber can be identified by just its mapped NAT IP address and port block. For this
reason, the NetScaler appliance does not log the creation or deletion of an LSN session.
A DS-Lite subscriber can have only one deterministic port block. If the entire block of ports is being
used, the NetScaler appliance drops any new connection from the subscriber.
In this example, a deterministic DS-Lite configuration includes four subscribers with IP addresses
192.0.17.5, 192.0.17.6, 192.0.17.7, and 192.0.17.8. These ipv4 subscribers are behind a B4 device hav-
ing the IPv6 address 2001:DB8::3:4. In this configuration, the port block size is set to 20480 and LSN
NAT IP address pool has IP addresses in the range 203.0.113.41-203.0.113.42.
The NetScaler appliance sequentially pre-allocates, from the LSN NAT IP pool and on the basis of the
set port block size, an LSN NAT IP address and a block of ports to each subscriber. It assigns the first
block of ports (1024-21503) on the beginning NAT IP address (203.0.113.41) to the beginning subscriber
IP address (192.0.17.5). The next range of ports is assigned to the next subscriber, and so on, until the
NAT address does not have enough ports for the next subscriber. At that point, the first port block on
the next NAT IP address is assigned to the subscriber, and so on. The NetScaler logs the NAT IP address
and the block of ports allocated for each subscriber.
The NetScaler appliance does not log any LSN session created or deleted for these subscribers.
The following table lists the NAT IP address and blocks of ports allocated to each subscriber in this
example:
Configuration Steps
You need to configure deterministic NAT as part of the DS-Lite configuration. For instructions on con-
figuring DS-Lite, see Configuring DS-Lite.
1 add lsn client LSN-DSLITE-CLIENT-10
2
3 Done
4 bind lsn client LSN-DSLITE-CLIENT-10 -network 192.0.17.5 -netmask
255.255.255.255 -network6 2001:DB8::3:4/128
5
6 Done
7 bind lsn client LSN-DSLITE-CLIENT-10 -network 192.0.17.6 -netmask 255
.255.255.255 -network6 2001:DB8::3:4/128
8
9 Done
10 bind lsn client LSN-DSLITE-CLIENT-10 -network 192.0.17.7 -netmask 255
.255.255.255 -network6 2001:DB8::3:4/128
11
12 Done
13 bind lsn client LSN-DSLITE-CLIENT-10 -network 192.0.17.8 -netmask 255
.255.255.255 -network6 2001:DB8::3:4/128
14
15 Done
16 add lsn pool LSN-DSLITE-POOL-10 -nattype DETERMINISTIC
17
18 Done
19 bind lsn pool LSN-DSLITE-POOL-10 203.0.113.41-203.0.113.42
20
21 Done
22 add lsn ip6profile LSN-DSLITE-PROFILE-10 -type DS-Lite -network6 2001:
DB8::5:6
23
24 Done
25 add lsn group LSN-DSLITE-GROUP-10 -clientname LSN-DSLITE-CLIENT-10 -
nattype DETERMINISTIC -portblocksize 20480 -ip6profile LSN-DSLITE-
PROFILE-10
26
27 Done
28 bind lsn group LSN-DSLITE-GROUP-10 -poolname LSN-DSLITE-POOL-10
29
30 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
For some application layer protocols, the IP addresses and protocol port numbers are also commu-
nicated in the packet’s payload. Application Layer Gateway (AGL) for a protocol parses the packet
payload and does necessary changes to ensure that the protocol continues to work over DS-Lite.
The NetScaler appliance supports ALG for the following protocols for DS-Lite:
• FTP
• ICMP
• TFTP
• SIP
• RTSP
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can enable or disable ALG for the FTP protocol for a DS-Lite configuration by enabling or disabling
the FTP ALG option of the LSN group of the configuration.
ALG for the ICMP protocol is enabled by default, and there is no provision to disable it.
ALG for the TFTP protocol is disabled by default. TFTP ALG is enabled automatically for a DS-Lite
configuration when you bind a UDP LSN application profile, with endpoint-independent-mapping,
endpoint-independent filtering, and destination port as 69 (well-known port for TFTP), to the LSN
group.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Using DS-Lite with Session Initiation Protocol (SIP) is complicated, because SIP messages contain IP
addresses in the SIP headers as well as in the SIP body. When LSN is used with SIP, the SIP headers
contain information about the caller and the receiver, and the device translates this information to
hide it from the outside network. The SIP body contains the Session Description Protocol (SDP) in-
formation, which includes IP addresses and port numbers for transmission of the media. SIP ALG for
DS-Lite is compliant with RFC 3261, RFC 3581, RFC 4566, and RFC 4475.
You need to configure the SIP ALG as part of the LSN configuration. For instructions on configuring
LSN, see Configuring DS-Lite. While configuring LSN, make sure that you:
o IP Pooling = PAIRED
o Filtering = ENDPOINT-INDEPENDENT
• Create a SIP ALG profile and make sure that you define either the source port range or destina-
tion port range. Bind the SIP ALG profile to the LSN group
• Enable SIP ALG in the LSN group
Sample Configuration
The following sample DS-Lite configuration, SIP ALG is enabled for TCP traffic from B4 devices in the
network 2001:DB8::3:0/96.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Real Time Streaming Protocol (RTSP) is an application-level protocol for the transfer of real-time me-
dia data. Used for establishing and controlling media sessions between end points, RTSP is a control
channel protocol between the media client and the media server. The typical communication is be-
tween a client and a streaming media server.
Streaming media from a private network to a public network requires translating IP addresses and
port numbers over the network. NetScaler functionality includes an Application Layer Gateway (ALG)
for RTSP, which can be used with Large Scale NAT (LSN) to parse the media stream and make any
necessary changes to ensure that the protocol continues to work over the network.
How IP address translation is performed depends on the type and direction of the message, and the
type of media supported by the client-server deployment. Messages are translated as follows:
• Outbound request—Private IP address to NetScaler owned public IP address called LSN IP ad-
dress.
• Inbound response—LSN IP address to private IP address.
• Inbound request—No translation.
• Outbound response—Private IP address to LSN pool IP address.
Configure RTSP ALG as part of the LSN configuration. For instructions on configuring LSN, see Config-
uring DS-Lite. While configuring LSN, make sure that you:
• Set the following parameters while adding an LSN application profile:
– IP Pooling = PAIRED
– Address and Port Mapping = ENDPOINT-INDEPENDENT
– Filtering = ENDPOINT-INDEPENDENT
• Enable RTSP ALG in the LSN group
• Create a RTSP ALG profile and bind the RTSP ALG profile to the LSN group
The following sample DS-Lite configuration, RTSP ALG is enabled for TCP traffic from B4 devices in the
network 2001:DB8::4:0/96.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can log DS-Lite information to diagnose or troubleshoot problems, and to meet legal require-
ments. The NetScaler appliance supports all LSN logging features for logging DS-Lite information.
For configuring DS-Lite logging, use the procedures for configuring LSN logging, described at Logging
and Monitoring LSN.
A log message for a DS-Lite LSN mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (MAPPING)
• Whether the DS-Lite LSN mapping entry was created or deleted
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID might be present, depending on the following
conditions:
– Destination IP address and port are not logged for Endpoint-Independent mapping.
– Only the destination IP address is logged for Address-Dependent mapping. The port is not
logged.
– Destination IP address and port are logged for Address-Port-Dependent mapping.
A log message for a DS-Lite session consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (SESSION)
• Whether the DS-Lite session is created or removed
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The following table shows sample DS-Lite log entries of each type stored on the configured log servers.
These log entries are generated by a NetScaler appliance whose NSIP address is 10.102.37.115.You can
log DS-Lite information to diagnose or troubleshoot problems, and to meet legal requirements. The
NetScaler appliance supports all LSN logging features for logging DS-Lite information. For configuring
DS-Lite logging, use the procedures for configuring LSN logging, described at Logging and Monitoring
LSN.
A log message for a DS-Lite LSN mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (MAPPING)
• Whether the DS-Lite LSN mapping entry was created or deleted
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID might be present, depending on the following
conditions:
– Destination IP address and port are not logged for Endpoint-Independent mapping.
– Only the destination IP address is logged for Address-Dependent mapping. The port is not
logged.
– Destination IP address and port are logged for Address-Port-Dependent mapping.
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (SESSION)
• Whether the DS-Lite session is created or removed
• IPv6 address of B4
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The following table shows sample DS-Lite log entries of each type stored on the configured log servers.
These log entries are generated by a NetScaler appliance whose NSIP address is 10.102.37.115.
You can display the current DS-Lite sessions for detecting any unwanted or inefficient sessions on the
NetScaler appliance. You can display all or some DS-Lite sessions, on the basis of selection parame-
ters.
The following sample ouput displays all DS-Lite sessions existing on a NetScaler appliance:
1. Navigate to System > Large Scale NAT > Sessions, and click the DS-Lite tab.
2. For displaying DS-Lite sessions on the basis of selection parameters, click Search.
You can remove any unwanted or inefficient DS-Lite sessions from the NetScaler appliance. The ap-
pliance immediately releases the resources (such as NAT IP address, port, and memory) allocated for
these sessions, making the resources available for new sessions. The appliance also drops all the sub-
sequent packets related to these removed sessions. You can remove all or selected DS-Lite sessions
from the NetScaler appliance.
1. Navigate to System > Large Scale NAT > Sessions, and click the DS-Lite tab.
2. Click Flush Sessions.
The NetScaler appliance can log request header information of an HTTP connection that is using the
DS-Lite functionality. The following header information of an HTTP request packet can be logged:
The HTTP header logs can be used by ISPs to see the trends related to the HTTP protocol among a set
of subscribers. For example, an ISP can use this feature to find out the most popular website among
a set of subscribers.
Configuration Steps
Perform the following tasks for configuring the NetScaler appliance to log HTTP header information:
• Create an HTTP header log profile. An HTTP header log profile is a collection of HTTP header
attributes (for example, URL and HTTP method) that can be enabled or disabled for logging.
• Bind the HTTP header to an LSN group of a DS-Lite LSN configuration. Bind the HTTP header
log profile to an LSN group of an LSN configuration by setting the HTTP header log profile name
parameter to the name of the created HTTP header log profile. The NetScaler appliance then
logs HTTP header information of any HTTP requests related to the LSN group. An HTTP header
log profile can be bound to multiple LSN groups, but an LSN group can have only one HTTP
header log profile.
To create an HTTP header log profile by using the command line interface
To bind an HTTP header log profile to an LSN group by using the command line interface
Sample Configuration
In the following DS-Lite LSN configuration, HTTP header log profile HTTP-Header-LOG-1 is bound to
LSN group LSN-DSLITE-GROUP-1. The log profile has all the HTTP attributes (URL, HTTP method, HTTP
version, and HOST IP address) enabled for logging, so that all these attributes are logged for any HTTP
requests from B4 devices (in the network 2001:DB8:5001::/96).
Sample Configuration:
18
19 Done
20
21 add lsn ip6profile LSN-DSLITE-PROFILE-1 -type DS-Lite -network6 2001:
DB8::5:6
22
23 Done
24
25 add lsn group LSN-DSLITE-GROUP-1 -clientname LSN-DSLITE-CLIENT-1 -
portblocksize 1024 -ip6profile LSN-DSLITE-PROFILE-1
26
27 Done
28
29 bind lsn group LSN-DSLITE-GROUP-1 -poolname LSN-DSLITE-POOL-1
30
31 Done
32
33 bind lsn group LSN-DSLITE-GROUP-1 -httphdrlogprofilename HTTP-HEADER-
LOG-1
34
35 Done
IPFIX Logging
The NetScaler appliance supports sending information about LSN events in Internet Protocol Flow
Information Export (IPFIX) format to the configured set of IPFIX collector(s). The appliance uses the
existing AppFlow feature to send LSN events in IPFIX format to the IPFIX collectors.
IPFIX based logging is available for the following DS_Lite related events:
Before you start configuring IPSec ALG, consider the following points:
• You must configure the AppFlow feature and IPFIX collector(s) on the NetScaler appliance. For
instructions, see Configuring the AppFlow feature.
Configuration Steps
Perform the following tasks for logging LSN information in IPFIX format:
• Enable LSN logging in the AppFlow configuration. Enable the LSN logging parameter as part
of AppFlow configuration.
• Create an LSN log profile. An LSN log profile includes the IPFIX parameter that enables or dis-
ables the log information in IPFIX format.
• Bind the LSN log profile to an LSN group of an LSN configuration. Bind the LSN log profile
to one or multiple LSN group(s). Events related to the bound LSN group will be logged in IPFIX
format.
To create an LSN log profile by using the CLIAt the command prompt, type
To bind the LSN log profile to an LSN group of an LSN configuration by using the CLI
Navigate to System > Large Scale NAT > Profiles, click Log tab, and then add a log profile.
To bind the LSN log profile to an LSN group of an LSN configuration by using the GUI
1. Navigate to System > Large Scale NAT > LSN Group, open the LSN group.
2. In Advanced Settings, click + Log Profile to bind the created Log profile to the LSN group.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
NetScaler appliances now support Port Control Protocol (PCP) for large scale NAT (LSN). Many of an
ISP’s subscriber applications must be accessible from Internet (for example, Internet of Things (IOT)
devices, such as an IP camera that provides surveillance over the Internet). One way to meet this
requirement is to create static large scale NAT (LSN) maps. But for a very large number of subscribers,
creating static LSN NAT maps is not a feasible solution.
Port Control Protocol (PCP) enables a subscriber to request specific LSN NAT mappings for itself
and/or for other 3rd party devices. The large scale NAT device creates an LSN map and sends it to the
subscriber. The subscriber sends the remote devices on the Internet the NAT IP address:NAT port at
which they can connect to the subscriber.
Applications usually send frequent keep-alive messages to the large scale NAT device so that their LSN
mappings do not time out. PCP helps reduce the frequency of such keep-alive messages by enabling
the applications to learn the timeout settings of the LSN mappings. This helps reduce bandwidth
consumption on the ISP’s access network and battery consumption on mobile devices.
PCP is a client-server model and runs over the UDP transport protocol. A NetScaler appliance imple-
ments the PCP server component and is compliant with RFC 6887.
Configuration Steps
• (Optional) Create a PCP profile. A PCP profile includes settings for PCP related parameters (for
example, to listen for mapping and peer PCP requests). A PCP profile can be bound to a PCP
server. A PCP profile bound to a PCP server applies all its settings to the PCP server. A PCP profile
can be bound to multiple PCP servers. By default, one PCP profile with default parameters
settings is bound to all PCP servers. A PCP profile that you bind to a PCP server overrides the
default PCP profile settings for that server. A default PCP profile has the following parameter
settings:
– Mapping: Enabled
– Peer: Enabled
– Minimum map life: 120 seconds
– Maximum max life: 86400 seconds
– Announce count: 10
– Third Party: Disabled
• Create a PCP server and bind a PCP profile to it. Create a PCP server on the NetScaler appliance
to listen for PCP related requests and messages from the subscribers. A Subnet IP (SNIP) address
must be assigned to a PCP server to access it. By default, a PCP server listens on port 5351.
• Bind the PCP server to an LSN group of an LSN configuration. Bind the created PCP server to an
LSN group of an LSN configuration by setting the PCP Server parameter to specify the created
PCP server. The created PCP server can be accessed only by the subscribers of this LSN group.
Note: A PCP server for a large scale NAT configuration does not serve requests from subscribers
that are identified from ACL rules.
In the following sample configuration, PCP server PCP-SERVER-1, with PCP settings from PCP-DSLITE-
PROFILE-1, is bound to LSN group LSN-DSLITE-GROUP-1. PCP-SERVER-9 serves PCP requests from
IPv4 subscribers behind B4 devices from network 2001:DB8::3:0/100.
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Because of the imminent exhaustion of IPv4 addresses, ISPs have started transitioning to IPv6 infras-
tructure. But during the transition, ISPs must continue to support IPv4 along with IPv6, because most
of the public Internet still uses IPv4. Large scale NAT64 is an IPv6 transition solution for ISPs with IPv6
infrastructure to connect their IPv6-only subscribers to the IPv4 Internet. DNS64 is a solution for en-
abling discovery of IPv4-only domains by IPv6-only clients. DNS64 is used with large scale NAT64 to
enable seamless communication between IPv6-only clients and IPv4-only servers.
A NetScaler appliance implements large scale NAT64 and DNS64 and is compliant with RFCs 6145,
6146, 6147, 6052, 3022, 2373, 2765, and 2464.
Architecture
The NAT64 architecture of an ISP using a NetScaler appliance consists of IPv6 subscribers access-
ing the IPv4 Internet through a NetScaler appliance deployed in the ISP’s core network. IPv6 sub-
scribers are connected to the ISP core network through the ISP’s IPv6-only access network.
The large scale NAT64 functionality of a NetScaler appliance enables communication between IPv6
clients and IPv4 servers through IPv6-to-IPv4 packet translation, and vice versa, while maintaining
session information on the NetScaler appliance.NetScaler DNS64 functionality represents IPv4-only
domains to IPv6-subscribers by synthesizing DNS AAAA records for IPv4-only domains and sending
them to the subscribers.
Large scale NAT64 has two main components: NAT64 prefix and NAT IPv4 pool. DNS64 has one main
component, DNS64 prefix, which has the same value as NAT64 prefix.
Upon receiving an AAAA request from an IPv6-only subscriber for a domain name that is hosted on an
IPv4-only web server on the Internet, the NetScaler DNS64 functionality synthesizes an AAAA record
for the domain name and sends it to the subscriber. The AAAA record is synthesized by concatenating
the DNS64 prefix (which is set to the NAT64 prefix) and the actual IPv4 address of the domain name.
The subscriber now has an IPv6 destination address that corresponds to the desired domain name.
The subscriber sends the request to the synthesized IPv6 address. Upon receiving the IPv6 request,
the large scale NetScaler NAT64 functionality translates the IPv6 request packet to an IPv4 request
packet. Large scale NAT64 sets the IPv4 request’s destination address to the IPv4 address, which is
extracted from the IPv6 request’s destination address by stripping the NAT64 prefix from the IPv6 ad-
dress. The destination port is retained from the IPv6 request. Large Scale NAT64 also sets the source
IP address:source port of the IPv4 packet to the NAT IP address:NAT port selected from the configured
NAT pool.
The appliance maintains a record of all active sessions that use the large scale NAT64 functionality.
These sessions are called large scale NAT64 sessions. The appliance also maintains the mappings be-
tween subscriber IPv6 address and port, and NAT IPv4 address and port, for each large scale NAT64
session. These mappings are called large scale NAT64 mappings. From large scale NAT64 session en-
tries and large scale NAT64 mapping entries, the NetScaler appliance recognizes a response packet
(received from the Internet) as belonging to a particular NAT64 session.
When the appliance receives an IPv4 response packet belonging to a particular NAT64 session, it uses
the information stored in the NAT64 session to translate the IPv4 packet into an IPv6 packet, and then
sends the IPv6 response packet to the subscriber.
Consider an example of a large scale NAT64 and DNS64 deployment consisting of NetScaler appliance
NS-1 and two local DNS servers, DNS-1 and DNS-2, in an ISP’s core network, and IPv6 subscriber SUB-1.
SUB-1 is connected to NS-1 through the ISP’s IPv6 access network. NS-1 includes large scale NAT64
and DNS64 configurations for enabling the communication between IPv6 subscriber SUB-1 and IPv4
hosts (internal and external).
Large scale NAT64 configuration includes a NAT64 prefix (2001:DB8:300::/96) and NAT IPv4 pool for
translation of IPv6 requests to IPv4 requests and IPv4 responses to IPv6 responses.
DNS64 configuration includes a DNS load balancing virtual server LBVS-DNS64-1 (2001:DB8:9999::99)
and a DNS64 prefix (2001:DB8:300::/96). LBVS-DNS64-1 represents local DNS server DNS-1 and DNS-
2 to ISP’s subscribers. The DNS64 prefix, which has the same value as the NAT64 prefix, is used for
synthesizing DNS AAAA records from DNS A records received from DNS servers DNS-1 and DNS-2. NS-
1 responds with a synthesized AAAA record to SUB-1 for a DNS request to resolve an IPv4 host.
Traffic flows between IPv6 subscriber SUB-1 and site www.example.com, which resides on an IPv4-
only web server on the Internet, as follows:
1. IPv6 subscriber SUB-1 sends a DNS AAAA request for www.example.com to its designated DNS
server (2001:DB8:9999::99).
2. DNS load balancing virtual server LBVS-DNS64-1 (2001:DB8:9999::99) on NetScaler appliance
NS1 receives the AAAA request. LBVS-DNS64-1’s load balancing algorithm selects DNS server
DNS-1 and forwards the AAAA request to it.
3. DNS-1 returns an empty record or an error message, because there is no AAAA record available
for www.example.com.
4. Because the DNS64 option is enabled on LBVS-DNS64-1 and the AAAA request from CL1 matches
the condition specified in DNS64-Policy-1, NS1 sends a DNS A request to DNS-1 for the IPv4 ad-
dress of www.example.com.
5. DNS-1 responds with the A record of 192.0.2.60 for www.example.com.
6. DNS64 module on NS1 synthesizes an AAAA record for www.example.com by concatenating the
DNS64 Prefix (2001:DB8:300::/96) associated with LBVS-DNS64-1, and IPv4 address (192.0.2.60)
for www.example.com = 2001:DB8:300::192.0.2.60
7. NS1 sends the synthesized AAAA record to IPv6 client CL1. NS1 also caches the A record into
its memory. NS1 uses the cached A record to synthesize AAAA records for subsequent AAAA re-
quests.
1. IPv6 subscriber SUB-1 sends a request to 2001:DB8:5001:30 www.example.com. The IPv6 packet
has:
• Source IP address = 2001:DB8:5001:30
• Source port = 2552
• Destination IP address = 2001:DB8:300::192.0.2.60
• Destination port = 80
2.IPv6 subscriber SUB-1 sends a request to 2001:DB8:5001:30 www.example.com. The IPv6 packet
has:
• Source IP address = 2001:DB8:5001:30
• Source port = 2552
• Destination IP address = 2001:DB8:300::192.0.2.60
• Destination port = 80
3. When NS-1 receives the IPv6 packet, the large scale NAT64 module creates a translated IPv4
request packet with:
• Source IP address = One of the IPv4 addresses available in the configured NAT pool (203.0.113.61)
• Source port = One of ports available with the allocated NAT IPv4 address (3002)
• Destination IP address = IPv4 address extracted from the IPv6 request’s destination address by
stripping the NAT64 prefix (2001:DB8:300::/96) from the IPv6 address (192.0.2.60)
• Destination port = IPv6 request’s destination port (80)
4. The large scale NAT64 module also creates mapping and session entries for this large scale NAT64
flow. The session and mapping entries include the following information:
• Source IP address of the IPv6 packet = 2001:DB8:5001:30
• Source port of the IPv6 packet = 2552
• NAT IP address = 203.0.113.61
• NAT port = 3002
• NS-1 sends the resulting IPv4 packet to its destination on the Internet.
5. Upon receiving the request packet, the server for www.example.com processes the packet and
sends a response packet to NS-1. The IPv4 response packet has:
Large scale NAT64 on a NetScaler appliance supports the standard LSN feature set. For more informa-
tion on these LSN features, see LSN Architecture.
Following are some of the large scale NAT64 features supported on NetScaler appliances:
• ALGs. Support of application Layer Gateway (ALG) for SIP, RTSP, FTP, ICMP, and TFTP protocols.
• Deterministic/Fixed NAT. Support for pre-allocation of blocks of ports to subscribers to minimize
logging.
• Mapping. Support of Endpoint-independent mapping (EIM), Address-dependent mapping
(ADM), and Address-Port dependent mapping (APDM).
• Filtering. Support of Endpoint-Independent Filtering (EIF), Address-Dependent Filtering (ADF),
and Address-Port-Dependent Filtering (APDF).
• Quotas. Configurable limits on number of ports, sessions per subscriber, and sessions per LSN
group.
• Static Mapping. Support for manually defining a large scale NAT64 mapping.
• Hairpin Flow. Support for communication between subscribers or internal hosts using NAT IP
addresses.
• 464XLAT connections. Support for communication between IPv4-only applications on IPv6 sub-
scriber hosts and IPv4 hosts on the Internet through IPv6 network.
• Variable length NAT64 and DNS64 prefixes. The NetScaler appliance supports defining NAT64
and DNS64 prefixes of lengths of 32, 40, 48, 56, 64, and 96.
• Multiple NAT64 and DNS64 prefix. The NetScaler appliance supports multiple NAT64 and DNS64
prefixes.
• LSN Clients. Support for specifying or identifying subscribers for large scale NAT64 by using IPv6
prefixes and extended ACL6 rules.
• Logging. Support for logging NAT64 sessions for law enforcement. In addition, the following
are also supported for logging.
– Reliable SYSLOG. Support for sending SYSLOG messages over TCP to external log servers
for a more reliable transport mechanism.
– Load balancing of log servers. Support for load balancing of external log servers for pre-
venting storage of redundant log messages.
– Minimal Logging. Deterministic LSN configurations or Dynamic LSN configurations with
port block significantly reduce the large scale NAT64 log volume.
– Logging MSISDN information. Support for including subscribers’ MSISDN information in
large scale NAT64 logs to identify and track subscriber activity over the Internet.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Before you start configuring large scale NAT64 and DNS64, consider these points:
1. Make sure you understand the different components of large scale NAT64, described in RFCs.
2. The NetScaler appliance supports only the following ALGs for large Scale NAT64:
• FTP
• TFTP
• ICMP
• SIP
• RTSP
3. In a high availability setup of two NetScaler appliances, large NAT64 session synchronization
(connection mirroring) is not supported.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Configuring DNS64
Contributed by:
C
Creating the required entities for stateful NAT64 configuration on the NetScaler appliance involves the
following procedures:
• Add DNS services. DNS services are logical representations of DNS servers for which the
NetScaler appliance acts as a DNS proxy server. For more information on setting optional
parameters of a service, see “Load Balancing”.
• Add DNS64 action and DNS64 policy and then bind the DNS64 action to the DNS64 policy. A
DNS64 policy specifies conditions to be matched against traffic for DNS64 processing accord-
ing to the settings in the associated DNS64 action. The DNS64 action specifies the mandatory
DNS64 prefix and the optional exclude-rule and mapped-rule settings.
• Create a DNS load balancing virtual server and bind the DNS services and the DNS64 policy to
it. The DNS load balancing virtual server acts as a DNS proxy server for DNS servers represented
by the bound DNS services. Traffic arriving at the virtual server is matched against the bound
DNS64 policy for DNS64 processing. For more information on setting optional parameters of a
load balancing virtual server, see “Load Balancing.
Note
The command line interface has separate commands for these two tasks, but the GUI combines
them in a single dialog box.
• Enable caching of DNS records. Enable the global parameter for the NetScaler appliance to
cache DNS records, which are obtained through DNS proxy operations. For more information
on enabling caching of DNS records, see “Enabling Caching of DNS Records”.
To create a DNS load balancing virtual server by using the command line interface
To bind the DNS services and the DNS64 policy to the DNS load balancing virtual server
by using the command line interface
Sample configuration:
12 Done
13 bind lb vserver LBVS-DNS64-1 SVC-DNS-2
14 Done
15 bind lb vserver LBVS-DNS64-1 -policyname DNS64-Policy-1 -priority 2
16 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
A large scale NAT64 configuration on a NetScaler appliance uses the LSN commands sets. In a large
scale NAT64 configuration, the LSN client entity specifies the IPv6 address or IPv6 network address,
or ACL6 rules, for identifying IPv6 subscribers. A NAT64 configuration also includes an IPv6 profile,
which specifies a NAT64 prefix.
• Set the global LSN parameters. Global parameters include the amount of NetScaler memory
reserved for the LSN feature and synchronization of LSN sessions in a high availability setup.
• Create an LSN client entity for identifying traffic from IPv6 subscribers. The LSN client entity
refers to a set of IPv6 subscribers. The client entity includes IPv6 addresses or IPv6 network
prefixes, or ACL6 rules, for identifying the traffic from these subscribers. An LSN client can be
bound to only one LSN group. The command line interface has two commands for creating an
LSN client entity and binding a subscriber to the LSN client entity. The GUI combines these two
operations on a single screen.
• Create an LSN pool and bind NAT IP addresses to it. An LSN pool defines a pool of NAT IP ad-
dresses to be used by the NetScaler appliance to perform large scale NAT64. The command line
interface has two commands for creating an LSN pool and binding NAT IP addresses to the LSN
pool. The GUI combines these two operations on a single screen.
• Create an LSN IP6 profile. An LSN IP6 profile defines the NAT64 prefix for a large scale NAT64
configuration.
• (Optional) Create an LSN Transport Profile for a specified protocol. An LSN transport profile de-
fines various timeouts and limits, such as maximum large scale NAT64 sessions and maximum
ports usage that a subscriber can have for a given protocol. You bind an LSN transport profile
for each protocol (TCP, UDP, and ICMP) to an LSN group. A profile can be bound to multiple LSN
groups. A profile bound to an LSN group applies to all subscribers of an LSN client bound to
the same group. By default, one LSN transport profile with default settings for TCP, UDP, and
ICMP protocols is bound to an LSN group during its creation. This profile is called the default
transport profile. An LSN transport profile that you bind to an LSN group overrides the default
LSN transport profile for that protocol.
• (Optional) Create an LSN Application Profile for a specified protocol and bind a set of destination
ports to it. An LSN application profile defines the LSN mapping and LSN filtering controls of a
group for a given protocol and for a set of destination ports. For a set of destination ports, you
bind an LSN profile for each protocol (TCP, UDP, and ICMP) to an LSN group. A profile can be
bound to multiple LSN groups. An LSN application profile bound to an LSN group applies to all
subscribers of an LSN client bound to the same group. By default, one LSN application profile
with default settings for TCP, UDP, and ICMP protocols for all destination ports is bound to an
LSN group during its creation. This profile is called a default application profile. When you bind
an LSN application profile, with a specified set of destination ports, to an LSN group, the bound
profile overrides the default LSN application profile for that protocol at that set of destination
ports. The command line interface has two commands for creating an LSN application profile
and binding a set of destination ports to the LSN application profile. The GUI combines these
two operations on a single screen.
• Create an LSN Group and bind LSN pools, LSN IPv6 profile, (optional) LSN transport profiles,
and (optional) LSN application profiles to the LSN group. An LSN group is an entity consisting
of an LSN client, an LSN IPv6 profile, LSN pool(s), LSN transport profile(s), and LSN application
profiles(s). A group is assigned parameters, such as port block size and logging of LSN sessions.
The parameter settings apply to all the subscribers of an LSN client bound to the LSN group.
Only one LSN IPv6 profile can be bound to an LSN group, and an LSN IPv6 profile bound to
an LSN group cannot be bound to other LSN groups. Only LSN Pools and LSN groups with the
same NAT type settings can be bound together. Multiples LSN pools can be bound to an LSN
group. Only one LSN client entity can be bound to an LSN group, and an LSN client entity bound
to an LSN group cannot be bound to other LSN groups. The command line interface has two
commands for creating an LSN group and binding LSN pools, LSN transport profiles, and LSN
application profiles to the LSN group. The GUI combines these two operations in a single screen.
You can create different configurations using the command line interface. Follow the steps given be-
low.
To bind an IPv6 network or an ACL6 rule to an LSN client by using the command line interface
To bind NAT IP addresses to an LSN pool by using the command line interface
Note
For removing NAT IP (LSN IP addresses) addresses from an LSN pool, use the unbind lsn pool
command.
To bind an application protocol port range to an LSN application profile by using the command
line interface
To bind LSN protocol profiles and LSN pools to an LSN group by using the command line
interface
Simple large scale NAT64 configuration with an extended ACL6 rule for identifying subscribers:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
For some Application layer protocols, the IP addresses and protocol port numbers are also commu-
nicated in the packet payload. Application Layer Gateway for a protocol parses the packet’s payload
and does necessary changes to ensure that the protocol continues to work over large scale NAT64.
The NetScaler appliance supports ALG for the following protocols for large scale NAT64:
• FTP
• ICMP
• TFTP
• SIP
• RTSP
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can enable or disable ALG for the FTP protocol for an large scale NAT64 configuration by enabling
or disabling the FTP ALG option of the LSN group of the configuration.
ALG for the ICMP protocol is enabled by default, and there is no provision to disable it.
ALG for the TFTP protocol is disabled by default. TFTP ALG is enabled automatically for an large
scale NAT64 configuration when you bind a UDP LSN application profile, with endpoint-independent-
mapping, endpoint-independent filtering, and destination port as 69 (well-known port for TFTP), to
the LSN group.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Using Large Scale NAT64 with Session Initiation Protocol (SIP) is complicated, because SIP messages
contain IP addresses in the SIP headers as well as in the SIP body. When LSN is used with SIP, the
SIP headers contain information about the caller and the receiver, and the device translates this infor-
mation to hide it from the outside network. The SIP body contains the Session Description Protocol
(SDP) information, which includes IP addresses and port numbers for transmission of the media. SIP
ALG for large scale NAT64 is compliant with RFC 3261, RFC 3581, RFC 4566, and RFC 4475.
SIP ALG for large scale NAT64 has the following limitations:
You need to configure the SIP ALG as part of the LSN configuration. For instructions on configuring
LSN, see Configuration Large Scale NAT64. While configuring LSN, make sure that you:
• Set the following parameters while adding an LSN application profile:
– IP Pooling = PAIRED
– Address and Port Mapping = ENDPOINT-INDEPENDENT
– Filtering = ENDPOINT-INDEPENDENT
• Create a SIP ALG profile and make sure that you define either the source port range or destina-
tion port range. Bind the SIP ALG profile to the LSN group.
• Enable SIP ALG in the LSN group.
Sample Configuration
The following sample large scale NAT64 configuration, SIP ALG is enabled for TCP traffic from sub-
scriber devices in the network 2001:DB8:1003::/96.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Configure RTSP ALG as part of the LSN configuration. For instructions on configuring LSN, see Config-
uring Large Scale NAT64. While configuring, make sure that you:
• Set the following parameters while adding an LSN application profile:
– IP Pooling = PAIRED
– Address and Port Mapping = ENDPOINT-INDEPENDENT
– Filtering = ENDPOINT-INDEPENDENT
• Enable RTSP ALG in the LSN group
• Create a RTSP ALG profile and bind the RTSP ALG profile to the LSN group
The following sample large scale NAT64 configuration, RTSP ALG is enabled for TCP traffic from sub-
scriber devices in the network 2001:DB8:1002::/96.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance supports manual creation of NAT64 mappings, which contain the mapping
between the following information:
Static Large Scale NAT64 mappings are useful in cases where you want to ensure that the IPv4 con-
nections initiated to a NAT IP address:port are IPv6 translated and mapped to the subscriber IP ad-
dress:port (for example, web servers located in the internal network).
A static large scale NAT64 mapping entry is usually a one-to-one mapping between a subscriber IPv6
address:port and a NAT IPv4 address:port. A one-to-one static large scale NAT64 mapping entry ex-
poses only one port of the subscriber IP address to the Internet.
Some situations might require exposing all ports (64K - limited to the maximum number of ports of a
NAT IPv4 address) of a subscriber IP address to the Internet (for example, a server hosted on an internal
network and running a different service on each port). To make these internal services accessible
through the Internet, you have to expose all the ports of the server to the Internet.
One way to meet this requirement is to add 64 thousand one-to-one static mapping entries, one map-
ping entry for each port. Creating those entries is very cumbersome and a big task. Also, this large
number of configuration entries might lead to performance issues in the NetScaler appliance.
A simpler method is to use wildcard ports in a static mapping entry. You just need to create one static
mapping entry with NAT-port and subscriber-port parameters set to the wildcard character (*), and
the protocol parameter set to ALL, to expose all the ports of a subscriber IP address for all protocols
to the Internet.
For a subscriber’s inbound or outbound connections matching a wildcard static mapping entry, the
subscriber’s port does not change after the NAT operation. When a subscriber-initiated connection
to the Internet matches a wildcard static mapping entry, the NetScaler appliance assigns a NAT port
that has the same number as the subscriber port from which the connection is initiated. Similarly, an
Internet host gets connected to a subscriber’s port by connecting to the NAT port that has the same
number as the subscriber’s port.
To configure the NetScaler appliance to provide access to all ports of a subscriber IPv6 address, create
a wildcard static map with the following mandatory parameter settings:
• Protocol=ALL
• Subscriber port = *
• NAT port = *
In a wildcard static map, unlike in a one-to-one static map, setting the NAT IP parameter is mandatory.
Also, the NAT IP address assigned to a wildcard static map cannot be used for any other subscribers.
To create a wildcard static map by using the command line interface
At the command prompt, type:
In the following sample configuration of a wildcard static map, all ports of a subscriber whose IP ad-
dress is 2001:DB8:5001::3 are made accessible through NAT IP 203.0.11.33.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
You can log large scale NAT64 information to diagnose and troubleshoot problems, and to meet le-
gal requirements. You can monitor the performance of the large scale NAT64 deployment by using
statistical counters and displaying the related current sessions.
Logging large scale NAT64 information is required for ISPs to meet legal requirements and identify the
source of traffic at any given time.
A log message for a large scale NAT64 mapping entry consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced.
• Time stamp.
• Entry type (MAPPING).
• Whether the mapping entry was created or deleted.
• Subscriber’s IP address, port, and traffic domain ID.
A log message for a large scale NAT64 session consists of the following information:
• NetScaler owned IP address (NSIP address or SNIP address) from which the log message is
sourced
• Time stamp
• Entry type (SESSION)
• Whether the session is created or removed
• Subscriber’s IP address, port, and traffic domain ID
• NAT IP address and port
• Protocol name
• Destination IP address, port, and traffic domain ID
The following table displays sample large scale NAT64 log entries of each type stored on the config-
ured log servers. The log entries show that a subscriber whose IPv6 address is 2001:db8:5001::9 was
connected to destination IP:port 23.0.0.1:80 through NAT IP:port 203.0.113.63:45195 on April 7, 2016,
from 14:07:57 GMT to 14:10:59 GMT.
Configuration Steps
You can configure logging of large scale NAT64 information for a large scale NAT64 configuration by
setting the LSN groups’s logging and session logging parameters. These are group level parameters
and are disabled by default. The NetScaler appliance logs large scale NAT64 sessions for an LSN group
only when both logging and session logging parameters are enabled.
The following table displays the logging behavior for an LSN group for various settings of logging and
session logging parameters.
To set the logging and session logging parameters while adding an LSN group, at the command
prompt, type:
To set the logging and session logging parameters for an existing LSN group, at the command prompt,
type:
Sample Configuration
In this example of large scale NAT64 configuration, logging and session logging paramters are enabled
for LSN group LSN-NAT64-GROUP-1.
The NetScaler appliance logs large scale NAT64 session and mapping information for connections
from subscribers (in the network 2001:DB8:5001::/96).
Sample configuration:
A Mobile Station Integrated Subscriber Directory Number (MSISDN) is a telephone number uniquely iden-
tifying a subscriber across multiple mobile networks. The MSISDN is associated with a country code
and a national destination code identifying the subscriber’s operator.
You can configure a NetScaler appliance to include MSISDNs in large scale NAT64 LSN log entries for
subscribers in mobile networks. The presence of MSISDNs in the LSN logs facilitates faster and accu-
rate back tracing of a mobile subscriber who has violated a policy or law, or whose information is
required by lawful interception agencies.
The following sample LSN log entries include MSISDN information for a connection from a mo-
bile subscriber in an LSN configuration. The log entries show that a mobile subscriber whose
MSISDN is E164:5556543210 and IPv6 address is 2001:db8:5001::9 was connected to destination
IP:port 23.0.0.1:80 through the NAT IP:port 203.0.113.63:45195 on April 7, 2016, from 14:07:57 GMT
to 14:10:59 GMT.
Configuration Steps
Perform the following tasks for including MSISDN information in LSN logs:
• Create an LSN log profile. An LSN log profile includes the log subscriber ID parameter, which
specifies whether to or not to include the MSISDN information in the LSN logs of an LSN config-
uration.
• Bind the LSN log profile to an LSN group of an LSN configuration.Bind the created LSN log pro-
file to an LSN group of an LSN configuration by setting the log profile name parameter to the
created LSN log profile name. MSISDN information is included in all LSN logs related to mo-
bile subscribers of this LSN group.
To bind an LSN log profile to an LSN group of an NAT64 LSN configuration by using the CLI
Sample Configuration
In this example of NAT64 LSN configuration, the LSN log profile LOG-PROFILE-MSISDN-1 has the log
subscriber ID parameter enabled. LOG-PROFILE-MSISDN-1 is bound to LSN group LSN-NAT64-GROUP-
1. MSISDN information is included in the LSN session and LSN mapping logs for connections from
mobile subscribers (in network 2001:DB8:5001::/96).
Logging LSN information is one of the important functions needed by ISPs to meet legal requirements
and be able to identify the source of traffic at any given time. This eventually results in a huge volume
of log data, requiring the ISPs to make large investments to maintain the logging infrastructure.
Compact logging is a technique for reducing the log size by using a notational change involving
short codes for event and protocol names. For example, C for client, SC for session created, and T for
TCP. Compact logging results in an average of 40 percent reduction in log size.
Configuration Steps
Perform the following tasks for logging LSN information in compact format:
1. Create an LSN log profile. An LSN log profile includes the Log Compact parameter, which speci-
fies whether to or not to log information in compact format for an LSN configuration.
2. Bind the LSN log profile to an LSN group of an LSN configuration. Bind the created LSN log
profile to an LSN group of an LSN configuration by setting the Log Profile Name parameter to
the created LSN log profile name. All sessions and mappings for this LSN group are logged in
compact format.
To bind an LSN log profile to an LSN group of an LSN configuration by using the CLI
18 Done
The NetScaler appliance can log request header information of an HTTP connection that is using
the NetScaler large scale NAT64 functionality. The following header information of an HTTP request
packet can be logged:
The HTTP header logs can be used by ISPs to see the trends related to the HTTP protocol among a set
of subscribers. For example, an ISP can use this feature to find out the most popular website among
a set of subscribers.
Configuration Steps
Perform the following tasks for configuring the NetScaler appliance to log HTTP header information:
• Create an HTTP header log profile. An HTTP header log profile is a collection of HTTP header
attributes (for example, URL and HTTP method) that can be enabled or disabled for logging.
• Bind the HTTP header to an LSN group of a large scale NAT64 configuration. Bind the HTTP
header log profile to an LSN group of an LSN configuration by setting the HTTP header log profile
name parameter to the name of the created HTTP header log profile. The NetScaler appliance
then logs HTTP header information of any HTTP requests related to the LSN group. An HTTP
header log profile can be bound to multiple LSN groups, but an LSN group can have only one
HTTP header log profile.
To create an HTTP header log profile by using the the command line interface
To bind an HTTP header log profile to an LSN group by using the the command line interface
Sample Configuration
You can display the current large scale NAT64 sessions in order to detect any unwanted or inefficient
sessions on the NetScaler appliance. You can display all or some large scale NAT64 sessions on the
basis of selection parameters.
Note
When more than a million large scale NAT64 sessions exist on the NetScaler appliance, Citrix rec-
ommends using the selection parameters to display selected large scale NAT64 sessions instead
To display all large scale NAT64 sessions by using the command line interface
To display selective large scale NAT64 sessions by using the command line interface
You can display statistics related to large scale NAT64 module, and evaluate its performance or trou-
bleshoot problems. You can display a summary of statistics of all large scale NAT64 configurations
or of a particular large scale NAT64 configuration. The statistical counters reflect events since the
NetScaler appliance was last restarted. All these counters are reset to 0 when the NetScaler appliance
is restarted.
To display total statistics of large scale NAT64 by using the command line interface
To display statistics for a specified large scale NAT64 configuration by using the command line
interface
You can remove any unwanted or inefficient large scale NAT64 sessions from the NetScaler appliance.
The appliance immediately releases resources (such as NAT IP address, port, and memory) allocated
for these sessions, making the resources available for new sessions. The appliance also drops all the
subsequent packets related to these removed sessions. You can remove all or selected large scale
NAT64 sessions from the NetScaler appliance.
To clear all large scale NAT64 sessions by using the command line interface
To clear selective large scale NAT64 sessions by using the command line interface
Sample configuration:
Clear all large scale NAT64 sessions related to client entity LSN-NAT64-CLIENT-1
Clear all large scale NAT64 sessions related to a subscriber network (2001:DB8:5001::/96) of LSN client
entity LSN-NAT64-CLIENT-2
2 Done
IPFIX Logging
The NetScaler appliance supports sending information about LSN events in Internet Protocol Flow
Information Export (IPFIX) format to the configured set of IPFIX collector(s). The appliance uses the
existing AppFlow feature to send LSN events in IPFIX format to the IPFIX collectors.
IPFIX based logging is available for the following NAT64 related events:
• Creation or deletion of an LSN session.
• Creation or deletion of an LSN mapping entry.
• Allocation or de-allocation of port blocks in the context of deterministic NAT.
• Allocation or de-allocation of port blocks in the context of dynamic NAT.
• Whenever subscriber session quota is exceeded.
Before you start configuring IPSec ALG, consider the following points:
• You must configure the AppFlow feature and IPFIX collector(s) on the NetScaler appliance. For
instructions, see Configuring the AppFlow feature.
Configuration Steps
Perform the following tasks for logging LSN information in IPFIX format:
• Enable LSN logging in the AppFlow configuration. Enable the LSN logging parameter as part
of AppFlow configuration.
• Create an LSN log profile. An LSN log profile includes the IPFIX parameter that enables or dis-
ables the log information in IPFIX format.
• Bind the LSN log profile to an LSN group of an LSN configuration. Bind the LSN log profile
to one or multiple LSN group(s). Events related to the bound LSN group will be logged in IPFIX
format.
To create an LSN log profile by using the CLIAt the command prompt, type
To bind the LSN log profile to an LSN group of an LSN configuration by using the CLI
Navigate to System > Large Scale NAT > Profiles, click Log tab, and then add a log profile.
To bind the LSN log profile to an LSN group of an LSN configuration by using the GUI
1. Navigate to System > Large Scale NAT > LSN Group, open the LSN group.
2. In Advanced Settings, click + Log Profile to bind the created Log profile to the LSN group.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
NetScaler appliances now support Port Control Protocol (PCP) for large scale NAT (LSN). Many of an
ISP’s subscriber applications must be accessible from Internet (for example, Internet of Things (IOT)
devices, such as an IP camera that provides surveillance over the Internet). One way to meet this
requirement is to create static large scale NAT (LSN) maps. But for a very large number of subscribers,
creating static LSN NAT maps is not a feasible solution.
Port Control Protocol (PCP) enables a subscriber to request specific LSN NAT mappings for itself
and/or for other 3rd party devices. The large scale NAT device creates an LSN map and sends it to the
subscriber. The subscriber sends the remote devices on the Internet the NAT IP address:NAT port at
which they can connect to the subscriber.
Applications usually send frequent keep-alive messages to the large scale NAT device so that their LSN
mappings do not time out. PCP helps reduce the frequency of such keep-alive messages by enabling
the applications to learn the timeout settings of the LSN mappings. This helps reduce bandwidth
consumption on the ISP’s access network and battery consumption on mobile devices.
PCP is a client-server model and runs over the UDP transport protocol. A NetScaler appliance imple-
ments the PCP server component and is compliant with RFC 6887.
Configuration Steps
• (Optional) Create a PCP profile. A PCP profile includes settings for PCP related parameters
(for example, to listen for mapping and peer PCP requests). A PCP profile can be bound to a PCP
server. A PCP profile bound to a PCP server applies all its settings to the PCP server. A PCP profile
can be bound to multiple PCP servers. By default, one PCP profile with default parameters
settings is bound to all PCP servers. A PCP profile that you bind to a PCP server overrides the
default PCP profile settings for that server. A default PCP profile has the following parameter
settings:
– Mapping: Enabled
– Peer: Enabled
– Minimum map life: 120 seconds
– Maximum max life: 86400 seconds
– Announce count: 10
– Third Party: Disabled
• Create a PCP server and bind a PCP profile to it. Create a PCP server on the NetScaler appli-
ance to listen for PCP related requests and messages from the subscribers. A Subnet IP (SNIP)
or (SNIP6) address must be assigned to a PCP server to access it. By default, a PCP server listens
on port 5351.
• Bind the PCP server to an LSN group of an LSN configuration. Bind the created PCP server to
an LSN group of an LSN configuration by setting the PCP Server parameter to specify the created
PCP server. The created PCP server can be accessed only by the subscribers of this LSN group.
Note
A PCP server for a large scale NAT configuration does not serve requests from subscribers that
are identified from ACL rules.
In the following sample configuration, PCP server PCP-SERVER-1, with PCP settings from PCP-
PROFILE-1,is bound to LSN group LSN-NAT64-GROUP-1. PCP-SERVER-1 serves PCP requests from IPv6
subscribers in network 2001:DB8:5001::/96.
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Mapping Address and Port using Translation (MAP-T) is an IPv6 transition solution for ISPs with IPv6
infrastructure to connect their IPv4 subscribers to the IPv4 internet<sub>. </sub>MAP-T is built on
stateless IPv4 and IPv6 address translation technologies. MAP-T is a mechanism that performs double
translation (IPv4 to IPv6 and vice versa) on customer edge (CE) devices and border routers (in ISP core
network).
In a MAP-T deployment, the CE device implements a combination of stateful NAPT44 translation and
stateless NAT46 translation. The CE device obtains NAT-IP and the port-block to be used for translation
through DHCPv6 or any other method.
When an IPv4 packet from a subscriber device arrives at the CE device, the CE device performs NAPT44
and stores the NAPT44 binding information. After NAT44 translation, the packet is subjected to NAT46
translation and then forwarded to the border router (BR) device located in the ISP’s core network. The
BR device receives the IPv6 packets from the CE device, extracts and validates the NAT-IP and port-
block embedded in the IPv6 header, and forwards the IPv4 packet to the IPv4 Internet. When the BR
receives the IPv4 packet from the Internet, it translates the IPv4 packet to an IPv6 packet and send the
IPv6 packet to the CE device.
MAP-T is stateless on a BR device, so it does not require the BR device to perform NAT on the traffic. In-
stead, NAT functionality is delegated to the CE devices. This delegation and stateless functionality in
BR devices allows the BR deployment to scale in proportion to the volume of traffic.
The NetScaler appliance implements the BR functionality of a MAP-T solution as described by RFC
7599.
Configuring MAP-T
To bind IPv4 NAT address range of CE devices to a basic mapping rule by using the CLI
Sample configuration
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
The number of subscribers in a telco network is increasing at an unprecedented rate, and managing
them is becoming a challenge for service providers. Newer, faster, and smarter devices are placing
high demand on the network and the subscriber management systems. It is no longer feasible to
provide each subscriber the same standard of service, and the need for traffic processing on a per-
subscriber basis is imperative.
The NetScaler appliance provides the intelligence to profile subscribers on the basis of their informa-
tion stored in the Policy and Charging Rules Function (PCRF). When a mobile subscriber connects to
the Internet, the packet gateway associates an IP address with the subscriber and forwards the data
packet to the appliance. The appliance receives the subscriber information dynamically, or you can
configure static subscribers. This information enables the appliance to apply its rich traffic manage-
ment capabilities, such as content switching, integrated caching, rewrite, and responder, on a per-
subscriber basis to manage the traffic.
Before you configure the NetScaler appliance to manage subscribers, you must allocate memory to
the module that stores subscriber sessions. For dynamic subscribers, you must configure an interface
through which the appliance receives session information. Static subscribers must be assigned IDs,
and you can associate them with policies.
Each subscriber session entry consumes 1 KB of memory. Storing 500,000 subscriber sessions at any
point in time requires 500 MB of memory. This value must be added to the minimum memory require-
ment, which is shown as part of the output of the “show extendedmemoryparam” command. In the
following example, the output is for a NetScaler VPX instance with 3 packet engines and 8 GB memory.
To store 500,000 subscriber sessions on this appliance, the configured memory must be 2058+500 MB
(500,000 x 1 KB = 500 MB.)
Note
The configured memory must be in multiples of 2 MB and must not exceed the maximum memory
usage limit. The appliance must be restarted for the changes to take effect.
Example
1 show extendedmemoryparam
2 Extended Memory Global Configuration. This memory is utilized by
LSN and Subscriber Session Store Modules:
3 Active Memory Usage: 0 MBytes
4 Configured Memory Limit: 0 MBytes
5 Minimum Memory Required: 2058 MBytes
6 Maximum Memory Usage Limit: 2606 MBytes
7 Done
8 set extendedmemoryparam -memLimit 2558
9 Done
10 show extendedmemoryparam
11 Extended Memory Global Configuration. This memory is
utilized by LSN and Subscriber Session Store Modules:
12
13 Active Memory Usage: 2558 MBytes
14 Configured Memory Limit: 2558 MBytes
15 Minimum Memory Required: 2058 MBytes
16 Maximum Memory Usage Limit: 2606 MBytes
17 Done
The NetScaler appliance dynamically receives the subscriber information through any of the following
types of interface:
• Gx Interface
• RADIUS Interface
• RADIUS and Gx Interface
Note
• Starting with NetScaler release 12.0 build 57.19, Gx interface is supported for a cluster de-
ployment. For more information see Gx interface in a cluster topology.
Gx interface
A Gx interface (as specified in 3GPP 29.212) is a standard interface based on the Diameter protocol
that allows exchange of policy control and charging rules between a PCRF and a Policy and Charging
Enforcement Function (PCEF) entity in a Telco network.
As soon as an IP-CAN session is established, the packet gateway forwards the subscriber ID, such as
the MSISDN, and Framed-IP address information about the subscriber to the PCRF as a Diameter mes-
sage. When the data packet arrives at the appliance from packet gateway (PGW), the appliance uses
the subscriber IP address to query the PCRF to get the subscriber information. This is also known as
secondary PCEF functionality.
The Policy and Charging Control (PCC) rules received by the appliance over the Gx interface are stored
on the appliance for the duration of the subscriber session, that is, until the PCRF sends a Re-Auth-
Request (RAR) message with a Session-Release-Cause AVP or the subscriber session is terminated
from the CLI or the configuration utility. If there are any updates to an existing subscriber, the PCRF
sends the updates in an RAR message. A subscriber session is initiated when a subscriber logs on to
the network, and terminated when the subscriber logs off.
The following illustration shows the high-level traffic flow. It assumes that the data plane traffic is
HTTP. The appliance sends a Credit Control Request (CCR) over a Gx interface to the PCRF server and,
in the credit control answer (CCA), receives the PCC rules and, optionally, other information, such as
the Radio Access Technology (RAT) type, that applies to the particular subscriber. PCC rules include
one or more policy (rule) names and other parameters. The appliance uses this information to retrieve
the predefined rules stored on the appliance, and to direct the flow of traffic. It also stores this informa-
tion in the subscriber policy and enforcement management system for the duration of the subscriber
session. After a subscriber session is terminated, the appliance discards all the information about the
subscriber.
The following example shows the commands for configuring a Gx interface. The commands are in
boldface.
Add a non-addressable DIAMETER load balancing virtual sever and bind the services created in step
1 to this virtual server. For more than one service, specify a persistenceType and the persistAVPno so
that specific sessions are handled by the same PCRF server. For example:
Configure NetScaler diameter identity and realm. Identity and realm are used as Origin-Host and
Origin-Realm AVPs in diameter messages sent by the Gx client. For example:
Configure the Gx interface to use the virtual server created in step 2 as the PCRF virtual server. Specify
the PCRF realm to use as Destination-Realm AVP in diameters messages sent by the Gx client. For
example:
Example
ARGUMENTS
vServer
Name of the load balancing or content switching virtual server to which the Gx connections are estab-
lished. The service type of the virtual server must be DIAMETER or SSL_DIAMETER. This parameter is
mutually exclusive with the service parameter. Therefore, you cannot set both service and the virtual
server in the Gx interface.
Service
pcrfRealm
The realm of PCRF to which the message is to be routed. This is the realm used in Destination-Realm
AVP by NetScaler Gx client (as a Diameter node).
holdOnSubscriberAbsence
Set to Yes to hold packets until the subscriber session information is fetched from the PCRF server. If
set to No, the default subscriber profile is applied until the subscriber session information is fetched
from the PCRF server. If a default subscriber profile is not configured, an UNDEF is raised for expres-
sions that use subscriber attributes.
requestTimeout
Time, in seconds, within which the Gx CCR request must complete. If the request does not complete
within this time, the request is retransmitted for the number of times specified in the requestRetry-
Attempts parameter. If request is not complete even after retransmitting, then the default subscriber
profile is applied to this subscriber. If a default subscriber profile is not configured, an UNDEF is raised
for expressions that use subscriber attributes. Zero disables the timeout. Default value: 10
requestRetryAttempts
Specify the number of times a request must be retransmitted if the request does not complete within
the value specified in the requestTimeout parameter. Default value: 3
revalidationTimeout
Time, in seconds, after which the Gx CCR-U request is sent after any PCRF activity on a session. Any
RAR or CCA message resets the timer. Zero value disables the idle timeout.
negativeTTL
Time, in seconds, after which the Gx CCR-I request is resent for sessions that have not been resolved
by PCRF because the server is down or there is no response or a failed response is received. Instead of
polling the PCRF server constantly, a negative-TTL makes the appliance hold on to an unresolved ses-
sion. For negative sessions, the appliance inherits the attributes from the default subscriber profile,
if one is configured and from the RADIUS accounting message, if one is received. Zero value disables
the negative sessions. The appliance does not install negative sessions even if a subscriber session
could not be fetched. Default value: 600
servicePathAVP
The AVP code in which PCRF sends the service path applicable to a subscriber.
servicePathVendorid
The vendor id of the AVP in which PCRF sends the service path applicable to a subscriber.
5. Click OK.
The NetScaler nodes in the cluster communicate with an external PCRF server through the Gx inter-
face. When a node receives client traffic, the appliance performs the following:
Each node maintains an independent subscriber store and subscriber sessions are not synchronized
to other nodes.
As per the Diameter Base Protocol RFC 6733, each peer must be configured with a unique diameter
identity to communicate with other peers over the diameter protocol. Hence, in a cluster deployment,
configuration of diameter identity is spotted. The diameter parameters (identity, realm, server close
propagation) for each node can be configured individually by using the GUI or the CLI.
When a node is added to a cluster, it assumes the default diameter parameters (identity=netscaler.com,
realm=com, serverClosePropogation=NO). After the nodes are added, the diameter parameters for
each node must be configured.
ARGUMENTS
Identity
Diameter Identity is used to identify a Diameter node uniquely. Before setting up diameter configu-
ration, the NetScaler appliance (as a Diameter node) must be assigned a unique diameter identity.
For example, set ns diameter -identity netscaler.com -ownerNode 1. So, whenever NetScaler system
needs to use identity in diameter messages, it uses ‘netscaler.com’ as Origin-Host AVP as defined in
RFC3588.
OwnerNode
OwnerNode represents the ID of the cluster node for which the diameter ID is set. OwnerNode can
be configured only through CLIP.
Minimum value: 0
Maximum value: 31
Example:
Note:
Example:
When the show ns diameter command is executed, it displays the diameter parameters for a given
node.
Example:
Add a DIAMETER load balancing virtual sever and bind the services created in step 1 to this virtual
server.
Example:
Configure NetScaler diameter identity and realm on all the cluster nodes. Identity and realm are used
as Origin-Host and Origin-Realm AVPs in diameter messages sent by the Gx client.
Example:
Configure the Gx interface to use the virtual server created in step 2 as the PCRF virtual server and set
the PCRF realm as well.
Example:
Example:
RADIUS interface
With a RADIUS interface, the packet gateway forwards the subscriber information in a RADIUS Account-
ing Start message to the appliance through the RADIUS interface as soon as an IP-CAN session is estab-
lished. A service of type RADIUSListener processes RADIUS Accounting messages. Add a shared secret
for the RADIUS client. If a shared secret is not configured, the RADIUS message is silently dropped. The
following example shows the commands for configuring a RADIUS interface. The commands are in
boldface.
Configure the subscriber RADIUS interface to use this service. For example:
Add a RADIUS client specifying a subnet and shared secret. For example:
A subnet of 0.0.0.0/0 implies that it is the default shared secret for all clients.To see the RADIUS inter-
face configuration and status, type:
ARGUMENTS
ListeningService
Name of the RADIUS listening service that will process the RADIUS accounting requests.
svrState
The state of the RADIUS listening service.
The following illustration shows the high-level traffic flow.
With a RADIUS and Gx interface, as soon as an IP-CAN session is established, the packet gateway for-
wards the subscriber ID, such as the MSISDN, and Framed-IP address information about the subscriber
to the appliance through the RADIUS interface. The appliance uses this subscriber ID to query the
PCRF on the Gx interface to get the subscriber information. This is known as primary PCEF function-
ality. The following example shows the commands for configuring a RADIUS and Gx interface.
You can configure the subscribers manually on the NetScaler appliance by using the command line
or the configuration utility. You create static subscribers by assigning a unique subscriber ID and op-
tionally associating a policy with each subscriber. The following examples show the commands for
configuring a static subscriber.
In the following examples, subscriptionIdvalue specifies the international telephone number, and
subscriptionIdType (E164 in this example) specifies the general format for international telephone
numbers.
A default subscriber profile is used if the subscriber IP address is not found in the subscriber session
store on the appliance. In the following example, a default subscriber profile is added with the sub-
scriber rule policy1.
Use the following command to display all the static and dynamic subscriber sessions.
Use the following command to clear a single session or the complete session store. If you do not
specify an IP address, the complete subscriber session store is cleared.
The NetScaler appliance uses the subscriber’s IP address as the key to the subscriber policy enforce-
ment and management system.
You can add subscriber expressions to read the subscriber information available in the Subscriber
Policy Enforcement & Management System. These expressions can be used with policy rules and ac-
tions that are configured for NetScaler features, such as integrated caching, rewrite, responder, and
content switching.
The following commands are an example of adding a subscriber-based responder action and policy.
The policy evaluates to true if the subscriber rule value is“pol1”.
The following example shows the commands to add a subscriber-based rewrite action and policy.
The action inserts an HTTP header “X-Nokia-MSISDN” by using the value of AVP(45) in the subscriber
session.
In the following example, two policies are configured on the appliance. When the appliance checks the
subscriber information and the subscriber rule is cache_enable, it performs caching. If the subscriber
rule is cache_disable, the appliance does not perform caching.
For a complete list of expressions starting with “SUBSCRIBER.” see the Policy Configuration Guide.
A telco user is generally identified by the IPv6 prefix rather than the complete IPv6 address. The
NetScaler appliance now uses the prefix instead of the complete IPv6 address (/128) to identify a sub-
scriber in the database (subscriber store). For communicating with the PCRF server (for example, in
a CCR-I message), the appliance now uses the framed-IPv6-Prefix AVP instead of the complete IPv6
address. The default prefix length is /64, but you can configure the appliance to use a different value.
Subscriber session cleanup on a NetScaler appliance is based on control plane events, such as a RA-
DIUS Accounting Stop message, a Diameter RAR (session release) message, or a “clear subscriber ses-
sion” command. In some deployments, the messages from a RADIUS client or a PCRF server might
not reach the appliance. Additionally, during heavy traffic, the messages might be lost. A subscriber
session that is idle for a long time continues to consume memory and IP resources on the NetScaler ap-
pliance. The idle session management feature provides configurable timers to identify idle sessions,
and cleans up these sessions on the basis of the specified action.
A session is considered idle if no traffic from this subscriber is received on the data plane or the control
plane. You can specify an update, terminate (inform PCRF and then delete the session), or delete
(without informing PCRF) action. The action is taken only after the session is idle for the time specified
in the idle timeout parameter.
To configure the idle session timeout and the associated action by using the command line
Examples:
To disable the idle session timeout, set the idle timeout to zero.
set subscriber param –idleTTL 0
To configure the idle session timeout and the associated action by using the configuration
utility
2. In the details pane, under Settings, click Configure Subscriber Parameters and specify an Idle
Time and Idle Action.
If you enable subscriber logging, you can track the RADIUS and Gx control plane messages specific to
a subscriber, and use the historical data to analyze subscriber activities. Some of the key attributes
are MSISDN and time stamp. The following attributes are also logged:
By using these logs, you can track users by IP address and, if available, MSISDN.
You can enable subscriber session logging to a local or remote syslog or nslog server. The following
example shows how to enable subscriber logging to a remote syslog server.
From these logs, you can learn about any activity related to a user, such as the time when a session
was updated, deleted, or created (installed). Additionally, error messages are also logged.
Examples:
1. The following log entries are examples of RADIUSandGx session creation, session update, and
session deletion.
09/30/2015:16:29:18 GMT Informational 0-PPE-0 : default SUBSCRIBER SESSION_EVENT
147 0 : Session Install, GX MsgType: CCR-I, RADIUS MsgType: Start, IP: 100.10.1.1, ID: E164 -
30000000001
2. The following log entries are examples of failure messages, such as when a subscriber is not
found on the PCRF server and when the appliance cannot connect to the PCRF server.
In earlier releases, if a subscriber session is deleted when a RADIUS Accounting STOP or a PCRF-RAR
message is received, or as a result of any other event, such as TTL expiry or flush, the corresponding
LSN sessions of the subscriber are removed only after the configured LSN timeout period. LSN ses-
sions that are kept open until this timeout expires continue to consume resources on the appliance.
From release 11.1, a new parameter (subscrSessionRemoval) is added. If this parameter is enabled,
and the subscriber information is deleted from the subscriber database, LSN sessions corresponding
to that subscriber are also removed. If this parameter is disabled, the subscriber sessions are timed
out as specified by the LSN timeout settings.
Troubleshooting
If your deployment is not working as expected, use the following commands to troubleshoot:
If subscriber logging is enabled, you can get more detailed information from the log files.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Traffic steering directs subscriber traffic from one point to another. When a subscriber connects to
the network, the packet gateway associates an IP address with the subscriber and forwards the data
packet to the NetScaler appliance. The appliance communicates with the PCRF server over the Gx
interface to get the policy information. Depending on the policy information, the appliance performs
one of the following actions:
• Forward the data packet to another set of services (as shown in the following illustration).
• Drop the packet.
• Perform only Large Scale NAT (LSN), if LSN is configured on the appliance.
The values shown in the following figure are configured in the CLI procedure that follows the figure.
A content switching virtual server on the NetScaler appliance directs requests to the value added ser-
vices or skips them, depending on the defined rule, and then sends the packet out to the Internet after
performing LSN.
To configure traffic steering for the above deployment by using the CLI
Example:
Add the VLANs. VLANs help the appliance identify the source of the traffic. Bind the VLANs to the
interfaces and subnet IP addresses.
Example:
1 add vlan 10
2
3 add vlan 20
4
5 add vlan 100
6
7 add vlan 200
8
9 bind vlan 10 -ifnum 1/4 -tagged -IPAddress 192.168.10.1 255.255.255.0
10
11 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.20.1 255.255.255.0
12
13 bind vlan 100 -ifnum 1/2 -tagged -IPAddress 100.1.1.1 255.0.0.0
14
15 bind vlan 200 -ifnum 1/3 -tagged -IPAddress 200.1.1.1 255.0.0.0
Specify the VLAN on which the subscriber traffic arrives on the appliance. Specify the service path
AVP that tells the appliance where to look for the service path name within the subscriber session.
For primary PCEF functionality, specify the interfaceType as RadiusAndGx.
Example:
Configure a service and virtual server of type Diameter, and bind the service to the virtual server. Then,
specify the PCRF realm and subscriber Gx interface parameters. For primary PCEF functionality, con-
figure a RADIUS listener service and RADIUS interface.
Example:
Add service functions to associate a VAS with an ingress VLAN. Add a service path to define the chain,
that is, specify the VAS that the packet must be sent to and the order in which it must go to that VAS.
The service path name is usually sent by the PCRF. However, the service path of the default subscriber
profile (*) applies if any of the following is true:
The service path AVP that contains this name must already be configured as part of the global config-
uration. Bind the service function to the service path. The service index specifies the order in which
the VAS is added to the chain. The highest number (255) indicates the beginning of the chain.
Example:
Add the LSN configuration. That is, define the NAT pool and identify the clients for which the appliance
must perform LSN.
The appliance performs LSN by default. To override LSN, you must create a net profile with the over-
rideLsn parameter enabled, and bind this profile to all the load balancing virtual servers that are con-
figured for value added services (VASs).
Example:
Configure the VAS on the appliance. This includes creating the services and virtual servers and then
binding the services to the virtual servers.
Add the content switching (CS) configuration. This includes virtual servers, policies, and their associ-
ated actions. The traffic arrives at the CS virtual server and is then redirected to the appropriate load
balancing virtual server. Define expressions that associate a virtual server with a service function.
Example:
3. Navigate to Traffic Management> Service Chaining> Configure Service Path Ingress VLAN
and specify an ingress VLAN.
4. Navigate to Traffic Management> Subscriber> Parameters> Configure Subscriber Parame-
ters and specify the following:
• Interface Type: Specify RadiusAndGx.
• Configure a diameter virtual server, PCRF realm, and the subscriber GX interface parame-
ters.
• Specify the RADIUS interface parameters.
5. Navigate to Traffic Management> Service Chaining> Service Function and add service func-
tions to associate a value-added service with an ingress VLAN.
6. Navigate to System> Network> Large Scale NAT. Click Pools and add a pool. Click Clients and
add a client. Click Groups and add a group and specify the client. Edit the group and bind the
pool to this group.
7. Navigate to System> Network> Net Profiles and add a net profile. Select Override LSN. Op-
tionally, navigate to System> Network> Settings> Configure Layer 3 Parameters and verify
that Override LSN is not selected.
8. Navigate to Traffic Management> Load Balancing> Virtual Servers and configure the virtual
servers and value-added services on the appliance. Bind the services and the net profile to the
virtual server.
9. Navigate to Traffic Management> Content Switching> Virtual Servers and configure a virtual
server, policy, and action. Specify the target load balancing virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
With the huge increase in the data traffic passing through telco networks, it is no longer feasible for
service providers to steer all the traffic through all the value added services (VAS). A service provider
should be able to optimize usage of VAS and intelligently steer traffic to improve the user experience.
For example, video optimization is not required for traffic that does not include a video. Moreover, if a
subscriber is connected to a 4G network, content can be streamed in high definition (HD), and video
optimization might not be needed. However, video optimization improves the experience for a user
in a 3G network. Similarly, caching provides a faster and better user experience and can be enabled
depending on the subscriber plan. Another example of VAS is parental control. If parents provide a
mobile handset to a minor child, they would like some kind of control over the websites that their
child visits.
To do the above and more, service providers must be able to provide value-added services on a per-
subscriber basis. In other words, entities in the service provider network must be capable of extracting
the subscriber information and intelligently steering the packet on the basis of this information.
Service chaining determines the set of services through which the traffic from a subscriber must pass
before going to the Internet. Instead of sending all the traffic to all the services, the NetScaler intel-
ligently routes all requests from a subscriber to a specific set of services on the basis of the policy
defined for that subscriber.
The following figure shows the entities involved in service chaining. The values shown are configured
in the procedure that follows the figure. A content switching virtual server on the NetScaler appliance
directs requests to the value added services or skips them, depending on the defined rule, and then
sends the packet out to the Internet after performing LSN.
To configure service chaining for the above deployment by using the CLI
Example:
Add the VLANs. VLANs help the appliance identify the source of the traffic. Bind the VLANs to the
interfaces and subnet IP addresses. Add an ingress and an egress VLAN for each VAS.
Example:
1 add vlan 10
2
3 add vlan 20
4
5 add vlan 30
6
7 add vlan 40
8
9 add vlan 50
10
11 add vlan 60
12
13 add vlan 100
14
15 add vlan 200
16
17 bind vlan 10 -ifnum 1/4 -tagged -IPAddress 192.168.10.1 255.255.255.0
18
19 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.20.1 255.255.255.0
20
21 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.30.1 255.255.255.0
22
23 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.40.1 255.255.255.0
24
25 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.50.1 255.255.255.0
26
27 bind vlan 20 -ifnum 1/4 -tagged -IPAddress 192.168.60.1 255.255.255.0
28
29 bind vlan 100 -ifnum 1/2 -tagged -IPAddress 100.1.1.1 255.0.0.0
30
31 bind vlan 200 -ifnum 1/3 -tagged -IPAddress 200.201.1.1 255.0.0.0
Specify the VLAN on which the subscriber traffic arrives on the appliance. Specify the service path
AVP that tells the appliance where to look for the service path name within the subscriber session.
For primary PCEF functionality, specify the interfaceType as RadiusAndGx.
Example:
Configure a service and virtual server of type Diameter, and bind the service to the virtual server. Then,
specify the PCRF realm and subscriber Gx interface parameters. For primary PCEF functionality, con-
figure a RADIUS listener service and RADIUS interface.
Example:
Add service functions to associate a VAS with an ingress VLAN. Add a service path to define the chain,
that is, specify the VAS that the packet must be sent to and the order in which it must go to that VAS.
The service path name is usually sent by the PCRF. However, the service path of the default subscriber
profile (*) applies if any of the following is true:
The service path AVP that contains this name must be configured as part of the global configuration
earlier. Bind the service function to the service path. The service index specifies the order in which the
VAS is added to the chain. The highest number (255) indicates the beginning of the chain.
Example:
Add the LSN configuration. That is, define the NAT pool and identify the clients for which the appliance
must perform LSN.
Example:
The appliance performs LSN by default. To override LSN, you must create a net profile with over-
rideLsn parameter enabled and bind this profile to all the load balancing virtual servers that are con-
figured for value added services (VASs).
Example:
Configure the VAS on the appliance. This includes creating the services and virtual servers and then
binding the services to the virtual servers.
Example:
Add the content switching (CS) configuration. This includes virtual servers, policies, and their associ-
ated actions. The traffic arrives at the CS virtual server and is then redirected to the appropriate load
balancing virtual server. Define expressions that associate a virtual server with a service function.
Example:
1. Navigate to System > Network > IPs and add the subnet IP addresses.
2. Navigate to System > Network > VLANs and add VLANs, Bind the VLANs to the interfaces and
subnet IP addresses.
3. Navigate to Traffic Management > Service Chaining> Configure Service Path Ingress VLAN
and specify an ingress VLAN.
4. Navigate to Traffic Management > Subscriber > Parameters > Configure Subscriber Param-
eters and specify the following:
• Interface Type: Specify RadiusAndGx.
• Configure a diameter virtual server, PCRF realm, and the subscriber GX interface parame-
ters.
• Specify the RADIUS interface parameters.
5. Navigate to Traffic Management > Service Chaining> Service Function and add service func-
tions to associate a value-added service with an ingress VLAN.
6. Navigate to System> Network> Large Scale NAT. Click Pools and add a pool. Click Clients and
add a client. Click Groups and add a group and specify the client. Edit the group and bind the
pool to this group.
7. Navigate to System> Network> Net Profiles and add a net profile. Select Override LSN. Op-
tionally, navigate to System> Network> Settings> Configure Layer 3 Parameters and verify
that Override LSN is not selected.
8. Navigate to Traffic Management> Load Balancing> Virtual Servers and configure the virtual
servers and value-added services on the appliance. Bind the services and the net profile to the
virtual server.
9. Navigate to Traffic Management> Content Switching> Virtual Servers and configure a virtual
server, policy, and action. Specify the target load balancing virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
The RAT-Type AVP (AVP code 1032) is of type Enumerated and is used to identify the radio access
technology that is serving the UE.
The value “1004” indicates that the RAT is EUTRAN. (RFC 29.212).
Example1:
Example2:
2
3 add appqoe action appact1 -priority HIGH -tcpprofile tcp1
4
5 add appqoe policy apppol1 -rule ”SUBSCRIBER.AVP(1032).VALUE.
GET_UNSIGNED32(0, BIG_ENDIAN).NE(1004)” -action appact1
6
7 bind cs vserver <name> -policyname apppol1 -priority 10 -type request
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
With the increase in control-plane traffic, the servers can become a bottleneck because the traffic
is not optimally distributed among the servers. Therefore, messages must be load balanced. The
NetScaler appliance supports Diameter, SIP, and SMPP load balancing.
SIP
NetScaler enables you to load balance SIP messages over UDP or over TCP (including TLS) to a group
of proxy servers. NetScaler also provides Call-ID based persistence and Call-ID hash load balancing
method using which you direct packets for a particular SIP session to the same load balanced SIP
server.
The NetScaler default expressions language contains a number of expressions that operate on Ses-
sion Initiation Protocol (SIP) connections. These expressions are intended to be used in policies for
SIP protocol that operates on a request/response basis. These expressions can be used in content
switching, rate limiting, responder, and rewrite policies.
SMPP
Millions of short messages are exchanged daily between individuals and value-added service
providers, such as banks, advertisers, and directory services, by using the short message peer to peer
(SMPP) protocol. Often, message delivery is delayed because servers are overloaded and traffic is not
optimally distributed among the servers.
The NetScaler appliance provides optimal distribution of messages across your servers, preventing
poor performance and outages. The NetScaler appliance:
• Load balances messages originating from the server and from the client
• Monitors the health of the message centers
• Provides content switching support for the message centers
• Handles concatenated messages
Limitation: Message IDs, from the message center, longer than 59 bytes are not supported. If the
message ID length returned by the message center is more than 59 bytes, ancillary operations fail and
the NetScaler appliance responds with an error message.
Diameter
Diameter is a base protocol with more than 50 protocols (also called applications) built over it. There-
fore, the diameter traffic generated in a Telco network is high. To optimally maintain this diameter
traffic, the NetScaler appliance performs load balancing, content switching, and acts as a relay agent.
Additionally, the appliance offers rewrite and responder functionality. The appliance supports rate
limiting of Diameter messages.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Telecom service providers can configure the NetScaler appliance to function as a DNS proxy. Caching
of DNS records, which is an important function of a DNS proxy, is enabled by default on the NetScaler
appliance. This enables the NetScaler appliance to provide quick responses for repeated translations
and hence enhances the customer experience and also saves the bandwidth. The caches responses
from DNS name servers. When the appliance receives a DNS query, it checks for the queried domain in
its cache. If the address for the queried domain is present in its cache, the NetScaler appliance returns
the corresponding address to the client. Otherwise, it forwards the query to a DNS name server that
checks for the availability of the address and returns it to the NetScaler appliance. The NetScaler
appliance then returns the address to the client.
For requests for a domain that has been cached earlier, the NetScaler appliance serves the Address
record of the domain from the cache without querying the configured DNS server and hence saves the
bandwidth.
From 11.0 release onwards, NetScaler also logs the DNS requests that it receives and also the responses
that it sends to the client. Telecom service providers can use this log to:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Scalability, high availability and performance are critical to service provider deployments. While many
service providers deploy there infrastructure at a single location or multiple location, these deploy-
ments are subject to a number of inherent limitations, such as:
• If the site loses connectivity to all or part of the public Internet, it will be inaccessible to users
and customers, which can have significant impact on the business.
• Users accessing the site from geographically distant locations may experience large and highly
variable delays, which are exacerbated by the large number of round trips that HTTP requires
to transfer content.
NetScaler appliance’s Global Server Load Balancing (GSLB) overcomes these problems by distributing
traffic among sites deployed in multiple geographic locations. By serving content from many different
points in the Internet, GSLB alleviates the impact of network bandwidth bottlenecks and provides
robustness in case of network failures at a particular site. Users can be automatically directed to the
nearest or least loaded site at the time of the request, minimizing the likelihood of long download
delays and/or service disruptions.
You can use NetScaler appliance’s global server load balancing for:
• Disaster recovery or high availability by configuring an Active-standby data center setup that
consists of an active and a standby data center. When a failover occurs as a result of a disaster
event, the standby data center becomes operational.
• High availability and speed by configuring an active-active data center setup that consists of
multiple active data centers. Client requests are load balanced across active data centers.
• Directing client requests to the data center that is closest in geographical distance or network
distance by configuring a proximity setup.
• Full-DNS resolutions, GSLB processes DNS queries of the A, AAAA and CNAME types, and the
DNS function option can process DNS queries of all other types, such as MX and PTR. Also, if the
recursive resolution is enabled, the appliance will forward DNS queries for domain names that
are not configured on the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The volume of web traffic on the Internet is enormous and a large percentage of that traffic is redun-
dant. Multiple clients ask web servers for the same content repeatedly leading to inefficient use of
bandwidth. To relieve the origin web server of processing each request, Internet Service Providers
(ISPs) can use the cache redirection feature of NetScaler appliance and serve the content from a cache
server instead of from the origin server. The NetScaler appliance analyzes incoming requests, sends
requests for cacheable data to cache servers, and sends non-cacheable requests and dynamic HTTP
requests to origin servers. Cache redirection feature of NetScaler is policy-based, and by default, re-
quests that match a policy are sent to the origin server, and all other requests are sent to a cache
server. You can combine content switching with cache redirection to cache selective content and
serve content from specific cache servers for specific types of requested content.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance provides advanced TCP tuning and optimization techniques and capabilities
that are well suited to modern 3.5 and 4G networks, improving user experience and perceived down-
load speeds significantly.
• Choosing and inserting an appropriate NetScaler T1000 Series model in a mobile network for
TCP optimization
• Full configuration instructions related to not only TCP optimization but also for appropriate
Layer-2 and Layer-3 configuration of the T1 device
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Getting Started
January 6, 2019
Contributed by:
C
Hardware
Citrix provides a wide breath of NetScaler models that might be loosely based on two factors:
• Capacity, currently ranging from hundreds of Mbps for the low-end VPX appliance to 160Gbps
for the high-end 25000 MPX series appliance
• Telco grade, with the availability of the T1000 series for Telco datacenters.
Your Citrix Sales or Support representative can help you select the appropriate hardware for your
demo, trial, or production needs.
The remainder of this section uses a NetScaler T1200 as a reference hardware. Note that putting aside
superficial differences related to number and notation of available interfaces (see * in note) or well-
documented limitations of NetScaler VPX (see ** in note) the instructions should apply mostly verba-
tim regardless of the NetScaler model selected.
Note
* For instance a the T1010 model only has 12x1GbE typically marked as 1/1-1/12 rather than the
10/x notation used in this document.
** A NetScaler VPX instance typically doesn’t support LACP aggregation; it might also not support
VLAN tagging.
Initial Setup
After a serial cable is connected, you can log on to the NetScaler appliance with the following creden-
tials:
• Username: nsroot
• Password: nsroot
Once logged in, configure the basic details of the NetScaler appliance as shown in the screen capture
below.
Example:
After you restart the appliance, you might use SSH for further configuration of the T1100 nodes.
Through LOM
Lights out Management (LOM) port on the front panel of the NetScaler appliance allows operator to
remotely monitor and manage the appliance independently of the operating system. Operator can
change the IP address, power cycle, and perform a code dump by connecting to the NetScaler appli-
ance through the LOM port.
Set a static IP on your laptop and plug it directly into the LOM interface with a crossover cable or into
a switch in the same broadcast domain as the LOM interface.
For initial configuration, type the port’s default address: http://192.168.1.3 in a web browser and
change the LOM port’s default IP address.
Software
The NetScaler TCP optimization for mobile networks is constantly evolving. The capabilities and
tunings outlined in this document require a NetScaler Telco build. Here is an example showing the
NetScaler Telco build.
Example:
1 show ver
2
3 NetScaler NS11.0: Build 64.957.nc, Date: Aug 26 2016, 02:00:23
If the T1000 has not shipped with the appropriate build revision, contact the NetScaler Customer
Support.
Important
SSH Client
A NetScaler appliance can be configured by using either the CLI or the HTML5 GUI. However, this sec-
tion provides only CLI-based instructions.
While the CLI is accessible through the NetScaler serial console, an SSH client is normally recom-
mended to allow for remote NetScaler configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Management Network
January 6, 2019
Contributed by:
C
Connectivity
Most NetScaler devices offer redundant 1GbE OAM ports, notated as 0/1 and 0/2. To provide for redun-
dancy in case of a switch failure, you should connect the relevant ports to different upstream switches.
After the NetScaler appliance is connected to the management network, subsequent configuration
steps can be performed remotely using SSH or web connectivity to the CLI and GUI respectively.
Routing
The add route command may be used to configure any routes appropriate to the management net-
work. The relevant gateway should be reachable on the NSIP subnet, as shown below.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Licensing
Contributed by:
C
A valid license file should be installed on the NetScaler appliance. The license should support at least
as many Gbps as the expected maximum Gi-LAN throughput.
License files should be copied through an SCP client to the /nsconfig/license of the appliance, as
shown in the screen capture below.
EXample:
1 shell ls /nsconfig/license/
2
3 CNS_V3000_SERVER_PLT_Retail.lic ssl
Do a warm restart to apply the new license, as shown in the screen capture below.
EXample:
1 reboot -warm
2
3 Are you sure you want to restart NetScaler (Y/N)? [N]:y
4
5 Done
After the restart completes, verify that the license has been properly applied, by using the show license
CLI.
In the example below a 3Gbps Platinum license has been successfully installed.
EXample:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
High Availability
January 6, 2019
Contributed by:
C
High availability (HA) refers to an active-standby operational mode of a NetScaler device pair. Each
device has its own dedicated management IP address. All other IP addresses are owned by the active
device in the pair.
Connectivity
While there are multiple connectivity options for aNetScaler HA pair, the most recommended one is
depicted in the following diagram:
In the above diagram, the N+1 red links between each T1000 and the respective switch imply N+1 re-
dundancy - as explained in Connectivity. For instance, considering a 45 Gbps Gi-LAN N=5 is an appro-
priate value, with 6x10GbE LACP channels between each switch and the respective T1000 as well as
between the two switches.
An extra pair of links is recommended between the NetScaler pair, to provide for HA communication
isolation from the OAM network.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Gi-LAN Integration
January 6, 2019
Contributed by:
C
Typically, a NetScaler appliance is inserted as a separate L3 inline node in the Gi-LAN, similarly to an
L3 router.
Connectivity
A physical NetScaler connectivity to upstream switches is recommended to provide for sufficient re-
dundancy. For example, assuming that a NetScaler appliance is inserted in a Gi-LAN that is handling
a total (uplink+downlink) of 24Gbps, connectivity with 4x10GbE or more interfaces is recommended.
This effectively provides for N+1 redundancy in case of a link failure.
The relevant ports on the upstream switch should be configured for LACP port aggregation. The rele-
vant configuration on NetScaler is outlined below:
Connectivity Configuration:
You can verify the appropriate functionality of LACP using the “show interface” command:
show interface:
sh interface LA/1
Disable the remaining unused interfaces and turn off the monitor.
Command:
Configuration of physical interfaces is not shared across the two NetScaler units. Hence, the above
commands must be run across both NetScaler nodes in case of an HA pair deployment.
HA Configuration
All other configuration parameters are shared between the NetScaler nodes of an HA pair. Hence, HA
sync should be enabled prior to any other configuration commands being run. Basic HA configuration
involves the following steps:
1. Using the exact same NetScaler hardware, software, and license: HA pairs are not supported be-
tween different models (i.e. a T1100 and an MPX21550) or same models with different firmware levels.
Refer to the appropriate instructions on upgrading an existing HA pair - Upgrading to Release 11.1.
Example:
3. Verify the HA pair establishment running the following command in either node; both nodes should
be visible, one of them as Primary (active), the other as a Secondary (standby).
Example:
“‘show HA node
1 4\. Enable failsafe mode and maxFlips. This ensures that in case of a
route monitor failure on both nodes at least one node remains active
without active/standby status constantly switching.
2
3 **Example:**
1 > **Note**
2 >
3 > The VLAN 4080 in the commands in the above example shouldn ’ t be
taken literally. Any unused VLAN-ID might be reserved.
4
5 ## VLAN Configuration
6
7 After the physical interfaces have been appropriately configured, you
might configure the appropriate Gi-LAN VLANs. For instance, consider
a rather simple Gi-LAN environment with an ingress/egress VLAN pair
with 100/101 VLAN-identifier respectively.
8
9 The following commands configure the relevant VLANs on top of the LACP
channel created in the prior step.
1 ## IPv4 Configuration
2
3 Typically, a NetScaler appliance requires one SNIP per VLAN. The
example below assumes that the networks outlined in the Gi-LAN
integration diagram, given in the begining of this page, have a /24
subnet mask:
1 After the SNIPs have been configured they should be associated with the
appropriate VLAN:
Done
Done
apply ns pbrs
1 ## IPv6 Configuration
2
3 The following commands assign IPv6 SNIP per vlan. The example below
assumes that the networks outlined in the Figure: A simple depiction
of a Gi-LAN in this page have a /64 subnet mask:
4
5 **Command:**
1 ## IPv6 Routing
2
3 After IPv6 addressing is complete, IPv6 static routing might be
configured:
4
5 - A fd00:10::/64 static route to the clients via the ingress router
6 - A default route to the internet via the egress router
7
8 **Example:**
apply ns pbr6
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
January 6, 2019
Contributed by:
C
Before configuring TCP optimization, apply the following basic configuration settings on the NetScaler
appliance:
Initial configuration:
Note
Restart the NetScaler appliance if you change the rsskeytype system parameter.
TCP Termination
For NetScaler T1 to apply TCP optimization it needs to first terminate incoming TCP traffic. Towards
this end, a wildcard TCP vserver should be created and configured to intercept ingress traffic and then
forward it to the Internet router.
For environments with static or dynamic routing in place, vserver can rely on routing table info to for-
ward packets towards internet router. Default route must point to the internet router and also routing
entries for client subnets towards wireless router should be in place:
Example:
There are customer environments where subscriber traffic is segmented to multiple flows and needs
to be forwarded to different routers based on incoming traffic parameters. Policy Based Routing (PBR)
can be used to route packets based on incoming packet parameters, such as VLAN, MAC address, In-
terface, source IP, source port, destination IP address, and destination port.
Example:
Using Policy Based Routing to route TCP optimized traffic is a new feature added in release 11.1 50.10.
For previous releases, having multiple “mode MAC” vserver entities per VLAN is an alternative solution
for multi-VLAN environments. Each vserver has a bound service representing the internet router for
the particular flow.
Example:
Note
The vserver mode is MAC in contrast to previous examples where it is mode IP. This is required
to retain the destination IP information when we have service(s) bound to vserver. Also, the ad-
ditional PBR configuration need to route non-optimized traffic.
TCP Optimization
Out-of-the-box NetScaler TCP termination is configured for TCP pass-through functionality. TCP pass-
through essentially means that NetScaler T1 may transparently intercept a client-server TCP stream
but does not retain separate client/server buffers or otherwise apply any optimization techniques.
To enable TCP optimization a TCP profile, named as nstcpprofile, is used to specify TCP configurations
that is used if no TCP configurations are provided at the service or virtual server level and it should be
modified as follows:
Command:
Note
If there is not any profile explicitly created and bound to vserver and service, the profile
nstcp_default_profile is bound by default.
In case of multiple TCP profiles requirement, extra TCP profiles can be created and associated
with the appropriate virtual server
Command:
Note
For deployments with vserver -m MAC and service, same profile should be associated with ser-
vice.
Most of the relevant TCP optimization capabilities of a NetScaler appliance are exposed through a
corresponding TCP profile. Typical CLI parameters that should be considered when creating a TCP
profile are the following:
1. Window Scaling (WS): TCP Window scaling allows increasing the TCP receive window size be-
yond 65535 bytes. It helps improving TCP performance overall and specially in high bandwidth
and long delay networks. It helps with reducing latency and improving response time over TCP.
2. Selective acknowledgment (SACK): TCP SACK addresses the problem of multiple packet loss
which reduces the overall throughput capacity. With selective acknowledgement the receiver
can inform the sender about all the segments which are received successfully, enabling sender
to only retransmit the segments which were lost. This technique helps T1 improve overall
throughput and reduce the connection latency.
3. Window Scaling Factor (WSVal): Factor used to calculate the new window size. It must be
configured with a high value in order to allow the advertised window by NS to be at least equal
to the buffer size.
4. Maximum Segment Size (MSS): MSS of a single TCP segment. This value depends on the MTU
setting on intermediate routers and end clients. A value of 1460 corresponds to an MTU of 1500.
5. maxBurst: Maximum number of TCP segments allowed in a burst.
6. Initial Congestion Window size(initialCwnd): TCP initial congestion window size determines
the number of bytes which can be outstanding in beginning of the transaction. It enables T1 to
send those many bytes without bothering for congestion on the wire.
7. Maximum OOO packet queue size(oooQSize): TCP maintains Out Of Order queue to keep the
OOO packets in the TCP communication. This setting impacts system memory if the queue size
is long as the packets need to be kept in runtime memory. Thus this needs to be kept at opti-
mized level based on the kind of network and application characteristics.
8. Minimum RTO(minRTO): The TCP retransmission timeout is calculated on each received ACK
based on internal implementation logic. The default retransmission timeout happens at 1 sec-
ond to start with and this can be tweaked with this setting. For second retransmission of these
packets RTO will be calculated by N*2 and then N*4 … N*8… goes on till last retransmission
attempt.
9. bufferSize / sendBuffsize: these refer to the maximum amount of data that the T1 may receive
from the server and buffer internally without sending to the client. They should be set to a
value larger (at least double) than the Bandwidth Delay Product of the underlying transmission
channel.
10. flavor: this refers to the TCP congestion control algorithm. Valid values are Default, BIC, CUBIC,
Westwood and Nile.
11. Dynamic receive buffering: allows the receive buffer to be adjusted dynamically based on
memory and network conditions. It will fill up the buffer as much as it’s required to keep the
client’s download pipe full instead of filling up, by reading ahead from server, a fixed size buffer,
as latter is specified in TCP profile and typically based on criteria such as 2*BDP, for a connec-
tion. NetScaler T1 monitors the network conditions to the client and estimates how much it
should read ahead from the server.
12. Keep-Alive (KA): Send periodic TCP keep-alive (KA) probes to check if peer is still up.
13. rstWindowAttenuate: Defending TCP against spoofing attacks. It will reply with corrective ACK
when a sequence number is invalid.
14. rstMaxAck: Enable or disable acceptance of RST that is out of window yet echoes highest ACK
sequence number.
15. spoofSynDrop: Drop of invalid SYN packets to protect against spoofing.
16. Explicit Congestion Notification(ecn): It sends notification of the network congestion status
to the sender of the data and takes corrective measures for data congestion or data corruption.
17. Forward RTO-Recovery: In case of spurious retransmissions, the congestion control configura-
tions are reverted to their original state.
18. TCP maximum congestion window (maxcwnd): TCP maximum congestion window size that
is user configurable.
19. Forward acknowledgment (FACK): To avoid TCP congestion by explicitly measuring the total
number of data bytes outstanding in the network, and helping the sender (either T1 or a client)
control the amount of data injected into the network during retransmission timeouts.
20. tcpmode: TCP optimization modes for specific profile.
For the above parameters please consult [1] for guidance on picking the appropriate values. For the
remaining ones, the values outlined in TCP Optimization should apply to most cases.
In a Telco network, almost 50 percent of a NetScaler appliance’s TCP connections become idle, and
the appliance sends RST packets to close them. The packets sent over radio channels activate those
channels unnecessarily, causing a flood of messages that in turn cause the appliance to generate a
flood of service-reject messages. The default TCP profile now includes DropHalfClosedConnOnTime-
out and DropEstConnOnTimeout parameters, which by default are disabled. If you enable both of
them, neither a half closed connection nor an established connection causes a RST packet to be sent
to the client when the connection times out. The appliance just drops the connection.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The TCP Speed Reporting is a NetScaler feature which extracts TCP connection statistics, as a measure
of TCP download and upload performance, and is utilized in TCP Insight reports of the Citrix Applica-
tion Delivery Management (ADM). To achieve this, NetScaler monitors each TCP connection, locates
packet bursts on an idle time-out basis and reports key metrics (such as byte count, retransmitted
byte count and duration) for the identified maximum burst. TCP Speed Reporting feature is enabled
by default, support both TCP and HTTP vServers and depends on the Appflow/ULFD reporting infras-
tructure.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Real-time Statistics
Contributed by:
C
The stat command might be used to verify that TCP optimization is properly applied:
Command:
7 vsrv...eless 0
8 Virtual Server Statistics
9 Rate (/s)
Total
10 Vserver hits 0
10
11 Requests 0
0
12 Responses 0
0
13 Request bytes 0
1580
14 Response bytes 0
532594360
15 Total Packets rcvd 0
216463
16 Total Packets sent 0
369898
17 Current client connections --
0
18 Current Client Est connections --
0
19 Current server connections --
0
20 Requests in surge queue --
0
21 Requests in vserver’s surgeQ --
0
22 Requests in service’s surgeQs --
0
23 Spill Over Threshold --
0
24 Spill Over Hits --
0
25 Labeled Connection --
0
26 Push Labeled Connection --
0
27 Deferred Request 0
0
28 Invalid Request/Response --
0
29 Invalid Request/Response Dropped --
0
30 Bound Service(s) Summary
The Total counters should constantly increase for an operational system. In addition, the Rate coun-
ters should be non-zero.
Note
The preceding output is from an operational yet idle lab system, explaining the zero rate.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
SNMP
Contributed by:
C
SNMP agent can be queried for system specific information from a remote device (SNMP Manager).
Based on the query, the agent searches for the equal object identifier (OID) in the management in-
formation base (MIB) for the data requested and sends the information to the SNMP Manager. The
following are the most useful SNMP OIDs for Telco deployments:
Memory
• resMemUsage (1.3.6.1.4.1.5951.4.1.1.41.2)
• resCpuUsage (1.3.6.1.4.1.5951.4.1.1.41.1)
• nsCPUTable (1.3.6.1.4.1.5951.4.1.1.41.6)
• nsCPUname (1.3.6.1.4.1.5951.4.1.1.41.6.1.1)
• nsCPUusage (1.3.6.1.4.1.5951.4.1.1.41.6.1.2)
Throughput
• allNicTotRxMbits (1.3.6.1.4.1.5951.4.1.1.71.1)
• allNicTotTxMbits (1.3.6.1.4.1.5951.4.1.1.71.2)
• ipTotRxPkts (1.3.6.1.4.1.5951.4.1.1.43.25)
IP packets received.
• ipTotRxMbits (1.3.6.1.4.1.5951.4.1.1.43.27)
• ipTotTxPkts (1.3.6.1.4.1.5951.4.1.1.43.28)
IP packets transmitted.
• ipTotTxMbits (1.3.6.1.4.1.5951.4.1.1.43.30)
Connections
Active connections:
• tcpActiveServerConn (1.3.6.1.4.1.5951.4.1.1.46.8)
Total connections:
• tcpCurServerConn (1.3.6.1.4.1.5951.4.1.1.46.1)
Server connections, including connections in the Opening, Established, and Closing state.
• tcpCurClientConn (1.3.6.1.4.1.5951.4.1.1.46.2)
Client connections, including connections in the Opening, Established, and Closing state.
• tcpTotZombieCltConnFlushed (1.3.6.1.4.1.5951.4.1.1.46.26)
Client connections that are flushed because the client has been idle for some time.
• tcpTotZombieSvrConnFlushed (1.3.6.1.4.1.5951.4.1.1.46.27)
Server connections that are flushed because there have been no client requests in the queue for some
time.
Errors
• tcpErrSynGiveUp (1.3.6.1.4.1.5951.4.1.1.46.37)
• tcpErrRetransmitGiveUp (1.3.6.1.4.1.5951.4.1.1.46.60)
Number of times NetScaler terminates a connection after retransmitting the packet seven times on
that connection.Retrasnmission happens when recieving end doesn’t acknowledges the packet.
• ifInDiscards (1.3.6.1.2.1.2.2.1.13)
The number of inbound packets which were chosen to be discarded even though no errors had been
detected to prevent their being deliverable to a higher-layer protocol. One possible reason for dis-
carding such a packet could be to free up buffer space.
• ifOutDiscards (1.3.6.1.2.1.2.2.1.19)
The number of outbound packets which were chosen to be discarded even though no errors had been
detected to prevent their being transmitted. One possible reason for discarding such a packet could
be to free up buffer space.
• ifErrTxOverflow (1.3.6.1.4.1.5951.4.1.1.54.1.36)
Number of packets that have passed through the overflow queues, during transmission on the speci-
fied interface, since the NetScaler appliance was started or the interface statistics were cleared. This
gets incremented only on congested ports.
Optimized/Bypass connections
• tcpOptimizationEnabled (1.3.6.1.4.1.5951.4.1.1.46.131)
• tcpOptimizationBypassed (1.3.6.1.4.1.5951.4.1.1.46.132)
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Technical Recipes
Contributed by:
C
The NetScaler T1 models provide advanced features and a powerful policy configuration language that
allow for evaluation of complex decision in runtime.
While it is not possible to evaluate all capabilities that are potentially unlocked by the T1000 features
and policy configuration guide, technical receipes consider implementation of various requirements
brought in by Telco operators. Feel free to re-use the “recipes” as is or adapt to your environment.
The NetScaler T1 model can be configured to limit the number of connections per unique subscriber
IP. With the below configuration, N concurrent TCP connections per IP (CLIENT.IP.SRC) is allowed.
For every attempt for connection beyond the configured threshold, T1 sends an RST. For maximum 2
concurrent connections per user:
Command:
Many operators concern about TCP connections disruption when the NetScaler T1 model is activated
inline for TCP optimization or when it is disabled for maintenance purposes. To avoid breaking exist-
ing connections when vserver is introduced, the following configuration needs to be applied before
configuring or activating vserver for TCP optimization:
Command:
Forwarding sessions are effective on top of routing (either static or dynamic or PBR) and create session
entries for traffic that is routed (L3 mode). Any existing connection is handled by forwarding session
due to corresponding sessions, and upon vserver introduction it starts capturing only new TCP con-
nections.
ACLs can be configured to capture only specific ports like vserver, in order to avoid creating sessions
for unnecessary traffic, which is memory consuming. Another option is to remove specific configura-
tion after vserver activation.
For maintenance purposes, vserver should be disabled and its state appears as OUT OF SERVICE.
When this happens, the vserver terminates all connections immediately by default. To make vserver
to still serve the existing connections and not accept new, the following configuration should be ap-
plied:
Command:
New connections go through the routing table, and corresponding session entries are created due to
forwarding sessions.
Policy-based TCP Profile selection allows operators to configure TCP profile dynamically for clients
coming from different traffic domains (i.e. 3G or 4G). Some of the QoS metrics are different for these
traffic domains, and in order to achieve better performance, you need to change some of the TCP pa-
rameter dynamically. Consider a case where clients coming from 3G and 4G hit same vserver and use
same TCP profile, which have negative impact on some client’s performance. AppQoE functionality
can classify these clients and dynamically change TCP profile on vserver.
Example:
The NetScaler T1 model is capable to receive the subscriber information dynamically through Gx or
Radius or Radius and Gx interface and apply different TCP profile on a per-subscriber basis.
Command:
For integration of the NetScaler T1 model with operator control-plane network, see Telco Subscriber
Management.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Scalability
January 6, 2019
Contributed by:
C
Because TCP optimization is resource intensive, a single NetScaler appliance, even a high end
–appliance, might not be able to sustain high Gi-LAN throughputs. To expand the capacity of your
network, you can deploy NetScaler appliances in an N+1 cluster formation. In a cluster deployment,
the NetScaler appliances work together as a single system image. The client traffic is distributed
across the cluster nodes with the help of external switch device.
Topology
1. All cluster nodes belong to the same network (also known as an L2 cluster).
2. Data plane and backplane traffic are handled by different switches.
3. Assuming Gi-LAN throughput is 200 Gbps and that a T1300-40G appliance can sustain 80Gbps
of throughput, we need three T1300-40G appliances. To provide redundancy in case of single
cluster node failure, we deploy four appliances in total.
4. Each node will receive up to 67Gbps of traffic (50Gbps in normal operating conditions and
67Gbps in case of single cluster node failure), so it needs 2x40Gbps connections to the up-
stream switch. To provide redundancy in case of switch failure, we deploy a couple of upstream
switches and double the number of connections.
5. Cluster Link Aggregation (CLAG) is used to distribute traffic across cluster nodes. A single CLAG
handles both client and server traffic. Link Redundancy is enabled on the CLAG, so only one
“subchannel” is selected at any given time and handles the traffic. If some link fails or through-
put falls below specified threshold, the other subchannel is selected.
6. The upstream switch performs symmetric port-channel load balancing (for example, source-
dest-ip-only algorithm of Cisco IOS 7.0(8) N1(1)) so that forward and reverse traffic flows are
handled by the same cluster node. This property is desirable because it eliminates packet re-
ordering, which would degrade TCP performance.
7. Fifty percent of data traffic is expected to be steered to backplane, which means each node will
steer up to 34Gbps to other cluster nodes (25Gbps in normal operating conditions and 34Gbps
in case of single cluster node failure). Thus, each node needs at least 4x10G connections to
the backplane switch. To provide redundancy in case of switch failure, we deploy a couple of
backplane switches and double the number of connections. Link redundancy is not currently
supported for backplane, so Cisco VPC or equivalent technology is desired to achieve switch-
level redundancy.
8. MTU size of steered packets is 1578 bytes, so backplane switches must support an MTU more
than 1500 bytes.
Note: The design depicted in Figure 1 is also applicable to T1120 and T1310 appliances. For T1310 we
would use 40GbE interfaces for the backplane connections, since it lacks 10GbE ports.
Note: While this document uses Cisco VPC as an example, if working with non-Cisco switches alternate
equivalent solutions could be used, such as Juniper’s MLAG.
Note: While other topologies such as ECMP instead of CLAG are possible, they are not currently sup-
ported for this particular use case.
After physical installation, physical connectivity, software installation, and licensing are completed,
you can proceed with the actual cluster configuration. The configurations described below apply to
the cluster depicted in Figure 1.
Note: For more information about cluster configuration, see “Setting up a NetScaler cluster.”
Assume that the four T1300 nodes in Figure 1 have the following NSIP addresses:
1 T1300-40-1: 10.102.29.60
2 T1300-40-2: 10.102.29.70
3 T1300-40-3: 10.102.29.80
4 T1300-40-4: 10.102.29.90
The cluster will be managed through the cluster IP (CLIP) address, which is assumed to be 10.78.16.61.
To begin configuring the cluster shown in Figure 1, log on to the first appliance that you want to add
to the cluster (for example, T1300-40-1) and do the following.
1. At the command prompt, enter the following commands:
Command:
2. After the appliance restarts, connect to the Cluster IP (CLIP) address and add the rest of the nodes
to the cluster:
Command:
3. Connect to the NSIP address of each of the newly added nodes and join the cluster:
Command:
4. After the nodes restart, proceed with backplane configuration. On the cluster IP address, enter the
following commands to create an LACP channel for the backplane link of each cluster node:
Command:
5. Similarly, configure dynamic LA and VPC on the backplane switches. Make sure the MTU of the
backplane switch interfaces is at least 1578 bytes.
6. Verify the channels are operational:
Command:
Command:
8. Check the cluster status and verify that the cluster is operational:
After you have formed theNetScaler cluster, deploy Cluster Link Aggregation (CLAG) to distribute traffic
across cluster nodes. A single CLAG link will handle both client and server traffic.
On the cluster IP address, execute the following commands to create the Cluster Link Aggregation
(CLAG) group shown in Figure 1:
Command:
Code:
Command:
For more information about cluster link aggregation, see the following topics:
Because we will be using MAC-based forwarding (MBF), configure a linkset and bind it to the CLAG
group as follows:
Command:
• Configuring Linksets
• Using Cluster LA Channel with Linksets
We will be using striped IP configuration, which means that IP addresses are active on all nodes (de-
fault setting). See “Striped, Partially Striped, and Spotted Configurations” for more information about
this topic.
Command:
Command:
Command:
At this point, we have applied all cluster specific commands. To complete the configuration, follow
the steps described in “[TCP optimization configuration]/en-us/netscaler/12/netscaler-support-for-
telecom-service-providers/NS_TCP_optimization/NS_TCP_opt_config.html)”.
A NetScaler cluster can be integrated into the dynamic routing environment of the customer’s net-
work. Following is an example of dynamic routing configuration using BGP routing protocol (OSPF is
also supported).
1. From the CLIP address, enable BGP and dynamic routing on ingress and egress IP addresses:
Command:
Code:
1 > shell
2 root@ns# vtysh
3 ns# configure terminal
4 ns(config)# router bgp 65531
5 ns(config-router)# network 10.0.0.0/24
6 ns(config-router)# neighbor 172.16.31.100 remote-as 65530
7 ns(config-router)# neighbor 172.16.31.100 update-source 172.16.31.254
8 ns(config-router)# exit
3. Configure the egress-side BGP peer to advertise the default route to the NetScaler cluster. For
example:
Command:
5. From vtysh verify that configuration is propagated to all cluster nodes, by entering:
Command:
6. Finally, log on to NSIP address of each cluster node and verify routes advertised from BGP peer:
Command:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
TCP uses the following optimization techniques and congestion control strategies (or algorithms) to
avoid network congestion in data transmission.
The Transmission Control Protocol (TCP) has long been used to establish and manage Internet connec-
tions, handle transmission errors, and smoothly connect web applications with client devices. But
network traffic has become more difficult to control, because packet loss does not depend only on
the congestion in the network, and congestion does not necessarily cause packet loss. Therefore, to
measure congestion, a TCP algorithm should focus on both packet loss and bandwidth.
NILE Algorithm
Citrix Systems has developed a new congestion-control algorithm, NILE, a TCP optimization algorithm
designed for high-speed networks such as LTE, LTE advanced and 3G. Nile addresses unique chal-
lenges caused by fading, random or congestive losses, link layer retransmissions and carrier aggre-
gation.
The telecom service providers can use the NILE algorithm in their TCP infrastructure to:
• Optimize mobile and long-distance networks— The NILE algorithm achieves higher throughput
compared to standard TCP. This feature is especially important for mobile and long-distance
networks.
• Decrease application perceived latency and enhance subscriber experience— The Nile algo-
rithm uses packet loss information to determine whether the transmission-window size should
be increased or decreased, and uses queuing delay information to determine the size of the
increment or decrement. This dynamic setting of transmission-window size decreases the
application latency on the network.
Example:
TCP Fast Recovery mechanisms reduce web latency caused by packet losses. The new Proportional
Rate Recovery (PRR) algorithm is a fast recovery algorithm that evaluates TCP data during a loss recov-
ery. It is patterned after Rate-Halving, by using the fraction that is appropriate for the target window
chosen by the congestion control algorithm. It minimizes window adjustment, and the actual window
size at the end of recovery is close to the Slow-Start threshold (ssthresh).
TCP Fast Open (TFO) is a TCP mechanism that enables speedy and safe data exchange between a
client and a server during TCP’s initial handshake. This feature is available as a TCP option in the TCP
profile bound to a virtual server of a NetScaler appliance. TFO uses a TCP Fast Open Cookie (a secu-
rity cookie) that the NetScaler appliance generates to validate and authenticate the client initiating a
TFO connection to the virtual server. By using the TFO mechanism, you can reduce an application’s
network latency by the time required for one full round trip, which significantly reduces the delay
experienced in short TCP transfers.
When a client tries to establish a TFO connection, it includes a TCP Fast Open Cookie with the initial
SYN segment to authenticate itself. If authentication is successful, the virtual server on the NetScaler
appliance can include data in the SYN-ACK segment even though it has not received the final ACK
segment of the three-way handshake. This saves up to one full round-trip compared to a normal TCP
connection, which requires a three-way handshake before any data can be exchanged.
A client and a backend server perform the following steps to establish a TFO connection and exchange
data securely during the initial TCP handshake.
1. If the client does not have a TCP Fast Open Cookie to authenticate itself, it sends a Fast Open
Cookie request in the SYN packet to the virtual server on the NetScaler appliance.
2. If the TFO option is enabled in the TCP profile bound to the virtual server, the appliance gen-
erates a cookie (by encrypting the client’s IP address under a secret key) and responds to the
client with a SYN-ACK that includes the generated Fast Open Cookie in a TCP option field.
3. The client caches the cookie for future TFO connections to the same virtual server on the appli-
ance.
4. When the client tries to establish a TFO connection to the same virtual server, it sends SYN that
includes the cached Fast Open Cookie (as a TCP option) along with HTTP data.
5. The NetScaler appliance validates the cookie, and if the authentication is successful, the server
accepts the data in the SYN packet and acknowledges the event with a SYN-ACK, TFO Cookie,
and HTTP Response.
Note: If the client authentication fails, the server drops the data and acknowledges the event only
with a SYN indicating a session timeout.
1. On the server side, if the TFO option is enabled in a TCP profile bound to a service, the NetScaler
appliance determines whether the TCP Fast Open Cookie is present in the service to which it is
trying to connect.
2. If the TCP Fast Open Cookie is not present, the appliance sends a cookie request in the SYN
packet.
3. When the backend server sends the Cookie, the appliance stores the cookie in the server infor-
mation cache.
4. If the appliance already has a cookie for the given destination IP pair, it replaces the old cookie
with the new one.
5. If the cookie is available in the server information cache when the virtual server tries to recon-
nect to the same backend server by using the same SNIP address, the appliance combines the
data in SYN packet with the cookie and sends it to the backend server.
6. The backend server acknowledges the event with both data and a SYN.
Note: If the server acknowledges the event with only a SYN segment, the NetScaler appliance immedi-
ately resends the data packet after removing the SYN segment and the TCP options from the original
packet.
To use the TCP Fast Open (TFO) feature, enable the TCP Fast Open option in the relevant TCP profile
and set the TFO Cookie Timeout parameter to a value that suits the security requirement for that pro-
file.
Examples:
add tcpprofile Profile1 – tcpFastOpen
Set tcpprofile Profile1 – tcpFastOpen Enabled
unset tcpprofile Profile1 – tcpFastOpen
To set TCP Fast Open cookie timeout value by using the command line interface
Example:
1. Navigate to Configuration > System > Profiles > and then click Edit to modify a TCP profile.
2. On the Configure TCP Profile page, select the TCP Fast Open checkbox.
3. Click OK and then Done.
To Configure the TCP Fast Cookie timeout value by using the GUI
Navigate to Configuration > System > Settings > Change TCP Parameters and then Configure TCP
Parameters page to set the TCP Fast Open Cookie timeout value.
TCP Hystart
A new TCP profile parameter, hystart, enables the Hystart algorithm, which is a slow-start algorithm
that dynamically determines a safe point at which to terminate (ssthresh). It enables a transition to
congestion avoidance without heavy packet losses. This new parameter is disabled by default.
If congestion is detected, Hystart enters a congestion avoidance phase. Enabling it gives you better
throughput in high-speed networks with high packet loss. This algorithm helps maintain close to max-
imum bandwidth while processing transactions. It can therefore improve throughput.
To use the Hystart feature, enable the Cubic Hystart option in the relevant TCP profile.
At the command prompt, type one of the following commands to enable or disable Hystart in a new
or existing TCP profile.
Examples:
1. Navigate to Configuration > System > Profiles > and click Edit to modify a TCP profile.
2. On the Configure TCP Profile page, select the Cubic Hystart check box.
3. Click OK and then Done.
Optimization Techniques
TCP uses the following optimization techniques and methods for optimized flow controls.
Network traffic today is more diverse and bandwidth-intensive than ever before. With the increased
traffic, the effect that Quality of Service (QoS) has on TCP performance is significant. To enhance QoS,
you can now configure AppQoE policies with different TCP profiles for different classes of network
traffic. The AppQoE policy classifies a virtual server’s traffic to associate a TCP profile optimized for a
particular type of traffic, such as 3G, 4G, LAN, or WAN.
To use this feature, create a policy action for each TCP profile, associate an action with AppQoE poli-
cies, and bind the policies to the load balancing virtual servers.
Configuring policy based TCP profile selection consists of the following tasks:
• Enabling AppQoE. Before configuring the TCP profile feature, you must enable the AppQoE fea-
ture.
• Adding AppQoE Action. After enabling the AppQoE feature, configure an AppQoE action with a
TCP profile.
• Configuring AppQoE based TCP Profile Selection. To implement TCP profile selection for differ-
ent classes of traffic, you must configure AppQoE policies with which your NetScaler appliance
can distinguish the connections and bind the correct AppQoE action to each policy.
• Binding AppQoE Policy to Virtual Server. Once you have configured the AppQoE policies, you
must bind them to one or more load balancing, content switching, or cache redirection virtual
servers.
At the command prompt, type the following commands to enable the feature and verify that it is en-
abled:
To bind a TCP profile while creating an AppQoE action using the command line interface
At the command prompt, type the following AppQoE action command with tcpprofiletobind option.
To bind an AppQoE policy to load balancing, cache redirection or content switching virtual
servers by using the command line interface
Example:
6. Click Create.
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, select a server and then
click Edit.
2. In the Policies section and click (+) to bind an AppQoE policy.
3. In the Policies slider, do the following:
a) Select a policy type as AppQoE from the drop-down list.
b) Select a traffic type from the drop-down list.
4. In the Policy Binding section, do the following:
a) Click New to create a new AppQoE policy.
b) Click Existing Policy to select an AppQoE policy from the drop-down list.
5. Set the binding priority and click Bind to the policy to the virtual server.
6. Click Done.
TCP performance slows down when multiple packets are lost in one window of data. In such a sce-
nario, a Selective Acknowledgement (SACK) mechanism combined with a selective repeat retransmis-
sion policy overcomes this limitation. For every incoming out-of-order packet, you must generate a
SACK block.
If the out-of-order packet fits in the reassembly queue block, insert packet info in the block, and set
the complete block info as SACK-0. If an out-of-order packet does not fit into reassembly block, send
the packet as SACK-0 and repeat the earlier SACK blocks. If an out-of-order packet is a duplicate and
packet info is set as SACK-0 then D-SACK the block.
Client Reneging
A NetScaler appliance can handle client reneging during SACK based recovery.
Memory checks for marking end_point on PCB is not considering total available
memory
In a NetScaler appliance, if the memory usage threshold is set to 75 percent instead of using the total
available memory, it causes new TCP connections to bypass TCP optimization.
In a non-endpoint mode, when you send DUPACKS, if SACK blocks are missing for few out of order
packets, triggers additional retransmissions from the server.
The following SNMP ids have been added to a NetScaler appliance to track number of connections
bypassed TCP optimization due to overload.
To maximize TCP performance, a NetScaler appliance can now dynamically adjust the TCP receive
buffer size.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Note
If you are interested in using CQA Reporting and Adaptive TCP, please contact Citrix sales team.
Mobile networks have unique characteristics that might affect TCP performance. By leveraging
NetScaler Connection Quality Analytics (CQA) and Adaptive TCP optimization techniques, mobile
operators can analyze the overall network behavior to provide an improved user experience and
increased levels of subscriber satisfaction.
When a client sends a TCP request, CQA monitors and extracts a large amount of detailed TCP layer
data during an active connection. With the extracted data, CQA uses a heuristic learning algorithm
to derive important characteristics of the connection, for example, network type (2G, 3G or 4G), con-
gestion level (None, Low, Medium, or High), and signal quality (Excellent, Good, Fair or Poor) on a per-
subscriber basis. NetScaler then stores the information in a subscriber store (so that it can be available
for the next TCP connections from the same subscriber) and exports the data to the AppFlow collec-
tors. The stored information is as raw values in a composite format that defines the network type,
congestion level, and signal quality of the subscriber connection. The detected characteristics can
be used for other applications, for example, to intelligently apply different TCP profiles for different
network characteristics. For more information, see topic Adaptive TCP.
Benefit
Prerequisites
The CQA feature works on Telco platforms with the purchase of a basic CBM license and CBM Pre-
mium license and for otherNetScaler platforms, the feature works with the purchase of a CNS Plat-
inum license. Before you configure the TCP optimization feature, your appliance must have a suitable
license installed.
• CBM_TXXX_SERVER_Retail.lic
• CBM_TPRE_SERVER_Retail.lic
• CNS_WEBF_SSERVER_Retail.lic
• CNS_XXX_SERVER_PLT_Retail.lic
To optimize a TCP traffic using CQA technique, begin by enabling CQA and Appflow features on the
appliance. When the appliance receives a client TCP connection request, it monitors the incoming
traffic and uses the CQA configuration to derive CQA parameters from the raw TCP metrics.
To configure CQA on a NetScaler appliance, you can perform the following tasks:
1. Enable CQA
2. Enable AppFlow Collector
3. Configure CQA Parameters
4. Verify CQA feature
5. Using CQA-based PI expressions
Enabling CQA
If you want the NetScaler appliance to extract TCP raw metric and derive CQA parameters, you must
enable the CQA feature and set adaptive TCP to ON. You must also enable the Appflow feature so that
the appliance can send the derived CQA data for network analysis.
To enable CQA:
You must have at least one Appflow collector to be running in your appliance. At the command
prompt, type the following command:
For CQA to derive parameters such as network type, signal quality, and congestion level, you must
configure CQA settings on the appliance.
To configure CQA:
Example:
Where,
net1csqscale is the signal quality score limit, such as Excellent, Good, or Fair. Maximum Length: 63
net1cclscale is the congestion level limit such as None, Low, or Medium. Maximum Length: 63
Note
For proper configuration of CQA parameters, please contact Citrix Customer Support.
1 sh ns cqaparam
2 Configured CQA parameters:
3 harqretxdelay (in ms): 7
4 net1label: 2g
Verifying CQA
To verify if the CQA parameters are derived during an active TCP action, execute the following com-
mand. Note: You can execute the command only if the TCP connection is open and active.
The NetScaler policy infrastructure is enhanced to use the derived CQA parameters (stored in sub-
scriber store) for string matching operations.
• NETWORK_TYPE: String value that matches the detected network type configured through the
cqaparam command interface.
• SIGNAL_QUALITY: Integer value ranging from 0 to 100 and matching the CQA signal quality pa-
rameter stored in the subscriber store (lower values indicate better signal quality).
• CONGESTION_LEVEL: Integer value ranging from 0 to 100 and matching CQA raw value of con-
gestion level parameter stored in the subscriber store (lower values indicate lower congestion).
Below are sample PI expressions with CQA parameters such as network type, congestion level, and
signal quality, evaluates an incoming traffic of network type 2G, exhibiting good or excellent signal
quality with a high congestion level:
Benefit
• Extract advanced and detailed insight of network conditions experienced by a mobile sub-
scriber.
• Automatically adapt traffic management actions of NetScaler based on the current network con-
ditions.
Prerequisites
The Adaptive TCP feature works only on telco traffic management platforms (such as NetScaler T1000
series and VPX-T platforms) with a Premium license. The VPX-T software and T1000 hardware appli-
ances are designed to meet the needs of telco mobile operators and service providers. Before you
configure the TCP optimization feature, your appliance must have the following license files installed:
1. Adaptive TCP
The configuration begins by enabling CQA, Appflow, and Adaptive TCP features. Once you enable,
you can configure a normal TCP profile with ‘applyAdaptiveTcp’ option enabled and scrutinizing TCP
parameters such as TCP favor, TCP Max congestion window, Burst Rate Control (pacing), TCP Rate,
and TCP Rate Maximum Queue. When the appliance receives a TCP request, it applies a TCP profile
and Adaptive TCP logic is triggered. The logic queries the subscriber store for the subscriber’s CQA
information. Based on the derived metrics, the appliance independently adapts the TPC profile to
optimize the subscriber traffic.
If you want the appliance to optimize TCP traffic, you must enable CQA, AppFlow, and Adaptive TCP
features.
1 enable ns feature adaptiveTCP cqa appflow LB
A NetScaler appliance uses a TCP load balancing virtual servers for optimizing an adaptive TCP traffic.
Note: Adaptive TCP optimization technique works for HTTP traffic also.
Example:
A NetScaler appliance uses a HTTP load balancing virtual servers for optimizing HTTP traffic.
Example:
You can configure a normal TCP profile to apply Adaptive TCP optimization. This can done by either
adding a new profile or modifying an existing one.
Note
Before you configure TCP profiles to apply Adaptive TCP optimization, please contact Citrix Cus-
tomer Support.
Example:
You can apply a TCP profile for Adaptive TCP optimization by either of the two ways:
Example:
To configuring AppQoE policy-based optimization, you must complete the following tasks:
Example:
Example:
To bind an AppQoE policy to a load balancing virtual server of HTTP and TCP traffic:
At the command prompt, type the following:
Example:
1. Sign in to the NetScaler appliance and navigate to the Traffic Management > Load Balanc-
ing > Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as TCP.
c) IP Address Type. IP address type: IPv4 or IPv6.
d) IP Address. IPv4 or IPv6 address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with configuration of other, optional, parameters. For more information,
see Creating a Virtual Server.
5. Click Create and Close.
1. Sign in to the NetScaler appliance and navigate to the Traffic Management > Load Balanc-
ing > Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as HTTP.
c) IP Address Type. IP address type: IPv4 or IPv6.
d) IP Address. IPv4 or IPv6 address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with configuration of other, optional, parameters. For more information,
see Creating a Virtual Server.
5. Click Create and Close.
1. Log on to NetScaler appliance and navigate to the Configuration > System > Profiles page
2. In the Details pane, click TCP Profiles tab.
3. In the Configure TCP Profiles page, select Apply Adaptive TCP checkbox.
4. Click OK and Close.
To apply adaptive TCP profile to load balancing virtual server for TCP traffic
1. Log on to NetScaler appliance and navigate to the Configuration > Traffic Management > Vir-
tual Servers.
2. In the details page, select a virtual server profile for TCP traffic and click Edit.
3. In the Load Balancing Virtual Server page, go to Profiles section and click pencil icon.
4. Apply the adaptive TCP profile to the virtual server.
5. Click OK and Done.
To apply adaptive TCP profile to load balancing virtual server for HTTP traffic
1. Log on to NetScaler appliance and navigate to the Configuration > Traffic Management > Vir-
tual Servers.
2. In the details page, select a virtual server profile for HTTP traffic and click Edit.
3. In the Load Balancing Virtual Server page, go to Profiles section and click pencil icon.
4. Apply the adaptive TCP profile to the HTTP virtual server.
5. Click OK and Done.
1. Log on to NetScaler appliance and navigate to the Configuration > AppExpert > AppQoE > Ac-
tions.
2. In the details pane, click Add to create an action.
3. In the Create AppQoE Action screen, type or select values for the parameters. The contents
of the dialog box correspond to the parameters described in “Parameters for configuring the
AppQoE Action” as follows (asterisk indicates a required parameter):
a) Name—name
b) Action type—PRIORITY_QUEUING
c) TCP Profile—Apply a TCP profile by adding a new one or selecting an existing one.
d) Priority—HIGH
e) Policy Queue Depth—0
f) Queue Depth—0
g) Click Create and OK.
1. Log on to NetScaler appliance and navigate to the Configuration > AppExpert > AppQoE > Pol-
icy.
To bind AppQoE policy to load balancing virtual server for policy-based Adaptive TCP optimiza-
tion
1. Log on to NetScaler appliance and navigate to the Configuration > Traffic Management > Load
Balancing > Virtual Servers.
2. In the details pane, select a load balancing virtual server of type HTTP or TCP and click Edit.
3. In the Load Balancing Virtual Server page, go to Policies section and click the + icon.
4. In the Policies slider page, do the following:
a) Choose policy. Policy name.
b) Choose type. Policy type as request or response.
5. Click Continue to close the slider page and go to the main page.
6. Click Done.
The TCP Speed Reporting is a NetScaler feature which extracts a rich set of TCP-level statistics, as a
measure of TCP download and upload performance, and is utilized in TCP Insight reports of the Citrix
Application Delivery Management (ADM) . To achieve this, NetScaler monitors each TCP connection,
locates packet bursts on an idle time-out basis and reports key metrics (such as byte count, retrans-
mitted byte count, an duration) for the identified maximum burst. In addition to this, the TCP raw
metrics such as RTT, BIF, receive window and so forth are also measured based on the optimization
type (endpoint or transparent) that you configure. The TCP Speed Reporting feature is enabled by de-
fault, supports both TCP and HTTP vServers and depends on Appflow/ULFD reporting infrastructure.
For more information, see Analytics and Reporting.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Troubleshooting Guidelines
January 6, 2019
Contributed by:
C
Technical Support
All troubleshooting and escalation queries require a recent NetScaler techsupport bundle, which cap-
tures current configuration, firmware version installed, log files, outstanding cores, and others.
Example:
1 show techsupport
2
3 showtechsupport data collector tool - $Revision: #5 $!
4 ...
5 All the data will be collected under
6 /var/tmp/support/collector_P_192.168.121.117_18Jun2015_09_53
7 ...
8 Archiving all the data into ”/var/tmp/support/collector_P_192
.168.121.117_18Jun2015_09_53.tar.gz” ....
9 Created a symbolic link for the archive with /var/tmp/support/support.
tgz
10 /var/tmp/support/support.tgz ---- points to ---> /var/tmp/support/
collector_P_192.168.121.117_18Jun2015_09_53.tar.gz
11
12 After a techsupport bundle has been generated, it might be copied using
SCP.
Traces
NetScaler TCP optimization issues normally require NetScaler traces to troubleshoot properly. Note
that one should try to capture traces under similar conditions, i.e. on the same cell, during the same
time of day, using the same user equipment and application, and others.
The start nstrace and stop nstrace commands might be used to capture traces:
• It’s strongly recommended that the appropriate filter is used to avoid capturing extraneous, un-
necessary packets on the trace. For instance use start nstrace -filter ‘IP == 10.20.30.40’ to only
capture packets being sent to or received from IP address 10.20.30.40, which is the user equip-
ment IP address.
• Do not use the -tcpdump option, since it strips the nstrace headers which are required for de-
bugging.
Trace Analysis
After a NetScaler trace has been captured, it might be viewed with Wireshark 1.12 or later. Verify that
the captured traces include the appropriate NetScaler Packet Trace headers, as shown in the screen
capture below:
The additional debug headers are also visible per the illustration below:
Connection Table
When the issue is related to TCP optimization and it can be reproduced or it’s on-going, it is best to get
also the connection table when the issue occurs from the primary T1 node.
To get the table you shall need to switch to the BSD shell and run the following command:
1 shell
2 ...
3
4 nscli -U 127.0.0.1:nsroot:nsroot show connectiontable -detail full link
> /var/tmp/contable.log
Note
The command might be executed for a longer time and management CPU might be stressed at
that time (depends on the number of connection table entries), but it’s not service affecting.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
Timeouts
Important
Before using any nsapimgr knob, consult with Citrix Customer Support.
The following is a list of different idle connection timeouts that can be set on NetScaler T1 virtual
servers and services. Idle timeout set for client or server connections at the vserver or service level
are applicable only for the connections in TCP ESTABLISHED state and are idle.
• Load Balancing virtual server cltTimeout parameter specifies the time in seconds that a connec-
tion from a client to a Load Balancing virtual server must be idle, before the appliance closes
the connection.
• Service svrTimeout parameter specifies the time in seconds that a connection from the appli-
ance to a service or server must be idle, before the appliance closes the connection.
• Service cltTimeout parameter specifies the time in seconds that a connection from a client to a
service must be idle, before the appliance closes the connection.
When a service is bound to a Load Balancing virtual server, then the cltTimeout for the Load Balancing
virtual server takes precedence, and the service cltTimeout for service is ignored.
In case of there is not service bound to Load Balancing virtual server, global idle timeout, namely
tcpServer, is used for server side connections. It can be configured as follows:
Command:
Command:
When half-close timeout is triggered, connection is moved to zombie state. When zombie timeout
expires, zombie cleanup kicks in and T1 sends RST on both client and server side for given connection
by default.
• Zombie timeout: Interval at which the zombie cleanup process must run to clean up inactive
TCP connections. Default timeout value is 120s and can be configured between 1s and 600s.
Command:
A NetScaler T1 appliance defends against SYN flood attacks by using SYN cookies instead of maintain-
ing half-open connections on the system memory stack. The appliance sends a cookie to each client
that requests a TCP connection, but it does not maintain the states of half-open connections. Instead,
the appliance allocates system memory for a connection only upon receiving the final ACK packet, or,
for HTTP traffic, upon receiving an HTTP request. This prevents SYN attacks and allows normal TCP
communications with legitimate clients to continue uninterrupted. Specific function is enabled by
default without option to disable.
However, there is caveat as standard SYN cookies limit connections to the use of only eight Maximum
Segment Size (MSS) values. If connection MMS does not match with any predefined value, it will pick
up the next available lower value towards both client and server side.
The predefined TCP Maximum Segment Size (MSS) values are the following and can be configured
through a new nsapimgr knob.
• Need not contain Jumbo-Frame support. Even though by default 8 values are reserved in the
MSS table for jumbo frames, the table settings can be modified to include standard Ethernet-
sized frames only.
• Should have 16 values
• Should have values in descending order
• Should include 128 as the last value
If the new MSS table is valid, the table is stored and the old values are switched out at the SYN-cookie
rotation time. Otherwise the new table returns an error. Changes are applied to new connections
while existing connections preserve the old MSS table until the connections expire or are terminated.
To display the current MSS table in a NetScaler appliance, type the following command.
Command:
1 >shell
2
3 #nsapimgr -d mss_table
EXample:
1 #nsapimgr -d mss_table
2
3 MSS table
4
5 {
6 9176,9156,8192,7168,6144,4196,3072,2048,1460,1440,1330,1212,956,536,384,128
}
7
8
9 Done.
1 >shell
2
3 #nsapimgr -s mss_table=<16 comma seperated values>
Example:
2
3 # nsapimgr -d mss_table
4
5 MSS table
6
7 {
8 9176,9156,8192,7168,6144,4196,3072,2048,1460,1400,1330,1212,956,536,384,128
}
9
10
11 Done.
2
3 # nsapimgr -d mss_table
4
5 MSS table
6
7 {
8 1460,1440,1420,1400,1380,1360,1340,1320,1300,1280,1260,1212,956,536,384,128
}
9
10
11 Done.
To make this change permanent even after the NetScaler appliance restarts, include the command
“#nsapimgr -ys mss_table=<16 comma seperated values>” in the “/nsconfig/rc.netscaler” file. If the
“rc.netscaler” file doesn’t exist, create it under the “/nsconfig” folder, and then append the command.
A NetScaler Packet Processing Engine (PPE) starts bypassing connections from TCP optimization if
the memory in use by that one PPE is more than a specified high watermark value. If a PPE memory
utilization goes above ~2.6GB, then it starts bypassing any new connections from optimization. The
existing connections (ones admitted for optimization previously) continues getting optimization. This
watermark value has been purposefully selected and is not recommended for tuning.
Note
If you believe that there is a good reason to change that watermark value, contact Customer
Support.
If the NetScaler appliance receives a SYN for a destination for which the state is unknown, the appli-
ance first checks the reachability of the server and then acknowledges the client. This probing mech-
anism enables clients with dual IP stacks to discover the reachability of dual-stack internet servers.
If the client discovers that both IPv6 and IPv4 access are available, it establishes a connection to the
server that responds more quickly, and resets the other. For the connection for the NetScaler appli-
ance receives a reset, it will reset the corresponding server side connection.
Note: This feature has no user configurable TCP settings to be disabled/enabled on the NetScaler
appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
The NetScaler appliance provides optimization techniques and capabilities to optimization ABR video
traffic for video traffic over mobile networks. This improves user experience and reduces the overall
network bandwidth consumption.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Getting Started
January 6, 2019
Contributed by:
C
Media files have been driving an increasing amount of traffic over mobile networks, and migration to
faster networking technologies has dramatically increased the volume of encrypted video traffic. The
traditional media delivery technology (Progressive Download) is failing to deliver acceptable quality
of experience (QoE) at a high transmission rate. This has led to the introduction of the Adaptive Bit
Rate (ABR) protocol. It can adapt the streaming bit rate to the available network bandwidth and re-
strict streaming quality to match the capability of the handset receiving the video. However, the ABR
protocol does not work as well in mobile networks as it does over the internet. Mobile operators must,
therefore, optimize ABR traffic.
A NetScaler appliance has unique capabilities to detect incoming video traffic and selectively optimize
ABR videos.
A NetScaler appliance can identify and optimize encrypted ABR traffic (including Facebook video traf-
fic) over TCP, and YouTube ABR traffic over QUIC. The appliance has the following capabilities:
Also, the appliance uses the following support domains for detecting video traffic over TCP and QUIC
protocols.
• Unencrypted ABR videos over TCP. Appliance detects all standard compliant video streaming
web sites. The appliance detects ABR sessions by inspecting the response video payload header,
URL, and HTTP headers.
• Encrypted ABR video over TCP. Appliance detects ABR sessions using a generic and heuristic
algorithm based on domain, SSL header and traffic patterns. Using this, the appliance has a
built-in support to detect top video web sites, with 95 percent accuracy and we continue to add
support for new video types. NetScaler also has a program to provide additional verification for
top encrypted ABR sites for a region or country to ensure network coverage.
• Encrypted ABR videos over QUIC. The appliance detects ABR sessions for QUIC based video
provider, such as YouTube. The detection algorithm is on the basis of a heuristic leveraging
the QUIC headers and domain. NetScaler will continue to add support for newer video sites
using QUIC.
Benefits
Optimizing the ABR video traffic can provide the following benefits:
1. HTTP or HTTPS traffic that the appliance receives over TCP is sent to the corresponding load
balancing virtual server.
2. The built-in detection policies bound to the virtual server combined with other proprietary de-
tection algorithms evaluate the traffic.
3. The policies use a set of built-in video detection signatures to detect the video type. The policy
that matches traffic applies an action that categorizes the video type as one of the following:
a) Clear-text PD
b) Clear-text ABR
c) Encrypted ABR
d) Other
4. The optimization policies bound to the same virtual server evaluate the traffic and determine
the optimization bit rate to apply to the traffic.
5. The optimization bit rate is applied if the traffic is either clear-text ABR or encrypted ABR.
A mobile service provider can improve the quality of experience (QoE) by setting the download speed
for 2G, 3G, and 4G mobile traffic. This reduces the video start times or buffering events. Optimization
can also reduce the amount of network bandwidth consumed by video sessions.
The optimization techniques include dynamic burst control and random sampling.
NetScaler ABR optimization adapts dynamically to changing network conditions. It allows an initial
burst rate of 1.3 times the configured pacing rate for 15 seconds. The initial burst rate applies to the
beginning of every optimized ABR video session, even when multiple sessions use the same TCP con-
nection or group of TCP connections.
The appliance also supports recovery bursts in the event that the bit rate supported by the network
drops below the configured pacing rate. For example, if the effective bit rate drops at the 7th second
and recovers at 15th second of the initial burst, the appliance recovers the loss during the next burst
cycle. By doing so, the appliance dynamically optimizes the network bandwidth for all subscribers so
that the quality of video remains consistent per pixel.
Note: When a recovery burst happens during an initial burst, the pacing bit rate must not exceed the
maximum recovery-burst and initial-burst rates (you must not add the Recovery Burst factor on top
of the Initial Burst factor). Otherwise, it might be so fast that the media player shifts to a higher qual-
ity mode. However, if necessary, you can extend the duration of the Initial Burst to compensate the
unused bandwidth.
Random Sampling
To estimate the savings from video optimization, the NetScaler appliance implements random sam-
pling. With this technique, the appliance randomly selects a configurable percentage of the detected
video traffic (the random sampling parameter is an integer number ranging from 0 to 100, so less than
1 percent is not possible). These randomly selected and non-optimized transactions (and sessions)
become a reference group, and they are identified in the transaction logs (along with other character-
istics, such as byte size and timer fields. The characteristics of the optimized sessions are also logged,
and the reporting engine compares statistics of the optimized and reference groups to estimate the
savings from optimization (including the savings from ABR Optimization).
Google has introduced a new transport protocol called QUIC. Google’s QUIC protocol is very similar
to TCP+TLS+HTTP/2 and is implemented on top of UDP. NetScaler can detect YouTube ABR videos
streamed over the QUIC protocol, and apply ABR video optimization in a similar way as ABR over TCP.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Licensing
Contributed by:
C
The Video Optimization feature works on Telco platforms with the purchase of a basic CBM license
and CBM Premium license and for otherNetScaler platforms, the feature works with the purchase of a
CNS Platinum license. Before you configure the video optimization feature, your appliance must have
a suitable license.
• CBM_TXXX_SERVER_Retail.lic
• CBM_TPRE_SERVER_Retail.lic
• CNS_WEBF_SSERVER_Retail.lic
• CNS_XXX_SERVER_PLT_Retail.lic
1. A valid license file should be installed on the NetScaler appliance. The license should support at
least as many Gbps as the expected maximum Gi-LAN throughput.
License files should be copied through an SCP client to the /nsconfig/license of the appliance, as
shown in the screen capture below.
2. Do a warm restart to apply for the new license, as shown in the screen capture below.
3. After the restart completes, verify that the license has been properly applied, by using the show
license CLI.
In the example below a premium license with premium edition has been successfully installed.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
To optimize video traffic over TCP, begin by enabling the video optimization feature. The appliance
then activates the built-in detection policies to detect the incoming video traffic and identify the type
of video. User configurable optimization policies for each video type specify the optimization bit rate
needed for optimizing the traffic.
To configure video optimization on a NetScaler appliance, you perform the following tasks:
If you want the NetScaler appliance to detect, optimize, and report video traffic, you must enable the
Video Optimization feature and set optimization to ON. After enabling the feature you can use built-in
detection policies to identify the incoming video traffic, and you can configure optimization policies
to optimize encrypted ABR traffic. To optimize ABR video traffic, you must configure the download bit
rate (also called the pacing rate).
You must also enable the load balancing feature, and if you want to use video optimization for HTTPS
traffic you must enable the SSL feature.
Note
If you want to monitor the video optimization performance and video insight reports you must
enable the AppFlow feature and then access the Video Analytics feature on Citrix Application
Delivery Management (ADM). For more information, see Video Insight documentation.
A NetScaler appliance uses different virtual servers for detecting and optimizing the different types of
incoming video traffic. The appliance supports the following types of virtual servers for TCP traffic.
• HTTP Load Balancing virtual server. For detecting HTTP video traffic, the appliance uses an
HTTP load balancing virtual server. It manages HTTP video requests that the appliance receives
from clients.
• SSL-Bridge Load Balancing virtual server. To detect encrypted video traffic, you must config-
ure an SSL bridge virtual server on the appliance.
To add an HTTP Load Balancing virtual server for detecting HTTP video traffic
Example:
To add an SSL Bridge virtual server for detecting HTTPS video traffic
Example:
To detect video traffic over an HTTP connection, you must bind all the built-in detection policies to
a load balancing virtual server. You must bind the policies to either request-time or response-time
processing, depending on the policy type.
To bind detection policies for different video types to an HTTP load balancing virtual server
At the command prompt, type the appropriate command for each type. The available commands are:
Example:
Binding the HTTP Body Content Detection Policy to Load Balancing Virtual Server
To detect video traffic over HTTP, you must bind the body content detection policy to the load balanc-
ing virtual server. You can use the following command:
Example:
To detect video traffic over an HTTPS connection, you must bind built-in detection policies to a SSL
Bridge load balancing virtual server.
At the command prompt, type the appropriate command for each type. The available commands are:
Example:
4
5 bind lb vserver ProxyVserver-SSL -policyName
ns_videoopt_https_abr_generic -priority 150 -type REQUEST
To optimize ABR traffic, you have to configure optimization policies and the associated actions. You
then bind the policies to the same load balancing virtual servers to which you bound the detection
policies. For each policy, create the action first, so that you can include it when you create the policy.
Where the rate parameter specifies the rate in Kbps at which to send the traffic (the pacing rate).
Example:
Example:
To optimize ABR video traffic over an HTTP connection, you must bind the optimization policies to a
load balancing virtual server to which the detection policies are bound.
Example:
To optimize ABR video traffic over an HTTPS connection, you must bind the optimization policies to
the SSL Bridge virtual server to which the built-in detection policies are bound.
To bind an optimization policy to SSL Bridge virtual server for pacing encrypted traffic
Example:
The CLI enables you to set the video optimization pacing parameters, such as random sampling per-
centage.
Example:
1. Sign in to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as HTTP
c) IP Address Type. IP address type: IPv4 or IPv6.
d) IP Address. IPv4 or IPv6 address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with configuration of other, optional, parameters. For more information,
see Creating a Virtual Server.
5. Click Create and Close.
1. Sign in to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as SSL-bridge.
c) IP Address Type. IP address type: IPv4 or IPv6.
d) IP Address. IPv4 or IPv6 address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with the configuration of other, optional, parameters. For more informa-
tion, see Creating a Virtual Server.
5. Click Create and then Close.
1. Sign in to the NetScaler appliance and navigate to Traffic Management > Load Balancing >
Virtual Servers screen.
2. In the details pane, select the load balancing virtual server and click Edit.
a) In the Advanced Setting section, click Policies.
b) In the Policies section, click the + icon to access the Policies slider.
c) In the Policies section, set the following parameters.
d) Choose Policy. Select a video optimization detection policy from the drop-down list.
e) Choose Type. Select the policy type as Request.
f) Click Continue.
3. Select the video detection policy from the list and click Close.
1. Log on to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Virtual Servers screen.
2. In the details pane, select the SSL-bridge load balancing virtual server and click Edit.
3. In the Advanced Setting section, click Policies.
4. In the Policies section, click the + icon to access the Policies slider.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Pacing > Actions.
2. In the details pane, click Add.
3. On the Create Video Optimization Pacing Action page, set the following parameters.
a) Name. Name of the optimization action.
b) ABR Optimization Rate (Kbps). Pacing rate at which to send the ABR video traffic. The
default rate for ABR optimization is 1000 Kbps. The minimum value is 1, and the maximum
value is 2147483647.
c) Comment. A short description of the action.
4. Click Create and Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Pacing > Policies.
2. In the details pane, click Add.
3. On the Create Video Optimization Pacing Policy page, set the following parameters.
a) Name. Name of the optimization policy
b) Expression. Custom regrex expressions that implement the policy.
c) Action. Optimization action associated with the policy to handle the incoming video traf-
fic.
d) UNDEF Action. Undefined event if the incoming request does not match the optimization
policy.
e) Comment. A short description of the policy.
f) Log Action. Select the audit log action that creates the desired log messages.
4. Click Create, and then click Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization.
2. In the Video Optimization page, click Change Video Optimization Settings link.
3. In the Video Optimization Settings page, set the following parameter.
a) Random Sampling Percentage (%). Percentage of packets selected for random sampling.
4. Click OK and Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization.
2. On the Video Optimization page, click the Video Optimization Pacing Policy Manager link.
3. Set the following parameters.
a) Bind Point. The point at which to apply the optimization policy during request or response
processing.
b) Connection Type. Connection type as Request or Response.
c) Virtual Server. The load balancing virtual server to which to bind the policy.
d) Click Continue.
4. In the Bind Point section, do one of the following:
a) Select a policy from the list.
b) Click Add Binding to access the Policies Binding slider.
i. Select an existing policy or add a new policy.
ii. Enter binding details and click Bind.
5. Click Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization.
2. On the Video Optimization page, click the Video Optimization Pacing Policy Manager link.
3. On the Video Optimization Policy Manager page, set the following parameters.
a) Bind Point. The point at which to apply the optimization policy during request/response
processing.
b) Connection Type. Connection type as Request or Response.
c) Virtual Server. The SSL-bridge load balancing virtual server to which to bind the policy.
4. Click Continue.
5. In the Bind Point section, do one of the following:
a) Select a policy binding from the list.
b) Click Add Binding to access the Policies Binding slider.
i. Select an existing policy or add a new policy.
ii. Enter binding details and click Bind.
6. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
Contributed by:
C
To optimize QUIC ABR video traffic over UDP, begin by enabling the video optimization feature. After
you complete the configuration, the appliance detects QUIC based ABR video traffic and applies the
optimization bit rate that is configured on the appliance.
To configure video optimization for QUIC video traffic over UDP, you must perform the following tasks:
If you want the NetScaler appliance to detect, optimize, and report video traffic, you must enable the
Video Optimization feature and set optimization ON.
Note
If you want to use video optimization for QUIC traffic, you must enable the load balancing and
AppFlow features.
A NetScaler appliance uses a QUIC service for the load balancing virtual server to connect to the egress
router in the static routing mode.
Note
Example:
A NetScaler appliance uses a load balancing virtual server for detecting and optimizing QUIC video
traffic over UDP.
Example:
After you have created the web services and load balancing virtual server for QUIC traffic, you must
bind the services to the virtual server.
To bind a web service to load balancing virtual server for QUIC video traffic
Example:
To optimize QUIC based UDP traffic, you have to configure optimization pacing policies and its actions.
You must then, bind the policies to QUIC based load balancing virtual servers. For each policy, create
an action first so that you can associate it to the policy.
Where, the rate parameter specifies the rate in Kbps at which to send the traffic (the pacing rate).
Example:
Example:
To optimize QUIC video traffic over a UDP connection, you must bind the optimization policies to a
QUIC load balancing virtual server.
Note
The pacing policies must be bound to a QUIC load balancing virtual server only at request time.
Example:
To configure the feature on the appliance through the GUI, you must perform the following tasks:
1. Log on to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Servers screen.
2. In the details pane, click Add.
3. On the Create Server page, set the following parameters:
a) Name. Name of the QUIC server.
b) IP address. IP address of the QUIC server
c) Traffic Domain. Domain name of the server.
d) Enabling after creating. Initial state of the server.
e) Comments. Brief information about the server.
4. Click Create.
1. Log on to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Services screen.
2. In the details pane, click Add.
3. On the Load Balancing Service page, set the following parameters:
a) Service Name. Name of the QUIC service.
b) IP address. IP address assigned to the QUIC service.
c) Protocol. Select protocol as QUIC.
d) Port. Port number of the web service.
4. Click OK to continue. You can then configure other, optional, parameters. For more, see Config-
uring Services.
5. Once you configure the optional parameters, click OK and Close.
1. Log on to the NetScaler appliance and navigate to the Traffic Management > Load Balancing
> Virtual Servers screen.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server page, set the following parameters:
a) Name. Name of the load balancing virtual server.
1. Navigate to Traffic Management > Load Balancing> Virtual Servers, and select a virtual server.
2. Click Services and Service Groups to access the Load Balancing Virtual Server Service Bind-
ing screen.
3. Select a QUIC based web service and click Bind.
4. Click Done.
1. Navigate to Traffic Management> Load Balancing> Virtual Servers, and select a virtual server.
2. Click Services and Service Groups to access the Load Balancing Virtual Server Service Bind-
ing screen.
3. Select a QUIC based web service and click Bind.
4. Click Done.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Pacing > Actions.
2. In the details pane, click Add.
3. On the Create Video Optimization Pacing Action page, set the following parameters.
a) Name. Name of the optimization action.
b) ABR Optimization Rate (Kbps). Pacing rate at which to send the ABR video traffic. The
default rate for ABR optimization is 1000 Kbps. The minimum value is 1, and the maximum
value is 2147483647.
c) Comment. A short description of the action.
4. Click Create and Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Pacing > Policies.
Contributed by:
C
URL Filtering provides policy-based control of websites by using the information contained in URLs.
This feature helps network administrators monitor and control user access to malicious websites on
mobile networks.
As an administrator, you can configure a URL filtering policy by using either the URL Categorization
feature or the URL List feature.
URL List. Controls access to blacklisted websites and web pages by blocking access to URLs that are
in a URL set imported into the appliance.
URL Categorization. Controls access to websites and web pages by filtering traffic on the basis of a
predefined list of categories.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
URL List
Each entry in a URL set can include a URL and, optionally, its metadata (URL category, category groups,
or any other related data). For URLs with a metadata, the appliance uses a policy expression that
evaluates the metadata. For more information, see URL Sets.
A NetScaler appliance supports two types of URL lists: Custom (with or without URL metadata) and
IWF (Internet Watch Foundation).
Custom URL List. You can create a customized URL set of up to 1,000,000 URL entries and import it
as a text file into your appliance. The list can contain URLs with or without metadata (which could be
like a URL category). TheNetScaler platform automatically detects whether metadata is present. It
also supports storing the imported lists securely. For more information, see URL Set.
IWF URL List. You can import an externally managed list maintained by the IWF. To access this list,
you need special access credentials, and you have to use a secure procedure. NetScaler has built-in
support for the IWF list, making it simple to use.
You can host the URL list and configure the NetScaler appliance to periodically update the list without
requiring manual intervention. Once the URL list is updated, the appliance can automatically detect
the metadata and the categories by using policy expressions to evaluate each incoming URL and then
apply actions such as allow, block, redirect, or notify the user.
The following table describes the basic expressions you can use to evaluate incoming traffic. After you
import an URL List to the appliance, it is called a URL Set.
Expression Operation
The most common enforcement action for URLs that match a URL list is to restrict access. Create a
URL list policy with a desired URL list matching expression and enforcement action. The policy group
usage depends upon the incoming traffic type (HTTP or HTTPS) and the virtual server configured on
the appliance. You can use a Responder policy for HTTP traffic or a Video Optimization policy for
HTTPS traffic. Specify actio ns to apply to the URLs that match the expressions in the policies. The
following table lists the available actions.
Prerequisites
To configure URL List feature, make sure you have configured the following server.
You must configure a DNS server if you import a URL Set from a hostname URL.
Example:
To set up IWF URL list support, you need access credentials. The IWF gives each member the unique
access credentials required for setup. The access credentials include a user name password.
Note
If the IWF changes the URL for importing a list, you can contact the NetScaler support team.
The NetScaler appliance supports HTTP and HTTPS traffic. To configure a load balancing virtual server
for HTTP traffic and bind URL list policies to the server, do the following:
Example:
Example:
Example:
Example:
The NetScaler appliance supports HTTP and HTTPS traffic. To configure a SSL-bridge load balancing
virtual server for HTTPS traffic and bind URL list policies to the server, do the following:
Example:
Example:
To bind URL List policy with SSL-bridge load balancing by using the CLI
Example:
f) Interval. Interval in seconds, rounded off to the nearest 15 minutes, at which the URL set
is updated.
g) Private Set. Option to prevent exporting the URL set
h) Canary URL. Internal URL for testing whether the content of the URL set is to be kept con-
fidential. The maximum length of the URL is 2047 characters
4. Click Create, and then Close.
1. Navigate to the Traffic Management > Load Balancing > Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Choose protocol type as HTTP.
c) IP Address Type. IP addressable type.
d) IP Address. IP 4 or IP6 IP address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with the configuration of other, optional, parameters. For more informa-
tion, see Creating a Virtual Server.
To bind a URL List policy to the HTTP load balancing virtual server
1. Navigate to Traffic Management > Load Balancing > Virtual Servers screen.
2. In the details pane, select the load balancing virtual server and click Edit.
3. In the Advanced Setting section, click Policies.
4. In the Policies section, click the + icon to access the Policies slider.
5. In the Policies section, set the following parameters.
a) Choose Policy. Select a URL categorization policy from the drop-down list.
b) Choose Type. Select the policy type as Request.
6. Click Continue.
7. Select the URL List policy from the list and click Close.
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Detection.
2. On the Detection page, click the Video Optimization Detection Policies link.
3. On the Video Optimization Detection Policies page, click Add.
4. On the Create Video Optimization Detection Policy page, set the following parameters.
a) Name. Name of the optimization policy
b) Expression. Configure policy using custom expressions.
c) Action. Optimization action associated with the policy to handle the incoming video traf-
fic.
d) UNDEF Action. Undefined event if the incoming request does not match the optimization
policy.
e) Comment. A short description of the policy.
f) Log Action. Select an audit log action that specifies the action to be performed for the log
messages.
5. Click Create and Close.
1. Navigate to the Traffic Management > Load Balancing > Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server screen, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as SSL-bridge.
c) IP Address Type. IP address type: IPv4 or IPv6.
d) IP Address. IPv4 or IP6vIP address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with the configuration of other, optional, parameters. For more informa-
tion, see “Creating a Virtual Server” topic.
To bind a URL List Policy to the SSL-bridge load balancing virtual server
1. Navigate to the Traffic Management > Load Balancing > Virtual Servers screen.
2. In the details pane, select the SSL-bridge load balancing virtual server and click Edit.
3. In the Advanced Setting section, click Policies.
4. In the Policies section, click the + icon to access the Policies slider.
5. Set the following parameters.
a) Choose Policy. Select video detection policy from the drop-down list.
b) Choose Type. Select the policy type as Request.
6. Click Continue.
7. Select the video detection policy from the list and click Close.
Audit logging enables you to review a condition or a situation in any phase of URL List process. When a
NetScaler appliance receives an incoming URL, if the responder policy has an URL Set advanced policy
expression, the audit log feature collects URL Set information in the URL and stores the details as a
log message for any target allowed by audit logging.
1. Timestamp.
2. Log message type.
3. The predefined log levels (Critical, Error, Notice, Warning, Informational, Debug, Alert, and
Emergency).
4. Log message information, such as URL set name, policy action, URL.
To configure audit logging for URL List feature, you must complete the following tasks:
The following table lists the URL Match patterns and describes how the URLs within a URL list are
matched against the incoming-request URLs. For example, the pattern www.example.com/bar
matches only with one page at www.example.com/bar. To match all the pages whose URL starts with
‘ www.example.com/bar’, you would add an asterisk (*) to the end of the URL.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Solutions for Telecom Service Providers
URL Categorization
January 6, 2019
Contributed by:
C
URL Categorization restricts user access to specific websites and website categories. As a subscrip-
tion service offered by NetScaler T1000, the feature enables customers to filter web traffic by using a
commercial categorization database. The database has billions of URLs classified into different cate-
gories, such as social networking, gambling, adult content, new media, and shopping. In addition to
categorization, each URL has a reputation score kept up to date based on the site’s historical risk pro-
file. To filter your traffic, you can configure advanced policies based on categories, category groups
(such as Terrorism, Illegal drugs), or site-reputation scores.
For example, you might block access to dangerous sites, such as sites known to be infected with mal-
ware, and selectively restrict access to content such as adult content or entertainment streaming me-
dia.
The following figure shows how NetScaler URL Filtering service is integrated with a commercial URL
Categorization database and cloud services for frequent updates.
You can use the URL filtering feature to detect sites that violate safe internet usage mandates issued by
the government and implement policies to block these sites. Sites that host adult content, streaming
media, or social networking identified as unsafe for children or banned as illegal.
Prerequisites
The feature works on Telco platforms with the purchase of a basic CBM license and CBM Premium
license and for otherNetScaler platforms, the feature works with the purchase of a CNS Platinum li-
cense.
Note: In addition to a Basic CBM license and a CBM Premium license, the appliance must have a URL
Threat Intelligence feature license with a subscription service for one year or 3 years. Before enabling
and configuring the feature, you must install the following licenses:
• CBM_TXXX_SERVER_Retail.lic
• CBM_TPRE_SERVER_Retail.lic
• CNS_WEBF_SSERVER_Retail.lic
• CNS_XXX_SERVER_PLT_Retail.lic
The following table lists the different URL categorization policy expressions that you can use to iden-
tify incoming URLs to which to apply an action of allow, redirect, drop, reset the connection, or deny
access.
Expression Operation
Expression Operation
Policy to select requests for URLs that are in add responder policy p1
the Search Engine category ‘HTTP.REQ.HOSTNAME.APPEND(HTTP.REQ.URL).URL_CATEGO
CATEGORY.EQ(“Search Engine”)
Policy to select requests for URLs that are in add responder policy p1
the Adult category group ‘HTTP.REQ.HOSTNAME.APPEND(HTTP.REQ.URL).URL_CATEGO
GROUP.EQ(“Adult”)’
Policy to select requests for Search Engine add responder policy p2
URLs with a reputation score equal to 4. ‘HTTP.REQ.HOSTNAME.APPEND(HTTP.REQ.URL).URL_CATEGO
CATEGORY.EQ(“Search Engine”)’
Policy to select requests for Search Engine and add policy patset good_categories; bind policy
Shopping URLs good_categories “Search Engine”; bind policy
good_categories “Shopping”; add responder
policy p3
‘HTTP.REQ.HOSTNAME.APPEND(HTTP.REQ.URL).URL_CATEGO
CATEGORY .EQUALS_ANY(“good_categories”)
A URL filtering policy evaluates the traffic to identify requests belonging to a particular category. The
following table lists the actions that you can assign to a URL filtering policy.
Note
For encrypted traffic, the VideoOptimization policy includes actions that implement the URL Fil-
tering actions.
To configure URL categorization, begin by enabling the URL Filtering feature. You must then config-
ure the cache memory limits, categorization policy, and virtual servers for HTTP and HTTPS traffic.
Configuring URL Categorization by using the CLI.
To use the CLI configure URL categorization on a NetScaler appliance, do the following:
To set up the feature, you must enable the URL Categorization feature, configure the filtering parame-
ters and set the shared memory limit.
Example:
*Example:
To configure the URL categorization feature for HTTP traffic, you must configure a loading balancing
virtual server, add URL categorization policies and bind the policies to the virtual server. By doing
so, the virtual server receives the HTTP traffic and based on policy evaluation, the system assigns a
filtering action.
Example:
Example:
If a virtual server for HTTP traffic is not already configured, at the command prompt, type:
Example:
Example:
To configure the URL categorization feature for HTTPS traffic, you must configure a SSL-bride loading
balancing virtual server, add URL categorization policies and bind the policies to the SSL-bridge virtual
server. By doing so, the server receives the HTTPS traffic and based on policy evaluation, the system
assigns a filtering action.
Example:
Example:
Example:
1. Log on to the NetScaler appliance and navigate to Configuration > Optimization > Video Op-
timization > Detection.
2. On the Detection page, click the Video Optimization Detection Policies link.
1. Navigate to the Traffic Management > Load Balancing > Virtual Servers page.
2. In the details pane, click Add.
3. On the Load Balancing Virtual Server page set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Choose protocol type as HTTP.
c) IP Address Type. IPv4 or IPv6.
d) IP Address. IPv4 or IPv6, VIP address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Click OK to continue with the configuration of other, optional, parameters.
5. Click Create and Close.
1. Navigate to the Traffic Management > Load Balancing > Virtual Servers page.
2. On the details pane, click Add.
3. On the Load Balancing Virtual Server page, set the following parameters:
a) Name. Name of the load balancing virtual server.
b) Protocol. Select protocol type as SSL-bridge.
c) IP Address Type. IP addressable type.
d) IP Address. IP 4 or IP6 IP address assigned to the virtual server.
e) Port. Port number of the virtual server.
4. Choose OK to continue configuration other optional parameters.
5. Click Create and then Close.
To bind a URL categorization policy to the HTTP load balancing virtual server
1. Navigate to Traffic Management > Load Balancing > Virtual Servers page.
2. On the details pane, select the load balancing virtual server and click Edit.
3. In the Advanced Setting section, click Policies.
4. In the Policies section, click the + icon to access the Policies slider.
5. Set the following parameters.
a) Choose Policy. Select URL categorization policy from the drop-down list.
b) Choose Type. Select the policy type as Request.
6. Click Continue.
7. Select the URL categorization policy from the list and click Close.
1. Navigate to Traffic Management > Load Balancing > Virtual Servers screen.
2. In the details pane, select the SSL-bridge load balancing virtual server and click Edit.
3. In the Advanced Setting section, click Policies.
4. In the Policies section, click + icon to access the Policies slider.
5. In the Policies section, set the following parameters.
a) Choose Policy. Select video detection policy from the drop-down list.
b) Choose Type. Select the policy type as Request.
6. Click Continue.
7. Select the video detection policy from the list and click Close.
Audit logging enables you to review a condition or a situation in any phase of URL Categorization
process. When a NetScaler appliance receives an incoming URL, if the responder policy has an URL
Filtering expression, the audit log feature collects URL Set information in the URL and stores it as log
messages for any target allowed by audit logging.
Source IP address (the IP address of the client that made the request).
To configure audit logging for URL List feature, you must complete the following tasks:
At any stage of the URL Filtering process, if there is a system-level failure, the NetScaler appliance
uses the audit log mechanism to store logs in the ns.log file. The errors are stored as text messages in
SYSLOG format so that, an administrator can view it later in a chronological order of event occurrence.
These logs are also sent to an external SYSLOG server for archival. For more information, see article
CTX229399.
For example, if a failure occurs when you initialize the URL Filtering SDK, the error message is stored
in the following messaging format.
Oct 3 15:43:40 <local0.err> ns URLFiltering[1349]: Error initializing NetStar SDK (SDK error=-1).
(status=1).
The NetScaler appliance stores the error messages under four different failure categories:
• Download failure. If an error occurs when you try to download the categorization database.
• Integration failure. If an error occurs when you integrate an update into the existing categoriza-
tion database.
• Initialization failure. If an error occurs when you initialize the URL Categorization feature, set
categorization parameters, or end a categorization service.
• Retrieval failure. If an error occurs when the appliance retrieves the categorization details of the
request.
The URL Categorization feature provides policy-based control to restrict blacklisted URLs. You can
control access to web sites based on URL category, reputation score, or URL category and reputation
score. If a network administrator monitors a user accessing highly risky websites, he or she can use a
responder policy bound to the URL reputation score to block such risky web sites.
Upon receiving an incoming URL request, the appliance retrieves the category and reputation score
from the URL categorization database. Based on the reputation score returned by the database, the
appliance assigns a reputation rating for websites. The value can range from 1 to 4, where 4 is the
riskiest type of websites, as shown in the following table.
1 Clean site.
2 Unknown site.
3 Potentially dangerous or affiliated to
dangerous site.
4 Malicious site.
1.
2. Citrix ADC
3. NetScaler 12.0
NetScaler Solutions
Contributed by:
C
NetScaler solutions simplify the task of setting up frequently deployed configurations. Check this
space from time to time for additional solutions.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A NetScaler appliance can provide load balanced, secure remote access to your XenApp/XenDesktop
applications. You can use the NetScaler appliance load balancing feature to distribute traffic across
the XenApp/XenDesktop servers, and the NetScaler Gateway feature to provide secure remote access
to the servers. NetScaler appliance can also accelerate and optimize the traffic flow and offer visibility
features that are useful for XenApp/XenDesktop deployments.
• NetScaler Gateway.** Provides the URL for user access, and provides security by authenticating
the users.
• NetScaler appliance load balancing virtual server. Load balances the traffic for the Web In-
terface or StoreFront servers. You can also deploy a load balancing virtual server in front of the
XenApp/XenDesktop servers to load balance key components such as XML Broker and Desktop
Delivery Controller (DDC) server.
• Web Interface or StoreFront or Web Interface on NetScaler appliance. Provides the interface
through which you can access the applications.
Note: Web Interface on NetScaler (WIonNS) is a customization of the Web Interface product,
hosted on the NetScaler appliance.
To set up the NetScaler appliance for XenApp/XenDesktop by using the NetScaler appliance GUI
Prerequisites
Procedure:
1. Log on to the NetScaler appliance and on the Configuration tab click XenApp and XenDesktop.
2. On the Details pane, click Get Started. If the setup exists on the NetScaler, click the Edit link
corresponding to each of the section that you want to modify.
3. Select the product (StoreFront, Web Interface, or Web Interface on NetScaler appliance) that in
your deployment provides the interface for access to the XenApp/XenDesktop applications.
4. Set up secure remote access.
a) In the NetScaler Gateway Settings** section, specify the details for the VPN virtual server
and click Continue.
b) In the Server Certificate section, choose an existing certificate or install a new certificate
and click Continue.
c) In the Authentication section, configure the primary authentication mechanism to be
used and specify the server details or use an existing server and click Continue.
d) In the StoreFront section, specify the details of the server that provides the interface for
accessing the applications and click Continue.
e) You can use one of the following as your StoreFront server.
i. LB vserver pointing to multiple SF servers.
ii. Web Interface or StoreFront server directly reachable from the NetScaler appliance.
iii. Web Interface on NetScaler.
5. Click Done to complete the configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
GSLB powered zone preference is a feature that integrates XenApp/XenDesktop, StoreFront, and
NetScaler appliance to provide clients access to the most optimized data center on the basis of the
client location.
With this enhancement, the client IP address is examined when an HTTP request arrives at the
NetScaler Gateway appliance, and the real client IP address is used to create the datacenter prefer-
ence list that is forwarded to StoreFront. If the NetScaler appliance is configured to insert the zone
preference header, StoreFront 3.5 or later can use the information provided by the appliance to
reorder the list of delivery controllers and connect to an optimal delivery controller in the same zone
as the client. StoreFront selects the optimal gateway VPN virtual server for the selected datacenter
zone, adds this information to the ICA file with appropriate IP addresses, and sends it to the client.
Storefront then tries to launch applications hosted on the preferred datacenter’s delivery controllers
before trying to contact equivalent controllers in other datacenters.
For a video overview about GSLB powered zone preference solution, click https://www.youtube.com/
watch?v=Y8DELum0Xp0.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can use a NetScaler appliance for load balancing in a private cloud that is managed through Mi-
crosoft Windows Azure Pack. The network for the private cloud is automated by using Cisco ACI and
NetScaler appliance.
This solution involves many integration points, such as Windows Azure Pack (WAP) to Cisco APIC, Cisco
APIC to System Center Virtual Machine Manager (SCVMM), and Cisco APIC to NetScaler appliance. As a
tenant in the private cloud, you can enable NAT, provision network services, and add a load balancer.
WAP supports tenant and administrator portals where an administrator can perform administrative
tasks such as ACI registration, VIP range, NetScaler appliance device association with virtual machine
cloud, tenant user account creation, and so on. Tenants can log on to the WAP Tenant Portal and
configure the network, bridge domains, and Virtual Routing and Forwarding (VRFs), and make use of
the NetScaler appliance load balancing and RNAT features.
Important
• In this solution, the NetScaler appliance provides only basic load balancing.
• Tenants can deploy multiple VIP addresses with different ports for the same network, but
must ensure that the IP and port combination is unique.
• The NetScaler appliance device package supports only single-context deployment. Each
Tenant gets a dedicated NetScaler appliance instance.
• WAP supports NetScaler appliance MPX appliances and NetScaler appliance VPX virtual ap-
pliances, including NetScaler appliance VPX instances deployed on the NetScaler appliance
SDX platform.
Prerequisites
• You have conceptual knowledge of Cisco ACI components and NetScaler appliances.
– For more information about Cisco ACI and its components, see the product docu-
mentation at: http://www.cisco.com/c/en/us/support/cloud-systems-management/
application-policy-infrastructure-controller-apic/tsd-products-support-series-home.
html.
– For more information about the NetScaler appliances, see the NetScaler appliance prod-
uct documentation at http://docs.citrix.com/.
• All the required components of Cisco ACI, including Cisco APIC in the datacenter, are set up
and configured. For more information about Cisco ACI and its components, see the product
documentation at: http://www.cisco.com/c/en/us/support/cloud-systems-management/
application-policy-infrastructure-controller-apic/tsd-products-support-series-home.html.
• You know how to integrate Cisco ACI with Microsoft Windows Azure Pack. See the product doc-
umentation at: http://www.cisco.com/c/en/us/td/docs/switches/datacenter/aci/apic/sw/2-x/
virtualization/b_ACI_Virtualization_Guide_2_2_1.html.
• You have conceptual knowledge of Microsoft Windows Azure Pack. See the product documen-
tation at: https://www.microsoft.com/en-in/cloud-platform/windows-azure-pack.
• You have installed NetScaler appliance software release 11.1 or later.
• You configure NetScaler appliances in Cisco ACI, so that they can be managed by using Cisco
APIC.
• From Cisco APIC, make sure that:
– Management connectivity of Cisco APIC to NetScaler appliance are established.
– You upload the NetScaler appliance device package version 11.1-52.3 and register the
NetScaler appliance device in Cisco ACI by using Cisco APIC.
– You configure the NetScaler appliance in Cisco APIC’s common tenant and make sure that
there are no faults in Cisco APIC.
– You have configured all the APIC specific configurations such as, VLAN pool, L3OutServicesDom,
L3ExtOUt, resource pool, and so on. For more information, see Cisco documentation.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The Service Management Portal in WAP allows an administrator to register Cisco APIC with WAP and
also create a hosting plan. As part of the plan, you can specify the VIP range, associate the NetScaler
appliance load balancer with the plan, create tenant user accounts, and so on.
3. In the plans pane, select the plan that you want to add a load balancer.
5. On the Networking (ACI) pane, in the L4-L7 SERVICE POOL drop-down list, select the L4-L7
resource pool that you had created in Cisco APIC.
6. Create a tenant user account and associate the user with the plan you have created.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In WAP, once the Tenant creates the Bride Domain (BD), VRF, and a Network, the Tenant can configure
NetScaler appliance Load Balancer through the Service Management Portal (Tenant Portal).
To configure NetScaler appliance Load Balancer in Service Management Portal (Tenant Portal)
b. Click NEW.
d. In the BRIDGE DOMAIN field, enter the bridge domain name (for example, BD01).
e. (Optional) In the SUBNET’S GATEWAY field, enter the subnet’s gateway (for example,
192.168.1.1/24).
f. In the VRF field, select a VRF that is already part of the subscription or select Create One to
create a VRF.
g. Click CREATE.
3. Create a network and associate it with the bridge domain that you created. Do the following:
b. Click NEW.
d. In the NETWORK NAME field, enter the network name (for example, S01).
e. In the BRIDGE DOMAIN drop-down list, select the bridge domain you have created. (for
example, BD01).
f. In the subnet’s GATEWAY field, enter the subnet’s gateway address (for example, 172.23.2.1/24).
g. (Optional) In the DNS SERVER IP/IPS field, enter the DNS server details.
h. Click CREATE.
5. Double-click the network that you have created. Then, in the network pane, select Enable load
balancer (public). In the IP ADDRESS field, a VIP is automatically assigned from the VIP Range that
the administrator configured in the Admin Portal. For more information, see [Creating a NetScaler
appliance Load Balancer to a Plan in Service Management Portal (Admin Portal)].
6. Double-click the network that you have created. Then, in the network pane, select Enable load
balancer (public). In the IP ADDRESS field, a VIP is automatically assigned from the VIP Range that
the administrator configured in the Admin Portal. For more information, see [Creating a NetScaler
appliance Load Balancer to a Plan in Service Management Portal Admin Portal]
6. In the network pane, select the Load Balancers tab, and click ADD.
a. In the NAME field, enter the name for the load balancer.
b. Optionally, in the VIRTUAL IP ADDRESS field, assign the load balancer a VIP address from the
VIP range that you defined earlier.
8. Click CREATE.
The NetScaler appliance Load Balancer is displayed in the LOAD BALANCERS tab and the
NetScaler appliance Load Balancer is data path ready.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Using Service Management Portal (Tenant Portal), from the Network, you can delete the NetScaler
appliance load balancer that you created.
3. In the ACI pane, on the NETWORKS tab, click the network that you created.
4. In the selected network’s pane, select the NetScaler appliance load balancer and click DELETE.
1.
2. Citrix ADC
3. NetScaler 12.0
March 7, 2019
Contributed by:
C
The NetScaler VPX product is a virtual appliance that can be hosted on a wide variety of virtualization
and cloud platforms:
• Citrix XenServer
• VMware ESX
• Microsoft Hyper-V
• Linux KVM
For more information about provisioning a Citrix ADC VPX instance on an SDX appliance, see Provi-
sioning Citrix ADC instances.
NetScaler Management and Analytics Service (MAS) is a centralized management solution that simpli-
fies operations by providing administrators with enterprise-wide visibility and automating manage-
ment jobs that need to be executed across multiple instances.
You can manage and monitor NetScaler VPX instances as well as other Citrix application networking
products such as Citrix Gateway, NetScaler SDX, NetScaler CPX, and Citrix SD-WAN. You can use MAS to
manage, monitor, and troubleshoot the entire global application delivery infrastructure from a single,
unified console.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
This document lists the different hypervisors and features supported on a NetScaler VPX instance as
well as the limitations and usage guidelines that apply.
6.5, 7.0,7.1 450000 VPX 10, VPX 25, VPX 200, VPX
1000, VPX 3000, VPX 5000,
VPX 8000, VPX 10G, VPX 15G,
VPX 25G, VPX 40G
6.0, build numbers 3620759, 450010 VPX 10, VPX 25, VPX 200, VPX
5050593 (supported from 1000, VPX 3000, VPX 5000,
NetScaler release 12.0 build VPX 8000, VPX 10G, VPX 15G,
51.x onwards) 6765062 VPX 25G, VPX 40G, VPX 100G
(supported from NetScaler
release 12.0 build 56.20
onwards). 6.5, build numbers
4564106 and patch 7967591
2012, 2012R2 450020 VPX 10, VPX 25, VPX 200, VPX
1000, VPX 3000, VPX 8000
RHEL 7.3, Ubuntu 16.04 450070 VPX 10, VPX 25, VPX 200, VPX
1000, VPX 3000, VPX 5000,
VPX 8000, VPX 10G, VPX 15G.
VPX 25G, VPX 40G, VPX 100G
Note: The VPX instance is qualified for hypervisor release versions mentioned in table 1–4, and
not for patch releases within a version. However, the VPX instance is expected to work seamlessly
with patch releases of a supported version. If it does not, log a support case for troubleshooting
and debugging.
*Clustering support is available on SRIOV for client- and server-facing interfaces and not for the back-
plane.
For Static LA, traffic might still be sent on the interface whose physical status is DOWN.
For LACP, peer device knows interface DOWN event based on LACP timeout mechanism.
For Dynamic routing, convergence time depends on the Routing Protocol since link events are not
detected.
Monitored static Route functionality fails if monitors are not bound to static routes since Route state
depends on the VLAN status. The VLAN status depends on the link status.
Partial failure detection does not happen in high availability if there is link failure. High availability-
split brain condition might happen if there is link failure.
***When any link event (disable/enable, reset) is generated from a VPX instance, the physical status of
the link does not change. For static LA, any traffic initiated by the peer gets dropped on the instance.
For LACP, peer device knows interface DOWN event based on LACP timeout mechanism.
On the VMware ESX, set the port group’s VLAN ID to 1–4095 on the vSwitch of VMware ESX server. For
more information about setting a VLAN ID on the vSwitch of VMware ESX server, see pdf.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
To install VPX instances on Citrix XenServer, you must first install XenServer on a machine with ade-
quate system resources. To perform the NetScaler VPX instance installation, you use Citrix XenCenter,
which must be installed on a remote machine that can connect to the XenServer host through the
network.
The following figure shows the bare-metal solution architecture of NetScaler VPX instance on
XenServer.
• Install XenServer version 6.0 or later on hardware that meets the minimum requirements.
• Install XenCenter on a management workstation that meets the minimum system requirements.
• Obtain virtual appliance license files. For more information about virtual appliance licenses,
see the NetScaler VPX Licensing Guide at http://support.citrix.com/article/ctx122426.
The following table describes the minimum hardware requirements for a XenServer platform running
a NetScaler VPX instance.
Table 1. Minimum system requirements for XenServer running a nCore VPX instance
Component Requirement
Component Requirement
For information about installing XenServer, see the XenServer documentation at http://support.citrix.
com/product/xens/.
The following table lists the virtual computing resources that XenServer must provide for each nCore
VPX virtual appliance.
Table 2. Minimum virtual computing resources required for running a ncore VPX instance
Component Requirement
Memory 2 GB
Virtual CPU (VCPU) 2
Virtual network interfaces 2
XenCenter is a Windows client application. It cannot run on the same machine as the XenServer host.
For more information about minimum system requirements and installing XenCenter, see the follow-
ing XenServer documents:
• System requirements
• Install
After you have installed and configured XenServer and XenCenter, you can use XenCenter to install
virtual appliances on XenServer. The number of virtual appliances that you can install depends on
the amount of memory available on the hardware that is running XenServer.
After you have used XenCenter to install the initial NetScaler VPX instance (.xva image) on XenServer,
you have the option to use Command Center to provision NetScaler VPX instance. For more informa-
tion, see the Command Center documentation.
To install NetScaler VPX instances on XenServer by using XenCenter, follow these steps:
Note
After the initial configuration of the VPX instance, if you want to upgrade the appliance to the
latest software release, see Upgrading or Downgrading the System Software.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
After you have installed and configured a NetScaler VPX instance on XenServer, you can configure the
virtual appliance to use SR-IOV network interfaces.
Limitations
• L2 mode switching
• Clustering
• Admin partitioning [Shared VLAN mode]
• High Availability [Active - Active mode]
• Jumbo frames
• IPv6 protocol in Cluster environment
Prerequisites
• Add the Intel 82599 Network Interface Card (NIC) to the host.
• Blacklist the ixgbevf driver by adding the following entry to the /etc/modprobe.d/blacklist.conf
file:
blacklist ixgbevf
• Enable SR-IOV Virtual Functions (VFs) by adding the following entry to the /etc/mod-
probe.d/ixgbe file:
options ixgbe max_vfs=<number_of_VFs>
where <number_VFs> is the number of SR-IOV VFs that you want to create.
• Verify that SR-IOV is enabled in BIOS.
Assign SR-IOV VFs to the VPX instance by using the XenServer host
To assign SR-IOV network interfaces to NetScaler VPX instance, follow these steps:
1. On the XenServer host, use the following command to assign the SR-IOV VFs to the NetScaler VPX
instance:
Where:
• <Xen host UUID> is the UUID of the XenServer host.
• <Netscalar VM UUID> is the UUID of the NetScaler VPX instance.
• <interface name> is the interface for the SR-IOV VFs.
• <mac addr > is the mac address of the SR-IOV VF.
Note
Specify the mac address that you want use in the args:mac= parameter, if not specified, the iovirt
script randomly generates and assigns a mac address. Also, if you want use the SR-IOV VFs in Link
Aggregation mode, make sure that you specify the mac address as 00:00:00:00:00:00.
Unassign SR-IOV VFs to the VPX instance by using the XenServer host
If you have assigned an incorrect SR-IOV VFs or if you want modify the a assigned SR-IOV VFs, you need
to unassign and reassign the SR-IOV VFs to the NetScaler VPX instance.
To unassign SR-IOV network interface assigned to a NetScaler VPX instance, follow these steps:
1. On the XenServer host, use the following command to assign the SR-IOV VFs to the NetScaler VPX
instance and reboot the NetScaler VPX instance:
xe host-call-plugin plugin=iovirt host-uuid=<Xen_host_UUID> fn=unassign_all args:uuid=<Netscalar_VM_UUID>
Where:
• <Xen_host_UUID> - The UUID of the XenServer host.
• <Netscalar_VM_UUID> - The UUID of the NetScaler VPX instance
2. Boot the NetScaler VPX instance.
Important
While you are assigning the SR-IOV VFs to the NetScaler VPX instance, make sure that you specify
MAC address 00:00:00:00:00:00 for the VFs.
To use the SR-IOV virtual functions in link aggregation mode, you need to disable spoof checking for
virtual functions that you have created. On the XenServer host, use the following command to disable
spoof checking:
ip link set <interface_name> vf <VF_id> spoofchk off
Where:
After disabling spoof checking for all the Virtual Function that you have created, restart the NetScaler
VPX instance and configure link aggregation. For instructions, see Configure link aggregation.
You can configure VLAN on the SR-IOV Virtual Functions, for instructions, see Configuring a VLAN.
Important
Make sure that the XenServer host does not contain VLAN settings for the VF interface.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Before installing
NetScaler VPX instances on VMware ESX, make sure that VMware ESX Server is installed on a machine
with adequate system resources. To install a NetScaler VPX instance on VMware ESXi
, you use VMware vSphere client. The client or tool must be installed on a remote machine that can
connect to VMware ESX through the network.
Important
You cannot install standard VMware Tools or upgrade the VMware Tools version available on a
NetScaler VPX instance. VMware Tools for a NetScaler VPX instance are delivered as part of the
NetScaler software release.
Prerequisites
• Install VMware Client on a management workstation that meets the minimum system require-
ments.
• Download the NetScaler VPX appliance setup files.
• Label the physical network ports of VMware ESX.
• Obtain VPX license files. For more information about NetScaler VPX instance licenses, see
the NetScaler VPX Licensing Guide at http://support.citrix.com/article/ctx131110.
The following table describes the minimum system requirements for VMware ESX servers running
NetScaler VPX ncore virtual appliance.
Table 1. Minimum system requirements for a VMware ESX server running a NetScaler VPX instance
Component Requirement
The following table lists the virtual computing resources that the VMware ESX server must provide for
each VPX ncore virtual appliance.
Table 2. Minimum virtual computing resources required for running a NetScaler VPX instance
Component Requirement
Memory 2 GB
Virtual CPU (VCPU) 2
Component Requirement
Virtual network interfaces 1. Note that with ESX, you can install a
maximum of 10 virtual network interfaces if the
VPX hardware is upgraded version to 7 or
higher.
Disk space 20 GB
Note that this is in addition to any disk requirements for the hypervisor.
For production use of VPX virtual appliance, the full memory allocation must be reserved. CPU cycles
(in MHz) equal to at least the speed of one CPU core of the ESX should also be reserved.
VMware vSphere is a client application that can run on Windows and Linux operating systems. It can-
not run on the same machine as the VMware ESX server. The following table describes the minimum
system requirements.
Component Requirement
OVF Tool is a client application that can run on Windows and Linux systems. It cannot run on the same
machine as the VMware ESX server. The following table describes the minimum system requirements.
Component Requirement
For information about installing OVF, search for the “OVF Tool User Guide” PDF file at http:
//kb.vmware.com/.
The NetScaler VPX instance setup package for VMware ESX follows the Open Virtual Machine (OVF)
format standard. You can download the files from MyCitrix.com. You need a My Citrix account to log
on. If you do not have a My Citrix account, access the home page at http://www.mycitrix.com, click
the New Users link, and follow the instructions to create a new My Citrix account.
Once logged on, navigate the following path from the My Citrix home page:
Copy the following files to a workstation on the same network as the ESX server. Copy all three files
into the same folder.
Before installing a VPX virtual appliance, label of all the interfaces that you plan to assign to virtual ap-
pliances, in a unique format, for example, NS_NIC_1_1, NS_NIC_1_2, and so on. In large deployments,
labeling in a unique format helps in quickly identifying the interfaces that are allocated to the VPX
virtual appliance among other interfaces used by other virtual machines, such as Windows and Linux.
Such labeling is especially important when different types of virtual machines share the same inter-
faces.
To label the physical network ports of VMware ESX server, follow these steps:
After you have installed and configured VMware ESX, you can use the VMware vSphere client to install
virtual appliances on the VMware ESX server. The number of virtual appliances that you can install
depends on the amount of memory available on the hardware that is running VMware ESX.
To install NetScaler VPX instances on VMware ESX by using VMware vSphere Client, follow these steps:
Note
After the installation, you can use vSphere client or vSphere Web Client to manage virtual appliances
on VMware ESX.
For the VLAN tagging feature to work,on the VMware ESX, set the port group’s VLAN ID to 1 -
4095 on the VSwitch of VMware ESX server. For more information about setting a VLAN ID on
the VSwitch of VMware ESX server, see http://www.vmware.com/pdf/esx3_vlan_wp.pdf.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
After you have installed and configured the NetScaler VPX instance on the VMware ESX, you can use
the VMware vSphere web client to configure the virtual appliance to use VMXNET3 network interfaces.
To configure NetScaler VPX instances to use VMXNET3 network interfaces by using the VMware vSphere
Web Client:
2. Upgrade the Compatibility setting of the NetScaler VPX instance to ESX, as follows:
b. Right-click the NetScaler VPX instance and select Compatibility > Upgrade VM Compatibility.
c. In the Configure VM Compatibility dialog box, select ESXi 5.5 and later from the Compatible
with drop-down list and click OK.
4. In the <virtual_appliance> - Edit Settings dialog box, click the CPU section.
- Number of CPUs
- Number of Sockets
- Reservations
- Limit
- Shares
a. In the CPU drop-down list, select the number of CPUs to assign to the virtual appliance.
b. In the Cores per Socket drop-down list, select the number of sockets.
c. (Optional) In the CPU Hot Plug field, select or unselect the Enable CPU Hot Add checkbox.
d. In the Reservation drop-down list, select the number that is shown as the maximum value.
e. In the Limit drop-down list, select the number that is shown as the maximum value.
f. In the Shares drop-down lists, select Custom and the number that is shown as the maximum value.
- Size of RAM
- Reservations
- Limit
- Shares
a. In the RAM drop-down list, select the size of the RAM. It should be number of vCPUs x 2 GB. For
example, if the number of vCPUs is 4, the RAM should be 4 x 2 GB = 8 GB.
Note: For an Enterprise or Platinum edition of the NetScaler VPX appliance, make sure that you al-
locate 4 GB of RAM to each vCPU. For example, if the number of vCPU is 4 then RAM = 4 x 4 GB = 16
GB.
b. In the Reservation drop-down list, enter the value for the memory reservation, and select the Re-
serve all guest memory (All locked) checkbox. The memory reservation should be the number of vC-
PUs x 2 GB. For example, if the number of vCPUs is 4, the memory reservation should be 4 x 2 GB = 8
GB.
Note: For an Enterprise or Platinum edition of the NetScaler VPX appliance, make sure that you al-
locate 4 GB of RAM to each vCPU. For example, if the number of vCPU is 4 then RAM = 4 x 4 GB = 16
GB.
c. In the Limit drop-down list, select the number that is shown as the maximum value.
d. In the Shares drop-down lists, select Custom and the number that is shown as the maximum value.
7. Add a VMXNET3 network interface. From the New device drop-down list, select Network and
click Add.
8. In the New Network section, from the drop-down list, select the network interface, and do the
following:
The default E1000 network interface and VMXNET3 cannot coexist, make sure that you remove
the E1000 network interface and use VMXNET3 (0/1) as the management interface.
9. Click OK.
11. Once the NetScaler VPX instance powers on, you can use the following command to verify the
configuration:
The output should show all the interfaces that you configured:
Note
After you add a VMXNET3 interface and restart the NetScaler VPX appliance, the VMWare ESX hy-
pervisor might change the order in which the NIC is presented to the VPX appliance. So, network
adapter 1 might not always remain 0/1, resulting in loss of management connectivity to the VPX
appliance. To avoid this issue, change the virtual network of the network adapter accordingly.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
After you have installed and configured the NetScaler VPX instance on VMware ESX, you can use the
VMware vSphere web client to configure the virtual appliance to use single root I/O v irtualization (SR-
IOV) network interfaces.
Limitations
A NetScaler VPX configured with SR-IOV network interface has the following limitations:
• The following features are not supported on SR-IOV interfaces using Intel 82599 10G NIC on ESX
VPX:
– L2 mode switching
– Static Link Aggregation and LACP
– Clustering
– Admin partitioning [Shared VLAN mode]
– High Availability [Active - Active mode]
– Jumbo frames
– IPv6
• The following features are not supported for on SR-IOV interface with an Intel 82599 10G NIC on
KVM VPX:
– Static Link Aggregation and LACP
– L2 mode switching
– Clustering
– Admin partitioning [Shared VLAN mode]
– High Availability [Active – Active mode]
– Jumbo frames
– IPv6
– VLAN configuration on Hypervisor for SR-IOV VF interface through “ip link” command is not
supported
Prerequisite
- Add the Intel 82599 Network Interface Card (NIC) to the ESX Host. IXGBE driver version 3.7.13.7.14iov is
recommended.
2. On the Manage > Networking tab, select Physical adapters. The SR-IOV Status field shows
whether a physical adapter supports SR-IOV.
3. Select the physical adapter, and then click the pencil icon to open the Edit Settings dialog box.
5. In the Number of virtual functions field, enter the number of virtual functions that you want to
configure for the adapter.
6. Click OK.
7. Restart the host.
- Create a Distributed Virtual Switch (DVS) and Portgroups. For instructions, see the VMware Documen-
tation.
Note
Citrix has qualified the SR-IOV configuration on DVS and Portgroups only.
To configure NetScaler VPX instances to use SR-IOV network interface by using VMware vSphere
Web Client:
2. Upgrade the Compatibility setting of the NetScaler VPX instance to ESX 5.5 or later, as follows:
b. Right-click the NetScaler VPX instance and select Compatibility > Upgrade VM Compatibility.
c. In the Configure VM Compatibility dialog box, select ESXi 5.5 and later from the Compatible
with drop-down list and click OK.
4. In the <virtual_appliance> - Edit Settings dialog box, click the CPU section.
- Number of CPUs
- Number of Sockets
- Reservations
- Limit
- Shares
a. In the CPU drop-down list, select the number of CPUs to assign to the virtual appliance.
b. In the Cores per Socket drop-down list, select the number of sockets.
c. (Optional) In the CPU Hot Plug field, select or clear the Enable CPU Hot Add check box.
d. In the Reservation drop-down list, select the number that is shown as the maximum value.
e. In the Limit drop-down list, select the number that is shown as the maximum value.
f. In the Shares drop-down lists, select Custom and the number that is shown as the maximum
value.
- Size of RAM
- Reservations
- Limit
- Shares
a. In the RAM drop-down list, select the size of the RAM. It should be number of vCPUs x 2 GB. For
example, if the number of vCPU is 4 then RAM = 4 x 2 GB = 8 GB.
Note: For Enterprise or Platinum edition of the NetScaler VPX appliance, make sure that you allocate 4
GB of RAM to each vCPU. For example, if the number of vCPU is 4 then RAM = 4 x 4 GB = 16 GB.
b. In the Reservation drop-down list, enter the value for the memory reservation, and select
the Reserve all guest memory (All locked) check box. The memory reservation should be number
of vCPUs x 2 GB. For example, if the number of vCPUs is 4, the memory reservation should be 4 x 2 GB
= 8 GB.
Note: For Enterprise or Platinum edition of the NetScaler VPX appliance, make sure that you allocate 4
GB of RAM to each vCPU. For example, if the number of vCPU is 4 then RAM = 4 x 4 GB = 16 GB.
c. In the Limit drop-down list, select the number that is shown as the maximum value.
d. In the Shares drop-down lists, select Custom, and select the number that is shown as the
maximum value.
7. Add an SR-IOV network interface. From the New device drop-down list, select Network and click
Add.
8. In the New Network section. From the drop-down list, select the Portgroup that you created,
and do the following:
a. In the Adapter Type drop-down list, select SR-IOV passthrough.
b. In the Physical function drop-down list, select the physical adapter mapped with the Port-
group.
9. In the <virtual_appliance> - Edit Settings dialog box, click the VM Options tab.
10. On the VM Options tab, select the Advanced section. From the Latency Sensitivity drop-down
list, select High.
13. Once the NetScaler VPX instance powers on, you can use the following command to verify the con-
figuration:
The output should show all the interfaces that you configured:
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
You can configure your exiting NetScaler VPX instances that use E1000 network interfaces to use SR-
IOV or VMXNET3 network interfaces.
To configure an existing NetScaler VPX instance to use SR-IOV network interfaces, see Configuring
NetScaler VPX instances to use Single Root I/O Virtualization (SR-IOV) Network Interface.
To configure an existing NetScaler VPX instance to use VMXNET3 network interfaces, see Configuring
NetScaler VPX instances to use VMXNET3 Network Interface.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Overview
After you have installed and configured a NetScaler VPX instance on VMware ESX Server, you can use
the vSphere Web Client to configure the virtual appliance to use PCI passthrough network interfaces.
The PCI passthrough feature allows a guest virtual machine to directly access physical PCI and PCIe
devices connected to a host.
Prerequisites
• The firmware version of the Intel XL710 NIC on the host is 5.04.
• A PCI passthrough device connected to and configured on the host
• Supported NICs:
– Intel X710 10G NIC
– Intel XL710 Dual Port 40G NIC
– Intel XL710 Single Port 40G NIC
Before configuring a passthrough PCI device on a virtual machine, you should configure it on the host
machne. Follow these steps to configure passthrough devices on a host.
1. Select the host from the Navigator panel of the vSphere Web Client.
2. Click Manage > Settings > PCI Devices. All available passthrough devices are displayed.
3. Right-click the device that you want to configure and click Edit.
4. The Edit PCI Device Availability window appears.
5. Select the devices to be used for passthrough and click OK.
Follow these steps to configure a passthrough PCI device on a NetScaler VPX instance.
4. Expand New PCI device and select the passthrough device to connect to the virtual machine
from the drop-down list and click OK.
Note
VMXNET3 network interface and PCI Passthrough Network Interface cannot coexist.
You have completed the steps to configuring NetScaler VPX to use PCI passthrough network interfaces.
1.
2. Citrix ADC
3. NetScaler 12.0
March 6, 2019
Contributed by:
C
To install Citrix
NetScaler VPX instances on Microsoft Windows Server, you must first install Windows Server, with the
Hyper-V role enabled, on a machine with adequate system resources. While installing the Hyper-V
role, be sure to specify the network interface cards (NICs) on the server that Hyper-V will use to create
the virtual networks. You can reserve some NICs for the host. Use Hyper-V Manager to perform the
NetScaler VPX instance installation.
NetScaler VPX instance for Hyper-V is delivered in virtual hard disk (VHD) format. It includes the de-
fault configuration for elements such as CPU, network interfaces, and hard-disk size and format. After
you install NetScaler VPX instance, you can configure the network adapters on virtual appliance, add
virtual NICs, and then assign the NetScaler IP address, subnet mask, and gateway, and complete the
basic configuration of the virtual appliance.
After the initial configuration of the VPX instance, if you want to upgrade the appliance to the latest
software release, see Upgrade a NetScaler VPX standalone appliance
Note
• Enable the Hyper-V role on Windows Servers . For more information, see http://technet.
microsoft.com/en-us/library/ee344837(WS.10).aspx.
• Download the virtual appliance setup files.
• Obtain NetScaler VPX instance license files. For more information about NetScaler VPX instance
licenses, see the NetScaler VPX Licensing Guide at http://support.citrix.com/article/ctx131110.
The following table describes the minimum system requirements for Microsoft Servers.
Component Requirement
The following table lists the virtual computing resources for each
NetScaler VPX instance.
Table 2. Minimum virtual computing resources required for running a NetScaler VPX instance
Component Requirement
RAM 2 GB
Virtual CPU 2
Disk Space 20 GB
Component Requirement
NetScaler VPX instance for Hyper-V is delivered in virtual hard disk (VHD) format. You can download
the files from MyCitrix.com. You will need a My Citrix account to log on. If you do not have a My Citrix
account, access the home page at http://www.mycitrix.com, click the New Users link, and follow the
instructions to create a new My Citrix account.
To download the NetScaler VPX instance setup files, follow these steps:
3. Click Downloads.
After you have enabled the Hyper-V role on Microsoft Server and extracted the virtual appliance files,
you can use Hyper-V Manager to install NetScaler VPX instance. After you import the virtual machine,
you need to configure the virtual NICs by associating them to the virtual networks created by Hyper-V.
You can configure a maximum of eight virtual NICs. Even if the physical NIC is DOWN, the virtual ap-
pliance assumes that the virtual NIC is UP, because it can still communicate with the other virtual
appliances on the same host (server).
Note
You cannot change any settings while the virtual appliance is running. Shut down the virtual
appliance and then make changes.
1. To start Hyper-V Manager, click Start, point to Administrative Tools, and then click Hyper-V
Manager.
2. In the navigation pane, under Hyper-V Manager, select the server on which you want to install
NetScaler VPX instance.
Important
Make sure that you extract the files to a different folder in step 4.
Auto-provisioning of NetScaler VPX instance is optional. If auto-provisioning is not done, the virtual
appliance provides an option to configure the IP address and so on.
1. Create an ISO9660 compliant ISO image using the xml file as depicted in the example. Make sure
that the name of the xml file is userdata.
<Environment xmlns:oe=”http://schemas.dmtf.org/ovf/environment/1”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
oe:id=””
xmlns=”http://schemas.dmtf.org/ovf/environment/1”>
<PlatformSection>
<Kind>HYPER-V</Kind>
<Version>2013.1</Version>
<Vendor>CISCO</Vendor>
<Locale>en</Locale>
</PlatformSection>
<PropertySection>
</Environment>
3. Select the virtual appliance that you imported, and then on the Action menu, select Settings. You
can also select the virtual appliance and then right click and select Settings. The Settings window
for the selected virtual appliance is displayed.
4. In the Settings window, under the hardware section, click on IDE Controller.
5. In the right window pane, select DVD Drive and click on Add. The DVD Drive is added under the IDE
Controller section in the left window pane.
6. Select the DVD Drive added in step 5. In the right window pane, select the Image file radio button
and click on Browse and select the ISO image that you copied on Hyper-V server,
in step 2.
7. Click Apply.
Note
• The DVD drive is attached and the ISO file is not provided.
• The ISO file does not inculde the userdata file.
• The userdata file name or format is not correct.
To configure virtual NICs on the NetScaler VPX instance, follow these steps:
1. Select the virtual appliance that you imported, and then on the Action menu, select Settings.
2. In the Settings for <virtual appliance name> dialog box, click Add Hardware in the left pane.
3. In the right pane, from the list of devices, select Network Adapter.
4. Click Add.
5. Verify that Network Adapter (not connected) appears in the left pane.
6. Select the network adapter in the left pane.
7. In the right pane, from the Network drop-down list, select the virtual network to connect the
adapter to.
8. To select the virtual network for additional network adapters that you want to use, repeat
steps 6 and 7.
9. Click Apply, and then click OK.
1. Right-click the virtual appliance that you previously installed, and then select Start.
2. Access the console by double-clicking the virtual appliance.
3. Type the NetScaler IP address, subnet mask, and gateway for your virtual appliance.
You have completed the basic configuration of your virtual appliance. Type the IP address in a Web
browser to access the virtual appliance.
Note
You can also use virtual machine (VM) template to provision NetScaler VPX instance using SCVMM.
If you use Microsoft Hyper-V NIC teaming solution with NetScaler VPX instances, see article
CTX224494 for more information.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
To set up a NetScaler VPX for the Linux-KVM platform, you can use the graphical Virtual Machine Man-
ager (Virt-Manager) application. If you prefer the Linux-KVM command line, you can use the virsh pro-
gram.
The host Linux operating system must be installed on suitable hardware by using virtualization tools
such as KVM Module and QEMU. The number of virtual machines (VMs) that can be deployed on the
hypervisor depends on the application requirement and the chosen hardware.
After you provision a NetScaler VPX instance, you can add additional interfaces.
General recommendations
• Do not change the MTU of the vnet interface associated with the VPX VM. Shut down the VPX VM
before modifying any configuration parameters, such as Interface modes or CPU.
• Do not force a shutdown of the VPX VM. That is, do not use the Force off command.
• Any configurations done on the host Linux might or might not be persistent, depending on your
Linux distribution settings. You can choose to make these configurations persistent to ensure
consistent behavior across reboots of host Linux operating system.
• The NetScaler package has to be unique for each of the NetScaler VPX instance provisioned.
Limitations
1.
2. Citrix ADC
3. NetScaler 12.0
December 5, 2018
Contributed by:
C
Check the minimum system requirements for a Linux-KVM serves running a NetScaler VPX instance.
CPU requirement:
• 64-bit x86 processors with the hardware virtualization features included in the AMD-V and Intel
VT-X processors.
To test whether your CPU supports Linux host, enter the following command at the host Linux shell
prompt:
1 *.egrep’^flags.*(vmx|svm)’/proc/cpuinfo*
If the BIOS settings for the above extension are disabled, you must enable them in BIOS.
• There is no specific recommendation for processor speed, but higher the speed, the better the
performance of the VM application.
Minimum 4 GB for the host Linux kernel. Add additional memory as required by the VMs.
Calculate the space for Host Linux kernel and VM requirements. A single NetScaler VPX VM requires 20
GB of disk space.
Software requirements
The Host kernel used must be a 64-bit Linux kernel, release 2.6.20 or later, with all virtualization tools.
Citrix recommends newer kernels, such as 3.6.11-4 and later.
Many Linux distributions such as Red Hat, Centos, and Fedora, have tested kernel versions and asso-
ciated virtualization tools.
NetScaler VPX supports IDE and virtIO hard disk type. The Hard Disk Type has been configured in the
XML file, which is a part of the NetScaler package.
Networking requirements
NetScaler VPX supports virtIO para-virtualized, SR-IOV, and PCI Passthrough network interfaces.
• Provision the NetScaler VPX instance by using the Virtual Machine Manager
• Configure a NetScaler VPX instance to use SR-IOV network interfaces
• Configure a NetScaler VPX instance to use PCI passthrough network interfaces
The source device type can be either Bridge or MacVTap. In case of MacVTap, four modes are possible
- VEPA, Bridge, Private and Pass-through.
Check the types of interfaces that you can use and the supported traffic types, as given below.
Bridge:
• Linux Bridge.
• Ebtables and iptables settings on host Linux might filter the traffic on the bridge if you do not
choose the correct setting or disable IPtable services.
Note: For best performance by the VPX instance, ensure that the gro and lro capabilities are
switched off on the source interfaces.
Make sure that you switch off the generic-receive-offload (gro) and large-receive-offload (lro) capabil-
ities of the source interfaces. To switch off the gro and lro capabilities, run the following commands
at the host Linux shell prompt.
Example:
12
13 udp-fragmentation-offload: off
14
15 generic-segmentation-offload: on
16
17 generic-receive-offload: off
18
19 large-receive-offload: off
20
21 rx-vlan-offload: on
22
23 tx-vlan-offload: on
24
25 ntuple-filters: off
26
27 receive-hashing: on
28
29 [root@localhost ~]#
Example:
If the host Linux bridge is used as a source device, as in the following example, gro and lro capabilities
must be switched off on the vnet interfaces, which are the virtual interfaces connecting the host to the
guest VMs.
In the above example, the two virtual interfaces are derived from the eth6_br and are represented
as vnet0 and vnet2. Run the following commands to switch off gro and lro capabilities on these inter-
faces.
Promiscuous mode
The promiscuos mode has to be enabled for the following features to work:
• L2 mode
• Multicast traffic processing
• Broadcast
• IPV6 traffic
• VMAC
• Dynamic routing
Module required
For better network performance, make sure the vhost_net module is present in the Linux host. To
check the existence of vhost_net module, run the following command on the Linux host :
If vhost_net is not yet running, enter the following command to run it:
1 modprobe vhost\_net
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can provision a NetScaler VPX instance in an Openstack environment either by using the Nova
boot command (OpenStack CLI) or Horizon (OpenStack dashboard) .
Provisioning a VPX instance, optionally involves using data from the config drive. Config drive is a spe-
cial configuration drive that attaches to the instance as a CD-ROM device when it boots. This configu-
ration drive can be used to pass networking configuration such as management IP address, network
mask, default gateway, and to inject customer scripts.
In a NetScaler appliance, the default authentication mechanism is password based. Now, SSH key-
pair authentication mechanism is supported for NetScaler VPX instances on OpenStack environment.
The key-pair (public key and private key) needs to be generated before using Public Key Cryptography
mechanism. You can use different mechanisms, such as Horizon, Puttygen.exe for Windows, and ssh-
keygen for Linux environment, to generate the key pair. Refer to online documentation of respective
mechanisms for more information about generating key pair.
Once a key pair is available, copy the private key to a secure location to which authorized persons
will have access. In OpenStack, public key can be deployed on a VPX instance by using Horizon or
Nova boot command. When a VPX instance is provisioned by using OpenStack, it first detects that
the instance is booting in an OpenStack environment by reading a specific BIOS string. This string is
“OpenStack Foundation” and for Red Hat Linux distributions it is stored in /etc/nova/release. This is
a standard mechanism that is available in all OpenStack implementations based on KVM hypervisor
platform. The drive should have a specific OpenStack label.
If the config drive is detected, the instance attempts to read the network configuration, custom scripts,
and SSH key pair if provided.
Userdata file
The NetScaler VPX instance uses a customized OVF file, also known as userdata file, to inject network
configuration, custom scripts. This file is provided as part of config drive. Here is an example of a
customized OVF file.
5 xmlns=”http://schemas.dmtf.org/ovf/environment/1”
6 xmlns:cs=”http://schemas.citrix.com/openstack”>
7 <PlatformSection>
8 <Kind></Kind>
9 <Version>2016.1</Version>
10 <Vendor>VPX</Vendor>
11 <Locale>en</Locale>
12 </PlatformSection>
13 <PropertySection>
14 <Property oe:key=”com.citrix.netscaler.ovf.version” oe:value=”1.0”/>
15 <Property oe:key=”com.citrix.netscaler.platform” oe:value=”NSVPX”/>
16 <Property oe:key=”com.citrix.netscaler.orch_env” oe:value=”openstack-
orch-env”/>
17 <Property oe:key=”com.citrix.netscaler.mgmt.ip” oe:value=”10.1.2.22”/>
18 <Property oe:key=”com.citrix.netscaler.mgmt.netmask” oe:value=”
255.255.255.0”/>
19 <Property oe:key=”com.citrix.netscaler.mgmt.gateway” oe:value=”10.1.2.1
”/>
20 </PropertySection>
21 <cs:ScriptSection>
22 <cs:Version>1.0</cs:Version>
23 <ScriptSettingSection xmlns=”http://schemas.citrix.com/openstack”
xmlns:i=”http://www.w3.org/2001/XMLSchema-instance”>
24 <Scripts>
25 <Script>
26 <Type>shell</Type>
27 <Parameter>X Y</Parameter>
28 <Parameter>Z</Parameter>
29 <BootScript>before</BootScript>
30 <Text>
31 #!/bin/bash
32 echo ”Hi, how are you” $1 $2 >> /var/sample.txt
33 </Text>
34 </Script>
35 <Script>
36 <Type>python</Type>
37 <BootScript>after</BootScript>
38 <Text>
39 #!/bin/python
40 print(”Hello”);
41 </Text>
42 </Script>
43 <Script>
44 <Type>perl</Type>
45 <BootScript>before</BootScript>
46 <Text>
47 !/usr/bin/perl
48 my $name = ”VPX”;
49 print ”Hello, World $name !\n” ;
50 </Text>
51 </Script>
52 <Script>
53 <Type>nscli</Type>
54 <BootScript>after</BootScript>
55 <Text>
56 add vlan 33
57 bind vlan 33 -ifnum 1/2
58 </Text>
59 </Script>
60 </Scripts>
61 </ScriptSettingSection>
62 </cs:ScriptSection>
63 </Environment>
In the OVF file above “PropertySection” is used for NetScaler networking configuration while
<cs:ScriptSection> is used to enclose all scripts. <Scripts></Scripts> tags are used to bundle all
scripts together. Each script is defined in between <Script> </Script> tags. Each script tag has
following fields/tags:
a) <Type>: Specifies value for script type. Possible values: Shell/Perl/Python/NSLCI (for NetScaler CLI
scripts)
b) <Parameter>: Provides parameters to the script. Each script can have multiple <Parameter> tags.
c) <BootScript>: Specifies script execution point. Possible values for this tag: before/after. “before”
specifies script will be executed before PE comes up. “after” specifies that the script will be executed
after PE comes up.
Note
Currently the VPX instance does not take care of sanitization of scripts. As an administrator, you
should check the validity of the script.
Not all sections need to be present. Use an empty “PropertySection” to only define scripts to
execute on first boot or an empty <cs:ScriptSection> to only define networking configuration.
After the required sections of the OVF file (userdata file) are populated, use that file to provision
the VPX instance.
Network configuration
• Management IP address
• Network mask
• Default gateway
After the parameters are successfully read, they are populated in the NetScaler configuration, to allow
managing the instance remotely. If the parameters are not read successfully or the config drive is not
available, the instance transitions to the default behavior, which is:
Customer script
The VPX instance allows to execute a custom script during initial provisioning. The appliance supports
script of type Shell, Perl, Python, and NetScaler CLI commands.
The VPX instance copies public key, available within the configuration drive as part of instance meta
data, into its “authorized_keys” file. This allows the user to access the instance with private key.
Note
When an SSH key is provided, the default credentials (nsroot/nsroot) no longer work. If password-
based access is needed, log on with the respective SSH private key and manually set a password.
Before you provision a VPX instance on OpenStack environment, extract the .qcow2 file from the .tgz
file and build
1. Extract the. qcow2 file from the .tqz file by typing the following command.
5 NSVPX-KVM-12.0-26.2_nc.qcow2
2. Build an OpenStack image using the .qcoz2 file extracted in step 1 by typing the following command.
Figure 1: The following illustration provides a sample output for the glance image-create command.
You can provision a VPX instance in two ways by using one of the options:
1. Instance Name
2. Instance Flavor
3. Instance Count
4. Instance Boot Source
5. Image Name
5. Deploy a new key pair or an existing key pair through Horizon by completing the following steps:
a) If you don’t have an existing key pair, create the key by using any existing mechanisms. If you’ve an
existing key, skip this step.
e) Click the + sign next to the Key Pair drop-down menu and provide values for shown parameters.
f) Paste public key content in Public key box, give a name to the key and click Import Key Pair.
6. Click the Post Creation tab in the wizard. In Customization Script, add the content of the userdata
file. The userdata file contains the IP address, Netmask and Gateway details, and customer scripts of
the VPX instance.
7. After a key pair is selected or imported, check config-drive option and click Launch.
3. To create an instance of a particular flavor, type the following command to choose a flavor ID/Name
of from a list:
4. To attach a NIC to a particular network, type the following command to choose a network ID from
a network list:
6 VPX-ToT
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The Virtual Machine Manager is a desktop tool for managing VM guests. It enables you to create new
VM guests and various types of storage, and manage virtual networks. You can access the graphical
console of VM guests with the built-in VNC viewer and view performance statistics, either locally or
remotely.
After installing your preferred Linux distribution, with KVM virtualization enabled, you can proceed
with provisioning virtual machines.
While using the Virtual Machine Manager to provision a NetScaler VPX instance, you have two options:
You can use two kinds of images to provision a NetScaler VPX instance:
• RAW
• QCOW2
You can convert a NetScaler VPX RAW image to a QCOW2 image and provision the NetScaler VPX in-
stance. To convert the RAW image to a QCOW2 image, type the following command:
For example:
qemu-img convert -O qcow2 NSVPX-KVM-11.1-12.5_nc.raw NSVPX-KVM-11.1-12.5_nc.qcow
Auto-provisioning is an optional feature, and it involves using data from the CDROM drive. If this fea-
ture is enabled, you need not enter the management IP address, network mask, and default gateway
of the NetScaler VPX instance during initial setup.
You need to complete the following tasks before you can auto-provision a VPX instance:
1. Create a customized Open Virtualization Format (OVF) XML file or userdata file.
2. Convert the OVF file into an ISO image by using an online application (for example PowerISO).
3. Mount the ISO image on the the KVM host by using any secure copy (SCP)-based tools.
Here’s is an example of the contents an OVF XML file, which you can use as a sample to create your file.
<Environment xmlns:oe=”http://schemas.dmtf.org/ovf/environment/1”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
oe:id=””
xmlns=”http://schemas.dmtf.org/ovf/environment/1”
xmlns:cs=”http://schemas.citrix.com/openstack”\>
<PlatformSection>
<Kind></Kind>
<Version>2016.1</Version>
<Vendor>VPX</Vendor>
<Locale>en</Locale>
</PlatformSection>
<PropertySection>
</PropertySection>
</Environment>
In the OVF XML file above, “PropertySection” is used for NetScaler networking configuration. When
you create the file, specify values for the parameters that are highlighted at the end of the example:
• Management IP address
• Netmask
• Gateway
Important
If the OVF file is not properly XML formatted, the VPX instance is assigned the default network
configuration, not the values specified in the file.
The Virtual Machine Manager enables you to provision a NetScaler VPX instancy by using a RAW image.
To provision a NetScaler VPX instance by using the Virtual Machine Manager, follow these steps:
1. Open the Virtual Machine Manager (Application > System Tools > Virtual Machine Manager)
and enter the logon credentials in the Authenticate window.
2. Click the icon or right-click localhost (QEMU) to create a new NetScaler VPX instance.
3. In the Name text box, enter a name for the new VM (for example, NetScaler-VPX).
4. In the New VM window, under “Choose how you would like to install the operating system,”
select Import existing disk image, and then and click Forward.
5. In the Provide the existing storage path field, navigate the path to the image. Choose the OS
type as UNIX and Version as FreeBSD 6.x. Then, click Forward.
6. Under Choose Memory and CPU settings select the following settings, and then click Forward:
7. Select the Customize configuration before install check box. Optionally, under Advanced op-
tions you can you can customize the MAC address. Make sure the Virt Type selected is kvm and
the Architecture selected is x86_64. Click Finish.
9. Click Apply.
10. If you want to auto-provision the VPX instance, see the section “Enabling Auto-Provisioning
by Attaching a CDROM Drive” in this document. Otherwise, click Begin Installation. After you
have provisioned the NetScaler VPX on KVM, you can add additional interfaces.
Using the Virtual Machine Manager, you can provision the NetScaler VPX instance by using a QCOW2
image.
To provision a NetScaler VPX instance by using a QCOW2 image, follow these steps:
1. Follow step 1 to step 8 in Provision the NetScaler VPX instance by using a RAW image.
Note: Ensure that you select qcow2 image in step 5 .
2. Select Disk 1 and click Advanced options.
3. Select qcow2 from the Storage format drop-down list.
1. Click Add Hardware > Storage > Device type > CDROM device.
2. Click Manage and selec the correct ISO file that you mounted in the “Prerequisites for Auto-
Provisioning a NetScaler VPX Instance” section, and click Finish. A new CDROM under Resources on
your NetScaler VPX instance is created.
3. Power on the VPX instance, and it auto-provisions with the network configuration provided in the
OVF file, as shown in the example screen capture.
4. If auto-provision fails, the instance comes up with the default IP address (192.168.100.1). In that
case, you need to complete the initial configuration manually. For more information, see Configuring
a NetScaler for the First Time.
Add additional interfaces to the NetScaler VPX instance by using Virtual Machine
Manager
After you have provisioned the NetScaler VPX instance on KVM, you can add additional interfaces.
2. Right-click the VPX instance and choose Open from the pop-up menu.
3. Click the icon in the header to view the virtual hardware details.
4. Click Add Hardware. In the Add New Virtual Hardware window, select Network from the
navigation menu.
5. In Host Device field, select the physical interface type. The host device type can be either
Bridge or MacVTap. In case of MacVTap, four modes possible are VEPA, Bridge, Private and Pass-
through.
a) For Bridge
i. Host device— Select the “Specify shared device name” option.
ii. Provide the Bridge name that is configured in the KVM host.
Note: Make sure that you have configured a Linux bridge in the KVM host, bound the
physical interface to the bridge, and put the bridge in the UP state.
iii. Device model—virtio.
iv. Click Finish.
b) For MacVTap
i. Host device—Select the physical interface from the menu.
ii. Device model—virtio.
iii. Click Finish. You can view the newly added NIC in the navigation pane.
iv. Select the newly added NIC and select the Source mode for this NIC. The available
modes are VEPA, Bridge, Private, and Passthrough. For more details on the interface
and modes, see Source Interface and Modes.
v. Click Apply.
6. If you want to auto-provision the VPX instance, see the section “Adding a Config Drive to Enable
Auto-Provisioning” in this document. Otherwise, power on the VPX instance to complete the
initial configuration manually.
Important
Interface parameter configurations such as speed, duplex, and autonegotiation are not
supported.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can use the Virtual Machine Manager to configure a NetScaler VPX instance running on Linux-KVM
to use single root I/O virtualization (SR-IOV) network interfaces with Intel 82599 10G NIC and X710 10G
and XL710 40G NICs.
Limitations
Keep the limitations in mind while using Intel 82599, X710, XL710 NICs. The following features not
supported.
• L2 mode switching
• Admin partitioning (shared VLAN mode)
• High availability (active-active mode
• Jumbo Frames.
• IPv6: You can configure only up to 30 unique IPv6 addresses in a VPX instance if you’ve alteast
one SR-IOV interface.
• VLAN configuration on Hypervisor for SRIOV VF interface through “ip link” command is not sup-
ported.
• Interface parameter configurations such as speed, duplex, and autonegotiations are not sup-
ported.
• L2 mode switching.
• In a cluster, Jumbo Frames are not supported when the XL710 NIC is used as a data interface.
• Interface list re-orders when interfaces are disconnected and reconnected.
• Interface parameter configurations such as speed, duplex, and auto negotiations are not sup-
ported.
• Interface name is 40/X for both XL710 and X710 NICs
• Up to 16 Intel XL710/X710 SRIOV or PCI Passthrough interfaces can be supported on a VPX in-
stance.
Note: For IPv6 to work with X710 10G and XL710 40G NICs, you need to enable trust mode on the
Virtual Functions (VFs) by typing the following command on the KVM host:
For example:
Prerequisites
Before you configure a NetScaler VPX instance to use SR-IOV network interfaces, complete the follow-
ing prerequisite tasks. See the NIC column for details about about how to complete the corresponding
tasks.
4.Enable SR-IOV Virtual If you are using earlier version If you are using earlier version
Functions (VFs) on the KVM of kernel 3.8, then add the of kernel 3.8, then add the
host. In both the commands following entry to the following entry to the
in the next two columns: /etc/modprobe.d/ixgbe file /etc/modprobe.d/i40e.conf
number_of_VFs =the number and restart the KVM host: file and restart the KVM
of Virtual VFs that you want to *options ixgbe max_vfs=*.If host:*options i40e
create. device_name =the you are using kernel 3.8 max_vfs=*.If you are using
interface name. version or later, create VFs kernel 3.8 version or later,
using the following create VFs using the following
command: *echo > command: *echo >
/sys/class/net//device/s- /sys/class/net//device/s-
riov_numvfs*. See example in riov_numvfs*.See example in
figure 1. figure 2.
5. Make the VFs persistent by See example in figure 3. See example in figure 3.
adding the commands that
you used to create VFs, to the
rc.local file.
Important
When you are create the SR-IOV VFs, ensure that you do not assign MAC addresses to the VFs.
Figure 1: Enable SR-IOV VFs on the KVM host for 82599 10G NIC.
Figure 2: Enable SR-IOV VFs on the KVM host for X710 10G and XL710 40G NICs.
To configure NetScaler VPX instance to use SR-IOV network interface by using Virtual Machine Manager,
complete these steps:
6. Repeat Step 4 and 5 to add the VFs that you have created.
7. Power on the NetScaler VPX instance.
8. After the NetScaler VPX instance powers on, use the following command to verify the configu-
ration:
Important
When you are creating the SR-IOV VFs, ensure that you do not assign MAC addresses to the VFs.
To use the SR-IOV VFs in link aggregation mode, disable spoof checking for VFs that you have created.
On the KVM host, use the following command to disable spoof checking:
Where:
For example:
After you disable spoof checking for all the VFs that you have created. Restart the NetScaler VPX in-
stance and configure link aggregation. For detailed instructions, see Configure Link Aggregation.
You can configure VLAN on SR-IOV VFs. For detailed instructions, see Configuring a VLAN.
Important
Ensure that the KVM host does not contain VLAN settings for the VF interface.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
After you have installed and configured a NetScaler VPX instance on the Linux-KVM platform, you can
use the Virtual Machine Manager to configure the virtual appliance to use PCI passthrough network
interfaces.
Prerequisites
• The firmware version of the Intel XL710 Network Interface Card (NIC) on the KVM Host is 5.04.
• The KVM Host supports input–output memory management unit (IOMMU) and Intel VT-d, and
they are enabled in the BIOS of the KVM Host. On the KVM Host, to enable IOMMU, add the
following entry to the /boot/grub2/grub.cfg file:
intel_iommu=1
• Execute the following command and reboot the KVM Host:
Grub2-mkconfig –o /boot/grub2/grub.cfg
To configure NetScaler VPX instances to use PCI passthrough network interfaces by using the
Virtual Machine Manager:
b. In the Host Device section, select the Intel XL710 physical function.
c. Click Finish.
6. Repeat steps 4 and 5 to add any additional Intel XL710 physical functions.
7. Power on the NetScaler VPX instance.
8. Once the NetScaler VPX instance powers on, you can use the following command to verify the con-
figuration:
The output should show all the interfaces that you configured:
1.
2. Citrix ADC
3. NetScaler 12.0
1 cp NSVPX-KVM-10.1-117_nc.xml NetScaler-VPX-NSVPX-KVM-10.1-117_nc.
xml
Example:
<name>NetScaler-VPX</name>
<mac address=’52:54:00:29:74:b3’/>
<source file=’/root/NSVPX-KVM-10.1-117_nc.raw’/>
Specify the absolute QCOW2 disk-image source path and define the driver type as qcow2,
as shown in the following example:
Example:
<name>NetScaler-VPX</name>
<mac address=’52:54:00:29:74:b3’/>
<driver name =’qemu’ type=’qcow2’/>
<source file=’/root/NSVPX-KVM-10.1-117_nc.qcow’/>
Example: Mode: MacVTap Bridge Set target interface as ethx and mode as bridge Model type as
virtio
1 <interface type=’direct’>
2 <mac address=’52:54:00:29:74:b3’/>
3 <source dev=’eth0’ mode=’bridge’/>
4 <target dev=’macvtap0’/>
5 <model type=’virtio’/>
6 <alias name=’net0’/>
7 <address type=’pci’ domain=’0x0000’ bus=’0x00’ slot=’0x03’
function=’0x0’/>
8 </interface>
6.
7.
1 virsh console NetScaler-VPX
After you have provisioned the NetScaler VPX on KVM, you can add additional interfaces.
2.
a) For MacVTap
Example:
1 <interface type=’direct’>
2 <mac address=’52:54:00:29:74:b3’/>
3 <source dev=’eth1’ mode=’passthrough’/>
4 <model type=’virtio’/>
5 </interface>
Note: Make sure that you have configured a Linux bridge in the KVM host, bound the phys-
ical interface to the bridge, and put the bridge in the UP state.
1 <interface type=’bridge’>
2 <mac address=’52:54:00:2d:43:a4’/>
3 <source bridge=’br0’/>
4 <model type=’virtio’/>
5 </interface>
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can use the Virtual Machine Manager and the virsh program to perform management tasks such
as starting or stopping a VM Guest, setting up new guests and devices, editing existing configurations,
and connecting to the graphical console through Virtual Network Computing (VNC).
The main Window of the Virtual Machine Manager displays a list of all the VM Guests for each VM
host server it is connected to. Each VM Guest entry contains the virtual machine’s name, along
with its status (Running, Paused, or Shutoff) displayed as icon.
Opening a Graphical Console to a VM Guest enables you to interact with the machine like you
would with a physical host through a VNC connection. To open the graphical console in the
Virtual Machine Manager, right-click the VM Guest entry and select the Open option from the
pop-up menu.
You can start or stop a VM Guest from the Virtual Machine Manager. To change the state of the
VM, right-click the VM Guest entry and select Run or one of the Shut Down options from the
pop-up menu.
• Reboot a guest
You can reboot a VM Guest from the Virtual Machine Manager. To reboot the VM, right-click the
VM Guest entry, and then select Shut Down > Reboot from the pop-up menu.
• Delete a guest
Deleting a VM Guest removes its XML configuration by default. You can also delete a guest’s
storage files. Doing so completely erases the guest.
4. To completely erase the guest, delete the associated .raw file by selecting the Delete Asso-
ciated Storage Files check box.
Manage the NetScaler VPX guest VMs using the virsh program
1 Id Name State
2 ----------------------------------
3 0 Domain-0 running
4 1 Domain-1 paused
5 2 Domain-2 inactive
6 3 Domain-3 crashed
• Reboot a guest
Delete a guest
To delete a Guest VM you need to shut-down the Guest and un-define the
<DomainName>-NSVPX-KVM-*_nc.xml before you run the delete command.
Example:
Note: The delete command doesn’t remove disk image file which needs to be removed manu-
ally.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can deploy high-performance NetScaler VPX instances that use single-root I/O virtualization (SR-
IOV) technology, on OpenStack.
You can deploy a NetScaler VPX instance that uses SR-IOV technology, on OpenStack, in three steps:
Prerequisites
• Add the Intel 82599 Network Interface Card (NIC) to the host.
• Download and Install the latest IXGBE driver from Intel.
• Blacklist the IXGBEVF driver on the host. Add the following entry in the /etc/mod-
probe.d/blacklist.conf file: blacklist ixgbevf
Note
• If you are using a kernel version earlier than 3.8, add the following entry to the /etc/mod-
probe.d/ixgbe file and restart the host: options ixgbe max_vfs=<number_of_VFs>
• If you are using kernel 3.8 version or later, create VFs by using the following command:
Where:
While you are creating the SR-IOV VFs, make sure that you do not assign MAC addresses to the
VFs.
Make the VFs persistent, add the commands that you used to created VFs to the rc.local file. Here is
an example showing contents of rc.local file.
Follow the steps given at the link below to configure SR-IOV on OpenStack: https://wiki.openstack.
org/wiki/SR-IOV-Passthrough-For-Networking.
You can provision a NetScaler VPX instance in an Openstack environment by using the OpenStack CLI.
Provisioning a VPX instance, optionally involves using data from the config drive. The config drive is a
special configuration drive that attaches to the instance when it boots. This configuration drive can be
used to pass networking configuration information such as management IP address, network mask,
and default gateway etc. to the instance before you configure the network settings for the instance.
When OpenStack provisions a VPX instance, it first detects that the instance is booting in an OpenStack
environment, by reading a specific BIOS string (OpenStack Foundation) that indicates OpenStack. For
Red Hat Linux distributions, the string is stored in /etc/nova/release. This is a standard mechanism
that is available in all OpenStack implementations based on KVM hyper-visor platform. The drive
should have a specific OpenStack label. If the config drive is detected, the instance attempts to read
the following information from the file name specified in the nova boot command. In the procedures
below, the file is called “userdata.txt.”
• Management IP address
• Network mask
• Default gateway
Once the parameters are successfully read, they are populated in the NetScaler stack. This helps in
managing the instance remotely. If the parameters are not read successfully or the config drive is not
available, the instance transitions to the default behavior, which is:
You can provision a VPX instance in an OpenStack environment by using the OpenStack CLI. Here’s the
summary of the steps to provision a NetScaler VPX instance on OpenStack:
1. Extract the. qcow2 file from the .tqz file by typing the command:
2. Build an OpenStack image using the .qcoz2 file extracted in step 1 by typing the following command:
4 qcow2 file>
5
6 glance image-create --name=”NS-VPX-12-0-26-2” --property
7 hw_disk_bus=ide --is-public=
8 true --container-format=bare --disk-format=qcow2< NSVPX-KVM-12.0-
9 26.2_nc.qcow2
The following illustration provides a sample output for the glance image-create command.
3. After an OpenStack image is created, provision the NetScaler VPX instance instance.
In the above command, userdata.txt is the file which contains the details like, IP address, netmask,
and default gateway for the VPX instance. The userdata file is a user customizable file. NSVPX-KVM-
12.0-26.2 is the name of the virtual appliance that you want to provision. –nic port-id=218ba819-9f55-
4991-adb6-02086a6bdee2 is the OpenStack VF.
The following illustration gives a sample output of the nova boot command.
The following illustration shows a sample of the userdata.txt file. The values within the <PropertySection></Propert
tags are the values which is user configurable and holds the information like, IP address, netmask,and
default gateway.
20 <Property oe:key=”com.citrix.netscaler.mgmt.netmask”
21 oe:value=”255.255.0.0”/>
22 <Property oe:key=”com.citrix.netscaler.mgmt.gateway”
23 oe:value=”10.1.0.1”/>
24 </PropertySection>
25 </Environment>
Additional supported Configurations: Creating and Deleting VLANs on SR-IOV VFs from the Host
These steps complete the procedure for deploying a NetScaler VPX instance that uses SRIOV technol-
ogy, on OpenStack.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
You can configure a NetScaler VPX instance running on KVM (Fedora and RHOS) to use Open vSwitch
(OVS) with Data Plane Development Kit (DPDK) for better network performance. Also, certain
NetScaler VPX deployments require the VPX host on KVM to operate on the vhost-user ports exposed
by OVS rather than on MacVTap-based vhost interfaces.
OVS is a multilayer virtual switch licensed under the open-source Apache 2.0 license. DPDK is a set of
libraries and drivers for fast packet processing.
The following Fedora, RHOS, OVS, and DPDK versions are qualified for configuring a NetScaler VPX
instance:
Fedora RHOS
Prerequisites
Before you install DPDK, make sure the host has 1 GB hugepages.
For more information, see this DPDK system requirements documentation.
Here is the summary of the steps required to configuring a NetScaler VPX Instance on KVM to use OVS
DPDK-based host interfaces:
• Install DPDK.
• Build and Install OVS.
• Create an OVS bridge.
• Attach a physical interface to the OVS bridge.
• Attach vhost-user ports to the OVS data path.
• Provision a KVM-VPX with OVS-DPDK based vhost-user ports.
Install DPDK
To install DPDK, follow the instruction given at this Open vSwitch with DPDK document .
Download OVS from the OVS download page. Next, build and install OVS by using a DPDK datapath.
Follow the instructions given in the Installing Open vSwitch document.
For more detailed information, DPDK Getting Started Guide for Linux.
Depending on your need, type the Fedora or RHOS command to create an OVS bridge:
Fedora command:
RHOS command:
Bind the ports to DPDK and then attach them to the OVS bridge by typing the following Fedora or
RHOS commands:
Fedora command:
RHOS command:
The dpdk-devargs shown as part of options specifies the PCI BDF of the respective physical NIC.
Type the following Fedora or RHOS commands to attach vhost-user ports to the OVS data path:
Fedora command:
RHOS command:
You can provision a VPX instance on Fedora KVM with OVS-DPDK-based vhost-user ports only from CLI
by using the following QEMU commands:
Fedora command:
16
17 -chardev socket,id=char1,path=</usr/local/var/run/openvswitch/vhost-
user2> \
18
19 -netdev type=vhost-user,id=mynet2,chardev=char1,vhostforce -device
virtio-net
20
21 pci,mac=00:00:00:00:00:02,netdev=mynet2,mrg_rxbuf=on \
22
23 --nographic
For RHOS, use the following sample XML file to provision the NetScaler VPX instance, by using virsh.
<domain type=’kvm’>
<name>dpdk-vpx1</name>
<uuid>aedb844b-f6bc-48e6-a4c6-36577f2d68d6</uuid>
<memory unit=’KiB’>16777216</memory>
<currentMemory unit=’KiB’>16777216</currentMemory>
<memoryBacking>
<hugepages>
</hugepages>
</memoryBacking>
<vcpu placement=’static’>6</vcpu>
<cputune>
<shares>4096</shares>
<emulatorpin cpuset=’0,2,4,6’/>
</cputune>
<numatune>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<boot dev=’hd’/>
</os>
<features>
<acpi/>
<apic/>
</features>
<model fallback=’allow’>Haswell-noTSX</model>
<vendor>Intel</vendor>
<domain type=’kvm’>
<name>dpdk-vpx1</name>
<uuid>aedb844b-f6bc-48e6-a4c6-36577f2d68d6</uuid>
<memory unit=’KiB’>16777216</memory>
<currentMemory unit=’KiB’>16777216</currentMemory>
<memoryBacking>
<hugepages>
</hugepages>
</memoryBacking>
<vcpu placement=’static’>6</vcpu>
<cputune>
<shares>4096</shares>
<emulatorpin cpuset=’0,2,4,6’/>
</cputune>
<numatune>
</numatune>
<resource>
<partition>/machine</partition>
</resource>
<os>
<boot dev=’hd’/>
</os>
<features>
<acpi/>
<apic/>
</features>
<model fallback=’allow’>Haswell-noTSX</model>
<vendor>Intel</vendor>
<numa>
</numa>
</cpu>
<clock offset=’utc’/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<source file=’/home/NSVPX-KVM-12.0-52.18_nc.qcow2’/>
</disk>
</controller>
</controller>
<interface type=’direct’>
<mac address=’52:54:00:bb:ac:05’/>
<model type=’virtio’/>
</interface>
<interface type=’vhostuser’>
<mac address=’52:54:00:55:55:56’/>
<model type=’virtio’/>
</interface>
<interface type=’vhostuser’>
<mac address=’52:54:00:2a:32:64’/>
<model type=’virtio’/>
</interface>
<interface type=’vhostuser’>
<mac address=’52:54:00:2a:32:74’/>
<model type=’virtio’/>
</interface>
<interface type=’vhostuser’>
<mac address=’52:54:00:2a:32:84’/>
<model type=’virtio’/>
</interface>
<serial type=’pty’>
<target port=’0’/>
</serial>
<console type=’pty’>
</console>
<listen type=’address’/>
</graphics>
<video>
</video>
<memballoon model=’virtio’>
</memballoon>
</devices>
</domain
Points to note
In the XML file, the hugepage size must be 1 GB, as shown in the sample file.
<memoryBacking>
<hugepages>
</hugepages>
Also, in the sample file vhost-user1 is the vhostuser port bound to ovs-br0.
<interface type=’vhostuser’>
<mac address=’52:54:00:55:55:56’/>
<model type=’virtio’/>
</interface>
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can launch a Citrix NetScaler VPX instance on Amazon Web Services (AWS). The NetScaler VPX ap-
pliance is available as an Amazon Machine Image (AMI) in AWS marketplace. A NetScaler VPX instance
on AWS enables customer like you to leverage AWS Cloud computing capabilities and use NetScaler
load balancing and traffic management features for their business needs. The VPX instance supports
all the traffic management features of a physical NetScaler appliance, and they can be deployed as
standalone instances or in HA pairs.
• AWS terminology
• How a NetScaler VPX instance on AWS works
• Supported instance type, ENI, and IP addresses
AWS terminology
Here is a brief description of the terms used in this document. For more information, see AWS Glos-
sary.
Term Defintion
Term Defintion
Identity and Access Management (IAM) An AWS identity with permission policies that
determine what the identity can and cannot do
in AWS. You can use an IAM role to enable
applications running on an EC2 instance to
securely access your AWS resources.IAM role is
required for deploying VPX instances in a
high-availability setup.
Internet Gateway Connects a network to the Internet. You can
route traffic for IP addresses outside your VPC
to the Internet gateway.
Key pair A set of security credentials that you use to
prove your identity electronically. A key pair
consists of a private key and a public key.
Route tables A set of routing rules that controls the traffic
leaving any subnet that is associated with the
route table. You can associate multiple subnets
with a single route table, but a subnet can be
associated with only one route table at a time.
Security groups A named set of allowed inbound network
connections for an instance.
Subnets A segment of the IP address range of a VPC that
EC2 instances can be attached to. You can
create subnets to group instances according to
security and operational needs.
Virtual Private Cloud (VPC) A web service for provisioning a logically
isolated section of the AWS cloud where you
can launch AWS resources in a virtual network
that you define.
Auto Scaling A web service to launch or terminate Amazon
EC2 instances automatically based on
user-defined policies, schedules, and health
checks.
CloudFormation A service for writing or changing templates that
create and delete related AWS resources
together as a unit.
The NetScaler VPX instance is available as an AMI in AWS marketplace, and it can be launched as an
EC2 instance within an AWS VPC. The NetScaler VPX AMI instance requires a minimum of 2 virtual CPUs
and 2 GB of memory. An EC2 instance launched within an AWS VPC can also provide the multiple
interfaces, multiple IP addresses per interface, and public and private IP addresses needed for VPX
configuration. Each VPX instance requires at least three IP subnets:
• A management subnet
• A client-facing subnet (VIP)
• A back-end facing subnet (SNIP,MIP, etc.)
Citrix recommends three network interfaces for a standard VPX instance on AWS installation.
AWS currently makes multi-IP functionality available only to instances running within an AWS VPC. A
VPX instance in a VPC can be used to load balance servers running in EC2 instances. An Amazon VPC
allows you to create and control a virtual networking environment, including your own IP address
range, subnets, route tables, and network gateways.
Note: By default, you can create up to 5 VPC instances per AWS region for each AWS account. You
can request higher VPC limits by submitting Amazon’s request form http://aws.amazon.com/contact-
us/vpc-request.
Figure 1. A Sample NetScaler VPX Instance Deployment on AWS Architecture
Figure 1 shows a simple topology of an AWS VPC with a
NetScaler VPX deployment. The AWS VPC has:
1. A single Internet gateway to route traffic in and out of the VPC.
2. Network connectivity between the Internet gateway and the Internet.
3. Three subnets, one each for management, client, and server.
4. Network connectivity between the Internet gateway and the two subnets (management and
client).
5. A standalone NetScaler VPX instance deployed within the VPC. The VPX instance has three ENIs,
one attached to each subnet.
For more information about Amazon EC2 instances and IP addresses supported per NIC per instance
type:
• Instance types
• IP addresses per network interface per instance type
For higher bandwidth, Citrix recommends the following instance types:
Enhanced networking
Instance type Bandwidth (SR-IOV)
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
The following limitations and usage guidelines apply when deploying a NetScaler VPX instance on
AWS:
• Before you start, read the AWS terminology section in Deploy a NetScaler VPX instance on AWS.
• The clustering feature is not supported for VPX.
• For the high availability setup to work effectively, associate a dedicated NAT device to manage-
ment Interface or associate EIP to NSIP. For more information on NAT, in the AWS documenta-
tion, see NAT Instances .
• Data traffic and management traffic must be segregated with ENIs belonging to different sub-
nets.
• Only the NSIP address should be present on the management ENI.
• If a NAT instance is used for security instead of assigning an EIP to the NSIP, appropriate VPC
level routing changes are required. For instructions on making VPC level routing changes, in
the AWS documentation, see Scenario 2: VPC with Public and Private Subnets.
• A VPX instance can be moved from one EC2 instance type to another (for example, from m3.large
to an m3.xlarge).
• For storage options for VPX on AWS, Citrix recommends EBS, because it is durable and the data
is available even after it is detached from instance.
• Dynamic addition of ENIs to VPX is not supported. You have to restart the VPX instance to apply
the update. Citrix recommends you to stop the standalone or HA instance, attach the new ENI,
and then restart the instance.
• You can assign multiple IP addresses to an ENI. The maximum number of IP addresses per ENI
is determined by the EC2 instance type, see the section “IP Addresses Per Network Interface Per
Instance Type” in Elastic Network Interfaces . You must allocate the IP addresses in AWS before
you assign them to ENIs. For more information, see Elastic Network Interfaces .
• Citrix recommends that you avoid using the enable and disable interface commands on
NetScaler VPX interfaces.
• The NetScaler “set ha node <NODE_ID> -haStatus STAYPRIMARY” and “set ha node <NODE_ID>
-haStatus STAYSECONDARY” commands are disabled by default.
• Due to Amazon AWS limitations, these features are not supported:
– IPV6
– Gratuitous ARP(GARP)
– L2 mode
– Tagged VLAN
– Dynamic Routing
– Virtual MAC (VMAC)
• For RNAT to work, ensure Source/Destination Check is disabled. For more information, see
“Changing the Source/Destination Checking” in Elastic Network Interfaces .
• In a NetScaler VPX deployment on AWS, in some AWS regions, the AWS infrastructure might not
be able to resolve AWS API calls. This happens if the API calls are issued through a nonmanage-
ment interface on the NetScaler VPX instance.
As a workaround, restrict the API calls to the management interface only. To do that, create a
nsvlan on the VPX instance and bind the management interface to the nsvlan by using the ap-
propriate command.
For example:
set ns config -nsvlan <vlan id> -ifnum 1/1 -tagged NO
save config
Restart the VPX instance at the prompt. For more information about configuring nsvlan, see Con-
figuring NSVLAN.
1.
2. Citrix ADC
3. NetScaler 12.0
Prerequisites
Contributed by:
C
Before attempting to create a VPX instance in AWS, ensure you have the following:
• An AWS account: to launch a NetScaler VPX AMI in an Amazon Web Services (AWS) Virtual Pri-
vate Cloud (VPC). You can create an AWS account for free at www.aws.amazon.com.
• An AWS Identity and Access Management (IAM) user account: to securely control access to
AWS services and resources for your users. For more information about how to create an IAM
user account, see the topic Creating IAM Users (Console).
An IAM role is mandatory for both standalone and high availability deployments. The IAM role must
have the following privileges:
ec2:DescribeInstances
ec2:DescribeNetworkInterfaces
ec2:DetachNetworkInterface
ec2:AttachNetworkInterface
ec2:StartInstances
ec2:StopInstances
ec2:RebootInstances
autoscaling:*
sns:*
sqs:*
iam:SimulatePrincipalPolicy
iam:GetRole
If you use the Citrix CloudFormation template, the IAM role is automatically created. The template
does not have the option to select an already created IAM role.
• AWS CLI: to use all of the functionality provided by the AWS Management Console from your
terminal program. For more information , see the AWS CLI user guide. You also need the AWS
CLI to change the network interface type to SR-IOV.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
This topic describes the procedure for deploying a NetScaler VPX instance on AWS.
• Prerequisites
• Limitation and usage guidelines
Deploy a NetScaler VPX instance on AWS by using the AWS web console
You can deploy a NetScaler VPX instance on AWS through the AWS web console. The deployment
process includes the following steps:
Amazon EC2 uses a key pair to encrypt and decrypt logon information. To log on to your instance, you
must create a key pair, specify the name of the key pair when you launch the instance, and provide
the private key when you connect to the instance.
When you review and launch an instance by using the AWS Launch Instance wizard , you are prompted
to use an existing key pair or create a new key pair. More more information about how to create a key
pair, see Amazon EC2 Key Pairs.
A NetScaler VPC instance is deployed inside an AWS VPC. A VPC allows you to define virtual network
dedicated to your AWS account. For more information about AWS VPC, see Getting Started With Ama-
zon VPC.
While creating a VPC for your NetScaler VPX instance, keep the following points in mind.
• Use the VPC with a Single Public Subnet Only option to create a new AWS VPC in an AWS avail-
ability zone.
• Citrix recommends that you create at least three subnets, of the following types:
– One subnet for management traffic. You place the management IP(NSIP) on this subnet. By
default elastic network interface (ENI) eth0 is used for management IP.
– One or more subnets for client-access (user-to-NetScaler VPX) traffic, through which
clients connect to one or more virtual IP (VIP) addresses assigned to NetScaler load
balancing virtual servers.
– One or more subnets for the server-access (VPX-to-server) traffic, through which your
servers connect to VPX-owned subnet IP (SNIP) addresses. For more information about
NetScaler load balancing and virtual servers, virtual IP addresses (VIPs), and subnet IP
addresses (SNIPs), see:
– All subnets must be in the same availability zone.
When you used the VPC wizard, only one subnet was created. Depending on your requirement, you
might want to create additional subnets. For more information about how to create additional sub-
nets, see Adding a Subnet to Your VPC.
To control inbound and outbound traffic, create security groups and add rules to the groups. For more
information how to create groups and add rules, see Security Groups for Your VPC.
For NetScaler VPX instances, the EC2 wizard gives default security groups, which are generated by AWS
Marketplace and is based on recommended settings by Citrix. However, you can create additional
security groups based on your requirements.
Note
Port 22, 80, 443 to be opened on the Security group for SSH, HTTP, and HTTPS access respec-
tively.
Route table contains a set of rules, called routes, that are used to determine where network traffic is
directed. Each subnet in your VPC must be associated with a route table. For more information about
how to create a route table, see Route Tables.
An internet gateway serves two purposes: to provide a target in your VPC route tables for internet-
routable traffic, and to perform network address translation (NAT) for instances that have been as-
signed public IPv4 addresses.
Create an internet gateway for internet traffic. For more information about how to create an Internet
Gateway, see the section Attaching an Internet Gateway.
Step 7: Create a NetScaler VPX instance by using the AWS EC2 service.
To create a NetScaler VPX instance by using the AWS EC2 service, complete the following steps.
1. From the AWS dashboard, go to Compute > EC2 > Launch Instance > AWS Marketplace.
Before you click Launch Instance, ensure your region is correct by checking the note that appears
under Launch Instance.
2. In the Search AWS Marketplace bar, search with the keyword NetScaler VPX.
3. Select the version you want to deploy and then click Select. For the NetScaler VPX version, you the
following options:
• A licensed version
• NetScaler VPX Express appliance (This is a free virtual appliance, which is available from
NetScaler 12.0 56.20.)
• Bring your own device
The Launch Instance wizard starts. Follow the wizard to create an instance. The wizard prompts you
to:
Create two additional network interfaces for VIP and SNIP. For more information about how to create
additional network interfaces, see the Creating a Network Interface section.
After you’ve created the network interfaces, you must attach them to the VPX instance. Before at-
taching the interface, shut down the VPX instance, attach the interface, and power on the instance.
For more information about how to attach network interfaces, see the Attaching a Network Interface
When Launching an Instance section.
If you assign a public IP address to an EC2 instance, it remains assigned only until the instance is
stopped. After that, the address is released back to the pool. When you restart the instance, a new
public IP address is assigned.
In contrast, an elastic IP (EIP) address remains assigned until the address is disassociated from an
instance.
Allocate and associate an elastic IP for the management NIC. For more information about how to allo-
cate and associate elastic IP addresses, see these topics:
These steps complete the procedure to create a NetScaler VPX instance on AWS. It can take a few min-
utes for the instance to be ready. Check that your instance has passed its status checks. You can view
this information in the Status Checks column on the Instances page.
After you’ve created the VPX instance, you connect the instance by using the GUI and an SSH client.
• GUI
The following are the default administrator credentials to access a NetScaler VPX instance
Password: The default password for the nsroot account is set to the AWS instance-ID of the NetScaler
VPX instance.
• SSH client
From the AWS management console, select the NetScaler VPX instance and click Connect. Follow the
instructions given on the Connect to Your Instance page.
For more information about how to deploy a NetScaler VPX standalone instance on AWS by using the
AWS web console, see:
You can use the Citrix-provided CloudFormation template to automate VPX instance launch. The tem-
plate provides functionality to launch a single NetScaler VPX instance, or to create a high availability
environment with a pair of NetScaler VPX instances.
The CloudFormation template requires an existing VPC environment, and it launches a VPX instance
with three elastic network interfaces (ENIs). Before you start the CloudFormation template, ensure
that you complete the following requirements:
See the “Deploy a NetScaler VPX Instance on AWS by Using the AWS Web Console” section or AWS
documentation for more information about how to complete the prerequisites.
Watch this video to learn about how to configure and launch a NetScaler VPX standalone instance by
using the Citrix CloudFormation template available in the AWS Marketplace.
Further, you configure and launch a NetScaler VPX Express standalone instance by using the Citrix
CloudFormation template available in GitHub:
https://github.com/citrix/netscaler-aws-cloudformation/tree/master/templates/express_single_
nic
An IAM role is not mandatory for a standalone deployment. However, Citrix recommends that you
create and attach an IAM role with the required privileges to the instance, for future need. The IAM
role ensures that the standalone instance is easily converted to a high availability node with SR-IOV,
when required.
For more information about the required privileges, see Configuring NetScaler VPX instances to Use
SR-IOV Network Interface.
You can use the AWS CLI to launch instances. For more information, see the AWS Command Line In-
terface Documentation.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
After the initial instance launch, NetScaler VPX for AWS requires a license. If you are bringing your own
license (BYOL), see the VPX Licensing Guide at http://support.citrix.com/article/CTX122426
If this is a paid marketplace instance, then you do not need to install a license. The correct feature set
and performance will activate automatically.
If you use a NetScaler VPX instance with a model number higher than VPX 5000, the network through-
put might not be the same as specified by the instance’s license. However, other features, such as SSL
throughput and SSL transactions per second, might improve.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A VPX instance can be used to load balance servers running in the same availability zone, or in:
To enable a VPX instance to load balance servers running outside the AWS VPC that the
VPX instance is in, configure the instance to use EIPs to route traffic through the Internet gateway, as
follows:
1. Configure a SNIP on the NetScaler VPX instance by using the NetScaler CLI or the GUI.
2. Enable traffic to be routed out of the AZ, by creating a public facing subnet for the server-side
traffic.
3. Add an Internet gateway route to the routing table, using the AWS GUI console.
4. Associate the routing table you just updated with the server-side subnet.
5. Associate an EIP with the server-side private IP address that is mapped to a NetScaler SNIP ad-
dress.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure two NetScaler VPX instances on AWS as a high-availability (HA) active-passive pair.
In this pair, one instance configured as the primary node and the other as the secondary node. The
primary node accepts connections and manages servers while the secondary node monitors the pri-
mary. If the primary node, for any reason, is unable to accept connections, the secondary node takes
over.
• Create the instances with IAM role manually by using the AWS Management Console and then
configure the instances as an HA pair.
• Automate the HA deployment by using the Citrix CloudFormation template.
The CloudFormation template significantly decreases the number of steps involved for creating an HA
pair, and it automatically creates an IAM role. This section shows how to deploy a NetScaler VPX HA
(active-passive) pair by using the Citrix CloudFormation template.
Keep the following points in mind while deploying two NetScaler VPX instances as an HA pair.
Points to note
• HA on AWS requires the primary node to have at least two ENIs - one for management and the
other for data traffic. And the secondary node to have one management ENI. However, for secu-
rity purposes, create three ENIs on the primary node, because this setup allows you to segregate
private and public network (recommended).
• The secondary node always has one ENI interface (for management) and the primary node can
have up to four ENIs.
• The NSIP addresses for each VPX instance in a high availability pair must be configured on the
default ENI of the instance.
• Amazon does not allow any broadcast/multicast packets in AWS. As a result, in an HA setup, data-
plane ENIs are migrated from the primary to the secondary VPX instance when the primary VPX
instance fails.
• Because the default (management) ENI cannot be moved to another VPX instance, do not use
the default ENI for client and server traffic (data-plane traffic).
• The message AWSCONFIG IOCTL NSAPI_HOTPLUG_INTF success output 0 in the /var/log/ns.log
indicates that the two data ENIs have successfully attached to the secondary instance (the new
primary).
• Failover might take up to 20 seconds due to the AWS detach/attach ENI mechanism.
• Upon failover, the failed instance always restarts.
• The heartbeat packets are received only on the management interface.
• The configuration file of the primary and secondary VPX instances is synchronized, including
the nsroot password. The nsroot password of the secondary node is set to that of the primary
node, after the HA configuration synchronizes.
• To access the AWS API servers, either the VPX instance must have a public IP address assigned
or routing must be set up correctly at VPC subnet level pointing to internet gateway of the VPC.
• Nameservers/DNS servers are configured at VPC level using DHCP options.
• The Citrix CloudFormation template does not create an HA setup between different availability
zones.
• The Citrix CloudFormation template does not create an INC mode.
• The AWS debug messages are available in the log file, /var/log/ns.log, on the VPX instance.
Before start the CloudFormation template, ensure that you complete the following requirements:
• A VPC
• Three subnets within the VPC
• A security group with UDP 3003, TCP 3009–3010, HTTP, SSH ports open
• A key pair
Note
The Citrix CloudFormation template automatically creates an IAM role. Existing IAM roles do not
appear in the template.
b. Under High Availability Configuration, select Yes from the menu for Create HA pair?.
• Select the VPC that you’ve already created for VPC ID.
• Select the key pair that you’ve already created from the menu for Key Pair.
• Add Primary Management IP, Secondary Management IP, Client IP, and Server IP. The
IP addresses must belong to the same subnets of the respective subnetworks. Alterna-
tively, you can let the template assign the IP addresses automatically.
f. Click Next.
6. The Review page appears. Take a moment to review the settings and make necessary changes
if necessary.
7. Select the I acknowledge that AWS CloudFormation might create IAM resources. check box,
and then click Create.
8. The CREATE-IN-PROGRESS status appears. Wait until the status is CREATE-COMPLETE. If the
status does not change to “COMPLETE,” check the Events tab for the reason of failure and recre-
ate the instance with proper configurations.
1. After an IAM resource is created, go to EC2 Management Console > Instances. The two VPX
instances created with an IAM role appear. The primary node is created with three private IP
addresses and three network interfaces.
The secondary node is created with one private IP address and one network interface.
Note
The secondary node is created with one interface by default in AWS. During failover, the interface
from the primary node gets attached to the secondary node (the new primary node) and gets
detached from the original primary node (the new secondary node).
1. Log on to the primary node with user name nsroot and the instance ID as the password. From
the GUI, go to System > High Availability. The NetScaler VPX HA pair appears.
Next, configure the HA pairing on both the instances. Configure the instance with three ENIs before
configuring HA on the instance with one ENI). Use the add HA node command, from within the VPX
CLI, or from the GUI.
After you run the “add HA node” commands, the two nodes form an HA pair, and configuration infor-
mation is synchronized between the two VPX instances.
Support for SR-IOV interfaces in a high availability setup is available from NetScaler release 12.0 57.19
onwards. For more information about how to configure SR-IOV, see Configuring NetScaler VPX in-
stances to Use SR-IOV Network Interface.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Efficient hosting of applications in a cloud involves easy and cost-effective management of resources
depending on the application demand. To meet increasing demand, you have to scale network re-
sources upward. Whether demand subsides, you need to scale down to avoid the unnecessary cost of
idle resources. To minimize the cost of running the application by deploying only as many instances
as are necessary during any given period of time, you have to constantly monitor traffic, memory and
CPU use, and so on. However, monitoring traffic manually is cumbersome. For the application envi-
ronment to scale up or down dynamically, you must automate the processes of monitoring traffic and
of scaling resources up and down whenever necessary.
Integrated with AWS Auto Scaling service, the NetScaler VPX instance provides the following advan-
tages:
• Load balance and management: Auto configures servers to scale up and scale down, depend-
ing on demand. The VPX instance auto detects Auto Scale groups in the back-end subnet and
allows user to select the Auto Scale groups to balance the load. All of this is done by auto con-
figuring the virtual and subnet IP addresses on the VPX instance.
• High availability: Detects Auto Scale groups that span multiple availability zones and load-
balance servers.
• Better network availability: The VPX instance supports:
– Back-end servers on different VPCs, by using VPC peering
– Back-end servers on same placement groups
– Back-end servers on different availability zones
• Graceful connection termination: Removes Auto Scale servers gracefully, avoiding loss of
client connections when scale-down activity occurs, by using the Graceful Timeout feature.
The above diagram illustrates how the AWS Auto Scaling service works with a NetScaler VPX instance
(LB virtual server). For more information, see the following AWS topics.
• CloudWatch
• Simple Notification Service (SNS)
• Simple Queue Service (Amazon SQS)
Before you start using Auto Scaling with your NetScaler VPX instance, you should complete the follow-
ing tasks.
• Prerequisites
• Limitation and usage guidelines
• For more information about how to create a NetScaler VPX standalone instance, see Deploy a
NetScaler VPX standalone instance on AWS and Scenario: standalone instance
• For more information about how to deploy VPX instances in HA mode, see Deploy a high avail-
ability pair on AWS.
Citrix recommends CloudFormation template for creating NetScaler VPX instances on AWS.
Note
Citrix recommends you create three interfaces: one for management (NSIP), one for client-facing
LB virtual server (VIP), and one for subnet IP (NSIP).
3. Create an AWS Auto Scale group. If you don’t have an existing Auto Scaling configuration, you need
to:
You can add the Auto Scaling service to a VPX instance with a single click by using the GUI. Complete
these steps to add the Auto Scaling service to the VPX instance:
2. When you log on to the NetScaler VPX instance for the first time, you see the default Cloud Profile
page. Select the AWS auto scaling group from drop-down menu and click Create to create a cloud
profile. Click Skip if you want to create the cloud profile later.
Points to keep in mind while creating a Cloud Profile: By default the CloudFormation Template
creates and attaches the below IAM Role.
“Version”: “20120-17”,
“Statement”: [
“Action”: [
“ec2:DescribeInstances”,
“ec2:DescribeNetworkInterfaces”,
“ec2:DetachNetworkInterface”,
“ec2:AttachNetworkInterface”,
”ec2:StartInstances”,
”ec2:StopInstances”,
”ec2:RebootInstances”,
“autoscaling:*”,
”sns:*”,
“sqs:*”
“iam: SimulatePrincipalPolicy”
“iam: GetRole”
],
“Resource”: “*”,
“Effect”: “Allow”
• The virtual server IP address is autopopulated from the free IP address available to the
VPX instance. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/MultipleIP.html#
ManageMultipleIP
• Auto Scale group is prepopulated from the Auto Scale group configured on your AWS ac-
count. http://docs.aws.amazon.com/autoscaling/latest/userguide/AutoScalingGroup.html.
• While selecting the Auto Scaling Group protocol and port, ensure your servers listen on those
protocol and ports and you bind the correct monitor in the service group. By default, TCP mon-
itor is used.
• For SSL Protocol type Autos Scaling, after you create the Cloud Profile the load balance virtual
server or service group will be down because of a missing certificate. You can bind the certificate
to the virtual server or service group manually.
• Select the Graceful Timeout option to remove Auto Scale servers gracefully. If this option is not
selected the server is the Auto Scale group is removed immediately after the load goes down,
which might cause service interruption for the existing connected clients. Selecting Graceful
and giving a timeout means in the event of scale down. The VPX instance does not remove the
server immediately but marks one of the servers for graceful deletion. During this period, the
instance does not allow new connections to this server. Existing connection are served till the
timeout occurs, and after timeout the VPX instance removes the server.
3. After first time logon if you want to create Cloud Profile, on the GUI go to System > AWS > Cloud
Profile and click Add.
Cloud Profile creates a NetScaler load-balancing (LB) virtual server (virtual server) and a service group
with members (servers) as the servers of the Auto Scaling Group. Your back-end servers should be
reachable through the SNIP configured on the VPX instance.
Note
To view Auto Scale-related information in the AWS console, go to EC2 > Dashboard > Auto Scal-
ing > Auto Scaling Group.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Note
Support for SR-IOV interfaces in a high availability setup is available from NetScaler release 12.0
57.19 onwards.
After you have created a NetScaler VPX instance on AWS, you can configure the virtual appliance to
use SR-IOV network interfaces, by using AWS CLI.
In all NetScaler VPX models, except NetScaler VPX AWS Marketplace Editions of 3G and 5G, SR-IOV is
not enabled in the default configuration of a network interface.
• Prerequisites
• Limitations and Usage Guidelines
You can run the show interface summary command to check the default configuration of a network
interface.
Example 1: The following CLI screen capture shows the configuration of a network interface where
SR-IOV is enabled by default on NetScaler VPX AWS Marketplace Editions of 3G and 5G.
Example 2: The following CLI screen capture shows the default configuration of a network interface
where SR-IOV is not enabled.
For more information about changing the interface type to SR-IOV, see http://docs.aws.amazon.com/
AWSEC2/latest/UserGuide/sriov-networking.html
2. To enable SR-IOV on the network interface, type the following command in the AWS CLI.
3. To check if SR-IOV has been enabled, type the following command in the AWS CLI.
3. Power on the VPX instance. To see the changed status of the network interface, type “show interface
summary” in CLI.
Example 5: The following screen capture shows the network interfaces with SR-IOV enabled. The
interfaces 10/1, 10/2, 10/3 are SR-IOV enabled.
These steps complete the procedure to configure VPX instances to use SR-IOV network interfaces.
High availability is supported with SR-IOV interfaces from NetScaler release 12.0 build 57.19 onwards.
If the high availability setup was deployed manually or by using the Citrix CloudFormation template
for NetScaler version 12.0 56.20 and lower, the IAM role attached to the high availability setup must
have the following privileges:
• ec2:DescribeInstances
• ec2:DescribeNetworkInterfaces
• ec2:DetachNetworkInterface
• ec2:AttachNetworkInterface
• ec2:StartInstances
• ec2:StopInstances
• ec2:RebootInstances
• autoscaling:*
• sns:*
• sqs:*
• iam:SimulatePrincipalPolicy
• iam:GetRole
By default, the Citrix CloudFormation template for NetScaler version 12.0 57.19 automatically adds the
required privileges to the IAM role.
Note
A high availability setup with SR-IOV Interfaces take around 100 seconds of down time.
Related resources:
1.
2. Citrix ADC
3. NetScaler 12.0
December 5, 2018
Contributed by:
C
You can upgrade the EC2 instance type, throughput, software edition, and the system software of a
NetScaler VPX running on AWS. For certain types of upgrades, Citrix recommends using the High Avail-
ability Configuration method to minimize downtime.
Note:
• NetScaler software release 10.1.e-124.1308.e or later for a NetScaler VPX AMI (including both
utility license and customer license) does not support the M1 and M2 instance families.
• Because of changes in VPX instance support, downgrading from 10.1.e-124 or a later release
to 10.1.123.x or an earlier release is not supported.
• Most of the upgrades do not require the launch of a new AMI, and the upgrade can be done on
the current NetScaler AMI instance. If you do want to upgrade to a new NetScaler AMI instance,
use the high availability configuration method.
If your NetScaler VPX instances are running release 10.1.e-124.1308.e or later, you can change the EC2
instance type from the AWS console as follows:
You can also use the above procedure to change the EC2 instance type for a release, earlier than 10.1.e-
124.1308.e, unless you want to change the instance type to M3. In that case, you must first follow the
standard NetScaler upgrade procedure, at , to upgrade the NetScaler software to 10.1.e-124 or a later
release, and then follow the above steps.
To upgrade the software edition (for example, to upgrade from Standard to Platinum edition) or
throughput (for example, to upgrade from 200 mbps to 1000mbps), the method depends on the
instance’s license.
If you are using a customer license, you can purchase and download the new license from the Citrix
Licensing portal (MyCitrix), and then install the license on the VPX instance. For more information
about downloading and installing a license from the MyCitrix portal, see the VPX Licensing Guide.
AWS does not support direct upgrades for fee-based instances. To upgrade the software edition or
throughput of a fee based NetScaler VPX instance, launch a new AMI with the desired license and ca-
pacity and migrate the older instance configuration to the new instance. This can be achieved by using
a NetScaler high availability configuration as described in Upgrade to a new NetScaler AMI instance
by using a NetScaler high availability configuration subsection in this page.
If you need to upgrade a VPX instance running 10.1.e-124.1308.e or a later release, follow the standard
NetScaler upgrade procedure at .
If you need to upgrade a VPX instance running a release older than 10.1.e-124.1308.e to 10.1.e-124.1308.e
or a later release, first upgrade the system software, and then change the instance type to M3 as fol-
lows:
To use the high availability method of upgrading to a new NetScaler AMI instance, perform the follow-
ing tasks:
• Create a new instance with the desired EC2 instance type, software edition, throughput, or soft-
ware release from the AWS marketplace.
• Configure high availability between the old instance (to be upgraded) and the new instance.
After high availability is configured between the old and the new instance, configuration from
the old instance is synchronized to the new instance.
• Force an HA failover from the old instance to the new instance. As a result, the new instance
becomes primary and starts receiving traffic.
• Stop, and reconfigure or remove the old instance from AWS.
• Ensure you understand how high availability works between two NetScaler VPX instances on
AWS. For more information about high availability configuration between two NetScaler VPX
instances on AWS, see Deploy a high availability pair on AWS.
• You must create the new instance in the same availability zone as the old instance, having the
exact same security group and subnet.
• High availability setup requires access and secret keys associated with the user’s AWS Identity
and Access Management (IAM) account for both instances. If the correct key information is not
used when creating VPX instances, the HA setup fails. For more information about creating an
IAM account for a VPX instance, see Prerequisites.
– You must use the EC2 console to create the new instance. You cannot use the AWS 1-click
launch, because it does not accept the access and secret keys as the input.
– The new instance should have only one ENI interface.
To upgrade a NetScaler VPX Instance by using a high availability configuration, follow these steps:
1. Configure high availability between the old and the new instance. To configure high availability
between two NetScaler VPX instances, at the command prompt of each intance, type:
Example:
• In the HA setup, the old instance is the primary node and the new instance is the secondary
node.
• The NSIP IP address is not copied from the old instance to the new instance. Therefore, after the
upgrade, your new instance has a different management IP address from the previous one.
• The nsroot account password of the new instance is set to that of the old instance after HA syn-
chronization.
For more information about high availability configuration between two NetScaler VPX instances on
AWS, see Deploy a high availability pair on AWS.
2. Force an HA failover. To force a failover in a high availability configuration, at the command prompt
of either of the instances, type:
1 force HA failover
As the result of forcing a failover, the ENIs of the old instance are migrated to the new instance and
traffic flows through the new instance (the new primary node). The old instance (the new secondary
node) restarts.
If the following warning message appears, type N to abort the operation:
The warning message appears because the system software of the two VPX instances is not HA com-
patible. As a result, the configuration of the old instance cannot be automatically synced to the new
instance during a forced failover.
Following is the workaround for this issue:
1/. At the NetScaler shell prompt of the old instance, type the following command to create a backup
of the configuration file (ns.conf):
copy /nsconfig/ns.conf to /nsconfig/ns.conf.bkp
2. Remove the following line from the backup configuration file (ns.conf.bkp):
4. At the NetScaler shell prompt of the new instance, type the following command to load the old
instance’s configuration file (ns.conf.bkp) on the new instance:
• batch -f /nsconfig/ns.conf.bkp
• Save conifg
6. At the command prompt of either of the nodes, type the following command to force a failover, and
then type Y for the warning message to confirm the force failover operation:
• force ha failover
Example:
3. Remove the HA configuration, so that the two instances are no longer in an HA configuration. First
remove the HA configuration from the secondary node and then remove the HA configuration from
the primary node.
To remove an HA configuration between two NetScaler VPX instances, at the command prompt of each
instance, type:
For more information about high availability configuration between two VPX instances on AWS, see
Deploy a high availability pair on AWS.
Example:
At the command prompt of the old instance (new secondary node), type:
At the command prompt of the new instance (new primary node), type:
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Amazon does not provide console access to a NetScaler VPX instance. To troubleshoot, you have to
use the AWS GUI to view the activity log. You can debug only if the network is connected. To view an
instance’s system log, right-click the instance and select system log.
Citrix provides support for fee based NetScaler VPX instances (utility license with hourly fee) on AWS.
To file a support case, find your AWS account number and support PIN code, and call Citrix support.
You will also be asked for your name and email address. To find the support PIN, log on to the VPX GUI
and navigate to the System page.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Microsoft Azure Resource Manager (ARM) is a management framework that allows administrators to
deploy, manage, and monitor Azure resources. Azure Resource Manager can handle these tasks as a
group, rather than individually, in a single operation.
The NetScaler VPX virtual appliance is available as an image in the Microsoft Azure Marketplace and
GitHub. For more information, see the GitHub repository for Citrix NetScaler solution templates for
deploying NetScaler VPX instances in Microsoft Azure Cloud Services.
When you deploy NetScaler VPX on Microsoft Azure Resource Manager (ARM), you can leverage the
Azure cloud computing capabilities and use NetScaler load balancing and traffic management fea-
tures for your business needs. You can deploy NetScaler VPX instances on Azure Resource Manager
either as standalone instances or as high availability pairs in active-active or active-standby modes.
This document assumes that you are familiar with Azure terminology and network details. For infor-
mation, see Azure terminology.
This document also assumes that you have basic knowledge of a NetScaler appliance. For detailed
information the NetScaler appliance, see:
• NetScaler
• NetScaler Gateway
For information about NetScaler Gateway configuration for Citrix XenApp and XenDesktop
in Azure cloud, see https://www.citrix.com/content/dam/citrix/en_us/documents/products-
solutions/netscaler-vpx-deployment-with-xendesktop-and-xenapp-on-microsoft-azure.pdf.
Note
The Citrix XenApp and XenDesktop NetScaler Gateway configuration is based on the Azure Ser-
vice Management mode and not on the Azure Resource Management mode.
Network architecture
In ARM, a NetScaler VPX virtual machine (VM) resides in a virtual network. A virtual Network Interface
Card (NIC) is created on each NetScaler VM. The network security group (NSG) configured in the virtual
network is bound to the NIC, and together they control the traffic flowing into the VM and out of the
VM.
The NSG forwards the requests to the NetScaler VPX instance, and the VPX instance sends them to the
servers. The response from a server follows the same path in reverse. The NSG can be configured to
control a single VPX VM, or, with subnets and virtual networks, can control traffic in multiple VPX VM
deployment.
The NIC contains network configuration details such as the virtual network, subnets, internal IP ad-
dress, and Public IP address.
While on ARM, it is good to know the following IP addresses that are used to access the VMs deployed
with a single NIC and a single IP address:
• Public IP (PIP) address is the internet-facing IP address configured directly on the virtual NIC of
the NetScaler VM. This allows you to directly access a VM from the external network.
• NetScaler IP (NSIP) address is internal IP address configured on the VM. It is non-routable.
• Virtual IP address (VIP) is configured by using the NSIP and a port number. Clients access
NetScaler services through the PIP address, and when the request reaches the NIC of the
NetScaler VPX VM or the Azure load balancer, the VIP gets translated to internal IP (NSIP) and
internal port number.
• Internal IP address is the private internal IP address of the VM from the virtual network’s address
space pool. This IP address cannot be reached from the external network. This IP address is by
default dynamic unless you set it to static. Traffic from the internet is routed to this address
according to the rules created on the NSG. The NSG works with the NIC to selectively send the
right type of traffic to the right port on the NIC, which depends on the services configured on
the VM.
The following figure shows how traffic flows from a client to a server through a NetScaler VPX instance
provisioned in ARM.
In an Azure deployment, you can provision a NetScaler VPX instance on Azure in two ways:
VPX virtual appliances can be deployed on any instance type that has two or more cores and
more than 2 GB memory.
The following image illustrates how multiple IP addresses are used to perform the functions of NSIP,
SNIP, and VIP, with a single NIC in a standalone deployment. According to your requirement, you can
configure multiple NICs with different IP addresses.
For more information about NetScaler multi-NIC, multi-IP deployment on Azure, see the following
links:
The following image illustrates how a single IP address is used to perform the functions of NSIP, SNIP,
and VIP.
Note
The single IP mode is available only in Azure deployments. This mode is not available for a
NetScaler VPX instance on your premises, on AWS, or in other type of deployment.
In an Azure deployment, when you provision the NetScaler VPX instance as a virtual machine (VM),
Azure assigns a public IP address and an internal IP address (nonroutable) to the NetScaler VPX in-
stance. Inbound and outbound rules are defined on the NSG for the VPX instance, along with a public
port and a private port for each rule defined. The VPX instance listens on the internal IP address and
private port.
Any external request is received on the virtual NIC of the NetScaler VPX VM. The NIC is bound to the
NSG, which specifies the private IP and private port combination into which to translate the request’s
destination address and port (the public IP address and port). ARM performs port address translation
(PAT) to map the public IP address and port to the internal IP address and private port of the NetScaler
VPX instance, and forwards the traffic to the virtual machine.
The following figure shows how Azure performs port address translation to direct traffic to the
NetScaler internal IP address and private port.
In this example, the Public IP address assigned to the VM is 140.x.x.x, and the internal IP address is
10.x.x.x. When the inbound and outbound rules are defined, public HTTP port 80 is defined as the
port on which the client requests are received, and a corresponding private port, 10080, is defined as
the port on which the NetScaler VPX instance listens. The client request is received on the Public IP
address 140.x.x.x at port 80. Azure performs port address translation to map this address and port to
internal IP address 10.x.x.x on private port 10080 and forwards the client request.
For information about port usage guidelines while, see the Port usage guidelines section.
For information about NSG and access control lists, see What is a Network Security Group?
You can also request a public IP (PIP) address for your NetScaler VPX instance (instance level). If you
use this direct PIP at the VM level, you need not define inbound and outbound rules to intercept the
network traffic. The incoming request from the Internet is received on the VM directly. Azure per-
forms network address translation (NAT) and forwards the traffic to the internal IP address of the VPX
instance.
The following figure shows how Azure performs network address translation to map the NetScaler
internal IP address.
In this example, the Public IP assigned to the NSG is 140.x.x.x and the internal IP address is 10.x.x.x.
When the inbound and outbound rules are defined, public HTTP port 80 is defined as the port on
which the client requests are received, and a corresponding private port, 10080, is defined as the
port on which the NetScaler VPX instance listens. The client request is received on the Public IP ad-
dress (140.x.x.x). Azure performs network address translation to map the PIP to the internal IP address
10.x.x.x on port 10080, and forwards the client request.
Note
NetScaler VPX VMs in high availability are controlled by external or internal load balancers that
have inbound rules defined on them to control the load balancing traffic. The external traffic is
first intercepted by these load balancers and the traffic is diverted according to the load balancing
rules configured, which has back-end pools, NAT rules, and health probes defined on the load
balancers.
You can configure more inbound and outbound rules n NSG while creating the NetScaler VPX instance
or after the virtual machine is provisioned. Each inbound and outbound rule is associated with a
public port and a private port.
Before configuring NSG rules, note the following guidelines regarding the port numbers you can use:
1. The NetScaler VPX instance reserves the following ports. You cannot define these as private ports
when using the Public IP address for requests from the internet.
Ports 21, 22, 80, 443, 8080, 67, 161, 179, 500, 520, 3003, 3008, 3009, 3010, 3011, 4001, 5061, 9000, 7000.
However, if you want internet-facing services such as the VIP to use a standard port (for example,
port 443) you have to create port mapping by using the NSG. The standard port is then mapped to a
different port that is configured on the NetScaler for this VIP service.
For example, a VIP service might be running on port 8443 on the VPX instance but be mapped to public
port 443. So, when the user accesses port 443 through the Public IP, the request is directed to private
port 8443.
2. Public IP address does not support protocols in which port mapping is opened dynamically, such
as passive FTP or ALG.
3. High availability does not work for traffic that uses a public IP address (PIP) associated with a VPX
instance, instead of a PIP configured on the Azure load balancer. For more information, see Configure
a high-availability setup with a single IP address and a single NIC.
4. In a NetScaler Gateway deployment, you need not configure a SNIP address, because the NSIP can
be used as a SNIP when no SNIP is configured.
You must configure the VIP address by using the NSIP address and some nonstandard port number.
For call-back configuration on the back-end server, the VIP port number has to be specified along with
the VIP URL (for example, url:port).
Note
In Azure Resource Manager, a NetScaler VPX instance is associated with two IP addresses - a pub-
lic IP address (PIP) and an internal IP address. While the external traffic connects to the PIP,
the internal IP address or the NSIP is non-routable. To configure VIP in VPX, use the internal IP
address (NSIP) and any of the free ports available. Do not use the PIP to configure VIP.
For example, if NSIP of a NetScaler VPX instance is 10.1.0.3 and an available free port is 10022,
then you can configure VIP by providing the 10.1.0.3:10022 (NSIP address+port) combination.
A NetScaler VPX instance on Azure requires a license. The following licensing options are available for
NetScaler VPX instances running on Azure.
• Bring your own license (BYOL): If you bring your own license (BYOL), see the VPX Licensing
Guide at http://support.citrix.com/article/CTX122426. You have to:
– Use the licensing portal within MyCitrix to generate a valid license.
– Upload the license to the instance.
• NetScaler VPX Check-In/Check-Out licensing: For more information, see NetScaler VPX Check-
In/Check-Out Licensing.
Starting with NetScaler release 12.0 56.20, VPX Express for on-premises and cloud deployments does
not require a license file. For more information on NetScaler VPX Express see the “NetScaler VPX Ex-
press license” section in NetScaler Licensing Overview.
Note
Regardless of the subscription-based hourly license bought from Azure Marketplace, in rare
cases, the NetScaler VPX instance deployed on Azure might come up with a default NetScaler
license. This happens due to issues with Azure Instance Metadata Service (IMDS).
Do a warm restart before making any configuration change on the NetScaler VPX instance, to
enable the correct NetScaler VPX license.
Limitations
Running the NetScaler VPX load balancing solution on ARM imposes the following limitations:
1. The Azure architecture does not accommodate support for the following NetScaler features:
• Clustering
• IPv6
• Gratuitous ARP (GARP)
• L2 Mode
• Tagged VLAN
• Dynamic Routing
• Virtual MAC (VMAC)
• USIP
• Jumbo Frames
2. If you expect that you might have to shut down and temporarily deallocate the NetScaler VPX virtual
machine at any time, assign a static Internal IP address while creating the virtual machine. If you do
not assign a static internal IP address, Azure might assign the virtual machine a different IP address
each time it restarts, and the virtual machine might become inaccessible.
3. In an Azure deployment, only the following NetScaler VPX models are supported: VPX 10, VPX 200,
VPX 1000, and VPX 3000. For for information, see the NetScaler VPX Data Sheet.
If you use a NetScaler VPX instance with a model number higher than VPX 3000, the network through-
put might not be the same as specified by the instance’s license. However, other features, such as SSL
throughput and SSL transactions per second, might improve.
4. The “deployment ID” that is generated by Azure during virtual machine provisioning is not visible
to the user in ARM. You cannot use the deployment ID to deploy NetScaler VPX appliance on ARM.
5. The NetScaler VPX instance supports 20 Mb/s throughput and standard edition features when it’s
initialized.
6. For a XenApp and XenDesktop deployment, a VPN virtual server on a VPX instance can be configured
in the following modes:
• Basic mode, where the ICAOnly VPN virtual server parameter is set to ON. The Basic mode works
fully on an unlicensed NetScaler VPX instance.
• Smart-Access mode, where the ICAOnly VPN virtual server parameter is set to OFF. The Smart-
Access mode works for only 5 NetScaler AAA session users on an unlicensed NetScaler VPX in-
stance.
Note
To configure the Smart Control feature, you must apply a Platinum license to the NetScaler VPX
instance.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can provision a single NetScaler VPX instance in Azure Resource Manager (ARM) portal in a stan-
dalone mode by creating the virtual machine and configuring other resources.
On the Microsoft Azure Portal page, log on to the Azure Resource Manager portal by providing your
user name and password.
Note
In ARM portal, clicking an option in one pane opens a new pane to the right. Navigate from one
pane to another to configure your device.
Create a new resource group that is a container for all your resources. Use the resource group to de-
ploy, manage, and monitor your resources as a group.
Create a network security group (NSG) to assign inbound and outbound rules to control the incoming
and outgoing traffic within the virtual network. NSG allows you to define security rules for a single
virtual machine and also to define security rules for a virtual network subnet.
Note
Ensure that you have selected the correct location. The list of resources that appear in the drop-
down list is different for different locations.
Virtual networks in ARM provide a layer of security and isolation to your services. VMs and services
that are part of the same virtual network can access each other.
2. In the Virtual Network pane, ensure the deployment mode is Resource Manager and click Create.
3. In the Create virtual network pane, enter the following values, and then click Create.
1. Select the newly created virtual network from All resources pane and in the Settings pane, click
Subnets.
2. Click +Subnet and create the second subnet by entering the following details.
3. Click Create.
The ARM IaaS infrastructure storage includes all services where we can store data in the form of blobs,
tables, queues, and files. You can also create applications using these forms of storage data in ARM.
An availability set guarantees that at least one VM is kept up and running in case of planned or un-
planned maintenance. Two or more VMs under the same ‘availability set’ are placed on different fault
domains to achieve redundant services.
1. Click +New.
2. Click See all in the MARKETPLACE pane and click Virtual Machines.
3. Search for availability set, and then select Availability set entity from the list displayed.
4. Click Create, and in the Create availability set pane, enter the following details:
5. Click Create.
Create an instance of NetScaler VPX in the virtual network. Obtain the NetScaler VPX image from
the Azure marketplace, and then use the Azure Resource Manager portal to create a NetScaler VPX
instance.
Before you begin creating the NetScaler VPX instance, make sure that you have created a virtual net-
work with required subnets in which the instance will reside. You can create virtual networks during
VM provisioning, but without the flexibility to create different subnets. For information about cre-
ating virtual networks, see http://azure.microsoft.com/en-us/documentation/articles/create-virtual-
network/.
Optionally, configure DNS server and VPN connectivity that allows a virtual machine to access Internet
resources.
Note
Citrix recommends that you create resource group, network security group, virtual network, and
other entities before you provision the NetScaler VPX VM, so that the network information is avail-
able during provisioning.
As a quick way to find any entity on ARM portal, you can also type the name of the entity in the
Azure Marketplace search box and press <Enter>. Type NetScaler in the search box to find the Citrix
NetScaler images.
Note
Ensure to select the latest image. Your Citrix NetScaler image might have the release number in
the name.
3. On the NetScaler VPX Bring Your Own License page, from the drop-down list, select Resource
Manager and click Create.
4. In the Create virtual machine pane, specify the required values in each section to create a virtual
machine. Click OK in each section to save your configuration.
Basic:
You can create a resource group here, but Citrix recommends that you create a resource group from
Resource groups in Azure Resource Manager and then select the group from the drop-down list.
Size:
Depending on the VM disk type, SDD or HDD, you selected in Basic settings, the disk sizes are dis-
played.
Settings:
Summary:
The configuration settings are validated and the Summary page displays the result of the validation.
If the validation fails, the Summary page displays the reason of the failure. Go back to the particular
section and make changes as required. If the validation passes, click OK.
Buy:
Review the offer details and legal terms on the Purchase page and click Purchase.
For high availability deployment, create two independent instances of NetScaler VPX in the same avail-
ability set and in the same resource group to deploy them in active-standby configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
This section explains how to configure a standalone NetScaler VPX instance with multiple IP ad-
dresses, in Azure Resource Manager (ARM). The VPX instance can have one or more NIC attached to it,
and each NIC can have one or more static or dynamic public and private IP addresses assigned to it.
You can assign multiple IP addresses as NSIP, VIP, SNIP, and so on.
For more information, see the Azure documentation Assign multiple IP addresses to virtual machines
using the Azure portal.
If you want to use PowerShell commands, see Configuring multiple IP addresses for a NetScaler VPX
instance in standalone mode by using PowerShell commands.
Use case
In this use case, a standalone NetScaler VPX appliance is configured with a single NIC that is connected
to a virtual network (VNET). The NIC is associated with three IP configurations (ipconfig), each servers
a different purpose - as shown in the table.
Note
Diagram: Topology
Note
In a multi-NIC, multi-IP Azure NetScaler VPX deployment, the private IP associated with the pri-
mary (first) IPConfig of the primary (first) NIC is automatically added as the management NSIP of
the appliance. The remaining private IP addresses associated with IPConfigs need to be added
in the VPX instance as a VIP or SNIP by using the “add ns ip” command, according to your require-
ment.
Before you begin, create a VPX instance by following the steps given at this link:
Configure a NetScaler VPX standalone instance
For this use case, the NSDoc0330VM VPX instance is created.
Procedure to configure multiple IP addresses for a NetScaler VPX instance in standalone mode.
For configuring multiple IP addresses for a NetScaler VPX appliance in standalone mode:
1. Add IP addresses to the VM
2. Configure NetScaler -owned IP addresses
Step 1: Add IP addresses to the VM
1. In the portal, click More services > type virtual machines in the filter box, and then click Virtual
machines.
2. In the Virtual machines blade, click the VM you want to add IP addresses to. Click Network inter-
faces in the virtual machine blade that appears, and then select the network interface.
In the blade that appears for the NIC you selected, click IP configurations. The existing IP configu-
ration that was assigned when you created the VM, ipconfig1, is displayed. For this use case, make
sure the IP addresses associated with ipconfig1 are static. Next, create two more IP configurations:
ipconfig2 (VIP) and ipconfig3 (SNIP).
To create additional ipconfigs, create Add.
In the Add IP configuration window, enter a Name, specify allocation method as Static, enter an IP
address (192.0.0.5 for this use case), and enable Public IP address.
Note
Before adding a static private IP address, check for IP address availability and make sure the IP
address belongs to the same subnet to which the NIC is attached.
Next, click Configure required settings to create a static public IP addresss for ipconfig2.
By default, public IPs are dynamic. To make sure that the VM always uses the same public IP address,
create a static Public IP.
In the Create public IP address blade, add a Name, under Assignment click Static. And then click OK.
Note
Even when you set the allocation method to static, you cannot specify the actual IP address as-
signed to the public IP resource. Instead, it gets allocated from a pool of available IP addresses
in the Azure location the resource is created in.
Follow the steps to add one more IP configuration for ipconfig3. Public IP is not mandatory.
Configure the NetScaler-owned IP addresses by using the GUI or the command “add ns ip.” For more
information, see Configuring NetScaler-Owned IP Addresses.
You’ve now configured multiple IP addresses for a NetScaler VPX instance in standalone mode.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can deploy a pair of NetScaler virtual appliances with multiple NICs in an active-passive high avail-
ability (HA) setup on Azure. Each NIC can contain multiple IP addresses.
• The Azure Load Balancer (ALB) in Direct Server Return (DSR) mode
All traffic goes through the primary node. The secondary node remains in standby mode until
the primary node fails.
Note
For a Citrix VPX high availability deployment on Azure cloud to work, you need a floating public
IP (PIP) that can be moved between the two VPX nodes. The Azure Load Balancer (ALB) provides
that floating PIP, which is moved to the second node automatically in the event of a failover.
Diagram: Example of a high availability deployment architecture, using Azure Availability Set
In an active-passive deployment, the ALB floating public IP (PIP) addresses are added as the VIP ad-
dresses in each VPX node. In HA-INC configuration, the VIP addresses are floating and SNIP addresses
are instance specific.
ALB monitors each VPX instances by sending health probe at every 5 seconds and redirects traffic to
that instance only that sends health probes response on regular interval. So in an HA setup, the pri-
mary node responds to health probes and secondary does not. If the primary instance misses two
consecutive health probes, ALB does not redirect traffic to that instance. On failover, the new primary
starts responding to health probes and the ALB redirects traffic to it. The standard VPX high availabil-
ity failover time is three seconds. The total failover time that might take for traffic switching can be
maximum of 13 seconds.
You can deploy a VPX pair in active-passive high availability mode in two ways by using:
• NetScaler VPX standard high availability template: use this option to configure an HA pair
with the default option of three subnets and six NICs.
• Windows PowerShell commands: use this option to configure an HA pair according to your
subnet and NIC requirements.
This topic describes how to deploy a VPX pair in active-passive HA setup by using the Citrix template.
If you want to use PowerShell commands, see Configuring an HA Setup with Multiple IP Addresses and
NICs by Using PowerShell Commands.
You can quickly and efficiently deploy a pair of VPX instances in HA-INC mode by using the standard
template. The template creates two nodes, with three subnets and six NICs. The subnets are for
management, client, and server-side traffic, and each subnet has two NICs for both the VPX instances.
You can get the NetScaler 12.0 HA Pair template at the Azure Marketplace.
Complete the following steps to launch the template and deploy a high availability VPX pair, by using
Azure Availability Sets.
1. From Azure Marketplace, select and initiate the Citrix solution template. The template appears.
3. The Basics page appears. Create a Resource Group and select OK.
4. The General Settings page appears. Type the details and select OK.
5. The Network Setting page appears. Check the vnet and subnet configurations, edit the required
settings, and select OK.
6. The Summary page appears. Review the configuration and edit accordingly. Select OK to confirm.
It might take a moment for the Azure Resource Group to be created with the required configurations.
After completion, select the Resource Group in the Azure portal to see the configuration details, such
as LB rules, back-end pools, health probes, and so on. The high availability pair appears as ns-vpx0
and ns-vpx1.
If further modifications are required for your HA setup, such as creating more security rules and ports,
you can do that from the Azure portal.
Next, you need to configure the load-balancing vserver with the ALB public IP (PIP) address, on each
node. To find the ALB PIP, select ALB > Frontend IP configuration.
See the Resources section for more information about how to configure the load-balancing vserver.
Resources:
The following links provide additional information related to HA deployment and virtual server
(vserver) configuration:
Related resources:
• Configure a high-availability setup with multiple IP addresses and NICs by using PowerShell
commands
• Configuring GSLB on Active-Standby HA Deployment on Azure
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can deploy a pair of NetScaler VPX instances with multiple NICs in an active-passive high avail-
ability (HA) setup on Azure. Each NIC can contain multiple IP addresses.
All traffic goes through the primary node. The secondary node remains in standby mode until the
primary node fails.
Note
For a NetScaler VPX high availability deployment on Azure cloud to work, you need a floating
public IP (PIP) that can be moved between the two high-availability nodes. The Azure Load Bal-
ancer (ALB) provides that floating PIP, which is moved to the second node automatically in the
event of a failover.
In an active-passive deployment, the ALB floating public IP (PIP) addresses are added as the VIP ad-
dresses in each VPX node. In HA-INC configuration, the VIP addresses are floating and SNIP addresses
are instance specific.
ALB monitors each VPX instances by sending health probe at every 5 seconds and redirects traffic
to that instance only that sends health probes response on regular interval. So in an HA setup, the
primary node responds to health probes and secondary does not. If the primary instances misses
two consecutive health probes, ALB does not redirect traffic to that instance. On failover, the new
primary starts responding to health probes and the ALB redirects traffic to it. The standard VPX high
availability failover time is three seconds. The total failover time that might take for traffic switching
can be maximum of 13 seconds.
You can deploy a VPX pair in active-passive HA setup in two ways by using:
• NetScaler VPX Standard high availability template: use this option to configure an HA pair
with the default option of three subnets and six NICs.
• Windows PowerShell commands: use this option to configure an HA pair according to your
subnet and NIC requirements.
This topic describes how to deploy a VPX pair in active-passive HA setup by using PowerShell com-
mands. If you want to use the NetScaler VPX Standard HA template, see Configuring an HA Setup with
Multiple IP Addresses and NICs.
In this scenario, you deploy a NetScaler VPX pair by using the topology given in the table. Each VPX
instance contains three NICs, with each NIC is deployed in a different subnet. Each NIC is assigned
an IP configuration.
ALB|VPX1|VPX2
|–|–|–|
|ALB is associated with public IP 3 (pip3)|Management IP is configured with IPConfig1, which includes
one public IP (pip1) and one private IP (12.5.2.24); nic1; Mgmtsubnet=12.5.2.0/24|Management IP is con-
figured with IPConfig5, which includes one public IP (pip3) and one private IP (12.5.2.26);nic4;Mgmtsubnet=12.5.2.0/
|LB rules and port configured are HTTP (80),SSL (443), health probe (9000)|Client-side IP is configured
with IPConfig3, which includes one private IP(12.5.1.27);nic2; FrontEndsubet=12.5.1.0/24|Client-side IP
is configured with IPConfig7, which includes one private IP (12.5.1.28);nic5;FrontEndsubet=12.5.1.0/24|
|-|Server-side IP is configured with IPConfig4, which includes one private IP(12.5.3.24); nic3;BackendSubnet=12.5.3.0
side IP is configured with IPConfig8, which includes one private IP(12.5.3.28);nic6;BackendSubnet=12.5.3.0/24|
|-|Rules and ports for NSG areSSH (22),HTTP (80),HTTPS (443)|-|
Parameter settings
$rgName = “MulitIP-MultiNIC-RG”
$nicName1= “VM1-NIC1”
$nicName2 = “VM1-NIC2”
$nicName3= “VM1-NIC3”
$nicName4 = “VM2-NIC1”
$nicName5= “VM2-NIC2”
$nicName6 = “VM2-NIC3”
$vNetName = “Azure-MultiIP-ALB-vnet”
$vNetAddressRange= “12.5.0.0/16”
$frontEndSubnetName= “frontEndSubnet”
$frontEndSubnetRange= “12.5.1.0/24”
$mgmtSubnetName= “mgmtSubnet”
$mgmtSubnetRange= “12.5.2.0/24”
$backEndSubnetName = “backEndSubnet”
$backEndSubnetRange = “12.5.3.0/24”
$prmStorageAccountName = “multiipmultinicbstorage”
$avSetName = “multiple-avSet”
$vmSize= “Standard_DS4_V2”
$publisher = “citrix”
$offer = “netscalervpx-120”
$sku = “netscalerbyol”
$version=”latest”
$pubIPName1=”VPX1MGMT”
$pubIPName2=”VPX2MGMT”
$pubIPName3=”ALBPIP”
$domName1=”vpx1dns”
$domName2=”vpx2dns”
$domName3=”vpxalbdns”
$vmNamePrefix=”VPXMultiIPALB”
$osDiskSuffix1=”osmultiipalbdiskdb1”
$osDiskSuffix2=”osmultiipalbdiskdb2”
$lbName= “MultiIPALB”
$frontEndConfigName1= “FrontEndIP”
$backendPoolName1= “BackendPoolHttp”
$lbRuleName1= “LBRuleHttp”
$healthProbeName= “HealthProbe”
$nsgName=”NSG-MultiIP-ALB”
$rule1Name=”Inbound-HTTP”
$rule2Name=”Inbound-HTTPS”
$rule3Name=”Inbound-SSH”
To complete the deployment, complete the following steps by using PowerShell commands:
17
18
19 $nsg = New-AzureRmNetworkSecurityGroup -ResourceGroupName $rgName -
Location $locName -Name $nsgName -SecurityRules $rule1,$rule2,$rule3
1 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
$frontEndSubnetName -AddressPrefix $frontEndSubnetRange (this
parameter value should be as per your requirement)
2
3
4 $mgmtSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name $mgmtSubnetName
-AddressPrefix $mgmtSubnetRange
5
6
7 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
$backEndSubnetName -AddressPrefix $backEndSubnetRange
8
9
10 $vnet =New-AzureRmVirtualNetwork -Name $vNetName -ResourceGroupName
$rgName -Location $locName -AddressPrefix $vNetAddressRange -Subnet
$frontendSubnet,$backendSubnet, $mgmtSubnet
11
12
13 $subnetName =”frontEndSubnet”
14
15
16 $subnet1=$vnet.Subnets|?{
17 $_.Name -eq $subnetName }
18
19
20
21 $subnetName=”backEndSubnet”
22
23
24 $subnet2=$vnet.Subnets|?{
25 $_.Name -eq $subnetName }
26
27
28
29 $subnetName=”mgmtSubnet”
30
31
32 $subnet3=$vnet.Subnets|?{
1 $IpConfigName1 = ”IPConfig1”
2
3
4 $IPAddress = ”12.5.2.24”
5
6
7 $IPConfig1=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName1 -
Subnet $subnet3 -PrivateIpAddress $IPAddress -PublicIpAddress $pip1
-Primary
8
9
10 $IPConfigName3=”IPConfig-3”
11
12
13 $IPAddress=”12.5.1.27”
14
15
16 $IPConfig3=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName3 -
Subnet $subnet1 -PrivateIpAddress $IPAddress -Primary
17
18
19 $IPConfigName4 = ”IPConfig-4”
20
21
22 $IPAddress = ”12.5.3.24”
23
24
25 $IPConfig4 = New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName4 -
Subnet $subnet2 -PrivateIpAddress $IPAddress -Primary
1 $IpConfigName5 = ”IPConfig5”
2
3
4 $IPAddress=”12.5.2.26”
5
6
7 $IPConfig5=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName5 -
Subnet $subnet3 -PrivateIpAddress $IPAddress -PublicIpAddress $pip2
-Primary
8
9
10 $IPConfigName7=”IPConfig-7”
11
12
13 $IPAddress=”12.5.1.28”
14
15
16 $IPConfig7=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName7 -
Subnet $subnet1 -PrivateIpAddress $IPAddress -Primary
17
18
19 $IPConfigName8=”IPConfig-8”
20
21
22 $IPAddress=”12.5.3.28”
23
24
25 $IPConfig8=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName8 -
Subnet $subnet2 -PrivateIpAddress $IPAddress -Primary
Create VPX1.
This step includes the following substeps:
• Create VM config object
• Set credentials, OS, and image
• Add NICs
• Specify OS disk and create VM
1 $suffixNumber = 1
2
3
4 $vmName=$vmNamePrefix + $suffixNumber
5
6
7 $vmConfig=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avSet.Id
8
9
10 $cred=Get-Credential -Message ”Type the name and password for VPX login
.”
11
12
13 $vmConfig=Set-AzureRMVMOperatingSystem -VM $vmConfig -Linux -
ComputerName $vmName -Credential $cred
14
15
16 $vmConfig=Set-AzureRMVMSourceImage -VM $vmConfig -PublisherName
$publisher -Offer $offer -Skus $sku -Version $version
17
18
19 $vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic1.Id -
Primary
20
21
22 $vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic2.Id
23
24
25 $vmConfig=Add-AzureRMVMNetworkInterface -VM $vmConfig -Id $nic3.Id
26
27
28 $osDiskName=$vmName + ”-” + $osDiskSuffix1
29
30
31 $osVhdUri=$prmStorageAccount.PrimaryEndpoints.Blob.ToString() + ”vhds/”
+ $osDiskName + ”.vhd”
32
33
34 $vmConfig=Set-AzureRMVMOSDisk -VM $vmConfig -Name $osDiskName -VhdUri
$osVhdUri -CreateOption fromImage
35
36
37 Set-AzureRmVMPlan -VM $vmConfig -Publisher $publisher -Product $offer -
Name $sku
38
39
40 New-AzureRMVM -VM $vmConfig -ResourceGroupName $rgName -Location
$locName
Create VPX2.
1 $suffixNumber=2
2
3
4 $vmName=$vmNamePrefix + $suffixNumber
5
6
To view private and public IP addresses assigned to the NICs, type the following commands:
1 $nic1.IPConfig
2
3
4 $nic2.IPConfig
5
6
7 $nic3.IPConfig
8
9
10 $nic4.IPConfig
11
12
13 $nic5.IPConfig
14
15
16 $nic6.IPConfig
1 $frontEndIP1=New-AzureRmLoadBalancerFrontendIpConfig -Name
$frontEndConfigName1 -PublicIpAddress $pip3
2
3
4 $healthProbe=New-AzureRmLoadBalancerProbeConfig -Name $healthProbeName
-Protocol Tcp -Port 9000 ‒ IntervalInSeconds 5 -ProbeCount 2
5
6
7 $beAddressPool1=New-AzureRmLoadBalancerBackendAddressPoolConfig -Name
$backendPoolName1
8
9
10 $lbRule1=New-AzureRmLoadBalancerRuleConfig -Name $lbRuleName1 -
FrontendIpConfiguration $frontEndIP1 -BackendAddressPool
$beAddressPool1 -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -
BackendPort 80 -EnableFloatingIP
11
12
13 $lb=New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name $lbName -
Location $locName -FrontendIpConfiguration $frontEndIP1 -
LoadBalancingRule $lbRule1 -BackendAddressPool $beAddressPool1 -
Probe $healthProbe
14
15
16 $nic2.IpConfigurations[0].LoadBalancerBackendAddressPools.Add($lb.
BackendAddressPools[0])
17
18
19 $nic5.IpConfigurations[0].LoadBalancerBackendAddressPools.Add($lb.
BackendAddressPools[0])
20
21
22 $lb=$lb |Set-AzureRmLoadBalancer
23
24
25 $nic2=$nic2 | Set-AzureRmNetworkInterface
26
27
28 $nic5=$nic5 | Set-AzureRmNetworkInterface
After you’ve successfully deployed the NetScaler VPX pair, log on to each VPX instance to configure
HA-INC, and SNIP and VIP addresses.
2. Add private IP addresses of client-side NICs as SNIPs for VPX1 (NIC2) and VPX2 (NIC5)
3. Add load-balancing vserver on the primary node with front-end IP address (public IP) of ALB.
Related resources:
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Note
For a Citrix VPX high availability deployment on Azure cloud to work, you need a floating public IP
(PIP) that can be moved between the two NetS high availability nodes. The Azure Load Balancer
(ALB) provides that floating PIP, which is moved to the second node automatically in the event
of a failover.
Two types of Azure load balancers are available for high availability:
• Azure external load balancer: If the client traffic originates from the Internet, you have to de-
ploy the external load balancer between the Internet and the NetScaler VPX instances to dis-
tribute client traffic.
• Azure internal load balancer: If the client traffic originates from within the virtual network, or
is forwarded by a gateway or firewall within the virtual network, you have to deploy the internal
load balancer to distribute client traffic.
To achieve high availability on Azure, you must add the two VPX instances as a load balanced set and
configure the NSG.
When two NetScaler VPX instances are configured in active-active mode, both instances must have the
same configuration. The client traffic is distributed across the virtual servers in both the instances by
the Azure load balancer. The VIP addresses in both the instances are different and should match the
NSIP of that VPX instance.
The active-passive mode provides failover capability. In this mode, the VPX instances synchronize
their configuration states. When the primary instance fails, the secondary instance takes over.
For information about high availability in NetScaler appliances, see High availability.
Note the following before you begin configuring the VPX instances in high availability mode in the
Azure virtual network.
• The two NetScaler VPX instances that you want to add to a load balanced set should be provi-
sioned in the same virtual network.
• A load balanced set applies only to a VM’s default NIC. Therefore the VIP has to be configured on
the default NIC of the VPX instance.
• In an active-passive deployment, the Azure load balancer monitors both the primary and the
secondary VPX instance by sending them TCP probes. These TCP probes are sent on port 9000.
After configuring all the resources, you can configure the VMs in high availability mode with either an
external load balancer or with an internal load balancer.
This article provides procedures to configure resources specific to high availability mode. For proce-
dures to configure the other resources, see Configure a NetScaler VPX standalone instance.
You need to set up two NetScaler VPX instances for high availability mode. To set up a NetScaler VPX
instance, see the “Configuring a NetScaler VPX Instance” section in Configure a NetScaler standalone
instance.
Create a load balancer to distribute traffic between the vidtaul machines that are part of the same
virtual network. The load balancing features can load balance level 4 traffic and support only TCP
and UDP traffic.
1. To create an external load balancer, follow similar steps as creating an internal load balancer
with the following differences:
• Schema - select Public
• Public IP address - assign a public IP address to the external load balancer
2. Click Create.
Create custom TCP or HTTP probes to monitor the health of the various server instances. When the
VM fails to respond to the probe for three consecutive times, the Azure load balancer will not send the
traffic to the nonresponsive VM.
1. Click All resources and search for the load balancer that you created by typing the name in the
search box.
2. In the Settings pane, click Probes.
3. Click +Add and in the Add probe pane, enter the following details:
4. Click OK.
Create backend pools, that is, a pool of IP addresses associated with the virtual machine Network
Interface Cards (NIC) to which the load is distributed.
1. Click All resources and search for the load balancer that you have created by typing the name
in the search box.
2. In the Settings pane, select Backend pools.
3. Click +Add and in the Add backend pool pane, enter the following details:
• Name of the backend pool
• Availability set - select the availability set created earlier
• Virtual machines - select the NetScaler VPX instances that are in high availability deploy-
ment. Press <Ctrl> to select multiple instances.
4. Click OK.
Create custom NAT rules on LB to define the inbound traffic flowing through the front end IP address
and distributed to the back end IP address. Make sure that no two NAT rules has the combination of
same service and same target port.
Note
A front end IP address is the external IP address on the load balancer that faces the incoming
traffic and a back end IP address is the VM facing IP address that receives the traffic from the
load balancer.
1. Click All resources and search for the load balancer that you have created by typing the name
in the search box.
2. In the Settings pane, select Inbound NAT rules.
3. Click +Add and in the Add inbound NAT rule pane, add a NAT rule for each type of request. You
can add multiple NAT rules.
4. Enter the following details, and then click OK.
• Name of the rule
• Service - select the required service from the drop-down list
• Port - type the correct port number
• Target - select the NetScaler VPX that will be the target of this rule
• Target port - the target port is automatically populated depending on the service selected
Note
Citrix recommends TCP services for the NetScaler VPX VM on port 9000.
By creating a load balancer rule, you can define a combination of a front end IP address and port, and
back end IP address and port associated with VMs.
For example, create a rule so that all HTTP requests coming on the public IP will be forwarded to the
availability set on their port 80.
1. Click All resources and search for the load balancer that you have created by typing the name
in the search box.
2. In the Settings pane, select Load balancing rules.
3. Click +Add and in the Add load balancing rules pane, create load balancing rules for each type
of incoming network traffic.
4. Enter the following details:
• Name of the rule
• Protocol - select the protocol
• Port - type the port number based on the port selected
• Backend pool - select the backend pool from the drop-down list
• Probe - select the health probe from the drop-down list
5. Click OK.
Configure NetScaler VPX high availability with the Azure external load balancer
If your client traffic originates from the Internet, you have to deploy the external load balancer to
create a high availability configuration of NetScaler VPX instances in a load-balanced set.
The following figure shows how high availability is achieved in active-active mode by using the exter-
nal load balancer. The two VPX instances are in a load-balanced set that accepts client traffic from
the Internet over port 15000. The Azure external load balancer load balances these client requests
between the two virtual machines.
Before you begin configuring the load-balanced set through the Azure portal, do one of the following:
• For an active-passive deployment, configure the NetScaler VPX instances as primary and sec-
ondary nodes by using the following command: add ha node <ID> <IP address>.
• For an active-active deployment, configure the required services on the two NetScaler VPX in-
stances.
Configure NetScaler VPX high availability with the Azure internal load balancer
If your client traffic originates from within the virtual network with a regional scope, you have to de-
ploy the internal load balancer to achieve high availability of NetScaler VPX instances added to a load-
balanced set.
The following figure shows how high availability is achieved in an active-active mode by using the
internal load balancer. The two NetScaler VPX instances are in a load-balanced set that accepts client
traffic from the Internet at port 15001. The Azure internal load balancer load balances these client
requests between the two virtual machines.
Before you begin configuring the load-balanced set by using Azure PowerShell, do one of the follow-
ing:
• For an active-passive deployment, configure the NetScaler VPX instances as primary and sec-
ondary nodes by using the following command: add ha node <ID> <IP address>.
• For an active-active deployment, configure the required services on the two NetScaler VPX in-
stances.
You can configure the load-balanced set only by using Azure PowerShell.
You can access the VPX instance either through its graphical user interface (GUI) or through the com-
mand line interface (CLI). You can use the PIP to access the NetScaler VPX instance instance.
To log on to the virtual machine, use your username and password specified while creating the virtual
machine.
You can change the password after you log on to the instance.
In a browser’s address field, type the virtual network public IP address provided by Azure during virtual
machine provisioning, or type the PIP address.
Note
Make sure you have created NSG inbound or outbound rules to allow access to the private port
80 or 443 when accessing the GUI by using the virtual network IP.
Use any command line access tool (for example, Putty). Specify either the virtual network public IP
address provided by Azure during NetScaler VPX provisioning, or specify the PIP address. Use SSH
protocol with port 22.
Note
Make sure that you have created NSG inbound or outbound rules to allow access to private port
For information about getting started with a NetScaler appliance, see the Getting started with
NetScaler.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
NetScaler appliances configured for global server load balancing (GSLB) provide disaster recovery and
continuous availability of applications by protecting against points of failure in a wide area network
(WAN). GSLB can balance the load across data centers by directing client requests to the closest or
best performing data center, or to surviving data centers in case of an outage.
This section describes how to enable GSLB on VPX instances on two sites in a Microsoft Azure environ-
ment, by using Windows PowerShell commands.
Note
For more information about GSLB, see Global Server Load Balancing.
You can configure GSLB on a NetScaler VPX instances on Azure, in two steps:
1. Create a VPX instance with multiple NICs and multiple IP addresses, on each site.
2. Enable GSLB on the VPX instances.
Note
For more information about configuring multiple NICs and IP addresses see:
• Configure multiple IP addresses for a NetScaler VPX instance in standalone mode by using
PowerShell commands
Scenario
This scenario includes two sites - Site 1 and Site 2. Each site has a VM (VM1 and VM2) configured with
multiple NICs, multiple IP addresses, and GSLB.
Figure. GSLB setup implemented across two sites - Site 1 and Site 2.
In this scenario, each VM has three NICs - NIC 0/1, 1/1, and 1/2. Each NIC can have multiple private and
public IP addresses. The NICs are configured for the following purposes.
For information about the IP addresses configured on each NIC in this scenario, see the
IP configuration details section.
Parameters
Following are sample parameters settings for this scenario in this document. You can use different
settings if you wish.
$vnetName=”NSVPX-vnet”
$RGName=”multiIP-RG”
$prmStorageAccountName=”multiipstorageaccnt”
$avSetName=”MultiIP-avset”
$vmSize=”Standard_DS3_V2”
Note: The minimum requirement for a VPX instance is 2 vCPUs and 2GB RAM.
$publisher=”citrix”
$offer=”netscalervpx111”
$sku=”netscalerbyol”
$version=”latest”
$vmNamePrefix=”MultiIPVPX”
$nicNamePrefix=”MultiipVPX”
$osDiskSuffix=”osdiskdb”
$numberOfVMs=1
$ipAddressPrefix=”10.0.0.”
$ipAddressPrefix1=”10.0.1.”
$ipAddressPrefix2=”10.0.2.”
$pubIPName1=”MultiIP-pip1”
$pubIPName2=”MultiIP-pip2”
$IpConfigName1=”IPConfig1”
$IPConfigName2=”IPConfig-2”
$IPConfigName3=”IPConfig-3”
$IPConfigName4=”IPConfig-4”
$frontendSubnetName=”default”
$backendSubnetName1=”subnet_1”
$backendSubnetName2=”subnet_2”
$suffixNumber=10
Create a VM
Follow steps 1-10 to create VM1 with multiple NICs and multiple IP addresses, by using PowerShell
commands:
6. Create NICs
9. Add NICs
After you complete all the steps and commands to create VM1, repeat these steps to create VM2 with
parameters specific to it.
1 $prmStorageAccount=New-AzureRMStorageAccount -Name
$prmStorageAccountName -ResourceGroupName $RGName -Type Standard_LRS
-Location $location
1. Add subnets.
1 $subnet1=New-AzureRmVirtualNetworkSubnetConfig -Name
$frontendSubnetName -AddressPrefix ”10.0.0.0/24”
2 $subnet2=New-AzureRmVirtualNetworkSubnetConfig -Name
$backendSubnetName1 -AddressPrefix ”10.0.1.0/24”
3 $subnet3=New-AzureRmVirtualNetworkSubnetConfig -Name
$backendSubnetName2 -AddressPrefix ”10.0.2.0/24”
3. Retrieve subnets.
1 $frontendSubnet=$vnet.Subnets|?{
2 $_.Name -eq $frontendSubnetName }
3
4 $backendSubnet1=$vnet.Subnets|?{
5 $_.Name -eq $backendSubnetName1 }
6
7 $backendSubnet2=$vnet.Subnets|?{
8 $_.Name -eq $backendSubnetName2 }
Create NICs
1 $vmName=$vmNamePrefix
2 $vmConfig=New-AzureRMVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avSet.Id
1 $cred=Get-Credential -Message ”Type the name and password for VPX login
.”
2 $vmConfig=Set-AzureRMVMOperatingSystem -VM $vmConfig -Linux -
ComputerName $vmName -Credential $cred
3 $vmConfig=Set-AzureRMVMSourceImage -VM $vmConfig -PublisherName
$publisher -Offer $offer -Skus $sku -Version $version
Add NICs
Note
Repeat steps 1-10 listed in “Create Multi-NIC VMs by Using PowerShell Commands” to create VM2
with parameters specific to VM2.
IP configuration details
Here are sample configurations for this scenario, showing the IP addresses and intial LB configurations
as created through the NetScaler VPX CLI for VM1 and VM2.
Perform the tasks described in the following topic to configure the two GSLB sites and other necessary
settings:
For additional information about how to configure GSLB on NetScaler VPX instances, click the follow-
ing image to watch the video about Configuring NetScaler GSLB in Microsoft Azure.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can configure global server load balancing (GSLB) on active-standby HA deployment on Azure in
three steps:
1. Create a VPX HA pair on each GSLB site. See Configure a high-availability setup with multiple IP
addresses and NICs for information about how to create an HA pair.
2. Configure the Azure Load Balancer (ALB) with the front-end IP address and rules to allow GSLB and
DNS traffic.
This step involves the following substeps. See the scenario in this section for the PowerShell com-
mands used to complete these substeps.
Scenario
This scenario includes two sites - Site 1 and Site 2. Each site has an HA pair (HA1 and HA2) configured
with multiple NICs, multiple IP addresses, and GSLB.
In this scenario, each VM has three NICs - NIC 0/1, 1/1, and 1/2. The NICs are configured for the following
purposes.
Parameter Settings
Following are sample parameters settings for the ALB. You can use different settings if you want.
$rgName=”MulitIP-MultiNIC-RG”
$pubIPName4=”PIPFORGSLB1”
$domName4=”vpxgslbdns”
$lbName=”MultiIPALB”
$frontEndConfigName2=”FrontEndIP2”
$backendPoolName1=”BackendPoolHttp”
$lbRuleName2=”LBRuleGSLB1”
$lbRuleName3=”LBRuleGSLB2”
$lbRuleName4=”LBRuleDNS”
$healthProbeName=”HealthProbe”
Configure ALB with the front-end IP address and rules to allow GSLB and DNS traffic
4 $frontendipconfig2=Get-AzureRmLoadBalancerFrontendIpConfig -
LoadBalancer $alb -Name $frontEndConfigName2
5
6
7 $backendPool=Get-AzureRmLoadBalancerBackendAddressPoolConfig -
LoadBalancer $alb -Name $backendPoolName1
8
9
10 $healthprobe=Get-AzureRmLoadBalancerProbeConfig -LoadBalancer $alb -
Name $healthProbeName
11
12
13 $alb | Add-AzureRmLoadBalancerRuleConfig -Name $lbRuleName2 -
BackendAddressPool $backendPool -FrontendIPConfiguration
$frontendipconfig2 -Protocol ”Tcp” -FrontendPort 3011 -BackendPort
3011 -Probe $healthprobe -EnableFloatingIP | Set-
AzureRmLoadBalancer
14
15
16 $alb | Add-AzureRmLoadBalancerRuleConfig -Name $lbRuleName3 -
BackendAddressPool $backendPool -FrontendIPConfiguration
$frontendipconfig2 -Protocol ”Tcp” -FrontendPort 3010 -BackendPort
3010 -Probe $healthprobe -EnableFloatingIP | Set-
AzureRmLoadBalancer
17
18
19 $alb | Add-AzureRmLoadBalancerRuleConfig -Name $lbRuleName4 -
BackendAddressPool $backendPool -FrontendIPConfiguration
$frontendipconfig2 -Protocol ”Udp” -FrontendPort 53 -BackendPort 53
-Probe $healthprobe -EnableFloatingIP | Set-AzureRmLoadBalancer
Now you’ve two front-end IP addresses for each ALB: ALB 1 and ALB 2. One IP address is for the LB
virtual server and the other for the GSLB site IP.
Related resources:
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In some situations, users who connect with the Citrix Gateway Plug-in need a unique IP address for a
NetScaler Gateway appliance. When you enable address pools (also known as IP pooling) for a group,
the Citrix Gateway appliance can assign a unique IP address alias to each user. You configure address
pools by using intranet IP (IIP) addresses.
You can configure address pools on a Citrix Gateway appliance deployed on Azure by following this
2-step procedure:
• Registering the private IP addresses that will be used in the address pool, in Azure
• Configuring address pools in the Citrix Gateway appliance
In Azure, you can deploy a NetScaler VPX instance with multiple IP addresses. You can add IP ad-
dresses to a VPX instance in two ways:
For more information about how to add multiple IP addresses while provisioning a VPX instance, see
Configure multiple IP addresses for a NetScaler standalone instance. To add IP addresses by using
PowerShell commands while provisioning a VPX instance, see Configure multiple IP addresses for a
NetScaler VPX instance in standalone mode by using PowerShell commands.
After you’ve provisioned a VPX instance, follow these steps to register a private IP address in the Azure
portal, which you configure as an address pool in the Citrix Gateway appliance.
1. From Azure Resource Manager (ARM), go to the already created NetScaler VPX instance > Network
interfaces. Choose the network interface which is bound to a subnet to which the IIP that you want
to register belongs.
3. Provide the required details as shown in the example below and click OK.
For more information about how to configure address pools on the Citrix Gateway, see this Configuring
Address Pools.
Limitation: You can not bind a range of IIP addresses to users. Every IIP address that is used in an
address pool should be registered.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In an Azure environment, a NetScaler VPX virtual appliance can be deployed with multiple NICs. Each
NIC can have multiple IP addresses. This section describes how to deploy a NetScaler VPX instance
with a single NIC and multiple IP addresses, by using PowerShell commands. You can use the same
script for multi-NIC and multi-IP deployment.
Note
In this document, IP-Config refers to a pair of IP addresses, public IP and private IP, that is asso-
ciated with an inidivual NIC. For more information, see the Azure terminology section.
Use case
In this use case, a single NIC is connected to a virtual network (VNET). The NIC is associated with three
IP configurations, as shown in the following table.
Note
Diagram: Topology
In a multi-NIC, multi-IP Azure NetScaler VPX deployment, the private IP address associated with
the primary (first) IPConfig of the primary (first) NIC is automatically added as the management
NSIP address of the appliance. The remaining private IP addresses associated with IPConfigs
must be added in the VPX instance as VIPs or SNIPs by using the “add ns ip” command, as deter-
mined by your requirements.
Here is the summary of the steps required for configuring multiple IP addresses for a NetScaler VPX
virtual appliance in standalone mode:
Script
Parameters
Following are sample parameters settings for the use case in this document. You can use different
settings if you wish.
$locName=”westcentralus”
$rgName=”Azure-MultiIP”
$nicName1=”VM1-NIC1”
$vNetName=”Azure-MultiIP-vnet”
$vNetAddressRange=”11.6.0.0/16”
$frontEndSubnetName=”frontEndSubnet”
$frontEndSubnetRange=”11.6.1.0/24”
$prmStorageAccountName=”multiipstorage”
$avSetName=”multiip-avSet”
Note: The minimum requirement for a VPX instance is 2 vCPUs and 2GB RAM.
$publisher=”citrix”
$version=”latest”
$pubIPName1=”PIP1”
$pubIPName2=”PIP2”
$domName1=”multiipvpx1”
$domName2=”multiipvpx2”
$vmNamePrefix=”VPXMultiIP”
$osDiskSuffix=”osmultiipalbdiskdb1”
$nsgName=”NSG-MultiIP”
$rule1Name=”Inbound-HTTP”
$rule2Name=”Inbound-HTTPS”
$rule3Name=”Inbound-SSH”
$IpConfigName1=”IPConfig1”
$IPConfigName2=”IPConfig-2”
$IPConfigName3=”IPConfig-3”
1. Add rules. You must add a rule to the NSG for any port that serves traffic.
1. Add subnets.
1 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
$frontEndSubnetName -AddressPrefix $frontEndSubnetRange
3. Retrieve subnets.
1 $subnetName=”frontEndSubnet”
2 $subnet1=$vnet.Subnets|?{
3 $_.Name -eq $subnetName }
Note
7. Assign IP Configuration
In this use case, consider the following points before assigning IP addresses:
Note
When you assign multiple IP configurations to a NIC, one configuration must be assigned as pri-
mary.
1 $IPAddress1=”11.6.1.27”
2 $IPConfig1=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName1 -
Subnet $subnet1 -PrivateIpAddress $IPAddress1 -PublicIpAddress $pip1
‒ Primary
3 $IPAddress2=”11.6.1.28”
4 $IPConfig2=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName2 -
Subnet $subnet1 -PrivateIpAddress $IPAddress2 -PublicIpAddress $pip2
5 $IPAddress3=”11.6.1.29”
6 $IPConfig3=New-AzureRmNetworkInterfaceIpConfig -Name $IPConfigName3 -
Subnet $subnet1 -PrivateIpAddress $IPAddress3 -Primary
Use a valid IP address that meets your subnet requirements and check its availability.
8. Create NIC
1. Initialize variables.
1 $suffixNumber = 1
2 $vmName = $vmNamePrefix + $suffixNumber
1 $cred=Get-Credential -Message ”Type the name and password for VPX login
.”
2 $vmConfig=Set-AzureRMVMOperatingSystem -VM $vmConfig -Linux -
ComputerName $vmName -Credential $cred
3 $vmConfig=Set-AzureRMVMSourceImage -VM $vmConfig -PublisherName
$publisher -Offer $offer -Skus $sku -Version $version
4. Add NIC.
Note
In a multi-NIC VPX deployment, one NIC should be primary. So, “-Primary” needs to be appended
while adding that NIC to the VPX instance.
After the VPX instance starts, you can check the IP addresses allocated to IPConfigs of the VPX NIC by
using the following command.
1 $nic.IPConfig
When the NetScaler VPX instance starts, a private IP address associated with primary IPconfig of the
primary NIC is added as the NSIP address. The remaining private IP addresses must be added as VIP
or SNIP addresses, as determined by your requirements. Use the following command.
You’ve now configured multiple IP addresses for a NetScaler VPX instance in standalone mode. For
additional information about how to configure multiple IP addresses for a NetScaler VPX instance in
standalone mode, see the NetScaler VPX deployments in Microsoft Azure video.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In Azure Resource Manager (ARM), configure multiple public virtual IP addresses (VIPs) for both single
NetScaler VPX deployment, and also for high availability (HA) deployment.
Note: Multiple VIPs can be configured for external load balancers only.
For deploying NetScaler VPX instances in both single mode and high availability mode, you have to
use PowerShell commands alone, as you can create multiple front-end IP addresses (FIP) through
PowerShell only.
This section provides PowerShell commands to deploy a NetScaler VPX in a standalone mode with
multiple front-end IPs mapped to a single back-end pool.
Configure multiple FIPs, back-end pools, LB rules, and inbound NAT rules as part of configuring Azure
load balancer.
Make sure that the following conditions are met in a single NetScaler VPX deployment:
1. A back-end pool contains only one NetScaler VPX instance.
2. Two load balancer rules are defined and are mapped to the following two VIPs:
a) VIP1:80 > Back-end Pool 1:10080
b) VIP2:80 > Back-end Pool 1:10081
3. A load balancer rule is defined to map VIP1:10080 > Back-end Pool 1:80, to access NetScaler VPX
user interface.
4. An inbound NAT rule is defined to map VIP1:22 > Back-end Pool 1:22 to access NetScaler VPX
through SSH.
The following image illustrates how you can configure multiple cloud service IP addresses on Azure
Resource Manager for NetScaler virtual servers.
Run the following PowerShell commands to deploy a NetScaler VPX instance in a standalone mode:
Command:
For example:
1 $rgName = ”ARM-LB-NS”
2
3 $locName = ”East Asia”
4
5 New-AzureRmResourceGroup -Name $rgName -Location $locName
You must select a globally unique name for your storage account that contains only lowercase letters
and numbers.
Command
For example:
1 $saName=”vpxstorage”
2
3 $saType=”Standard\_LRS”
4
5 New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -
Type $saType -Location $locName
Command:
For example:
1 $avName=”avNSSet”
Add new virtual network with at least one subnet, if it is not created previously.
$vnetName = “LBVnet”
Commands:
Create subnets:
1 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
frontendSubnet -AddressPrefix 10.0.1.0/24
1 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
backendSubnet -AddressPrefix 10.0.2.0/24
The number of public IPs created should be equal to number of External VIPs required.
• Before using, check for the availability of the value for DomainNameLabel.
• Create two VIPs.
Commands:
1 $pubName1 =”PublicIp1”
2
3 $dnsName1=”nsvpx1”
4
5 $pubName2 =”PublicIp2”
6
7 $dnsName2=”nsvpx2”
8
$FIPName1 =”VIP1”
$FIPName2=”VIP2”
Commands:
$BEPool1 = “backend-Pool1”
Command:
Create TCP health probe with port 9000 and interval 5 seconds.
Command:
Create NAT rules for services that does not require to be load balanced.
For example, create an ssh access to VPX instance.
Protocol - FrontEndPort - BackendPort triplet should not be same for two NAT rules belonging to same
front-end IP.
Command:
Create load balancer with all of the above defined rules, front-end IPs, and a back-end pool.
Command:
1 $lbName = ”NSALB”
2
3 $NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name
$lbName -Location $locName -InboundNatRule $inboundNATRule1 -
FrontendIpConfiguration $frontendIP1, $frontendIP2 -
LoadBalancingRule $lbrule1, $lbrule2, $lbrule3 -BackendAddressPool
$beAddressPool1 -Probe $healthProbe
Commands:
1 $nicName=”NIC1”
2
3 $lbName=”NSALB”
4
5 $bePoolIndex=0
6
7 $natRuleIndex=0
8
9 $subnetIndex=0 ß Frontend subnet index
10
11 $lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName
12
13 $nic1=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName
$rgName -Location $locName -Subnet $vnet.Subnets\[$subnetIndex\] -
LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex
\] -LoadBalancerInboundNatRule $lb.InboundNatRules\[$natRuleIndex\]
Create NetScaler VPX instance from MarketPlace image and attach the NIC to the virtual instance.
Commands:
1 $vmName=”VPX1”
2
3 $vmSize=”Standard\_A3” / ”Standard\_DS4”
4
5 $pubName=”citrix”
6
7 $skuName = ”netscalerbyol”
8
9 $offerName=”netscalervpx110-6531”
10
11 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
12
13 $vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
14
15 $cred=Get-Credential -Message ”Type Credentials which will be used to
login to VPX instance”
16
17 $vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName
-Credential $cred -Verbose
18
19 $vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
20
21 $vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $nic1.Id
22
23 $diskName=”dynamic”
24
25 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
26
27 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds1/” +
$diskName + ”.vhd”
28
29 $vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -
CreateOption fromImage
30
31 Set-AzureRmVMPlan -VM $vm1 -Publisher $pubName -Product $offerName -
Name $skuName
32
33 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1
The above commands creates a NetScaler VPX instance, then add virtual servers to the NetScaler VPX
instance for the specified front end services.
This section provides PowerShell commands to deploy a NetScaler VPX in HA deployment with multi-
ple front-end IPs mapped to a single back-end pool.
Configure multiple FIPs, backend pools, load balance rules, and inbound NAT rules as part of the Azure
load balancer.
Make sure that the following conditions are met in HA deployment of NetScaler VPX instances:
1. A back-end pool contains two NetScaler VPX instances, which are part of HA.
2. Two load balancer rules are defined and are mapped to following two VIPs:
a) VIP1:80 > Back-end Pool 1:10080
b) VIP2:80 > Back-end Pool 1:10081
3. A load balancer rule is defined, which maps VIP1:10080 > Back-end Pool 1:80, to access NetScaler
VPX GUI.
4. Two inbound NAT rules are defined to map the following two VIPS:
a) VIP1:22 > Back-end Pool 1:22 to access NetScaler VPX Primary
b) VIP1:10022 > Back-end Pool-1:22 to access NetScaler VPX Secondary through SSH
All services that are defined as part of Azure load balancer rules will get load balanced. That is, if the
primary VPX fails, the secondary VPX will take care of all of the services in Active-Passive HA deploy-
ment.
The following image illustrates how you can configure multiple cloud service IP addresses on Azure
Resource Manager for NetScaler virtual servers in HA mode.
Commands:
For example:
1 $rgName = ”ARM-Mult-VIP-HA”
2
3 $locName = ”East Asia”
4
5 New-AzureRmResourceGroup -Name $rgName -Location $locName
You must select a globally unique name for your storage account that contains only lowercase letters
and numbers.
Commands:
For example:
1 $saName=”vpxstorage1”
2
3 $saType=”Standard\_LRS”
4
5 New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -
Type $saType -Location $locName
Command:
For example:
$avName=”avNSSetARM”
Add new virtual network with at least one subnet if it is not created previously.
$vnetName = “LBVnet”
Commands:
Create subnets:
1 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
frontendSubnet -AddressPrefix 10.0.7.0/24
1 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
backendSubnet -AddressPrefix 10.0.8.0/24
The number of public IP addresses created should be equal to the number of external VIPs required.
• Before using, check for the availability of the value for Domain.Name.Label.
• Create two VIPs.
Commands:
$pubName1 =”PublicIp1”
$dnsName1=”nsvpx1”
$pubName2 =”PublicIp2”
$dnsName2=”nsvpx2”
$FIPName1 = “VIP1”
$FIPName2=”VIP2”
Commands:
$BEPool1 = “backend-Pool1”
Command:
Create TCP health probe with port 9000 and interval 5 seconds.
Command:
For each frond end IP and service, you have to create a separate load balancer rule.
Back-end address pool can contain set of virtual machines. For a single NetScaler VPX deployment,
only single NetScaler VPX instance will be part of this pool.
Note: Combined values for front-end IP configuration, back-end address pool, front-end port, back-
end port parameters should not be the same for any two rules.
Examples:
Each FIP/VIP access and HTTP service uses front-end port 80. As back-end pool is same, back-end port
has to be used differently for each load balancer rule.
Command:
Load balancer configuration rule to access the HTTP service of a NetScaler VPX instance can be added
in the following way:
Command:
Create NAT rules for services that does not require to be load balanced.
Note: Protocol - Front-end Port - Back-end Port triplet should not be the same for two NAT rules be-
longing to the same front-end IP address.
Commands:
Create load balancer with all of the above defined rules, front-end IPs, and a back-end pool.
Command:
1 $lbName =”NSALB”
2
3 $NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name
$lbName -Location $locName -InboundNatRule $inboundNATRule1,
$inboundNATRule2 -FrontendIpConfiguration $frontendIP1, $frontendIP2
-LoadBalancingRule $lbrule1, $lbrule2, $lbrule3 -BackendAddressPool
$beAddressPool1 -Probe $healthProbe
Commands:
1 $nicName=”NIC1”
2
3 $lbName=”NSALB”
4
5 $bePoolIndex=0
6
7 $natRuleIndex=0
8
9 $subnetIndex=0 ß Frontend subnet index
10
11 $lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName
12
13 $nic1=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName
$rgName -Location $locName -Subnet $vnet.Subnets\[$subnetIndex\] -
LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex
\] -LoadBalancerInboundNatRule $lb.InboundNatRules\[$natRuleIndex\]
14
15 $nicName=”NIC2 ”
16
17 $lbName=”NSALB”
18
19 $bePoolIndex=0
20
21 $natRuleIndex=1ß 2nd SSH rule
22
23 $subnetIndex=0
24
25 $nic2=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName
$rgName -Location $locName -Subnet $vnet.Subnets\[$subnetIndex\] -
LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex
\] -LoadBalancerInboundNatRule $lb.InboundNatRules\[$natRuleIndex\]
Create a NetScaler VPX instance from MarketPlace image and attach a NIC to it.
Commands:
1 $vmName=”VPX1”
2
3 $vmSize=”Standard\_A3”
4
5 $pubName=”citrix”
6
7 $skuName = ”netscalerbyol”
8
9 $offerName=”netscalervpx110-6531”
10
11 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
12
13 $vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
14
15 $cred=Get-Credential -Message ”Type Credentials which will be used to
login to VPX instance”
16
17 $vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName
-Credential $cred -Verbose
18
19 $vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
20
21 $vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $nic1.Id
22
23 $diskName=”dynamic”
24
25 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
26
27 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds1/” +
$diskName + ”.vhd”
28
64
65 Set-AzureRmVMPlan -VM $vm2 -Publisher $pubName -Product $offerName -
Name $skuName
66
67 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2
When both NetScaler VPX instances are running, connect to both VPX instances through SSH to con-
figure the virtual machines.
1. To configure Active-Passive HA, run “add HA node #nodeID” command on both nodes, and then
run configuration commands on Primary VPX instance.
2. To configure Active-Active HA, run same set of configuration commands on both nodes.
This table lists those of the Azure Resource Manager (ARM) components that can be created using
PowerShell, and those that can be created using the Azure Resource Manager portal.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
This section provides the PowerShell cmdlets with which you can perform the following configura-
tions in Azure PowerShell:
Also see the following topics for configurations that you can perform by using PowerShell commands:
• Configure a high-availability setup with multiple IP addresses and NICs by using PowerShell
commands
• Configure GSLB on NetScaler VPX instances
• Configure GSLB on a NetScaler active-standby high-availability setup
• Configure multiple IP addresses for a NetScaler VPX instance in standalone mode by using Pow-
erShell commands
• Configure multiple Azure VIPs for a standalone VPX instance
The resource group can include all the resources for the solution, or only those resources that you
want to manage as a group. The location specified here is the default location for resources in that
resource group. Make sure all commands to create a load balancer use the same resource group.
For example:
1 $rgName = ”ARM-VPX”
2
3 $locName = ”West US”
4
5 New-AzureRmResourceGroup -Name $rgName -Location $locName
Choose a unique name for your storage account that contains only lowercase letters and numbers.
For example:
1 $saName=”vpxstorage”
2
3 $saType=”Standard\_LRS”
4
5 New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -
Type $saType -Location $locName
Availability set helps to keep your virtual machines available during downtime, such as during main-
tenance. A load balancer configured with an availability set ensures that your application is always
available.
Add a new virtual network with at least one subnet, if the subnet was not created previously.
$FrontendAddressPrefix=”10.0.1.0/24”
$BackendAddressPrefix=”10.0.2.0/24”
$vnetAddressPrefix=”10.0.0.0/16”
For example:
1 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
frontendSubnet -AddressPrefix $FrontendAddressPrefix
2
3 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
backendSubnet -AddressPrefix $BackendAddressPrefix
4
5 New-AzureRmVirtualNetwork -Name TestNet -ResourceGroupName $rgName -
Location $locName -AddressPrefix $vnetAddressPrefix -Subnet
$frontendSubnet,$backendSubnet
5. Create a NIC
Create a NIC and associate the NIC with the NetScaler VPX instance. The front end Subnet created in
the above procedure is indexed at 0 and the back end Subnet is indexed at 1. Now create NIC in one
of the three following ways:
For example:
1 $nicName=”frontendNIC”
2
3 $domName=”vpxazure”
4
5 $pip = New-AzureRmPublicIpAddress -Name $nicName -ResourceGroupName
$rgName -DomainNameLabel $domName -Location $locName -
AllocationMethod Dynamic
6
7 $nic = New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName
$rgName -Location $locName -SubnetId $vnet.Subnets\[0\].Id -
PublicIpAddressId $pip.Id
Make sure that the private (static) IP address you add to the VM should be the same range as that of
the subnet specified.
$vmName=”<VM name>”
$cred=Get-Credential -Message “Type the name and password of the local administrator account.”
For example:
1 $pubName=”citrix”
The following command is used for displaying all offers from Citrix:
The following command is used to know sku offered by publisher for specific offer name:
For example:
1 $diskName=”dynamic”
2
3 $pubName=”citrix”
4
5 $offerName=”netscalervpx110-6531”
6
7 $skuName=”netscalerbyol”
8
9 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
10
11 $osDiskUri=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds/” +
$diskName + ”.vhd”
12
13 $vm=Set-AzureRmVMOSDisk -VM $vm -Name $diskName -VhdUri $osDiskUri -
CreateOption fromImage
When you create VM from Images present in marketplace, use the following command to specify the
VM plan:
Provision a NetScaler VPX pair in a high availabilty setup with an Azure external load
balancer
The location specified here is the default location for resources in that resource group. Make sure that
all commands used to create a load balancer use the same resource group.
For example:
1 $rgName = ”ARM-LB-NS”
2
3 $locName = ”West US”
4
5 New-AzureRmResourceGroup -Name $rgName -Location $locName
1 $saName=”vpxstorage”
2
3 $saType=”Standard\_LRS”
4
5 New-AzureRmStorageAccount -Name $saName -ResourceGroupName $rgName -
Type $saType -Location $locName
1 $vnetName = ”LBVnet”
2
3 $FrontendAddressPrefix=”10.0.1.0/24”
4
5 $BackendAddressPrefix=”10.0.2.0/24”
6
7 $vnetAddressPrefix=”10.0.0.0/16”
8
9 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
frontendSubnet -AddressPrefix $FrontendAddressPrefix
10
11 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
backendSubnet -AddressPrefix $BackendAddressPrefix
12
13 $vnet=New-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName
$rgName -Location $locName -AddressPrefix $vnetAddressPrefix -Subnet
$frontendSubnet,$backendSubnet
Assign front end and back end subnet to the virtual network that you created earlier in this step.
If the front end subnet is the first element of array vnet, subnetId should be $vnet.Subnets[0].Id.
If the front end subnet is the second element in the array, the subnetId should be $vnet.Subnets[1].Id,
and so on..
5) Configure front end IP address and create back end address pool
Configure a front end IP address for the incoming load balancer network traffic and create a back end
address pool to receive the load balanced traffic.
1 $pubName=”PublicIp1”
2
3 $publicIP1 = New-AzureRmPublicIpAddress -Name $pubName -
ResourceGroupName $rgName -Location $locName -AllocationMethod
Static -DomainNameLabel nsvpx
1 $FIPName = ”ELBFIP”
2
3 $frontendIP1 = New-AzureRmLoadBalancerFrontendIpConfig -Name $FIPName -
PublicIpAddress $publicIP1
4
5 $BEPool = ”LB-backend-Pool”
6
7 $beaddresspool1= New-AzureRmLoadBalancerBackendAddressPoolConfig -Name
$BEPool
Create a TCP health probe with port 9000 and interval 5 seconds.
Create a LB rule for each service that you are load balancing.
For example:
You can use the following example to load balance http service.
Create NAT rules for services that you are not load balancing.
Note: Protocol-FrontEndPort-BackendPort triplet should not be the same for two NAT rules.
Create the load balancer adding all objects (NAT rules, load balancer rules, probe configurations) to-
gether.
1 $lbName=”ELB”
2
3 $NRPLB = New-AzureRmLoadBalancer -ResourceGroupName $rgName -Name
$lbName -Location $locName -InboundNatRule $inboundNATRule1,
$inboundNATRule2 -FrontendIpConfiguration $frontendIP1 -
LoadBalancingRule $lbrule1 -BackendAddressPool $beAddressPool1 -
Probe $healthProbe
Create two NICs and associate each NIC with each VPX instance
For example:
1 $nicName=”NIC1”
2
3 $lbName=”ELB”
4
5 $bePoolIndex=0
6
7 \* Rule indexes starts from 0.
8
9 $natRuleIndex=0
10
11 $subnetIndex=0
12
13 \* Frontend subnet index
14
15 $lb=Get-AzureRmLoadBalancer -Name $lbName -ResourceGroupName $rgName
16
17 $nic1=New-AzureRmNetworkInterface -Name $nicName -ResourceGroupName
$rgName -Location $locName -Subnet $vnet.Subnets\[$subnetIndex\] -
LoadBalancerBackendAddressPool $lb.BackendAddressPools\[$bePoolIndex
\] -LoadBalancerInboundNatRule $lb.InboundNatRules\[$natRuleIndex\]
For example:
1 $nicName=”NIC2”
2
3 $lbName=”ELB”
4
5 $bePoolIndex=0
6
7 $natRuleIndex=1
$subnetIndex=0
Create two NetScaler VPX instances as part of the same resource group and availability set, and attach
it to the external load balancer.
For example:
1 $vmName=”VPX1”
2
3 $vmSize=”Standard\_A3”
4
5 $pubName=”citrix”
6
7 $offerName=”netscalervpx110-6531”
8
9 $skuName=”netscalerbyol”
10
11 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
12
13 $vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
14
15 $cred=Get-Credential -Message ”Type Credentials which will be used to
login to VPX instance”
16
17 $vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName
-Credential $cred -Verbose
18
19 $vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
20
21 $vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $nic1.Id
22
23 $diskName=”dynamic”
24
25 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
26
27 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds1/” +
$diskName + ”.vhd”
28
29 $vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -
CreateOption fromImage
30
31 Set-AzureRmVMPlan -VM $vm1 -Publisher $pubName -Product $offerName -
Name $skuName
32
33 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1
For example:
1 $vmName=”VPX2”
2
3 $vmSize=”Standard\_A3”
4
5 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
6
7 $vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
8
9 $cred=Get-Credential -Message ” Type Credentials which will be used to
login to VPX instance ”
10
11 $vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName
-Credential $cred -Verbose
12
13 $vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
14
15 $vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $nic2.Id
16
17 $diskName=”dynamic”
18
19 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
20
21 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds2/” +
$diskName + ”.vhd”
22
23 $vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -
CreateOption fromImage
24
25 Set-AzureRmVMPlan -VM $vm2 -Publisher $pubName -Product $offerName -
Name $skuName
26
27 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2
When both the NetScaler VPX instances start, then connect to both NetScaler VPX instances using the
SSH protocol to configure the virtual machines.
a) Active-Active: Run the same set of configuration commands on the command line of both the
NetScaler VPX instances.
b) Active-Passive: Run this command on the command line of both the NetScaler VPX instances.
Provision a NetScaler VPX pair in a high availability setup with Azure internal load
balancer
The location specified here is the default location for resources in that resource group. Make sure all
commands to create a load balancer use the same resource group.
For example:
1 $rgName = ”ARM-LB-NS”
2
3 $locName = ”West US”
4
5 New-AzureRmResourceGroup -Name $rgName -Location $locName
Choose a unique name for your storage account that contains only lowercase letters and numbers.
For example:
1 $saName=”vpxstorage”
2
3 $saType=”Standard\_LRS”
4
1 $vnetName = ”LBVnet”
2
3 $vnetAddressPrefix=”10.0.0.0/16”
4
5 $FrontendAddressPrefix=”10.0.1.0/24”
6
7 $BackendAddressPrefix=”10.0.2.0/24”
8
9 $vnet=New-AzureRmVirtualNetwork -Name $vnetName -ResourceGroupName
$rgName -Location $locName -AddressPrefix $vnetAddressPrefix -Subnet
$frontendSubnet,$backendSubnet\‘
10
11 $frontendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
frontendSubnet -AddressPrefix $FrontendAddressPrefix
12
13 $backendSubnet=New-AzureRmVirtualNetworkSubnetConfig -Name
backendSubnet -AddressPrefix $BackendAddressPrefix
Use front end and back end ports as per your requirement.
Create a TCP health probe with port 9000 and interval 5 seconds.
Create a LB rule for each service that you are load balancing.
For example:
You can use the following example to load balance http service.
Use front end and back end ports as per your requirement.
Create the load balancer adding all objects (NAT rules, load balancer rules, probe configurations) to-
gether.
Create two NICs and associate each NIC with each NetScaler VPX instance
This NIC is for NetScaler VPX 1. The Private IP should be in same subnet as that of subnet added.
This NIC is for NetScaler VPX 2.The parameter Private IPAddress can have any private IP as per your
requirement.
Create two VPX instances part of same resource group and availability set and attach it to the internal
load balancer.
For example:
1 $vmName=”VPX1”
2
3 $vmSize=”Standard\_A3”
4
5 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
6
7 $vm1=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
8
9 $cred=Get-Credential -Message ”Type Credentials which will be used to
login to VPX instance”
10
11 $vm1=Set-AzureRmVMOperatingSystem -VM $vm1 -Linux -ComputerName $vmName
-Credential $cred -Verbose
12
13 $vm1=Set-AzureRmVMSourceImage -VM $vm1 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
14
15 $vm1=Add-AzureRmVMNetworkInterface -VM $vm1 -Id $backendnic1.Id
16
17 $diskName=”dynamic”
18
19 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
20
21 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds1/” +
$diskName + ”.vhd”
22
23 $vm1=Set-AzureRmVMOSDisk -VM $vm1 -Name $diskName -VhdUri $osDiskUri1 -
CreateOption fromImage
24
25 Set-AzureRmVMPlan -VM $vm1 -Publisher $pubName -Product $offerName -
Name $skuName
26
27 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm1
For example:
1 $vmName=”VPX2”
2
3 $vmSize=”Standard\_A3”
4
5 $avSet=Get-AzureRmAvailabilitySet -Name $avName -ResourceGroupName
$rgName
6
7 $vm2=New-AzureRmVMConfig -VMName $vmName -VMSize $vmSize -
AvailabilitySetId $avset.Id
8
9 $cred=Get-Credential -Message ” Type Credentials which will be used to
login to VPX instance ”
10
11 $vm2=Set-AzureRmVMOperatingSystem -VM $vm2 -Linux -ComputerName $vmName
-Credential $cred -Verbose
12
13 $vm2=Set-AzureRmVMSourceImage -VM $vm2 -PublisherName $pubName -Offer
$offerName -Skus $skuName -Version ”latest”
14
15 $vm2=Add-AzureRmVMNetworkInterface -VM $vm2 -Id $backendnic2.Id
16
17 $diskName=”dynamic”
18
19 $storageAcc=Get-AzureRmStorageAccount -ResourceGroupName $rgName -Name
$saName
20
21 $osDiskUri1=$storageAcc.PrimaryEndpoints.Blob.ToString() + ”vhds2/” +
$diskName + ”.vhd”
22
23 $vm2=Set-AzureRmVMOSDisk -VM $vm2 -Name $diskName -VhdUri $osDiskUri1 -
CreateOption fromImage
24
25 Set-AzureRmVMPlan -VM $vm2 -Publisher $pubName -Product $offerName -
Name $skuName
26
27 New-AzureRmVM -ResourceGroupName $rgName -Location $locName -VM $vm2
When both the NetScaler VPX instances start, then connect to both NetScaler VPX instances using the
SSH protocol to configure the virtual machines.
a) Active-Active: Run the same set of configuration commands on the command line of both the
NetScaler VPX instances.
b) Active-Passive: Run this command on the command line of both the NetScaler VPX instances.
1.
2. Citrix ADC
3. NetScaler 12.0
Azure terminology
January 6, 2019
Contributed by:
C
Some of the Azure terms that are used in the NetScaler VPX Azure documentation are listed below.
1. Azure Load Balancer – Azure load balancer is a resource that distributes incoming traffic among
computers in a network. Traffic is distributed among virtual machines defined in a load-balancer set.
A load balancer can be external or internet-facing, or it can be internal.
2. Azure Resource Manager (ARM) – ARM is the new management framework for services in Azure.
Azure Load Balancer is managed using ARM-based APIs and tools.
3. Back-End Address Pool – These are IP addresses associated with the virtual machine Network
Interface Card (NIC) to which load will be distributed.
4. BLOB - Binary Large Object – Any binary object like a file or an image that can be stored in Azure
storage.
5. Front-End IP Configuration – An Azure Load balancer can include one or more front-end IP ad-
dresses, also known as a virtual IPs (VIPs). These IP addresses serve as ingress for the traffic.
6. Instance Level Public IP (ILPIP) – An ILPIP is a public IP address that you can assign directly to
your virtual machine or role instance, rather than to the cloud service that your virtual machine or
role instance resides in. This does not take the place of the VIP (virtual IP) that is assigned to your
cloud service. Rather, it’s an additional IP address that you can use to connect directly to your virtual
machine or role instance.
Note: In the past, an ILPIP was referred to as a PIP, which stands for public IP.
7. Inbound NAT Rules – This contains rules mapping a public port on the load balancer to a port for
a specific virtual machine in the back end address pool.
8. IP-Config - It can be defined as an IP address pair (public IP and private IP) associated with an indi-
vidual NIC. In an IP-Config, the public IP address can be NULL. Each NIC can have multiple IP-Config
associated with it, which can be upto 255.
9. Load Balancing Rules – A rule property that maps a given front-end IP and port combination
to a set of back-end IP addresses and port combination. With a single definition of a load balancer
resource, you can define multiple load balancing rules, each rule reflecting a combination of a front
end IP and port and back end IP and port associated with virtual machines.
10. Network Security Group (NSG) – NSG contains a list of Access Control List (ACL) rules that allow
or deny network traffic to your virtual machine instances in a virtual network. NSGs can be associated
with either subnets or individual virtual machine instances within that subnet. When a NSG is associ-
ated with a subnet, the ACL rules apply to all the virtual machine instances in that subnet. In addition,
traffic to an individual virtual machine can be restricted further by associating a NSG directly to that
virtual machine.
11. Private IP addresses – Used for communication within an Azure virtual network, and your on-
premises network when you use a VPN gateway to extend your network to Azure. Private IP addresses
allow Azure resources to communicate with other resources in a virtual network or an on-premises
network through a VPN gateway or ExpressRoute circuit, without using an Internet-reachable IP ad-
dress. In the Azure Resource Manager deployment model, a private IP address is associated with the
following types of Azure resources – virtual machines, internal load balancers (ILBs), and application
gateways.
12. Probes – This contains health probes used to check availability of virtual machines instances in
the back end address pool. If a particular virtual machine does not respond to health probes for some
time, then it is taken out of traffic serving. Probes enable you to keep track of the health of virtual
instances. If a health probe fails, the virtual instance will be taken out of rotation automatically.
13. Public IP Addresses (PIP) – PIP is used for communication with the Internet, including Azure
public-facing services and is associated with virtual machines, Internet-facing load balancers, VPN
gateways, and application gateways.
14. Region - An area within a geography that does not cross national borders and that contains
one or more datacenters. Pricing, regional services, and offer types are exposed at the region level. A
region is typically paired with another region, which can be up to several hundred miles away, to form
a regional pair. Regional pairs can be used as a mechanism for disaster recovery and high availability
scenarios. Also referred to generally as location.
15. Resource Group - A container in Resource Manager holds related resources for an application.
The resource group can include all of the resources for an application, or only those resources that are
logically grouped together
16. Storage Account – An Azure storage account gives you access to the Azure blob, queue, table, and
file services in Azure Storage. Your storage account provides the unique namespace for your Azure
storage data objects.
17. Virtual Machine – The software implementation of a physical computer that runs an operating
system. Multiple virtual machines can run simultaneously on the same hardware. In Azure, virtual
machines are available in a variety of sizes.
18. Virtual Network - An Azure virtual network is a representation of your own network in the cloud.
It is a logical isolation of the Azure cloud dedicated to your subscription. You can fully control the IP
address blocks, DNS settings, security policies, and route tables within this network. You can also
further segment your VNet into subnets and launch Azure IaaS virtual machines and cloud services
(PaaS role instances). Additionally, you can connect the virtual network to your on-premises network
using one of the connectivity options available in Azure. In essence, you can expand your network to
Azure, with complete control on IP address blocks with the benefit of enterprise scale Azure provides.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
NetScaler VPX appliances support receiving and transmitting jumbo frames containing up to 9216
bytes of IP data. Jumbo frames can transfer large files more efficiently than it is possible with the
standard IP MTU size of 1500 bytes.
A NetScaler appliance can use jumbo frames in the following deployment scenarios:
• Jumbo to Jumbo. The appliance receives data as jumbo frames and sends it as jumbo frames.
• Non-Jumbo to Jumbo. The appliance receives data as regular frames and sends it as jumbo
frames.
• Jumbo to Non-Jumbo. The appliance receives data as jumbo frames and sends it as regular
frames.
Jumbo Frames support is available on NetScaler VPX appliances running on the following virtualiza-
tion platforms:
• VMware ESX
• Linux-KVM Platform
• Citrix XenServer
• Amazon Web Services (AWS)
Jumbo frames on VPX appliances works similar to Jumbo frames on MPX appliances. For more infor-
mation on Jumbo Frames and its use cases, see Configuring Jumbo Frames on MPX appliances. The
use cases of Jumbo Frames on MPX appliances also apply to VPX appliances.
Perform the following tasks for configuring Jumbo Frames on a NetScaler VPX appliance running on
VMware ESX server:
1. Set the MTU of the interface or channel of the VPX appliance to a value in the range 1501-9000.
Use the CLI or GUI to set the MTU size. Note that NetScaler VPX appliances running on VMware
ESX support receiving and transmitting jumbo frames containing up to only 9000 bytes of IP
data.
2. Set the same MTU size on the corresponding physical interfaces of the VMware ESX server by
using its management applications. For more information about setting the MTU size on the
physical interfaces of VMware ESX, see http://vmware.com/.
Perform the following tasks for configuring Jumbo Frames on a NetScaler VPX appliance running on
a Linux-KVM Server:
1. Set the MTU of the interface or channel of the VPX appliance to a value in the range 1501-9216.
Use the NetScaler VPX CLI or GUI to set the MTU size.
2. Set the same MTU size on the corresponding physical interfaces of a Linux-KVM Server by using
its management applications. For more information about setting the MTU size on the physical
interfaces of Linux-KVM, see http://www.linux-kvm.org/.
Perform the following tasks for configuring Jumbo Frames on a NetScaler VPX appliance running on
Citrix XenServer:
Host-level configuration is not required for VPX on Azure. To configure Jumbo Frames on VPX, follow
the steps given in Configuring Jumbo Frames Support on a NetScaler Appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
Licensing
Contributed by:
C
The following topics describe the migration instructions for setting up a new version of a NetScaler
appliance with a list of all new and deprecated commands, parameters, and SNMP OIDs.
1.
2. Citrix ADC
3. NetScaler 12.0
March 6, 2019
Contributed by:
C
The process of allocating your NetScaler licenses has been greatly simplified. The new licensing frame-
work allows you to focus on getting maximum value from Citrix products.
In the NetScaler GUI, you can use your hardware serial number (HSN) or your license access code to
allocate your licenses. Alternatively, if a license is already present on your local computer, you can
upload it to the appliance.
For all other functionality, such as returning or reallocating your license, you must use the licensing
portal. Optionally, you can still use the licensing portal for license allocation. For more information
about the licensing portal, see http://support.citrix.com/article/CTX131110.
Note: Purchase separate licenses for each appliance in a high availability pair. Ensure that the same
types of licenses are installed on both the appliances. For example, if you purchase a platinum license
for one appliance, you must purchase another platinum license for the other appliance.
Prerequisites
To use the hardware serial number or license access code to allocate your licenses:
• You must be able to access public domains through the appliance. For example, the appliance
should be able to access www.citrix.com. The license allocation software internally accesses
the Citrix licensing portal for your license. To access a public domain:
• Your license must be linked to your hardware, or you must have a valid license access code.
Citrix sends your license access code by email when you purchase a license.
If your license is already linked to your hardware, the license allocation process can use the hardware
serial number. Otherwise, you must type the license access code.
You can partially allocate licenses as required for your deployment. For example, if your license file
contains 10 licenses, but your current requirement is for only six licenses, you can allocate six licenses
now, and allocate more licenses later. You cannot allocate more than the total number of licenses
present in your license file.
1. In a web browser, type the IP address of the NetScaler appliance (for example, http://
192.168.100.1).
4. In the details pane, click Manage Licenses, click Add New License, and then select one of the
following options:
• Use Serial Number. The software internally fetches the serial number of your appliance
and uses this number to display your licenses.
• Use license access code. Citrix emails the license access code for the license that you pur-
chased. Enter the license access code in the text box.
If you do not want to configure internet connectivity on the NetScaler appliance, you can
use a proxy server. Select the Connect through Proxy Server check box and specify the
IP address and port of your proxy server.
5. Click Get Licenses. Depending on the option that you selected, one of the following dialog
boxes appears.
• The following dialog box appears if you selected Hardware Serial Number.
• The following dialog box appears if you selected license access code.
6. Select the license file that you want to use to allocate your licenses.
7. In the Allocate column, enter the number of licenses to be allocated. Then click Get.
• If you selected Hardware Serial Number, enter the number of licenses, as shown in the
following screenshot.
• If you selected license access code, enter the number of licenses, as shown in the following
screenshot.
9. In the restart dialog box, click OK to proceed with the changes, or click Close to cancel the
changes.
Install a license
If you downloaded your license file to your local computer by accessing the licensing portal, you must
upload the license to the appliance.
1. In a web browser, type the IP address of the NetScaler appliance (for example, http://
192.168.100.1).
2. In User Name and Password, type the administrator credentials.
3. On the Configuration tab, navigate to System Licenses.
4. In the details pane, click Manage Licenses.
5. Click Add New License, then select Upload license files from a local computer.
6. Click Browse. Navigate to the location of the license files, select the license file, and then click
Open.
7. Click restart to apply the license.
8. In the restart dialog box, click OK to proceed with the changes, or click Close to cancel the
changes.
1. Open an SSH connection to the ADC appliance by using an SSH client, such as PuTTY.
3. Switch to the shell prompt, create a license subdirectory in the nsconfig directory, if it does not
exist, and copy one or more new license files to this directory.
Example
1 login: nsroot
2 Password: nsroot
3 Last login: Mon Aug 4 03:37:27 2008 from 10.102.29.9
4 Done
5 > shell
6 Last login: Mon Aug 4 03:51:42 from 10.103.25.64
7 root@ns# mkdir /nsconfig/license
8 root@ns# cd /nsconfig/license
Note: The NetScaler appliance does not prompt for a reboot option when you use the command
line interface to install the licenses. Run the
reboot -w command to warm restart the system, or run the
restart command to restart the system normally.
Before using a feature, ensure that your license supports the feature.
1. Open an SSH connection to the ADC appliance by using an SSH client, such as PuTTY.
2. Log on to the ADC appliance by using the administrator credentials.
3. At the command prompt, enter the sh ns license command to display the features supported by
the license.
Example
1 sh ns license
2 License status:
3 Web Logging: YES
4 Surge Protection: YES
5 .......
6
7 HTML Injection: YES
8 Done
1. In a web browser, type the IP address of the ADC appliance, such as http://192.168.100.1.
2. In User Name and Password, type the administrator credentials.
3. Provide the User name and Password and click Login.
4. In the navigation pane, expand System, and then click Licenses. You see a green check mark
next to the licensed features.
When you use the NetScaler appliance for the first time, you must enable a feature before you can
use its functionality. If you configure a feature before it is enabled, a warning message appears. The
configuration is saved but it applies only after the feature is enabled.
At the command prompt, type the following commands to enable a feature and verify the configura-
tion:
• show feature
Example
1 enable feature lb cs
2 done
3 >show feature
4
5 Feature Acronym
Status
6 ------- -------
------
7 1) Web Logging WL OFF
8 2) Surge Protection SP ON
9 3) Load Balancing LB ON
10 4) Content Switching CS ON
11 5) Cache Redirection CR ON
12 .
13 .
14 .
15 24) NetScaler Push push OFF
16 Done
The example shows how to enable load balancing (lb) and content switching (cs).
If the license key is not available for a particular feature, the following error message appears
for that feature:
Note: To enable an optional feature, you must have a feature-specific license. For example, you
have purchased and installed the Citrix NetScaler Enterprise Edition license. However, to enable
the Integrated Caching feature, you must purchase and install the AppCache license.
At the command prompt, type the following commands to disable a feature and verify the configura-
tion:
• show feature
Example
Starting with NetScaler release 12.0 56.20, VPX Express for on-premise and cloud deployments does
not require a license file and it comes with the following features:
• 20 Mbps bandwidth
• All ADC standard license features, except Citrix Gateway
• Maximum 250 SSL sessions
• 20 Mbps SSL throughput
You can upgrade the VPX Express License to the following two options:
2. NetScaler Pooled Capacity license for VPX instances. For more information, see NetScaler Pooled
Capacity.
1.
2. Citrix ADC
3. NetScaler 12.0
You need the following information before going to the Citrix Web site for the universal license.
• Your user ID and password for My Citrix
Register at My Citrix (www.mycitrix.com) to receive your user ID and password.
Note: If you cannot locate either the license code or your user ID and password, contact Citrix
Customer Service.
• The host name of the
Citrix Gateway
The entry field for this name on My Citrix is case-sensitive, so make sure that you copy the host
name exactly as it is configured on the NetScaler appliance.
• The number of licenses you want to include in the license file
You do not have to download all of the licenses you are entitled to at once. For example, if your
company purchased 100 licenses, you can choose to download 50. You can allocate the rest in
another license file at a later time. Multiple license files can be installed on the
Citrix Gateway.
Note: Before obtaining your licenses, make sure you configure the host name of the NetScaler
appliance using the Setup Wizard and then restart the appliance.
To verify installation of the universal license by using the command line interface
1. Open an SSH connection to the NetScaler appliance by using an SSH client, such as PuTTY.
2. Log on to the NetScaler appliance by using the administrator credentials.
3. Use the show license command to verify that “SSL VPN = YES” and that Maximum Users has
increased from 5 to the expected number of concurrent users.
1. In a Web browser, type the IP address of the NetScaler appliance, such as http://
192.168.100.1.
2. In User Name and Password, type the administrator credentials.
3. In the navigation pane, expand System, and then click Licenses.
4. In the Licenses pane, you will see a green check mark next to NetScaler Gateway. The field Max-
imum Citrix Gateway Users Allowed displays the number of concurrent user sessions licensed
on the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
NetScaler 12.0 offers new and updated features with increased functionality. A comprehensive list
of enhancements is listed in the release notes accompanying the release announcement. Read the
release notes document before you upgrade your software.
This section provides information about upgrading and downgrading a NetScaler appliance (MPX and
VPX) firmware. It includes the following topics:
• Before you begin
• Upgrade a NetScaler standalone appliance
• Downgrade a NetScaler standalone appliance
• Upgrade a high availability pair
• Downgrade a high availability Pair
• Troubleshooting
• FAQs
• New and Deprecated Commands, Parameters, and SNMP OIDs
For information about upgrading a NetScaler SDX appliance, see Single Bundle Upgrade.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Before upgrading the system software, make sure that you read the Before you begin section and
complete the necessary prerequisites such as backing up the necessary files and downloading the
Citrix NetScaler firmware.
When upgrading from 10.0 and higher releases you have the option to use the GUI or the CLI.
You cannot upgrade to release 12.0 from the following builds by using the Upgrade Wizard of the GUI:
If your Citrix NetScaler runs any 9.x or lower release, visit the Product matrix site for more information.
.
Follow these steps to upgrade a standalone Citrix NetScaler to release 12.0 by using the GUI.
1. In a web browser, type the IP address of the Citrix NetScaler, for example http://
10.102.29.50.
2. In User Name and Password, type the administrator credentials (nsroot/nsroot) and then click
Log On.
3. From the GUI, click System Upgrade.
4. From the Choose File drop-down menu choose the appropriate option: Local or Appliance. If
you want to use the Appliance option, the firmware needs to be uploaded to the Citrix NetScaler first.
You can use any file tranfer method such as WinSCP to upload the Citrix NetScaler firmware to the
appliance.
After the upgrade, close all browser instances and clear your computer’s cache before accessing the
appliance.
Follow these steps to upgrade a standalone Citrix NetScaler to release 12.0 by using the CLI:
In the following procedure, <release> and <releasenumber> represent the release version you are up-
grading to, and <targetbuildnumber> represents the build number that you are upgrading to. The
procedure includes optional steps to avoid losing any updates that are pushed to the /etc directory
during the upgrade.
1. Use an SSH client, such as PuTTy, to open an SSH connection to the appliance.
2. Log on to the appliance by using the administrator credentials. Save the running configuration.
At the prompt, type:save config
a) cd /nsconfig
b) cp ns.conf ns.conf.NS<currentreleasenumber><currentbuildnumber>
4. (Optional) If you have modified some of the following files in the /etc directory, and copied them
to /nsconfig to maintain persistency, any updates that are pushed to the /etc directory during
the upgrade might be lost:
• ttys
• resolv.conf
• sshd_config
• host.conf
• newsyslog.conf
• host.conf
• httpd.conf
• rc.conf
• syslog.conf
• crontab
• monitrc
To avoid losing these updates, create a /var/nsconfig_backup directory, and move the cus-
tomized files to this directory. That is, move any files that you modified in /etc directory and
copied to /nsconfig by running the following command:
cp /nsconfig/<filename> /var/nsconfig_backup
Example:
cp /nsconfig/syslog.conf /var/nsconfig_backup
5. Create a location for the installation package. At the shell prompt type:
• cd /var/nsinstall
• mkdir <releasenumber>nsinstall
• cd <releasenumber>nsinstall
• mkdir build_<targetbuildnumber>
• cd build_<targetbuildnumber>
6. Copy the already downloaded Citrix NetScaler firmware to the directory that you created for it in
step 5, by using any file transferring method such as WinSCP. See the Before You Begin section for
more information about downloading the Citrix NetScaler firmware.
8. Run the installns script to install the new version of the system software. The script updates the /etc
directory. Example: ./installns
10. (Optionally) If you’ve created a copy of the ns.conf file in the Before You Begin section, do the
following:
1 login: nsroot
2
3
4 Password: nsroot
5
6
7 Last login: Mon Apr 17 15:05:05 2018 from 10.252.243.134
8
9
10 Done
11
12
13 > save config
14
15
16 > shell
17
18
19 Last login: Mon Apr 17 15:05:05 2018 from 10.252.243.134
20
21
22 root@NSnnn# cd /var/nsinstall
23
24
25 root@NSnnn# cd 12.0nsinstall
26
27
28 root@NSnnn# mkdir build_41.16
29
30
31 root@NSnnn# cd build_41.16
32
33
34 root@NSnnn# ftp <FTP server IP address>
35
36
37 ftp> mget build-12.0-41.16_nc.tgz
38
39
40 ftp> bye
41
42
43 root@NSnnn# tar xzvf build-12.0-41.16_nc.tgz
44
45
46 root@NSnnn# ./installns
47
48
49 installns version (12.0-41.16) kernel (ns-12.0-41.16_nc.gz)
50
51
52 ...
53
54
55 ...
56
57
58 ...
59
60
61 Copying ns-12.0-41.16_nc.gz to /flash/ns-12.0-41.16_nc.gz ...
62
63
64
65
66
67 ...
68
69
70 Installation has completed.
71
72
73
74
75
76 Reboot NOW? [Y/N] Y
To use NITRO API to upgrade or downgrade a Citrix NetScaler, see Automate Citrix NetScaler Upgrade
and Downgrade with a Single API.
In release 10.1 build 122.17, the script files for user monitors are at a new location. If you upgrade an
appliance or virtual appliance to release 10.1 build 122.17 or later, the changes are as follows:
• A new directory named conflicts is created in /nsconfig/monitors/ and all the built-in scripts of
the previous builds are moved to this directory.
• All new built-in scripts are available in the /netscaler/monitors/ directory. All custom scripts are
available in the /nsconfig/monitors/ directory.
• You must save a new custom script in the /nsconfig/monitors/ directory.
• After the upgrade is completed, if a custom script is created and saved in the /nsconfig/moni-
tors/ directory with the same name as that of a built-in script, the script in the /netscaler/moni-
tors/ directory takes priority. That is, the custom script is not run.
If you provision a virtual appliance running release 10.1 build 122.17 or later, the changes are as follows:
For more information about user monitors, see “Understanding user monitors.”
Update the Citrix NetScaler software when an update is available, for better performance. A Citrix
NetScaler update can include feature improvements, performance fixes, or enhancements. Make sure
you read the release notes to see what fixes and enhancements are available in the update. To check
and install a software update, do the following.
1. In the Citrix NetScaler home page, click Check for Update from the nsroot drop-down menu at
the top right corner of the page.
2. In the Latest System Software Updates Available page, check the available software update
that you can install.
3. Click Download to download the installation package from the Citrix download website.
4. After you have downloaded the software package, install the update through either CLI or GUI
procedure.
Note
The Check for Update link is accessible only if you log into the GUI through HTTP protocol and
not through HTTPS protocol.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can downgrade to any earlier release on a standalone Citrix NetScaler by using the CLI. Downgrad-
ing using the GUI is not supported.
Note
Loss in configuration might occur when downgrading. You should compare the configurations
before and after the downgrade, and then manually reenter any missing entries.
Follow the steps given below to downgrade a Citrix NetScaler standalone appliance running release
12.0 to an earlier release.
In this procedure, <release> and <releasenumber> represent the release version you are downgrading
to, and <targetbuildnumber> represents the build number that you are downgrading to.
1. Open an SSH connection to the Citrix NetScaler by using an SSH client, such as PuTTY.
2. Log on to the Citrix NetScaler by using the administrator credentials. Save the running configu-
ration. At the prompt, type:
save config
a) cd /nsconfig
b) cp ns.conf ns.conf.NS<currentbuildnumber>
cp ns.conf.NS<releasenumber> ns.conf
5. If routing is enabled, the ZebOS.conf file will contain the configuration. At the shell prompt,
type:
a) cd /nsconfig
b) cp ZebOS.conf ZebOS.conf.NS
c) cp ZebOS.conf.NS<targetreleasenumber> ZebOS.conf
9. Run the installns script to install the new version of the system software. The script updates the
/etc directory.
If the configuration file for the build that you are downgrading to exists on the appliance, you
are prompted to load that configuration, as shown in the following figure.
If the free space available on the flash drive is insufficient to install the new build, the Citrix
NetScaler aborts the installation. Manually clean up the flash drive and restart the installation.
Example:
1 login: nsroot
2
3 Password: nsroot
4
5 Last login: Mon Apr 24 02:06:52 2017 from 10.102.29.9
6
7 Done
8
9 > save config
10
11 > shell
12
13 root@NSnnn# cp ns.conf.NS10.5 ns.conf
14
15 root@NSnnn# cd /var/nsinstall
16
17 root@NSnnn# mkdir 10.5nsinstall
18
19 root@NSnnn# cd 10.5nsinstall
20
21 root@NSnnn# mkdir build_57
22
23 root@NSnnn# cd build_57
24
25 root@NSnnn# ftp 10.102.1.1
26
27 ftp> mget build-10.5-57_nc.tgz
28
29 ftp> bye
30
31 root@NSnnn# tar -xzvf build-10.1-125_nc.tgz
32
33 root@NSnnn# ./installns
34
35 installns version (10.5-57) kernel (ns-10.5-57.gz)
36
37 ...
38
39 ...
40
41 ...
42
43 Copying ns-10.5-57.gz to /flash/ns-10.5-57_nc.gz ...
44
45 Changing /flash/boot/loader.conf for ns-10.5-57 ...
46
47
48
49 Installation has completed.
50
51
52
53 Reboot NOW? [Y/N] Y
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
One of the requirements of Citrix NetScaler appliances in a high availability setup is to install the same
Citrix NetScaler software release on both appliances of the setup. Therefore, when software on one
appliance is upgraded, ensure that the software is upgraded on both the appliances.
You can follow the same procedure to upgrade a standalone appliance or each appliance in a high
availability pair, although additional considerations apply to upgrading a high availability pair.
Before you start a Citrix NetScaler firmware upgrade on an HA pair, read the prerequisites mentioned
in the Before you begin section. Also, you need to consider a few HA-specific points.
Points to note
• First upgrade the secondary node, and then the primary node. Upgrading software on the sec-
ondary appliance before the primary appliance ensures that the upgrade process is completed
without any issues.
• If the two nodes in an HA configuration are running different Citrix NetScaler software releases,
the following information does not get synchronized on the primary and secondary nodes:
• The above information might not get synchronized on the primary and secondary nodes if the
two nodes are running different builds of the same release. Refer to the Known Issues section
of the release notes to check if your Citrix NetScaler build has this issue.
• Synchronization of the files in the All mode of the Sync HA files command works successfully if
the two nodes in an HA configuration are running different Citrix NetScaler software releases,
or the two nodes are running different builds of the same release. For more information, see
Synchronising Configuration Files in High Availability Setup.
The following illustration depicts the procedure to upgrade software on the secondary appliance:
1. Log on to the secondary NetScaler appliance using an SSH utility, such as PuTTY and specifying
the NetScaler IP (NSIP). Use the nsroot credentials to log on to the appliance.
2. From the command line interface of the appliance, type the following command to save the
existing configuration: save config
6 > shell
7 Copyright (c) 1992-20
4. Run the following command to change to the default installation directory: # cd /var/nsinstall
5. Run the following command to create a temporary subdirectory of the nsinstall directory: #
mkdir x_xnsinstall
Note: The text x_x is used to name the NetScaler version for future configurations. For
example, the directory for the installation files of NetScaler 9.3 us called 9_3nsinstall. Do
not use a period (.) in the folder name, it can cause failed upgrades.
7. Download the required installation package and documentation bundle, such as “ns-x.0-xx.x-
doc.tgz,” to the temporary directory created in Step 4.
Notes:
• Some builds do not have a documentation bundle as it does not have to be installed.
• Click the Documentation tab from the GUI to access the documentation.
8. Before you run the install script, the files must be extracted and placed on the appliance. Use
the following command to uncompress the bundle downloaded from Citrix website: tar -zxvf
ns-x.0-xx.x-doc.tgz. The following is a quick explanation of the parameters used.
x: Extract files
Note: If the appliance does not have sufficient disk space to install the new kernel files, the
installation process performs an automatic cleanup of the flash drive.
10. After the installation process is complete, the process prompts to restart the appliance. Press y
to restart the appliance.
11. Log on to the appliance Command Line Interface using the nsroot credentials.
12. Run the following command from to display the state of the NetScaler appliance: show ha node
The output of the preceding command should indicate that the appliance is a secondary node
and synchronization is disabled.
13. Run the following command to disable synchronization on the appliance if synchronization is
not disabled: set ha node -hasync disabled
15. Run the following command to perform a force failover and takeover as primary appliance:
force failover
1 login: nsroot
2 Password: nsroot
3 Last login: Monday Apr 17 08:37:26 2017 from 10.102.29.9
4 Done
5 show ha node
6 2 nodes:
7 1) Node ID: 0
8 IP: 10.0.4.2
9 Node State: UP
10 Master State: Primary
11 ...
12 Sync State: AUTO DISABLED
13 Propagation: AUTO DISABLED
14 ...
15 Done
The following illustration depicts the procedure to upgrade software on the primary appliance:
Note: After completing the “Upgrade software on the secondary appliance” procedure, the orig-
inal primary appliance is now a secondary appliance.
1. Log on to the secondary NetScaler appliance using an SSH utility, such as PuTTY. Use the nsroot
credentials to log on to the appliance. Follow the same steps as mentioned in the above section
to complete the installation process. We have to follow the same steps as mentioned in step 2
to step 9 in the previous section(Upgrade software of the secondary appliance)
2. After the installation process is complete, the process prompts to restart the appliance. Press y
to restart the appliance.
3. Log on to the appliance Command Line Interface using the nsroot credentials.
4. Run the following command to display the state of the NetScaler appliance: show ha node. The
output of the preceding command should indicate that the appliance is a primary node and the
status of the node state is marked as UP.
5. If the appliance is not a primary appliance, run the following command to perform a force
failover to ensure that the appliance is a primary appliance: force failover
1. Run the following command to verify that the appliance is a secondary appliance: show node
2. Run the following command to enable synchronization on the appliance: set ha node -hasync
enabled
3. Run the following command to verify that the configuration of the secondary appliance is syn-
chronized with that of the primary appliance: show ns runningconfig
Here’s an example configuration of the new primary node and the new secondary node.
1 show ha node
2 Node ID: 0
3 IP: 10.0.4.11
4 Node State: UP
5 Master State: Primary
6 ...
7 ...
8 INC State: DISABLED
9 Sync State: ENABLED
10 Propagation: ENABLED
11 Enabled Interfaces : 1/1
12 Disabled Interfaces : None
13 HA MON ON Interfaces : 1/1
14 ...
15 ...
16 Local node information
17 Critical Interfaces: 1/1
18 Done
19
20 Show ha node
21 Node ID: 0
22 IP: 10.0.4.2
23 Node State: UP
24 Master State: Secondary
25 ..
26 ..
27 INC State: DISABLED
28 Sync State: SUCCESS
29 Propagation: ENABLED
30 Enabled Interfaces : 1/1
Follow these steps to upgrade a Citrix NetScaler pair in a high availability setup, by using the GUI:
1. Log on to the secondary node and perform the upgrade as described in the section “Upgrade
a Citrix NetScaler standalone appliance by using the GUI” in Upgrade a Citrix NetScaler stan-
dalone appliance.
2. Log on to the primary node and perform the upgrade as described in the section “Upgrade a Cit-
rix NetScaler standalone appliance by using the GUI” in Upgrade a Citrix NetScaler standalone
appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can downgrade to any release on a high availability pair by using the command line interface. The
GUI does not support the downgrade process.
To downgrade the system software on a Citrix NetScaler pair in a high availability pair, you need to
downgrade the software first on the secondary node and then on the primary node. For instructions
on downgrading each node separately, see Downgrade a Citrix NetScaler standalone appliance.
Important
Loss in configuration might occur when downgrading. You should compare the configurations
before and after the downgrade, and then manually re-enter any missing entries.
1.
2. Citrix ADC
3. NetScaler 12.0
Troubleshooting
For best results, use the following resources to troubleshoot an issue related to installing, upgrading,
or downgrading a Citrix NetScaler:
• The configuration files from the appliance. In case of a High Availability pair, the configuration
files from both appliances.
• The following files from the appliance(s):
– The relevant newnslog files.
– The ns.log file.
– The messages file.
• A network topology diagram.
Following are the most common installation, upgrade, and downgrade issues, and tips for resolving
them:
• Issue
The Citrix NetScaler is not accessible after the software downgrade
Cause
During the software downgrade process, if the configuration file of the existing release and build
does not match the configuration file of the earlier release and build, the appliance cannot load
the configuration, and the default IP address is assigned to the appliance.
Resolution
• Issue
Configuration of the appliance is lost after you upgrade the software across multiple releases.
Cause
Some migration commands are built in for upgrading to the next release. Such commands
might not be available across releases.
Resolution
– Verify the path of the upgrade process. Citrix recommends upgrading by one release at a
time. For example, if the software needs to be upgraded from Citrix NetScaler (previously
NetScaler) release 9.2 to release 10.1, the following is the recommended path for the up-
grade:
* Release 9.2 to release 9.3
* Release 9.3 to release 10
* Release 10 to release 10.1
– Verify that the appliance has appropriate license files.
– Verifying the configuration at each step of the upgrade process can give you pointers to
the issue.
• Issue
During an upgrade, if I run the command for synchronizing, the following message appears:
Command failed on the secondary node but succeeded on the primary node.
Resolution
Do not run any dependent commands (set /unset /bind /unbind) when High Availability (HA)
synchronization is in progress.
• Issue
During an upgrade process, traffic does not pass through the new primary node when you run
the force failover command.
Resolution
– Check for problems with the network topology and the switch configurations.
– Run the set L2param -garpreply ENABLED command to enable the GARP reply.
– Try using VMAC if not already used.
• Issue
In an HA pair, after you run the force HA failover command the devices keep rebooting. The
secondary device does not come up after an upgrade.
Resolution
Check to see if the /var directory is full. If so, remove the old installation files. Run the df –h
command to show the available disk space.
• Issue
Resolution
– Check to see if both nodes are running the same build. If the builds are not same and HA
nodes have a version mismatch, some of the fields are shown as UNKNOWN when you run
the show ha node command.
– Check to see if the secondary appliance is reachable.
• Issue
After you upgrade the Citrix NetScaler, the interface shows most of the load balancing virtual
servers and services are DOWN.
Resolution
Verify that the SNIP address is active on the secondary appliance. Also, type the show service
command to see if the service is running.
• Issue
After performing an upgrade, all virtual servers are down on the secondary appliance.
Resolution
• Issue
After performing a downgrade, the Citrix NetScaler does not boot up properly.
Resolution
• Issue
In an HA pair, some features do not get synchronized after an upgrade is performed.
Resolution
Run the sync ha file misc command to synchronize the configurations files from the primary
node to secondary node.
• Issue
During reboot, the following error message appears:
One or more commands in ns.conf failedWhat should I do?
Resolution
Make sure that no command in the ns.conf file exceeds the 255 byte limit. In commands that
create policies that are too long for the 255-byte limit, you can use pattern sets to shorten the
policies.
Example:
• Issue
After performing an upgrade, and when I click on any link on the GUI that has to load a java
applet (Upgrade Wizard or license Wizard), the following error message appears: GUI version
does not match with the kernel version. Please close this instance, clear java plug-in cache
and reopen.
Resolution
– Log on to the Citrix NetScaler using the GUI.
– Navigate to Citrix NetScaler Gateway > Global Settings.
– Click Change Global Settings under Settings.
– In the details pane, under Client Experience, select Default from the UI theme list.
– Click OK.
Note
These troubleshooting steps also apply to issues with configuration loss when downgrading the
software across multiple releases.
For any other issue, see the release notes, Knowledge Center articles, and FAQs.
1.
2. Citrix ADC
3. NetScaler 12.0
FAQs
Contributed by:
C
This section lists the new and deprecated commands, parameters, and SNMP OIDs.
New commands
New parameters
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
Command:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Some of the NetScaler functionalities are deprecated in 12.0 and in its subsequent releases. Citrix
recommends that you do not use these features through the NetScaler command interface, NetScaler
GUI, or Nitro automation. However, to ease the transition to new alternatives, the deprecated features
are usable for a limited time and will be removed in future releases. Citrix recommends you to use the
below alternatives for the following set of deprecated functionalities.
A list of NetScaler features and functionalities are deprecated. For complete information, You can refer
to Deprecated List pdf.
You can use the nspepi tool to convert commands, expressions, and configurations. For more infor-
mation, see Converting Expressions by Using NSPEPI Tool topic.
Here is a list of conversion from Classic expressions to Advanced expressions.
When using AppQoE as an alternative for SureConnect feature, you can refer to the following use case
configurations.
Use Case 1: To limit simultaneous download of huge files and display loading screen:
Use Case 2: To limit simultaneous download of huge files and display loading screen with alter-
nate content:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
appliance instead of managing these controls separately for each application. Doing authentication
on the appliance also permits sharing this information across all web sites within the same domain
that are protected by the appliance.
The AAA feature supports authentication, authorization, and auditing for all application traffic. To
use AAA, you must configure authentication virtual servers to handle the authentication process and
traffic management virtual servers to handle the traffic to web applications that require authentica-
tion. You also configure your DNS to assign FQDNs to each virtual server. After configuring the virtual
servers, you configure a user account for each user that will authenticate via the NetScaler appliance,
and optionally you create groups and assign user accounts to groups. After creating user accounts
and groups, you configure policies that tell the appliance how to authenticate users, which resources
to allow users to access, and how to log user sessions. To put the policies into effect, you bind each
policy globally, to a specific virtual server, or to the appropriate user accounts or groups. After con-
figuring your policies, you customize user sessions by configuring session settings and binding your
session policies to the traffic management virtual server. Finally, if your intranet uses client certs, you
set up the client certificate configuration.
Before configuring AAA, you should be familiar with and understand how to configure load balancing,
content switching, and SSL on the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
January 6, 2019
Contributed by:
C
AAA provides security for a distributed internet environment by allowing any client with the proper
credentials to connect securely to protected application servers from anywhere on the Internet. This
feature incorporates the three security features of AAA. Authentication enables the NetScaler appli-
ance to verify the client’s credentials, either locally or with a third-party authentication server, and
allow only approved users to access protected servers. Authorization enables the ADC to verify which
content on a protected server it should allow each user to access. Auditing enables the ADC to keep a
record of each user’s activity on a protected server.
To understand how AAA works in a distributed environment, consider an organization with an intranet
that its employees access in the office, at home, and when traveling. The content on the intranet is
confidential and requires secure access. Any user who wants to access the intranet must have a valid
user name and password. To meet these requirements, the ADC does the following:
• Redirects the user to the login page if the user accesses the intranet without having logged in.
• Collects the user’s credentials, delivers them to the authentication server, and caches them in
a directory that is accessible through LDAP.
• Verifies that the user is authorized to access specific intranet content before delivering the user’s
request to the application server.
• Maintains a session timeout after which users must authenticate again to regain access to the
intranet. (You can configure the timeout.)
• Logs the user accesses, including invalid login attempts, in an audit log.
Authentication requires that several entities: the client, the
NetScaler appliance, the external authentication server if one is used, and the application server, re-
spond to each other when prompted by performing a complex series of tasks in the correct order. If
you are using an external authentication server, this process can be broken down into the following
fifteen steps.
1. The client sends a GET request for a URL on the application server.
2. The NetScaler appliance’s traffic management virtual server redirects the request to the appli-
cation server.
3. The application server determines that the client has not been authenticated, and therefore
sends an HTTP 200 OK response via the TM vserver to the client. The response contains a hidden
script that causes the client to issue a POST request for /cgi/tm.
4. The client sends a POST request for /cgi/tm.
5. The NetScaler appliance’s authentication virtual server redirects the request to the authentica-
tion server.
6. The authentication server creates an authentication session, sets and caches a cookie that con-
sists of the initial URL and the domain of the traffic management virtual server, and then sends
an HTTP 302 response via the authentication virtual server, redirecting the client to /vpn/in-
dex.html.
7. The client sends a GET request for /vpn/index.html.
8. The authentication virtual server redirects the client to the authentication server login page.
9. The client sends a GET request for the login page, enters credentials, and then sends a POST
request with the credentials back to the login page.
10. The authentication virtual server redirects the POST request to the authentication server.
11. If the credentials are correct, the authentication server tells the authentication virtual server to
log the client in and redirect the client to the URL that was in the initial GET request.
12. The authentication virtual server logs the client in and sends an HTTP 302 response that redi-
rects the client to the initially requested URL.
13. The client sends a GET request for their initial URL.
14. The traffic management virtual server redirects the GET request to the application server.
15. The application server responds via the traffic management virtual server with the initial URL.
If you use local authentication, the process is similar, but the authentication virtual server handles
all authentication tasks instead of forwarding connections to an external authentication server. The
following figure illustrates the authentication process.
When an authenticated client requests a resource, the ADC, before sending the request to the applica-
tion server, checks the user and group policies associated with the client account, to verify that the
client is authorized to access that resource. The ADC handles all authorization on protected applica-
tion servers. You do not need to do any special configuration of your protected application servers.
AAA traffic management handles password changes for users by using the protocol-specific method
for the authentication server. For most protocols, neither the user nor the administrator needs to do
anything different than they would without AAA traffic management. Even when an LDAP authenti-
cation server is in use, and that server is part of a distributed network of LDAP servers with a single
designated domain administration server, password changes are usually handled seamlessly. When
an authenticated client of an LDAP server changes his or her password, the client sends a credential
modify request to AAA traffic management, which forwards it to the LDAP server. If the user’s LDAP
server is also the domain administration server, that server responds appropriately and AAA traffic
management then performs the requested password change. Otherwise, the LDAP server sends AAA
traffic management an LDAP_REFERRAL response to the domain administration server. AAA traffic
management follows the referral to the indicated domain administration server, authenticates to that
server, and performs the password change on that server.
When configuring AAA traffic management with an LDAP authentication server, the system adminis-
trator must keep the following conditions and limitations in mind:
• AAA traffic management assumes that the domain administration server in the referral accepts
the same bind credentials as the original server.
• AAA traffic management only follows LDAP referrals for password change operations. In other
cases AAA traffic management refuses to follow the referral.
• AAA traffic management only follows one level of LDAP referrals. If the second LDAP server also
returns a referral, AAA traffic management refuses to follow the second referral.
The ADC supports auditing of all states and status information, so you can see the details of what each
user did while logged on, in chronological order. To provide this information, the appliance logs each
event, as it occurs, either to a designated audit log file on the appliance or to a syslog server. Auditing
requires configuring the appliance and any syslog server that you use.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Enabling AAA
Contributed by:
C
To use the AAA - Application Traffic feature, you must enable it. You can configure AAA entities—such
as the authentication and traffic management virtual servers—before you enable the AAA feature, but
the entities will not function until the feature is enabled.
At the command prompt, type the following commands to enable AAA and verify the configuration:
• show ns feature
Example
Done
• show ns feature
2. In the details pane, under Modes and Features, click Change basic features.
3. In the Configure Basic Features dialog box, select the Authentication, Authorization and Audit-
ing check box.
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
All authentication requests are redirected by the traffic management virtual server (load balancing
or content switching) to the authentication virtual sever. This virtual server processes the associated
authentication policies and accordingly provides access to the application.
Note
2. Configure an authentication virtual server. It must be of type SSL and make sure to bind SSL
certificate-key pair to the virtual server.
3. Specify the FQDN of the domain for the authentication virtual server.
4. Associate the authentication virtual server to the relevant traffic management virtual server.
Note:
The FQDN of the traffic management virtual server must be in the same domain as the FQDN of
the authentication virtual server for the domain session cookie to function correctly.
• Enable authentication.
• Specify the FQDN of the authentication virtual server as the authentication host of the traffic
management virtual server.
• [Optional] Specify the authentication domain on the traffic management virtual server.
Note:
If you do not configure the authentication domain, the appliance assigns an FQDN that con-
sists of the FQDN of the authentication virtual server without the hostname portion. For ex-
ample, if domain name of the authentication virtual server is tm.xyz.bar.com, the appliance
assigns xyz.bar.com as the authentication domain.
1. Verify that both the virtual servers are UP and configure correctly.
Navigate to System > Settings, click Configure Basic features, and enable Authentication,
Authorization and Auditing.
Navigate to Security > AAA - Application Traffic > Virtual Servers, and configure as required
(refer to the configurations provided in the CLI procedure provided above).
Navigate to Traffic Management > Load Balancing > Virtual Servers, and configure the virtual
server as required (refer to the configurations provided in the CLI procedure provided above).
Navigate to Traffic Management > Content Switching > Virtual Servers, and configure the
virtual server as required (refer to the configurations provided in the CLI procedure provided
above).
Navigate to Security > AAA - Application Traffic > Virtual Servers, and check the details of the
relevant authentication virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
To configure AAA, first configure an authentication virtual server to handle authentication traffic. Next,
bind an SSL certificate-key pair to the virtual server to enable it to handle SSL connections.
For additional information about configuring SSL and creating a certificate-key pair, see SSL certifi-
cates.
To configure an authentication virtual server and verify the configuration, at the command prompt
type the following commands in the order shown:
Example
• To modify an existing authentication virtual server, select the virtual server, and then click
Edit. The Configuration dialog opens with the Basic Settings area expanded.
3. Specify values for the parameters as follows (asterisk indicates a required parameter):
Note: The authentication virtual server uses only the SSL protocol and port 443, so those
options are greyed out. Any options that are not mentioned are not relevant and should
be ignored.
5. In the Certificates area, configure any SSL certificates you want to use with this virtual server.
• To configure a CA certificate, click the arrow on the right of CA Certificate to display the CA
Cert Key dialog box, select the certificate you want to bind to this virtual server, and click
Save.
• To configure a server certificate, click the arrow on the right of Server Certificate, and fol-
low the same process as for CA certificate.
7. If you want to bind an advanced authentication policy to the virtual server, click the arrow on
the right side of the line to display the Authentication Policy dialog box, choose the policy that
you want to bind to the server, set the priority, and then click OK.
9. If you want to create a basic authentication policy and bind it to the virtual server, click the plus
sign to display the Policies dialog box, and follow the prompts to configure the policy and bind
it to this virtual server.
11. In the 401-Based Virtual Servers area, configure any load balancing or content switching virtual
servers that you want to bind to this virtual server.
• To bind a load balancing virtual server, click the arrow to the right of LB virtual server to
display the LB Virtual Servers dialog box, and follow the prompts.
• To bind a content switching virtual server, click the arrow to the right of CS virtual server
to display the CS Virtual Servers dialog box, and follow the same process as to bind an LB
virtual server.
12. If you want to create or configure a group, in the Groups area click the arrow to display the
Groups dialog box, and follow the prompts.
13. Review your settings, and when you are finished, click Done. The dialog box closes. If you cre-
ated a new authentication virtual server, it now appears in the Configuration window list.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
After you have created and configured your authentication virtual server, you next create or configure
a traffic management virtual server and associate your authentication virtual sever with it. You can
use either a load balancing or content switching virtual server for a traffic management virtual server.
For more information about creating and configuring either type of virtual server, see the Citrix Traffic
Management Guide at Traffic Management.
Note
The FQDN of the traffic management virtual server must be in the same domain as the FQDN of
the authentication virtual server for the domain session cookie to function correctly.
You configure a traffic management virtual server for AAA by enabling authentication and then as-
signing the FQDN of the authentication server to the traffic management virtual server. You can also
configure the authentication domain on the traffic management virtual server at this time. If you do
not configure this option, the NetScaler appliance assigns the traffic management virtual server an
FQDN that consists of the FQDN of the authentication virtual server without the hostname portion.
For example, if domain name of the authentication virtual server is tm.xyz.bar.com, the appliance
assigns xyz.bar.com. as the authentication domain.
To configure a TM virtual server for AAA by using the command line interface
At the command prompt, type one of the following sets of commands to configure a TM virtual server
and verify the configuration:
Example
The login protocol between AAA traffic management virtual servers and AAA virtual servers is simpli-
fied to use internal mechanisms as opposed to sending the encrypted data through query parameters.
By leveraging this feature, the replay of requests is prevented.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Configuring DNS
Contributed by:
C
For the domain session cookie used in the authentication process to function correctly, you must con-
figure DNS to assign both the authentication and the traffic management virtual servers to FQDNs
in the same domain. For information about how to the configure DNS address records, see Domain
Name System.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
After you configure authentication and traffic management virtual servers and before you create user
accounts, you should verify that both virtual servers are configured correctly and are in the UP state.
To verify authentication virtual server setup by using the command line interface
To verify your AAA virtual server setup by using the configuration utility
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
When you want the same authentication settings to be used by multiple traffic management virtual
servers, you can create an authentication profile which specifies the authentication virtual server, the
authentication host, the authentication domain, and authentication level.
This authentication profile can be associated with the relevant traffic management virtual servers.
For example, to create a profile with an authentication virtual server named “authVS”.
Note:
The authentication weight or level will depend on the virtual server to which the traffic
will bound. A session that is created by authenticating against traffic management virtual
server at given level cannot be used to access traffic management virtual server at a higher level.
• Bind the authentication profile to the relevant traffic management virtual servers.
For example, to bind authProfile1 to a load balancing virtual server named “vserver1”.
In the Configuration tab, navigate to Security > AAA - Application Traffic > Authentication Profile,
and configure the authentication profile as required.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
After configuring the AAA basic setup, you create users and groups. You first create a user account for
each person who will authenticate via the NetScaler appliance. If you are using local authentication
controlled by the NetScaler appliance itself, you create local user accounts and assign passwords to
each of those accounts.
You also create user accounts on the NetScaler appliance if you are using an external authentication
server. In this case, however, each user account must exactly match an account for that user on the
external authentication server, and you do not assign passwords to the user accounts that you create
on the NetScaler appliance. The external authentication server manages the passwords for users that
authenticate with the external authentication server.
If you are using an external authentication server, you can still create local user accounts on the
NetScaler appliance if, for example, you want to allow temporary users (such as visitors) to log in but
do not want to create entries for those users on the authentication server. You assign a password to
each local user account, just as you would if you were using local authentication for all user accounts.
Each user account must be bound to policies for authentication and authorization. To simplify this
task, you can create one or more groups and assign user accounts to them. You can then bind policies
to groups instead of individual user accounts.
To create a local AAA user account by using the command line interface
At the command prompt, type the following commands to create a local AAA user account and verify
the configuration:
Example
To change the password for an existing AAA local user account by using the command
line interface
At the command prompt, type the following command and, when prompted, type the new password:
Example
To create AAA local groups and add users to them by using the command line interface
At the command prompt, type the following commands. Type the first command one time, and type
the second command once for each user:
Example
Example
To remove users from an AAA group by using the command line interface
At the command prompt, unbind users from the group by typing the following command once for
each user account that is bound to the group:
Example
First remove all users from the group. Then, at the command prompt, type the following command
to remove an AAA group and verify the configuration:
Example
To configure AAA local groups and add users to them by using the configuration utility
3. If you are creating a new group, in the Create AAA Group dialog box, in the Group Name text
box, type a name for the group.
• To add a user to the group, select the user, and then click Add.
• To remove a user from the group, select the user, and then click Remove.
• To create a new user account and add it to the group, click the Plus icon, and then follow
the instructions in “To configure AAA local users by using the configuration utility.”
5. Click Create or OK. The group that you created appears in the AAA Groups page.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
After you set up your users and groups, you next configure authentication policies, authorization poli-
cies, and audit policies to define which users are allowed to access your intranet, which resources
each user or group is allowed to access, and what level of detail AAA will preserve in the audit logs.
An authentication policy defines the type of authentication to apply when a user attempts to log on.
If external authentication is used, the policy also specifies the external authentication server. Autho-
rization policies specify the network resources that users and groups can access after they log on.
Auditing policies define the audit log type and location.
You must bind each policy to put it into effect. You bind authentication policies to authentication
virtual servers, authorization policies to one or more user accounts or groups, and auditing policies
both globally and to one or more user accounts or groups.
When you bind a policy, you assign a priority to it. The priority determines the order in which the
policies you define are evaluated. You can set the priority to any positive integer. In the NetScaler
appliance operating system, policy priorities work in reverse order: the higher the number, the lower
the priority. For example, if you have three policies with priorities of 10, 100, and 1000, the policy
assigned a priority of 10 is performed first, then the policy assigned a priority of 100, and finally the
policy assigned an order of 1000. The AAA feature implements only the first of each type of policy that
a request matches, not any additional policies of that type that a request might also match, so policy
priority is important for getting the results you intend.
You can leave yourself plenty of room to add other policies in any order, and still set them to evaluate
in the order you want, by setting priorities with intervals of 50 or 100 between each policy when you
bind the policies. You can then add additional policies at any time without having to reassign the
priority of an existing policy.
For additional information about binding policies on the NetScaler appliance, see the Citrix Traffic
Management Guide at Traffic Management.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Authentication policies
Contributed by:
C
The NetScaler appliance can authenticate users with local user accounts or by using an external au-
thentication server. The appliance supports the following authentication types:
• LOCAL
• RADIUS
• LDAP
• TACACS
Authenticates to an external Terminal Access Controller Access-Control System (TACACS) au-
thentication server.
After a user authenticates to a TACACS server, the NetScaler appliance connects to the same
TACACS server for all subsequent authorizations. When a primary TACACS server is unavailable,
this feature prevents delays while the ADC waits for the first TACACS server to time out before
resending the authorization request to the second TACACS server.
Note
When authenticating through a TACACS server, AAA traffic management logs only success-
fully executed TACACS commands, to prevent the logs from showing TACACS commands
that were entered by users who were not authorized to execute them.
Starting from NetScaler 12.0 Build 57.x, the Terminal Access Controller Access-Control System
(TACACS) is not blocking the AAA daemon while sending the TACACS request. The AAA daemon allows
LDAP, and RADIUS authentication to proceed with the request. The TACACS authentication request
resumes once TACACS server acknowledges the TACACS request.
• CERT
Authenticates to the NetScaler appliance by using a client certificate, without reference to an
external authentication server.
• NEGOTIATE
Authenticates to a Kerberos authentication server. If there is an error in Kerberos authentica-
tion, NetScaler appliance uses NTLM authentication.
• SAML
Authenticates to a server that supports the Security Assertion Markup Language (SAML).
• SAML IDP
Configures the NetScaler appliance to serve as a Security Assertion Markup Language (SAML)
Identity Provider (IdP).
• WEB
Authenticates to a web server, providing the credentials that the web server requires in an HTTP
request and analyzing the web server response to determine that user authentication was suc-
cessful.
An authentication policy is comprised of an expression and an action. Authentication policies use
NetScaler appliance expressions.
After creating an authentication action and an authentication policy, bind it to an authentication vir-
tual server and assign a priority to it. When binding it, also designate it as either a primary or a sec-
ondary policy. Primary policies are evaluated before secondary policies. In configurations that use
both types of policy, primary policies are normally more specific policies while secondary policies are
normally more general policies intended to handle authentication for any user accounts that do not
meet the more specific criteria.
If you do not use LOCAL authentication, you need to add an explicit authentication action. To do this,
at the command prompt, type the following command:
Example
To configure an existing authentication action, at the command prompt, type the following command:
Example
To remove an existing RADIUS action, at the command prompt, type the following command:
Example
Note
In the configuration utility, the term server is used instead of action, but refers to the same task.
1. Navigate to Security > AAA - Application Traffic > Policies > Authentication.
2. In the details pane, on the Servers tab, do one of the following:
• To create a new authentication server, click Add.
• To modify an existing authentication server, select the server, and then click Open.
3. In the Create Authentication Server or Configure Authentication Server dialog box, type or
select values for the parameters.
• Name*—radiusActionName (Cannot be changed for a previously configured action)
• Authentication Type*—authtype (Set to RADIUS, cannot be changed)
• IP Address*—serverip </IP>
• IPV6*—Select the checkbox if the server IP is an IPv6 IP. (No command line equivalent.)
• Port*—serverPort
• Time-out (seconds)*—authTimeout
4. Click Create or OK, and then click Close. The policy that you created appears in the Authenti-
cation Policies and Servers page.
To create and bind an authentication policy by using the command line interface
At the command prompt, type the following commands in the order shown to create and bind an
authentication policy and verify the configuration:
Example
At the command prompt, type the following commands to modify an existing authentication policy:
Example
At the command prompt, type the following command to remove an authentication policy:
Example
1. Navigate to Security > AAA - Application Traffic > Policies > Authentication, and then select
the type of policy that you want to create.
2. In the details pane, on the Policies tab, do one of the following:
• To create a new policy, click Add.
• To modify an existing policy, select the action, and then click Edit.
3. In the Create Authentication Policy or Configure Authentication Policy dialog, type or select val-
ues for the parameters.
• Name*—policyname (Cannot be changed for a previously configured action)
• Authentication Type*—authtype
• Server*—authVsName
• Expression*—rule (You enter expressions by first choosing the type of expression in the left-
most drop-down list beneath the Expression window, and then by typing your expression
directly into the expression text area, or by clicking Add to open the Add Expression dialog
box and using the drop-down lists in it to construct your expression.)
4. Click Create or OK. The policy that you created appears in the Policies page.
5. Click the Servers tab, and in the details pane do one of the following:
• To use an existing server, select it, and then click .
• To create a new server, click Add, and follow the instructions.
6. If you want to designate this policy as a secondary authentication policy, on the Authentication
tab, click Secondary. If you want to designate this policy as a primary authentication policy,
skip this step.
7. Click Insert Policy.
8. Choose the policy you want to bind to the authentication virtual server from the drop-down list.
9. In the Priority column to the left, modify the default priority as needed to ensure that the policy
is evaluated in the proper order.
10. Click OK. A message appears in the status bar, stating that the policy has been configured suc-
cessfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
As with other types of authentication policies, a Lightweight Directory Access Protocol (LDAP) authen-
tication policy is comprised of an expression and an action. After creating an authentication policy,
you bind it to an authentication virtual server and assign a priority to it. When binding it, you also
designate it as either a primary or a secondary policy. In addition to standard authentication func-
tions, LDAP can search other active directory (AD) servers for user accounts for users that do not exist
locally. This function is called referral support or referral chasing.
Normally you configure the NetScaler appliance to use the IP address of the authentication server dur-
ing authentication. With LDAP authentication servers, you can also configure the ADC to use the FQDN
of the LDAP server instead of its IP address to authenticate users. Using an FQDN can simplify an other-
wise much more complex AAA configuration in environments where the authentication server might
be at any of several IP addresses, but always uses a single FQDN. To configure authentication by using
a server’s FQDN instead of its IP address, you follow the normal configuration process except when
creating the authentication action. When creating the action, you use the serverName parameter
instead of the serverIP parameter, and substitute the server’s FQDN for its IP address.
Before you decide whether to configure the ADC to use the IP or the FQDN of your LDAP server to
authenticate users, consider that configuring AAA to authenticate to an FQDN instead of an IP address
adds an extra step to the authentication process. Each time the ADC authenticates a user, it must
resolve the FQDN. If a great many users attempt to authenticate simultaneously, the resulting DNS
lookups might slow the authentication process.
LDAP referral support is disabled by default and cannot be enabled globally. It must be explicitly en-
abled for each LDAP action. You must also make sure that the AD server accepts the same binddn
credentials that are used with the referring (GC) server. To enable referral support, you configure an
LDAP action to follow referrals, and specify the maximum number of referrals to follow.
If referral support is enabled, and the NetScaler appliance receives an LDAP_REFERRAL response to
a request, AAA follows the referral to the active directory (AD) server contained in the referral and
performs the update on that server. First, AAA looks up the referral server in DNS, and connects to
that server. If the referral policy requires SSL/TLS, it connects via SSL/TLS. It then binds to the new
server with the binddn credentials that it used with the previous server, and performs the operation
which generated the referral. This feature is transparent to the user.
Note
These instructions assume that you are already familiar with the LDAP protocol and have already
configured your chosen LDAP authentication server.
For more information about setting up authentication policies in general, see Authentication Poli-
cies. For more information about NetScaler appliance expressions, which are used in the policy rule,
see Policies and Expressions.
Note
In the configuration utility, the term server is used instead of action, but refers to the same task.
1. Navigate to Security > AAA - Application Traffic > Policies > LDAP.
2. In the details pane, on the Servers tab, select the LDAP server that you want to configure, and
then click Edit.
3. In the Configure Authentication Server dialog, scroll down to the Referrals check box, and
select it.
4. In the Maximum Referral Level text box, type the maximum number of referrals to allow.
5. Click OK, and then click Close.
With key-based authentication, you can now fetch the list of public keys that are stored on the user
object in LDAP server through SSH. The NetScaler appliance during role-based authentication (RBA)
process must extract public SSH keys from the LDAP server. The retrieved public key, which is com-
patible with SSH, must allow you to log in through RBA method.
A new attribute “sshPublicKey” is introduced in the “add authentication ldapAction” and “set authen-
tication ldapAction” commands. By using this attribute, you can obtain the following benefits:
• Can store the retrieved public key, and the LDAP action uses this attribute to retrieve SSH key
information from LDAP server.
• Can extract attribute names of up to 24 KB.
Note
The external authentication server, such as LDAP is used only to retrieve SSH key information. It
is not used for authentication purpose.
• SSH daemon sends an AAA_AUTHENTICATE request with password field empty to AAA daemon
port.
• If LDAP is configured to store the SSH public key, AAA responds with “sshPublicKey” attribute
along with other attributes.
• SSH daemon verifies these keys with the client keys.
• SSH daemon passes user name in the request payload, and AAA returns the keys specific to this
user along with generic keys.
To configure the sshPublicKey attribute, at the command prompt type the following commands:
• With add operation, you can add “sshPublicKey” attribute while configuring ldapAction com-
mand.
• With set operation, you can configure “sshPublicKey” attribute to an already added ldapAction
command.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
In addition to standard authentication functions, the Negotiate Action command can now extract user
information from a keytab file instead of requiring you to enter that information manually. If a keytab
has more than one SPN, AAA selects the correct SPN. You can configure this feature at the command
line, or by using the configuration utility.
Note: These instructions assume that you are already familiar with the LDAP protocol and have already
configured your chosen LDAP authentication server.
To configure AAA to extract user information from a keytab file by using the command
line interface
Example
To configure AAA to extract user information from a keytab file by using the
configuration utility
Note
In the configuration utility, the term server is used instead of action, but refers to the same task.
1. Navigate to Security > AAA - Application Traffic > Policies > Negotiate.
2. In the details pane, on the Servers tab, do one of the following:
• If you want to create a new Negotiate action, click Add.
• If you want to modify an existing Negotiate action, in the data pane select the action, and
then click Edit.
3. If you are creating a new Negotiate action, in the Name text box, type a name for your new
action. The name can be from one to 127 characters in length and can consist of upper- and low-
ercase letters, numbers, and the hyphen (-) and underscore (_) characters. If you are modifying
an existing Negotiate action, skip this step. The name is read-only; you cannot change it.
4. Under Negotiate, if the Use Keytab file check box is not already checked, check it.
5. In the Keytab file path text box, type the full path and filename of the keytab file that you want
to use.
6. In the Default authentication group text box, type the authentication group that you want to set
as default for this user.
7. Click Create or OK to save your changes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
As with other types of authentication policies, a Remote Authentication Dial In User Service (RADIUS)
authentication policy is comprised of an expression and an action. After creating an authentication
policy, you bind it to an authentication virtual server and assign a priority to it. When binding it, you
also designate it as either a primary or a secondary policy. However, setting up a RADIUS authentica-
tion policy has certain special requirements that are described below.
Normally you configure the NetScaler appliance to use the IP address of the authentication server
during authentication. With RADIUS authentication servers, you can now configure the ADC to use the
FQDN of the RADIUS server instead of its IP address to authenticate users. Using an FQDN can simplify
an otherwise much more complex AAA configuration in environments where the authentication server
might be at any of several IP addresses, but always uses a single FQDN. To configure authentication
by using a server’s FQDN instead of its IP address, you follow the normal configuration process except
when creating the authentication action. When creating the action, you substitute the serverName
parameter for the serverIP parameter.
Before you decide whether to configure the NetScaler appliance to use the IP or the FQDN of your
RADIUS server to authenticate users, consider that configuring AAA to authenticate to an FQDN instead
of an IP address adds an extra step to the authentication process. Each time the ADC authenticates
a user, it must resolve the FQDN. If a great many users attempt to authenticate simultaneously, the
resulting DNS lookups might slow the authentication process.
Note
These instructions assume that you are already familiar with the RADIUS protocol and have al-
ready configured your chosen RADIUS authentication server.
For more information about setting up authentication policies in general, see Authentication Poli-
cies. For more information about NetScaler appliance expressions, which are used in the policy rule,
see Policies and Expressions.
To add an authentication action for a RADIUS server by using the command line
interface
If you authenticate to a RADIUS server, you need to add an explicit authentication action. To do this,
at the command prompt, type the following command:
The following example adds a RADIUS authentication action named Authn-Act-1, with the server IP
10.218.24.65, the server port 1812, the authentication timeout 15 minutes, the radius key WareTh-
eLorax, NAS IP disabled, and NAS ID NAS1.
The following example adds the same RADIUS authentication action, but using the server FQDN
rad01.example.com instead of the IP.
To configure an existing RADIUS action, at the command prompt, type the following command:
To remove an existing RADIUS action, at the command prompt, type the following command:
Example
Note
In the configuration utility, the term server is used instead of action, but refers to the same task.
1. Navigate to Security > AAA - Application Traffic > Policies > Authentication > Radius
2. In the details pane, on the Servers tab, do one of the following:
• To create a new RADIUS server, click Add.
• To modify an existing RADIUS server, select the server, and then click Edit.
3. In the Create Authentication RADIUS Server or Configure Authentication RADIUS Server di-
alog, type or select values for the parameters. To fill out parameters that appear beneath Send
Calling Station ID, expand Details.
• Name*—radiusActionName (Cannot be changed for a previously configured action)
• Authentication Type*—authtype (Set to RADIUS, cannot be changed)
• Server Name / IP Address*—Choose either Server Name or Server IP
– Server Name*—serverName <FQDN>
– IP Address*—serverIp <IP> If the server is assigned an IPv6 IP address, select the IPv6
check box.
• Port*—serverPort
• Time-out (seconds)*—authTimeout
• Secret Key*—radKey (RADIUS shared secret.)
• Confirm Secret Key*—Type the RADIUS shared secret a second time. (No command line
equivalent.)
• Send Calling Station ID—callingstationid
• Group Vendor Identifier—radVendorID
• Group Attribute Type—radAttributeType
• IP Address Vendor Identifier—ipVendorID
• pwdVendorID—pwdVendorID
• Password Encoding—passEncoding
• Default Authentication Group—defaultAuthenticationGroup
• NAS ID—radNASid
• Enable NAS IP address extraction—radNASip
• Group Prefix—radGroupsPrefix
• Group Separator—radGroupSeparator
• IP Address Attribute Type—ipAttributeType
• Password Attribute Type—pwdAttributeType
• Accounting—accounting
4. Click Create or OK. The policy that you created appears in the Servers page.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
For information on NetScaler appliance as a SAML SP and IdP, see SAML Authentication.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
AAA is now able to authenticate a user to a web server, providing the credentials that the web server
requires in an HTTP request and analyzing the web server response to determine that user authenti-
cation was successful. As with other types of authentication policies, a Web authentication policy is
comprised of an expression and an action. After creating an authentication policy, you bind it to an
authentication virtual server and assign a priority to it. When binding it, you also designate it as either
a primary or a secondary policy.
To set up web-based authentication with a specific web server, first you create a web authentication
action. Since authentication to web servers does not use a rigid format, you must specify exactly
which information the web server requires and in which format when creating the action. To do this,
you create an expression in NetScaler appliance default syntax that contains the following items:
For all other parameters, follow the normal rules for the add authentication action command.
Next you create a policy associated with that action. The policy is similar to an LDAP policy, and like
LDAP policies uses NetScaler appliance syntax.
Note
These instructions assume that you are already familiar with the authentication requirements
of the web server(s) to which you want to authenticate, and have already configured the web
authentication server.
To create a web authentication action at the command line, at the command line type the following
command:
Example
Note
In the configuration utility, the term server is used instead of action, but refers to the same task.
1. Navigate to Security > AAA - Application Traffic > Policies > LDAP.
2. In the details pane, on the Servers tab, do one of the following:
• If you want to create a new web authentication action, click Add.
• If you want to modify an existing web authentication action, in the data pane select the
action, and then click Edit.
3. If you are creating a new web authentication action, in the Create Authentication Web server
dialog box, Name text box, type a name for the new web authentication action. The name can
be from one to 127 characters in length, and can consist of upper- and lowercase letters, num-
bers, and the hyphen (-) and underscore (_) characters. If you are modifying an existing web
authentication action, skip this step. The name is read-only; you cannot change it.
4. In the Web Server IP Address text box, type the IPv4 or IPv6 IP address of the authentication
web server. If the address is an IPv6 IP address, select the IPv6 check box first.
5. In the Port text box, type the port number on which the web server accepts connections.
6. Select HTTP or HTTPS in the Protocol drop-down list.
7. In the HTTP Request Expression text area, type a PCRE-format regular expression that creates
the web server request that contains the user’s credentials in the exact format expected by the
authentication web server.
8. In the Expression to validate the Authentication text area, type a NetScaler appliance default
syntax expression that describes the information in the web server response that indicates that
user authentication was successful.
9. Fill out the remaining fields as described in the general authentication action documentation.
10. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
If you know exactly how you want an authentication policy to be configured, you can use the advanced
authentication policy dialog to create the policy quickly.
1. Navigate to Security > AAA - Application Traffic > Policies > Authentication > Advanced Poli-
cies, and then select Policy.
2. In the details pane do one of the following:
• To create a new policy, click Add.
• To modify an existing policy, select the policy, and then click Edit.
3. In the Create Authentication Policy or Configure Authentication Policy dialog box, type or
select values for the parameters.
• Name*—The policy name. Cannot be changed for a previously configured policy.
• Action Type*—The policy type: Cert, Negotiate, LDAP, RADIUS, SAML, SAMLIDP, TACACS, or
WEBAUTH.
• Action*—The authentication action (profile) to associate with the policy. You can choose
an existing authentication action, or click the plus and create a new action of the proper
type.
• Log Action—The audit action to associate with the policy. You can choose an existing audit
action, or click the plus and create a new action.
• Expression*—The rule that selects connections to which you want to apply the action that
you specified. The rule can be simple (“true” selects all traffic) or complex. You enter ex-
pressions by first choosing the type of expression in the leftmost drop-down list beneath
the Expression window, and then by typing your expression directly into the expression
text area, or by clicking Add to open Add Expression dialog box and using the drop-down
lists in it to construct your expression.)
• Comment—You can type a comment that describes the type of traffic that this authentica-
tion policy will apply to. Optional.
4. Click Create or OK, and then click Close. If you created a policy, that policy appears in the Au-
thentication Policies and Servers page.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
November 6, 2018
Contributed by:
C
You can control the resources that an authenticated user can access within an application.
To do this, associate an authorization policy to each of the users, either individually or by associating
the policy to a group of users. The authorization policy must specify the following:
• Rule. The resource to which access must be authorized. This can be specified by using basic or
advanced expressions.
• Action. Whether access to the resource must be allowed or denied.
By default, access to all resources within an application is DENIED to all users. However, you can
change this default authorization action to ALLOW access to all users (by setting the session parame-
ters in session profile or by setting the global session parameters).
Warning
For optimum security, Citrix recommends that you do not to change the default authorization
action from DENY to ALLOW. Instead, it is advised to create specific authorization policies for
users who need access to specific resources.
Navigate to Security > AAA - Application Traffic > Policies > Authorization, click Add and then
define the policy as required.
Navigate to Security > AAA - Application Traffic > Users or Groups, and edit the relevant user
or group to associate it with the authorization policy.
Here are some example configurations to authorize user access to some application resources. Note
that these are CLI commands. You can do similar configurations using the GUI, although you must not
enclose the expression within quotes (“).
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
You can configure the NetScaler appliance to keep a log of all the events that are triggered in an au-
thenticated session. Using this information, you can audit state and status information, to see the
history for users in chronological order.
• Log type. The logs can be stored remotely (syslog) or locally on the NetScaler appliance (nslog).
• Rule. The conditions on which the logs are stored.
• Action. Details of the log server and other details for creating the log entries.
This audit policy can be configured at different levels: user-level, group-level, AAA virtual server, and
global system level. The policies configured at the user-level have the highest priority.
Note
This topic details steps for using syslog. Make necessary changes to use nslog.
Navigate to Security > AAA - Application Traffic > Policies > Auditing > Syslog, and configure
the server and the policy in the relevant tabs.
Navigate to Security > AAA - Application Traffic > Users, and associate the authorization
policy with the relevant user.
Navigate to Security > AAA - Application Traffic > Groups, and associate the authorization
policy with the relevant group.
Navigate to Security > AAA - Application Traffic > Virtual Servers, and associate the au-
thorization policy with the relevant virtual server.
Navigate to Security > AAA - Application Traffic > Policies > Auditing > Syslog or Nslog,
select the authorization policy, and click Action > Global Bindings to bind the policy glob-
ally.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Session settings
Contributed by:
C
After you configure your AAA profiles, you configure session settings to customize your user sessions.
The session settings are:
Controls the period after which the user is automatically disconnected and must authenticate
again to access your intranet.
To configure the session settings, you can take one of two approaches. If you want different settings
for different user accounts or groups, you create a profile for each user account or group for which you
want to configure custom sessions settings. You also create policies to select the connections to which
to apply particular profiles, and you bind the policies to users or groups. You can also bind a policy to
the authentication virtual server that handles the traffic to which you want to apply the profile.
If you want the same settings for all sessions, or if you want to customize the default settings for ses-
sions that do not have specific profiles and policies configured, you can simply configure the global
session settings.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Session profiles
Contributed by:
C
To customize your user sessions, you first create a session profile. The session profile allows you to
override global settings for any of the session parameters.
Note
The terms “session profile” and “session action” mean the same thing.
At the command prompt, type the following commands to create a session profile and verify the con-
figuration:
Example
2 Done
3 > show tm sessionAction session-profile
4 1) Name: session-profile
5 Authorization action : ALLOW
6 Session timeout: 30 minutes
7 Done
At the command prompt, type the following commands to modify a session profile and verify the con-
figuration:
• show tm sessionAction
Example
At the command prompt, type the following command to remove a session profile:
rm tm sessionAction <name>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Session policies
Contributed by:
C
After you create one or more session profiles, you create session policies and then bind the policies
globally or to an authentication virtual server to put them into effect.
At the command prompt, type the following commands to create a session policy and verify the con-
figuration:
Example
At the command prompt, type the following commands to modify a session policy and verify the con-
figuration:
Example
At the command prompt, type the following commands to globally bind a session policy and verify
the configuration:
bind tm global -policyName <policyname> [-priority <priority>]
Example
To bind a session policy to an authentication virtual server by using the command line
interface
At the command prompt, type the following command to bind a session policy to an authentication
virtual and verify the configuration:
bind authentication vserver <name> -policy <policyname> [-priority <priority
>]
Example
At the command prompt, type the following commands to unbind a session policy from an authenti-
cation virtual server and verify the configuration:
unbind authentication vserver <name> -policy <policyname>
Example
To unbind a globally bound session policy by using the command line interface
At the command prompt, type the following commands to unbind a globally-bound session policy:
unbind tm global -policyName <policyname>
Example
First unbind the session policy from global, and then, at the command prompt, type the following
commands to remove a session policy and verify the configuration:
rm tm sessionPolicy <name>
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
In addition to or instead of creating session profiles and policies, you can configure global session
settings. These settings control the session configuration when there is no explicit policy overriding
them.
At the command prompt, type the following commands to configure the global session settings and
verify the configuration:
Example
• Session Time-out—sessTimeout
• Default Authorization Action—defaultAuthorizationAction
• Single Sign-on to Web Applications—sso
• Credential Index—ssoCredential
• Single Sign-on Domain—ssoDomain
• HTTPOnly Cookie—httpOnlyCookie
• Enable Persistent Cookie—persistentCookie
• Persistent Cookie Validity (minutes)—persistentCookieValidity
• Home Page—homepage
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Traffic Settings
Traffic profiles
Contributed by:
C
After creating at least one forms or SAML sso profile, you must next create a traffic profile.
Note
In this feature, the terms “profile” and “action” mean the same thing.
Example
Example
rm tm trafficAction <name>
Example
1 rm tm trafficAction Traffic-Prof-1
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Traffic policies
Contributed by:
C
After you create one or more form SSO and traffic profiles, you create traffic policies and then bind the
policies, either globally or to a traffic management virtual server, to put them into effect.
Example
Example
Example
To bind a traffic policy to a load balancing or content switching virtual server by using
the command line interface
Example
To unbind a globally bound traffic policy by using the command line interface
Example
To unbind a traffic policy from a load balancing or content switching virtual server by
using the command line interface
Example
First unbind the session policy from global, and then, at the command prompt, type:
rm tm trafficPolicy <name>
Example
1 rm tm trafficPolicy Traffic-Pol-1
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
To enable and configure forms-based SSO, you first create an SSO profile.
Note
• Forms-based single sign-on does not work if the form is customized to include Javascript.
• In this feature, the terms “profile” and “action” mean the same thing.
Example
Example
rm tm formSSOAction <name>
Example
1 rm tm sessionAction SSO-Prof-1
1. Navigate to Security > AAA - Application Traffic > Policies > Traffic.
2. In the details pane, click the Form SSO Profiles tab.
3. On the Form SSO Profiles tab, do one of the following:
• To create a new form SSO profile, click Add.
• To modify an existing form SSO profile, select the profile, and then click Edit.
4. In the Create Form SSO Profile or Configure Form SSO Profile dialog, specify values for the
parameters:
• Name*—name (Cannot be changed for a previously configured session action.)
• Action URL*—actionURL
• User Name Field*—userField
• Password Field*—passField
• Expression*—ssoSuccessRule
• Name Value Pair—nameValuePair
• Response Size—responsesize
• Extraction—nvtype
• Submit Method—submitMethod
5. Click Create or OK, and then click Close. The form SSO profile that you created appears in the
Traffic Policies, Profiles, and Form SSO Profiles pane.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
To enable and configure SAML-based SSO, you first create a SAML SSO profile.
Example
Example
rm tm samlSSOProfile <name>
Example
1 rm tm sessionAction saml-SSO-Prof-1
1. Navigate to Security > AAA - Application Traffic > Policies > Traffic.
2. In the details pane, click the SAML SSO Profiles tab.
3. On the SAML SSO Profiles tab, do one of the following:
• To create a new SAML SSO profile, click Add.
• To modify an existing SAML SSO profile, select the profile, and then click OpenEdit.
4. In the Create SAML SSO Profiles or the Configure SAML SSO Profiles dialog box, set the fol-
lowing parameters:
• Name*
• Signing Certificate Name*
• ACS URL*
• Relay State Rule*
• Send Password
• Issuer Name
5. Click Create or OK, and then click Close. The SAML SSO profile that you created appears in the
Traffic Policies, Profiles, and SAML SSO Profiles pane.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
You can now force OWA 2010 connections to time out after a specified period of inactivity. OWA sends
repeated keepalive requests to the server to prevent timeouts. Keeping the connections open can
interfere with single sign-on.
To force OWA 2010 to timeout after a specified period by using the command line
interface
For <actname>, substitute a name for your traffic policy. For <mins>, substitute the number
of minutes after which to initiate a forced timeout. For <forcedTimeout>, substitute one of the
following values:
– START—Starts the timer for forced timeout if a timer has not already been started. If a
running timer exists, has no effect.
– STOP—Stops a running timer. If no running timer is found, has no effect.
– RESET—Restarts a running timer. If no running timer is found, starts a timer just as if the
START option had been used.
For <polname>, substitute a name for your traffic policy. For <rule>, substitute a rule in
NetScaler appliance default syntax.
For <vservername>, substitute the name of the AAA traffic management virtual server. For
<priority>, substitute an integer that designates the policy’s priority.
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Web sites that contain sensitive content, such as online banking websites or websites with employee
personal information, sometimes require client certificates for authentication. To configure AAA to
authenticate users on the basis of client-side certificate attributes, you first enable client authentica-
tion on the traffic management virtual server and bind the root certificate to the authentication virtual
server. Then, you implement one of two options. You can configure the default authentication type
on the authentication virtual server as CERT, or you can create a certificate action that defines what
the NetScaler appliance must do to authenticate users on the basis of a client certificate. In either
case, your authentication server must support CRLs. You configure the ADC to extract the user name
from the SubjectCN field or another specified field in the client certificate.
When the user tries to log on to an authentication virtual server for which an authentication policy is
not configured, and a global cascade is not configured, the user name information is extracted from
the specified field of the certificate. If the required field is extracted, the authentication succeeds. If
the user does not provide a valid certificate during the SSL handshake, or if the user name extraction
fails, authentication fails. After it validates the client certificate, the ADC presents a logon page to the
user.
The following procedures assume that you have already created a functioning AAA configuration, and
therefore they explain only how to enable authentication by using client certificates. These proce-
dures also assume that you have obtained your root certificate and client certificates and have placed
them on the ADC in the /nsconfig/ssl directory.
To configure the AAA client certificate parameters by using the command line interface
At the command prompt, type the following commands, in the order shown, to configure the certifi-
cate and verify the configuration:
To configure the AAA client certificate parameters by using the configuration utility
The NetScaler appliance can now log the number of unsuccessful login attempts made from the last
successful log on. The feature works only if the persistentLoginAttempts option is enabled on the
appliance. By default, the option is disabled on the NetScaler appliance.
A NetScaler administrator can use this information to verify if any unauthorized attempts have oc-
curred on a secured external user account.
To use this feature, at the NetScaler appliance command prompt, type:
set aaa parameter [‒maxloginAttempts <value> [-failedLoginTimeout <value>]]
-persistentLoginAttempts (ENABLED | DISABLED)
Example:
set aaa parameter ‒maxLoginAttempts 4 ‒failedLoginTimeout 3 ‒persistentLoginAttempts
ENABLED
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
• If the VPN virtual server is configured to require client certificate authentication, the ADC uses
the client certificate to authenticate the user, then inserts the certificate in the header and for-
wards the request to the protected application.
To create and configure client certificate pass-through by using the command line
interface
For name, substitute a name for the virtual server. The name must contain from one to 127 ASCII
characters, beginning with a letter or underscore (_), and containing only letters, numbers, and
the underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters.
For <IP>, substitute the IP address assigned to the virtual server.“‘
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Configuring the NetScaler appliance for AAA needs a specific setup on the NetScaler appliance and
clients’ browsers. The configuration varies with the protocol used for AAA.
For more information about configuring the NetScaler appliance for Kerberos authentication, see Han-
dling Authentication, Authorization and Auditing with Kerberos/NTLM.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
January 6, 2019
Contributed by:
C
Kerberos, a computer network authentication protocol, provides secure communication over the In-
ternet. Designed primarily for client-server applications, it provides for mutual authentication by
which the client and server can each ensure the other’s authenticity. Kerberos uses a trusted third
party, referred to as Key Distribution Center (KDC). A KDC consists of an Authentication Server (AS),
which authenticates a user, and a Ticket Granting Server (TGS).
Each entity on the network (client or server) has a secret key that is known only to itself and the KDC.
The knowledge of this key implies authenticity of the entity. For communication between two entities
on the network, the KDC generates a session key, referred to as the Kerberos ticket or service ticket.
The client makes a request to the AS for credentials for a specific server. The client then receives a
ticket, referred to as Ticket Granting Ticket (TGT). The client then contacts the TGS, using the TGT it
received from the AS to prove its identity, and asks for a service. If the client is eligible for the service,
the TGS issues a Kerberos ticket to the client. The client then contacts the server hosting the service
(referred to as the service server), using the Kerberos ticket to prove that it is authorized to receive
the service. The Kerberos ticket has a configurable lifetime. The client authenticates itself with the AS
only once. If it contacts the physical server multiple times, it reuses the AS ticket.
The following figure shows the basic functioning of the Kerberos protocol.
• Faster authentication. When a physical server gets a Kerberos ticket from a client, the server
has enough information to authenticate the client directly. It does not have to contact a domain
controller for client authentication, and therefore the authentication process is faster.
• Mutual authentication. When the KDC issues a Kerberos ticket to a client and the client uses
the ticket to access a service, only authenticated servers can decrypt the Kerberos ticket. If
the virtual server on the NetScaler appliance is able to decrypt the Kerberos ticket, you can
conclude that both the virtual server and client are authenticated. Thus, the authentication of
the server happens along with the authentication of the client.
• Single sign-on between Windows and other operating systems that support Kerberos.
• Kerberos has strict time requirements; the clocks of the involved hosts must be synchronized
with the Kerberos server clock to ensure that the authentication does not fail. You can miti-
gate this disadvantage by using the Network Time Protocol daemons to keep the host clocks
synchronized. Kerberos tickets have an availability period, which you can configure.
• Kerberos needs the central server to be available continuously. When the Kerberos server is
down, no one can log on. You can mitigate this risk by using multiple Kerberos servers and
fallback authentication mechanisms.
• Because all the authentication is controlled by a centralized KDC, any compromise in this infras-
tructure, such as the user’s password for a local workstation being stolen, can allow an attacker
to impersonate any user. You can mitigate this risk to some extent by using only a desktop ma-
chine or laptop that you trust, or by enforcing preauthentication by means of a hardware-token.
To use Kerberos authentication, you must configure it on the NetScaler appliance and on each client.
The NetScaler appliance now optimizes and improves the system performance while Kerberos authen-
tication. The AAA daemon remembers the outstanding Kerberos request for the same user to avoid
load on Key Distribution Center (KDC), which will avoid duplicate requests.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Important
Kerberos/NTLM authentication is supported only in the NetScaler 9.3 nCore release or later, and
it can be used only for AAA traffic management virtual servers.
NetScaler appliance handles the components involved in Kerberos authentication in the following
way:
In the Windows 2000 Server or later versions, the Domain Controller and KDC are part of the Windows
Server. If the Windows Server is UP and running, it indicates that the Domain Controller and KDC are
configured. The KDC is also the Active Directory server.
Note
All Kerberos interactions are validated with the Windows Kerberos Domain Controller.
A NetScaler appliance supports Kerberos authentication on the AAA traffic management authentica-
tion virtual servers. If the Kerberos authentication fails, the NetScaler appliance uses the NTLM au-
thentication.
By default, Windows 2000 Server and later Windows Server versions use Kerberos for AAA. If you cre-
ate an authentication policy with NEGOTIATE as the authentication type, the NetScaler appliance at-
tempts to use the Kerberos protocol for AAA and if the client’s browser fails to receive a Kerberos ticket,
the NetScaler appliance uses the NTLM authentication. This process is referred to as negotiation.
The client may fail to receive a Kerberos ticket in any of the following cases:
For Kerberos/NTLM authentication, the NetScaler appliance does not use the data that is present lo-
cally on the NetScaler appliance.
Authorization
The traffic management virtual server can be a load balancing virtual server or a content switching
virtual server.
Auditing
The NetScaler appliance supports auditing of Kerberos authentication with the following audit log-
ging:
Supported Environment
Kerberos authentication does not need any specific environment on the NetScaler appliance. The
client (browser) must provide support for Kerberos authentication.
High Availability
In a high availability setup, only the active NetScaler appliance joins the domain. In case of a failover,
the NetScaler appliance lwagent daemon joins the secondary NetScaler appliance to the domain. No
specific configuration is required for this functionality.
The following figure shows a typical process for Kerberos authentication in the NetScaler appliance
environment.
Note
The above authentication process is not necessary if the client already has a Kerberos ticket
whose lifetime has not expired. In addition, clients such as Web Services, .NET, or J2EE, which
support SPNEGO, get a Kerberos ticket for the target server, create an SPNEGO token, and insert
the token in the HTTP header when they send an HTTP request. They do not go through the client
authentication process.
1. The client sends the Kerberos ticket containing the SPNEGO token and the HTTP request to
the traffic management virtual server on the NetScaler appliance. The SPNEGO token has the
necessary GSSAPI data.
2. The NetScaler appliance establishes a security context between the client and the NetScaler
appliance. If the NetScaler appliance cannot accept the data provided in the Kerberos ticket,
the client is asked to get a different ticket. This cycle repeats till the GSSAPI data is acceptable
and the security context is established. The traffic management virtual server on the NetScaler
appliance acts as an HTTP proxy between the client and the physical server.
1. After the security context is complete, the traffic management virtual server validates the SP-
NEGO token.
2. From the valid SPNEGO token, the virtual server extracts the user ID and GSS credentials, and
passes them to the authentication daemon.
3. A successful authentication completes the Kerberos authentication.
Note
The NetScaler appliance can only support Kerberos (NEGOTIATE) SSO with backend.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
This topic provides the detailed steps to configure Kerberos authentication on the NetScaler appliance
by using the CLI and the GUI.
1. Enable the AAA feature to ensure the authentication of traffic on the appliance.
2. Add the keytab file to the NetScaler appliance. A keytab file is necessary for decrypting the
secret received from the client during Kerberos authentication. A single keytab file contains au-
thentication details for all the services that are bound to the traffic management virtual server
on the NetScaler appliance.
First generate the keytab file on the Active Directory server and then transfer it to the NetScaler
appliance.
• Log on to the Active Directory server and add a user for Kerberos authentication. For ex-
ample, to add a user named “Kerb-SVC-Account”:
In the User Properties section, ensure that the “Change password at next logon op-
tion” is not selected and the “Password does not expire” option is selected.
• Map the HTTP service to the above user and export the keytab file. For example, run the
following command on the Active Directory server:
You can map more than one service if authentication is required for more than one
service. If you want to map more services, repeat the above command for every ser-
vice. You can give the same name or different names for the output file.
• Transfer the keytab file to the NetScaler appliance by using the unix ftp command or any
other file transfer utility of your choice.
3. The NetScaler appliance must obtain the IP address of the domain controller from the fully qual-
ified domain name (FQDN). Therefore, Citrix recommends configuring the NetScaler appliance
with a DNS server.
Note
Alternatively, you can add static host entries or use any other means so that the NetScaler
appliance can resolve the FQDN name of the domain controller to an IP address.
b) Configure the negotiate policy and associate the negotiate action to this policy.
5. Create an authentication virtual server and associate the negotiate policy with it.
6. Associate the authentication virtual server with the traffic management (load balancing or con-
tent switching) virtual server.
Note
Similar configurations can also be done on the content switching virtual server.
a) Access the traffic management virtual server, using the FQDN. For example, Sample
Navigate to System > Settings, click Configure Basic Features and enable the AAA feature.
2. Add the keytab file as detailed in step 2 of the CLI procedure mentioned above.
Navigate to Traffic Management > DNS > Name Servers, and specify the IP address for the DNS
server.
Navigate to Security > AAA - Application Traffic > Policies > Authentication > Advanced Poli-
cies > Policy, and create a policy with Negotiate as the action type.
Navigate to Security > AAA - Application Traffic > Virtual Servers, and associate the Negotiate
policy with the authentication virtual server.
6. Associate the authentication virtual server with the traffic management (load balancing or con-
tent switching) virtual server.
Navigate to Traffic Management > Load Balancing > Virtual Servers, and specify the relevant
authentication settings.
Note
Similar configurations can also be done on the content switching virtual server.
7. Verify the configurations as detailed in step 7 of the CLI procedure mentioned above.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Kerberos support must be configured on the browser to use Kerberos for authentication. You can use
any Kerberos-compliant browser. Instructions for configuring Kerberos support on Internet Explorer
and Mozilla Firefox follow. For other browsers, see the documentation of the browser.
2. On the Security tab, click Local Intranet, and then click Sites.
3. In the Local Intranet dialog box, make sure that the Automatically detect intranet network op-
tion is selected, and then click Advanced.
4. In the Local Intranet dialog box, add the web sites of the domains of the traffic management
virtual server on the NetScaler appliance. The specified sites become local intranet sites.
5. Click Close or OK to close the dialog boxes.
1. Make sure that you have Kerberos properly configured on your computer.
Note: If you are running Windows, you also need to enter sspi in the filter text box and
change the network.auth.use-sspi option to False.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
The NetScaler appliance can offload authentication tasks from servers. Instead of the physical servers
authenticating the requests from clients, the NetScaler appliance authenticates all the client requests
before it forwards them to any of the physical servers bound to it. The user authentication is based
on Active Directory tokens.
There is no authentication between the NetScaler appliance and the physical server, and the authen-
tication offload is transparent to the end users. After the initial logon to a Windows computer, the end
user does not have to enter any additional authentication information in a pop-up or on a logon page.
In the current NetScaler appliance release, Kerberos authentication is available only for AAA traffic
management virtual servers. Kerberos authentication is not supported for SSL VPN in the Citrix Gate-
way Enterprise Edition appliance or for NetScaler appliance management.
Kerberos authentication requires configuration on the NetScaler appliance and on client browsers.
1. Create a user account on Active Directory. When creating a user account, verify the following
options in the User Properties section:
• Make sure that you do not select the Change password at next logon option.
• Be sure to select the Password does not expire option.
Note
Be sure to type the above command on a single line. The output of the above command is
written into the C:\kerbtabfile.txt file.
3. Upload the kerbtabfile.txt file to the /etc directory of the NetScaler appliance by using a Secure
Copy (SCP) client.
4. Run the following command to add a DNS server to the NetScaler appliance.
The NetScaler appliance cannot process Kerberos requests without the DNS server. Be sure to
use the same DNS server that is used in the Microsoft Windows domain.
Note
If keytab is not available, you can specify the parameters: domain, domainUser, and -
domainUserPasswd.
9. Run the following command to bind the Kerberos policy to the authentication virtual server:
10. Run the following command to bind an SSL certificate to the authentication virtual server. You
can use one of the test certificates, which you can install from the GUI NetScaler appliance. Run
the following command to use the ServerTestCert sample certificate.
11. Create an HTTP load balancing virtual server with the IP address, 192.168.17.200.
Ensure that you create a virtual server from the command line interface for NetScaler 9.3 re-
leases if they are older than 9.3.47.8.
13. Enter the host name Example in the address bar of the Web browser.
The Web browser displays an authentication dialog box because the Kerberos authentication is
not set up in the browser.
Note
Kerberos authentication requires a specific configuration on the client. Ensure that the
client can resolve the hostname, which results in the Web browser connecting to an HTTP
virtual server.
• For configuring on Internet Explorer, see Configuring Internet Explorer for Kerberos au-
thentication.
• For configuring on Mozilla Firefox, see Configuring Internet Explorer for Kerberos authen-
tication.
15. Verify whether you can access the backend physical server without authentication.
4. Click Sites.
5. Click Advanced.
6. Specify the URL, Example and click Add.
7. Restart Internet Explorer.
6. Restart Firefox.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Contributed by:
C
NetScaler appliances now support single sign-on (SSO) using the Kerberos 5 protocol. Users log on to
a proxy, the Application Delivery Controller (ADC), which then provides access to protected resources.
The NetScaler appliance Kerberos SSO implementation requires the user’s password for SSO meth-
ods that rely on basic, NTLM, or forms-based authentication. The user’s password is not required for
Kerberos SSO, although if Kerberos SSO fails and the NetScaler appliance has the user’s password, it
uses the password to attempt NTLM SSO.
If the user’s password is available, the KCD account is configured with a realm, and no delegated user
information is present, the NetScaler AD Kerberos SSO engine impersonates the user to obtain access
to authorized resources. Impersonation is also called unconstrained delegation.
The NetScaler appliance Kerberos SSO engine can also be configured to use a delegated account to
obtain access to protected resources on the user’s behalf. This configuration requires delegated user
credentials, a keytab, or a delegated user certificate and matching CA certificate. Configuration that
uses a delegated account is called constrained delegation.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
January 6, 2019
Contributed by:
C
To use the NetScaler appliance Kerberos SSO feature, users first authenticate with Kerberos or a sup-
ported third-party authentication server. Once authenticated, the user requests access to a protected
web application. The web server responds with a request for proof that the user is authorized to ac-
cess that web application. The user’s browser contacts the Kerberos server, which verifies that the
user is authorized to access that resource, and then provides the user’s browser with a service ticket
that provides proof. The browser resends the user’s request to the web application server with the ser-
vice ticket attached. The web application server verifies the service ticket, and then allows the user
to access the application.
AAA traffic management implements this process as shown in the following diagram. The diagram
illustrates the flow of information through the NetScaler appliance and AAA traffic management, on a
secure network with LDAP authentication and Kerberos authorization. AAA traffic management envi-
ronments that use other types of authentication have essentially the same information flow, although
they might differ in some details.
Figure 1. A Secure Network with LDAP and Kerberos
The AAA traffic management with authentication and authorization in a Kerberos environment re-
quires that the following actions take place.
1. The client sends a request for a resource to the traffic management virtual server on the
NetScaler appliance.
2. The traffic management virtual server passes the request to the authentication virtual server,
which authenticates the client and then passes the request back to the traffic management vir-
tual server.
3. The traffic management virtual server sends the client’s request to the web application server.
4. The web application server responds to the traffic management virtual server with a 401 Unau-
thorized message that requests Kerberos authentication, with fallback to NTLM authentication
if the client does not support Kerberos.
5. The traffic management virtual server contacts the Kerberos SSO daemon.
6. The Kerberos SSO daemon contacts the Kerberos server and obtains a ticket-granting ticket
(TGT) allowing it to request service tickets authorizing access to protected applications.
7. The Kerberos SSO daemon obtains a service ticket for the user and sends that ticket to the traffic
management virtual server.
8. The traffic management virtual server attaches the ticket to the user’s initial request and sends
the modified request back to the web application server.
9. The web application server responds with a 200 OK message.
These steps are transparent to the client, which just sends a request and receives the requested re-
source.
All AAA traffic management authentication mechanisms support NetScaler appliance Kerberos SSO.
AAA traffic management supports the Kerberos SSO mechanism with the Kerberos, CAC (Smart Card)
and SAML authentication mechanisms with any form of client authentication to the NetScaler ap-
pliance. It also supports the HTTP-Basic, HTTP-Digest, Forms-based, and NTLM (versions 1 and 2)
SSO mechanisms if the client uses either HTTP-Basic or Forms-Based authentication to log on to the
NetScaler appliance.
The following table shows each supported client-side authentication method, and the supported
server-side authentication method for that client-side method.
Kerberos Constrained
Basic/Digest/NTLM Delegation User Impersonation
Kerberos Constrained
Basic/Digest/NTLM Delegation User Impersonation
NT LM v1/v2 X X
SAML X
SAML Two-Factor X X X
Certificate X X X
Two-Factor
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Contributed by:
C
You can configure NetScaler appliance SSO to work in one of two ways: by impersonation or by del-
egation. SSO by impersonation is a simpler configuration than SSO by delegation, and is therefore
usually preferable when your configuration allows it. To configure NetScaler appliance SSO by imper-
sonation, you must have the user’s user name and password.
To configure NetScaler appliance SSO by delegation, you must have the delegated user’s credentials
in one of the following formats: the user’s user name and password, the keytab configuration that in-
cludes the user name and an encrypted password, or the delegated user certificate and the matching
CA certificate.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Prerequisites
Contributed by:
C
Before you configure NetScaler appliance SSO, you need to have your NetScaler appliance fully con-
figured to manage traffic to and authentication for your web application servers. Therefore, you must
configure either load balancing or content switching, and then AAA, for these web application servers.
You should also verify routing between the appliance, your LDAP server, and your Kerberos server.
If your network is not already configured in this manner, perform the following configuration tasks:
Following are brief instructions and examples for performing each of these tasks from the NetScaler
appliance command line. For further assistance, see Setting up an Authentication Virtual Server.
For NetScaler appliance SSO to obtain a TGS (service ticket) for a service, either the FQDN assigned
to the server entity on the NetScaler appliance must match the FQDN of the web application server,
or the server entity name must match the NetBios name of the web application server. You can take
either of the following approaches:
• Configure the NetScaler appliance server entity by specifying the FQDN of the web application
server.
• Configure the NetScaler appliance server entity by specifying the IP address of the web applica-
tion server, and assign the server entity the same name as the NetBios name of the web appli-
cation server.
• serverName. A name for the NetScaler appliance to use to refer to this server.
• serverFQDN. The FQDN of the server. If the server has no domain assigned to it, use the server’s
IP address and make sure that the server entity name matches the NetBios name of the web
application server.
• serviceName. A name for the NetScaler appliance to use to refer to this service.
• type. The protocol used by the service, either HTTP or MSSQLSVC.
• port. The port on which the service listens. HTTP services normally listen on port 80. Secure
HTTPS services normally listen on port 443.
Example
The following examples add server and service entries on the NetScaler appliance for the web appli-
cation server was1.example.com. The first example uses the FQDN of the web application server; the
second uses the IP address.
To add the server and service using the web application server FQDN, was1.example.com, you would
type the following commands:
To add the server and service using the web application server IP and NetBios name, where the web
application server IP is 10.237.64.87 and its NetBios name is WAS1, you would type the following com-
mands:
The traffic management virtual server manages traffic between the client and the web application
server. You can use either a load balancing or a content switching virtual server as the traffic manage-
ment server. The SSO configuration is the same for either type.
To create a load balancing virtual server, at the command prompt, type the following command:
• vserverName—A name for the NetScaler appliance to use to refer to this virtual server.
• type—The protocol used by the service, either HTTP or MSSQLSVC.
• IP—The IP address assigned to the virtual server. This would normally be an IANA-reserved,
non-public IP address on your LAN.
• port—The port on which the service listens. HTTP services normally listen on port 80. Secure
HTTPS services normally listen on port 443.
Example
To add a load balancing virtual server called tmvserver1 to a configuration that manages HTTP traffic
on port 80, assigning it a LAN IP address of 10.217.28.20 and then binding the load balancing virtual
server to the wasservice1 service, you would type the following commands:
The authentication virtual server manages authentication traffic between the client and the authen-
tication (LDAP) server. To create an authentication virtual server, at the command prompt type the
following commands:
• authvserverName —A name for the NetScaler appliance to use to refer to this authentication
virtual server. Must begin with a letter, number, or the underscore character (_), and must con-
tain only letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
colon (:), and underscore characters. Can be changed after the authentication virtual server is
added by using the rename authentication vserver command.
• IP—The IP address assigned to the authentication virtual server. As with the traffic management
virtual server, this address would normally be an IANA-reserved, non-public IP on your LAN.
• domain—The domain assigned to the virtual server. This would usually be the domain of your
network. It is customary, though not required, to enter the domain in all capitals when config-
uring the authentication virtual server.
Example
To add an authentication virtual server called authverver1 to your configuration and assign it the LAN
IP 10.217.28.21 and the domain EXAMPLE.COM, you would type the following commands:
The authentication virtual server can be configured to handle authentication for a single domain or
for multiple domains. If it is configured to support authentication for multiple domains, you must
also specify the domain for NetScaler appliance SSO by creating an authentication profile, and then
configuring the traffic management virtual server to use that authentication profile.
Note
The traffic management virtual server can be either a load balancing (lb) or content switching
(cs) virtual server. The following instructions assume that you are using a load balancing virtual
server. To configure a content switching virtual server, simply substitute
set cs vserver for set lb vserver. The procedure is otherwise the same.
To create the authentication profile, and then configure the authentication profile on a traffic man-
agement virtual server, type the following commands:
• authnprofileName—A name for the authentication profile. Must begin with a letter, number,
or the underscore character (_), and must consist of from one to thirty-one alphanumeric or
hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and underscore characters.
• authvserverName—The name of the authentication virtual server that this profile uses for au-
thentication.
• authenticationHost—Host name of the authentication virtual server.
• authenticationDomain—Domain for which NetScaler appliance SSO handles authentication.
Required if the authentication virtual server performs authentication for more than one do-
main, so that the correct domain is included when the NetScaler appliance sets the traffic man-
agement virtual server cookie.
Example
To create an authentication profile named authnProfile1 for authentication of the example.com do-
main, and to configure the load balancing virtual server vserver1 to use the authentication profile
authnProfile1, you would type the following commands:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Configuring SSO
Contributed by:
C
If you do not have the user’s password, you can configure NetScaler appliance SSO to authenticate
by delegation. Although somewhat more complex than configuring SSO to authenticate by imperson-
ation, the delegation method provides flexibility in that a user’s credentials might not be available to
the NetScaler appliance in all circumstances.
For either impersonation or delegation, you must also enable integrated authentication on the web
application server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Contributed by:
C
To set up NetScaler appliance Kerberos SSO on each web application server that Kerberos SSO will
manage, use the configuration interface on that server to configure the server to require authentica-
tion. Select Kerberos (negotiate) authentication by preference, with fallback to NTLM for clients that
do not support Kerberos.
Following are instructions for configuring Microsoft Internet Information Server (IIS) to require authen-
tication. If your web application server uses software other than IIS, consult the documentation for
that web server software for instructions.
1. Log on to the IIS server and open Internet Information Services Manager.
2. Select the web site for which you want to enable integrated authentication. To enable inte-
grated authentication for all IIS web servers managed by IISM, configure authentication settings
for the Default Web Site. To enable integrated authentication for individual services (such as
Exchange, Exadmin, ExchWeb, and Public), configure these authentication settings for each ser-
vice individually.
3. Open the Properties dialog box for the default web site or for the individual service, and click
the Directory Security tab.
4. Beside Authentication and Access Control, select Edit.
5. Disable anonymous access.
6. Enable Integrated Windows authentication (only). Enabling integrated Windows authentication
should automatically set protocol negotiation for the web server to Negotiate, NTLM, which
specifies Kerberos authentication with fallback to NTLM for non-Kerberos capable devices. If
this option is not automatically selected, manually set protocol negotiation to Negotiate, NTLM.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
December 5, 2018
Contributed by:
C
You can configure the KCD account for NetScaler appliance SSO by impersonation. In this configura-
tion, the NetScaler appliance obtains the user’s username and passwordwhen the user authenticates
to the authentication server and uses those credentials to impersonate the user to obtain a ticket-
granting ticket (TGT). If the user’s name is in UPN format, the appliance obtains the user’s realm from
UPN. Otherwise, it obtains the user’s name and realm by extracting it from the SSO domain used dur-
ing initial authentication, or from the session profile.
When configuring the KCD account, you must set the realm parameter to the realm of the service that
the user is accessing. The same realm is also used as the user’s realm if the user’s realm cannot be
obtained from authentication with the NetScaler appliance or from the session profile.
Example
To add a KCD account named kcdccount1, and use the keytab named kcdvserver.keytab, you would
type the following command:
For information on configuring Kerberos impersonation through Citrix ADC GUI, see Citrix Support.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Contributed by:
C
• If you are configuring delegation by delegated user certificate, install the matching CA certifi-
cates on the NetScaler appliance and add them to the NetScaler appliance configuration.
• Create the KCD account on the appliance. The appliance uses this account to obtain service
tickets for your protected applications.
• Configure the Active Directory server.
Note
For more information on creating KCD account and configuring on the NetScaler appliance, refer
to the following topics:
If you are configuring NetScaler appliance SSO with a client certificate, you must copy the matching
CA certificate for the client certificate domain (the client CA certificate) to the NetScaler appliance,
and then install the CA certificate. To copy the client CA certificate, use the file transfer program of
your choice to transfer the certificate and private-key file to the NetScaler appliance, and store the
files in /nsconfig/ssl.
• certkeyName. A name for the client CA certificate. Must begin with an ASCII alphanumeric or
underscore (_) character, and must consist of from one to thirty-one characters. Allowed char-
acters include the ASCII alphanumerics, underscore, hash (#), period(.), space, colon (:), at (@),
equals (=), and hyphen (-) characters. Cannot be changed after the certificate-key pair is cre-
ated. If the name includes one or more spaces, enclose the name in double or single quotation
marks (for example, “my cert” or ‘my cert’).
• cert. Full path name and file name of the X509 certificate file used to form the certificate-key
pair. The certificate file must be stored on the NetScaler appliance, in the /nsconfig/ssl/ direc-
tory.
• key. Full path name and file name of the file that contains the private key to the X509 certificate
file. The key file must be stored on the NetScaler appliance in the /nsconfig/ssl/ directory.
• password. If a private key is specified, the passphrase used to encrypt the private key. Use this
option to load encrypted private keys in PEM format.
• fipsKey. Name of the FIPS key that was created inside the Hardware Security Module (HSM) of
a FIPS appliance, or a key that was imported into the HSM.
Note
• inform. Format of the certificate and private-key files, either PEM or DER.
• passplain. Pass phrase used to encrypt the private key. Required when adding an encrypted
private-key in PEM format.
• expiryMonitor. Configure the NetScaler appliance to issue an alert when the certificate is about
to expire. Possible values: ENABLED, DISABLED, UNSET.
• bundle. Parse the certificate chain as a single file after linking the server certificate to its issuer’s
certificate within the file. Possible values: YES, NO.
Example
The following example adds the specified delegated user certificate customer-cert.pem to the
NetScaler appliance configuration along with the key customer-key.pem, and sets the password,
certificate format, expiration monitor, and notification period.
To add the delegated user certificate, you would type the following commands:
If you are configuring NetScaler appliance SSO by delegation, you can configure the KCD account to
use the user’s log-on name and password, to use the user’s log-on name and keytab, or to use the
user’s client certificate. If you configure SSO with user name and password, the NetScaler appliance
uses the delegated user account to obtain a Ticket Granting Ticket (TGT), and then uses the TGT to
obtain service tickets for the specific services that each user requests. If you configure SSO with keytab
file, the NetScaler appliance uses the delegated user account and keytab information. If you configure
SSO with a delegated user certificate, the NetScaler appliance uses the delegated user certificate.
To add a KCD account named kcdaccount1 to the NetScaler appliance configuration with a password
of password1 and a realm of EXAMPLE.COM, specifying the delegated user account in UPN format (as
root), you would type the following commands:
To add a KCD account named kcdaccount1 to the NetScaler appliance configuration with a password
of password1 and a realm of EXAMPLE.COM, specifying the delegated user account in SPN format, you
would type the following commands:
If you plan to use a keytab file for authentication, first create the keytab. You can create the keytab
file manually by logging onto the AD server and using the ktpass utility, or you can use the NetScaler
appliance configuration utility to create a batch script, and then run that script on the AD server to
generate the keytab file. Next, use FTP or another file transfer program to transfer the keytab file to
the NetScaler appliance and place it in the /nsconfig/krb directory. Finally, configure the KCD account
for NetScaler appliance SSO by delegation and provide the path and file name of the keytab file to the
NetScaler appliance.
Log on to the AD server command line and, at the command prompt, type the following command:
• SPN. The service principal name for the KCD service account.
• DOMAIN. The domain of the Active Directory server.
• username. The KSA account username.
• password. The KSA account password.
• path. The full path name of the directory in which to store the keytab file after it is generated.
To use the NetScaler appliance configuration utility to create a script to generate the keytab file
Example
To add a KCD account named kcdccount1, and use the keytab named kcdvserver.keytab, you would
type the following commands:
To create the KCD account for SSO by delegation with a delegated user cert
Example
To add a KCD account named kcdccount1, and use the keytab named kcdvserver.keytab, you would
type the following command:
When you configure SSO by delegation, in addition to creating the KCDAccount on the NetScaler appli-
ance, you must also create a matching Kerberos Service Account (KSA) on your LDAP active directory
server, and configure the server for SSO. To create the KSA, use the account creation process on the
active directory server. To configure SSO on the active directory server, open the properties window
for the KSA. In the Delegation tab, enable the following options: Trust this user for delegation to spec-
ified services only and Use any Authentication protocol. (The Kerberos only option does not work,
because it does not enable protocol transition or constrained delegation.) Finally, add the services
that NetScaler appliance SSO will manage.
Note
If the Delegation tab is not visible in the KSA account properties dialog box, before you can con-
figure the KSA as described, you must use the Microsoft
setspn command-line tool to configure the active directory server so that the tab is visible.
1. In the LDAP account configuration dialog box for the Kerberos service account that you created,
click the Delegation tab.
2. Choose “Trust this user for delegation to the specified services only”.
3. Under “Trust this user for delegation to the specified services only,” choose “Use any authenti-
cation protocol”.
4. Under “Services to which this account can present delegated credentials,” click Add.
5. In the Add Services dialog box, click Users or Computers, choose the server that hosts the
resources to be assigned to the service account, and then click OK.
Note
• Constrained delegation does not support services hosted in domains other than the
domain assigned to the account, even though Kerberos might have a trust relation-
ship with other domains.
• Use the following command to create the setspn if a new user is created in active di-
6. Back in the Add Services dialog box, in the Available Services list, choose the services assigned
to the service account. NetScaler appliance SSO supports the HTTP and MSSQLSVC services.
7. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
5. NetScaler Kerberos single sign-on
Contributed by:
C
The KCD Keytab Script dialog box generates the keytab script, which in turn generates the keytab file
necessary to configure KCD on the NetScaler appliance.
6. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
SAML authentication
February 4, 2019
Contributed by:
C
Security Assertion Markup Language (SAML) is an XML-based authentication mechanism that provides
single sign-on capability and is defined by the OASIS Security Services Technical Committee.
Why SAML?
Consider a scenario in which a service provider (LargeProvider) hosts a number of applications for a
customer (BigCompany). BigCompany has users that must seamlessly access these applications. In
a traditional setup, LargeProvider would need to maintain a database of users of BigCompany. This
raises some concerns for each of the following stakeholders:
The SAML authentication mechanism provides an alternative approach. The following deployment
diagram shows how SAML works.
• LargeProvider does not have to maintain a database for BigCompany users. Freed from identity
management, LargeProvider can concentrate on providing better services.
• BigCompany does not bear the burden of making sure the LargeProvider user database is kept
in sync with its own user database.
• A user can log on once, to one application hosted on LargeProvider, and be automatically logged
on to the other applications that are hosted there.
The NetScaler appliance can be deployed as a SAML Service Provider (SP) and a SAML Identity Provider
(IdP). Read through the relevant topics to understand the configurations that must be performed on
the NetScaler appliance.
A NetScaler appliance configured as a SAML service provider can now enforce an audience restriction
check. The audience restriction condition evaluates to “Valid” only if the SAML replying party is a
member of at least one of the specified audiences.
You can configure a NetScaler appliance to parse attributes in SAML assertions as group attributes.
Parsing them as group attributes enables the appliance to bind policies to the groups.
Note
A NetScaler appliance MPX FIPS appliance used as a SAML service provider now supports en-
crypted assertions. Also, a NetScaler appliance MPX FIPS appliance functioning as a SAML ser-
vice provider or a SAML identity provider can now be configured to use the SHA2 algorithms on
FIPS hardware.
2. Create a CSR and use it at CA server to generate a certificate. You can then copy the certificate
in /nsconfig/ssl. Let’s assume that the file is fips3cert.cer.
The following table lists some articles that are specific to deployments where the NetScaler appliance
is used as a SAML SP or a SAML IdP.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
The SAML Service Provider (SP) is a SAML entity that is deployed by the service provider. When a user
tries to access a protected application, the SP evaluates the client request. If the client is unauthen-
ticated (does not have a valid NSC_TMAA or NSC_TMAS cookie), the SP redirects the request to the
SAML Identity Provider (IdP).
The SP also validates SAML assertions that are received from the IdP.
When the NetScaler appliance is configured as an SP, all user requests are received by a traffic man-
agement virtual server (load balancing or content switching) that is associated with the relevant SAML
action.
The NetScaler appliance also supports POST and Redirect bindings during logout.
Note
A NetScaler appliance can be used as a SAML SP in a deployment where the SAML IdP is config-
ured either on the appliance or on any external SAML IdP.
• Can extract the user information (attributes) from the SAML token. This information can then
be used in the policies that are configured on the NetScaler appliance. For example, if you want
to extract the GroupMember and emailaddress attributes, in the SAMLAction, specify the At-
tribute2 parameter as GroupMember and the Attribute3 parameter as emailaddress.
Note
Default attributes such as username, password, and logout URL must not be extracted in
attributes 1 to 16, because they as are implicitly parsed and stored in the session.
• Can extract attribute names of upto 127 bytes from an incoming SAML assertion. The previous
limit was 63 bytes. Support introduced in NetScaler 11.0 Build 64.x.
• Supports post, redirect, and artifact bindings. Support for redirect and artifact bindings is intro-
duced in NetScaler 11.0 Build 55.x.
Note
Redirect binding should not be used for large amount of data, when the assertion after
inflate or decoding is greater than 10K.
• Can extract multi-valued attributes from a SAML assertion. These attributes are sent is nested
XML tags such as:
<AttributeValue> <AttributeValue>Value1</AttributeValue>
<AttributeValue>Value2</AttributeValue>
</AttributeValue>
When presented with above XML, the NetScaler appliance can extract both Value1 and Value2
as values of a given attribute, as opposed to the old firmware that extracts only Value1.
Note
If the system time on NetScaler appliance SAML IdP and the peer SAML SP is not in sync, the
messages might get invalidated by either party. To avoid such cases, you can now configure the
time duration for which the assertions will be valid.
This duration, called the “skew time,” specifies the number of minutes for which the message
should be accepted. The skew time can be configured on the SAML SP and the SAML IdP.
Note
• Can send additional attribute called ‘ForceAuth’ in the authentication request to external IDP
(Identity Provider). By default, the ForceAuthn is set to ‘False’. It can be set to ‘True’ to suggest
IDP to force authentication despite existing authentication context. Additionally, NetScaler ap-
pliance SP does authentication request in query parameter when configured with artifact bind-
ing.
To configure the NetScaler appliance as a SAML SP by using the command line interface
Example
The following command adds a SAML action that redirects unauthenticated user requests.
https://auth1.example.com
Example
The following command defines a SAML policy that applies the above defined SAML action to
all traffic.
Example
The following command binds the SAML policy to a authentication virtual server named
“av_saml”.
4. Bind the authentication virtual server to the appropriate traffic management virtual server.
Example
The following command adds a load balancing virtual server named “lb1_ssl” and associates
the authentication virtual server named “av_saml” to the load balancing virtual server.
add lb vserver lb1_ssl SSL 10.217.28.224 443 -persistenceType NONE -
cltTimeout 180 -AuthenticationHost auth1.example.com -Authentication ON
-authnVsName av_saml
Navigate to Security > AAA - Application Traffic > Policies > Authentication > Advanced Poli-
cies > Policy, create a policy with SAML as the action type, and associate the required SAML
action with the policy.
Navigate to Security > AAA - Application Traffic > Virtual Servers, and associate the SAML
policy with the authentication virtual server.
3. Associate the authentication server with the appropriate traffic management virtual server.
Navigate to Traffic Management > Load Balancing (or Content Switching) > Virtual Servers,
select the virtual server, and associate the authentication virtual server with it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
The SAML IdP (Identity Provider) is a SAML entity that is deployed on the customer network. The IdP
receives requests from the SAML SP and redirects users to a logon page, where they must enter their
credentials. The IdP authenticates these credentials with the user directory (external authentication
server, such as LDAP) and then generates a SAML assertion that is sent to the SP.
The SP validates the token, and the user is then granted access to the requested protected application.
When the NetScaler appliance is configured as an IdP, all requests are received by an authentication
virtual server that is associated with the relevant SAML IdP profile.
Note
A NetScaler appliance can be used as a IdP in a deployment where the SAML SP is configured
either on the appliance or on any external SAML SP.
• Digitally signs assertions. Support for the SHA256 algorithm is introduced in NetScaler 11.0 Build
55.x.
• Supports single-factor and two-factor authentication. SAML must not be configured as the sec-
ondary authentication mechanism.
• Can encrypt assertions by using the public key of the SAML SP. This is recommended when the
assertion includes sensitive information. Support introduced in NetScaler 11.0 Build 55.x.
• Can be configured to accept only digitally signed requests from the SAML SP. Support introduced
in NetScaler 11.0 Build 55.x.
• Can log on to the SAML IdP by using the following 401-based authentication mechanisms: Ne-
gotiate, NTLM, and Certificate. Support introduced in NetScaler 11.0 Build 55.x.
• Can be configured to send 16 attributes in addition to the NameId attribute. The attributes must
be extracted from the appropriate authentication server. For each of them, you can specify the
name, the expression, the format, and a friendly name in the SAML IdP profile. Support intro-
duced in NetScaler 11.0 Build 55.x.
• If the NetScaler appliance is configured as a SAML IdP for multiple SAML SP, a user can gain
access to applications on the different SPs without explicitly authenticating every time. The
NetScaler appliance creates a session cookie for the first authentication, and every subsequent
request uses this cookie for authentication. Support introduced in NetScaler 11.0 Build 55.x.
• Can send multi-valued attributes in a SAML assertion. Support introduced in NetScaler 11.0 Build
64.x.
• Supports post and redirect bindings. Support for redirect bindings is introduced in NetScaler
11.0 Build 64.x.
If the system time on NetScaler appliance SAML IdP and the peer SAML SP is not in sync, the
messages might get invalidated by either party. To avoid such cases, you can now configure the
time duration for which the assertions will be valid.
This duration, called the “skew time,” specifies the number of minutes for which the message
should be accepted. The skew time can be configured on the SAML SP and the SAML IdP.
Note
• Can be configured to serve assertions only to SAML SPs that are pre-configured on or trusted by
the IdP. For this configuration, the SAML IdP must have the service provider ID (or issuer name)
of the relevant SAML SPs. Support introduced in NetScaler 11.0 Build 64.x.
Note
Before proceeding, make sure that you have an authentication virtual server that is linked
to an LDAP authentication server.
To configure a NetScaler appliance as a SAML IdP by using the command line interface
Example
2. Configure the SAML authentication policy and associate the SAML IdP profile as the action of
the policy.
To configure a NetScaler appliance as a SAML IdP by using the graphical user interface
Navigate to Security > AAA - Application Traffic > Policies > Authentication > Advanced Poli-
cies > Policy, and create a policy with SAML IdP as the action type, and associate the required
SAML IdP profile with the policy.
Navigate to Security > AAA - Application Traffic > Virtual Servers, and associate the SAML IdP
policy with the authentication virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
To provide single sign-on capabilities across applications that are hosted on the service provider, you
can configure SAML single sign-on on the SAML SP.
Example
In the following command, Example is the load balancing virtual server that has a web link from
the SharePoint portal. Nssp.example.com is the Traffic Management virtual server that is load
balancing the SharePoint server.
Example
The following command enables SSO and binds the SAML SSO profile created above to a traffic
action.
3. Configure the traffic policy that specifies when the action must be executed.
Example
The following command associates the traffic action with a traffic policy.
4. Bind the traffic policy created above to a traffic management virtual server (load balancing or
content switching). Alternatively, the traffic policy can be associated globally.
Note
This traffic management virtual server must be associated with the relevant authentication
virtual sever that is associated with the SAML action.
1. Define the SAML SSO profile, the traffic profile, and the traffic policy.
Navigate to Security > AAA - Application Traffic > Policies > Traffic, select the appropriate tab,
and configure the settings.
2. Bind the traffic policy to a traffic management virtual server or globally to the NetScaler appli-
ance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
OAuth authentication
Contributed by:
C
The AAA traffic management feature now supports OAuth and OpenID-Connect mechanisms for au-
thenticating and authorizing users to applications that are hosted on applications such as Google,
Facebook, and Twitter.
The authentication mehanism facilitates the inline verification of OpenID tokens. The NetScaler ap-
pliance can be configured to obtain certificates and verify signatures on the token.
A major advantage of using the OAuth and OpenID-Connect mechanisms is that the user information
is not sent to the hosted applications and therefore the risk of identity theft is considerably reduced.
The NetScaler appliance configured for AAA now accepts incoming tokens that are signed using HMAC
HS256 algorithm. In addition, the public keys of the SAML Identity Provider (IdP) are read from a file,
instead of learning from an URL endpoint.
In the NetScaler appliance implementation, the application to be accessed is represented by the AAA
traffic management virtual server. So, to configure OAuth, you must configure an OAuth policy which
must then be associated with a AAA traffic management virtual server.
Note
OAuth on NetScaler appliance is currently qualified for all SAML IdPs that are compliant with
“OpenID connect 2.0”.
Note
Attributes (1 to 16) can be extracted in the OAuth response. Currently these attributes are not
evalauted. They are added for the future reference.
Example
preblock add authentication oauthAction a -authorizationEndpoint https
://example.com/ -tokenEndpoint https://example.com/ -clientiD sadf -
clientsecret df
Note
When a certEndpoint is specified, the NetScaler appliance polls that endpoint at the configured
frequency to learn the keys. To configure a NetScaler appliance to read the local file and parse
keys from that file, a new configuration option is introduced as follows.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Important
Starting from NetScaler 12.0 Build 51.x, NetScaler appliance used as a SAML Service Provider (SP)
with Multi-Factor (nFactor) authentication now prepopulates the user-name field on the login
page. The appliance sends a NameID attribute as part of a SAML authorization request, retrieves
the NameID attribute value from the NetScaler appliance SAML Identity Provider (IdP), and pre-
populates the user-name field.
Multi-factor authentication enhances the security of an application by requiring users to provide mul-
tiple proofs of identify to gain access. The NetScaler appliance provides an extensible and flexible
approach to configuring multi-factor authentication. This approach is called nFactor authentication.
For a nFactor benefit, see One Public IP for AAA-TM Deployments on NetScaler.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
January 6, 2019
Contributed by:
C
The primary entity used for nFactor authentication is called a login schema.
A login schema specifies an authentication schema XML file that defines the manner in which the login
form will be rendered. Considering the interaction that the user must have when logging in to the
application, you can create a single file for multiple factors or different files for different factors. View
sample XML file.
• Single file for multiple factors. User will be provided a single form in which to provide creden-
tials for multiple authentication factors.
• Different files for different factors. User will be provided a different form for each authentica-
tion factor.
Next, you must associate the XML file(s) with login schema(s). You can also specify expressions to ex-
tract the user name and the password from the login form.
Tip
You can configure an authentication factor to be pass-through. This means that the user is not re-
quired to provide credentials explicitly and there is no login form for that factor. The credentials
are either taken from the previous factor or the user name and/or password are dynamically ex-
tracted by using the username/password expressions that are configured for that login schema.
You must set the login schema to “NOSCHEMA”, instead of an XML file.
Now that the login schemas are configured, you must specify the manner in which they must be in-
voked. A login schema can be invoked by using either a login schema policy or an authentication
policy label. The decision depends on the following:
To summarize, the configurations you must perform to set up nFactor authentication are as follows:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
Imagine a user requesting access to an application that requires user credentials. As is the case in
NetScaler appliance deployments, the request arrives at the NetScaler appliance through a traffic
management virtual server (in this case, a load balancing virtual server). Since the user must provide
authentication credentials, the load balancing virtual server redirects the request to the authentica-
tion virtual server, which does the following:
1. Checks to determine whether any login schema policies are associated with the authentication
virtual server.
- If yes, the user is presented the login form associated with the login schema policy with the
highest priority that evaluates to true.
Note
2. The authentication policies that are associated with the authentication virtual server are eval-
uated. For the policies that are evaluated to true, the actions are executed in order of priority
until one of the actions succeeds.
4. The authentication policies that are associated with the authentication policy label are evalu-
ated. For the policies that are evaluated to true, the actions are executed in order of priority until
one of the actions succeeds.
6. Steps 4 and 5 are performed repetitively till all the configured next factors are executed.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
June 3, 2019
Contributed by:
C
The following diagram illustrates the high-level steps involved in nfactor configuration.
To understand the step-wise configurations for nFactor authentication, let us consider a 2-factor au-
thentication deployment where the 1st factor is LDAP authentication and the 2nd factor is RADIUS
authentication.
This sample deployment requires the user to login to both factors using a single login form. There-
fore, we define a single login form that accepts two passwords. The first password is used for LDAP
authentication and the other for RADIUS authentication. View XML file.
3. Configure the login schema for the login form and bind it to a login schema policy.
4. Configure a login schema for the pass-through and bind it to a policy label
7. Bind the LDAP policy (first factor) to the authentication virtual server.
bind authentication vserver auth56 -policy ldap -priority 1 -nextFactor label1 -gotoPriorityExpression
next
8. Bind the RADIUS policy (second factor) to the authentication policy label.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AAA application traffic
Contributed by:
C
A NetScaler appliance can now be configured as an identity provider by using OpenID Connect proto-
col. OpenID connect protocol strengthens identity providing capabilities of the NetScaler appliance.
You can now access enterprise wide hosted application with a single sign-on as OpenID connect offers
more security by not transferring user password but works with tokens with specific lifetime. OpenID
also is designed to integrate with non-browser clients such as apps and services. Therefore, OpenID
connect has been widely adopted by many implementations.
• OpenID eliminates overhead of maintaining multiple authentication passwords as the user has
a single identity across organization.
• OpenID provides a robust security for your password as the password is shared only with your
identity provider and not with any application you access.
• OpenID has vast interoperability with various systems making it easier for the hosted applica-
tions to accept OpenID.
• OpenID is a simple protocol that enables native clients to easily integrate with servers.
To configure NetScaler appliance as an IdP using the OpenID Connect protocol with the GUI**
1. Navigate to Configuration > Security > AAA-Application Traffic > Policies > Authentication > Ad-
vanced Policies > OAuth IdP.
On the Create Authentication OAuth IDP Profile screen, set values for the following parame-
ters and click Create.
4. On the Create Authentication OAuth IDP Policy screen, set values for the following parameters
and click Create.
Binding the OAuthIDP policy and LDAP policy to the authentication virtual server
1. Navigate to Configuration > Security > AAA-Application Traffic > Policies >Authentication >
Advanced Policies > Actions > LDAP.
3. On Create Authentication LDAP Server screen, set the values for the following parameters,
and click Create.
4. Navigate to Configuration > Security > AAA-Application Traffic > Policies >Authentication >
Advanced Policies > Policy.
6. On Create Authentication Policy page, set the values for the following parameters and click
Create.
To configure the NetScaler appliance as an IdP using the OpenID Connect protocol with the
command line
sAMAccountName
Note
You can bind more than one key. Public parts of certificates bound are sent in response to
jwks_uri query (https://gw/oauth/idp/certs)).
1.
2. Citrix ADC
3. NetScaler 12.0
Admin Partitioning
January 6, 2019
Contributed by:
C
A NetScaler appliance can be partitioned into logical entities called admin partitions, where each par-
tition can be configured and used as a separate NetScaler appliance. The following figure shows the
partitions of a NetScaler being used by different customers and departments:
A partitioned NetScaler appliance has a single default partition and one or more admin partitions.
The following table provides further details on the two partition types:
Note
In a partitioned appliance, the mode BridgeBPDUs can be enabled only in the default partition
and not in the administrative partitions.
Default Partition
Admin Partitions
Availability:
The NetScaler appliance ships with a single partition, which is called a default partition. The default
partition is retained even after the NetScaler appliance is partitioned.
Number of Partitions:
One
A NetScaler appliance can have one or more (maximum of 512) admin partitions.
The default partition can be accessed and configured by all NetScaler users who are not associated
with a partition-specific command policy. As always, the operations that a user can perform are re-
stricted by the associated command policy.
Can be created only by NetScaler superusers who also specify the users for that partition. Only supe-
rusers and associated users of the partition can access and configure the admin partition.
File Structure:
All files in a default partition are stored in the default NetScaler file structure.
For example, the NetScaler configuration file is stored in the /nsconfig directory and NetScaler logs
are stored in the /var/log/ directory.
All files in an admin partition are stored in directory paths that have the name of the admin partition.
For example, the NetScaler configuration file (ns.conf) is stored in the /nsconfig/partitions/<partitionName> di-
rectory. Other partition-specific files are stored in the /var/partitions/<partitionName> directories.
Note: Currently, logging is not supported at partition-level. Therefore, this directory is empty and all
logs are stored in the /var/log/ directory.
Resources Available:
All NetScaler resources.
NetScaler resources that are explicitly assigned to the admin partition.
In authenticating and authorizing a partitioned NetScaler appliance, a root administrator can assign
a partition administrator to one or more partitions. The partition administrator can authorize users
to that partition without affecting other partitions. These are partition users and they are authorized
to access only that partition using SNIP address. Both the root administrator and the partition admin-
istrator can configure role based access (RBA by authorizing users to access different applications.
Administrators and user roles can be described as follows:
Root Administrator. Accesses the partitioned appliance through its NSIP address and can grant user
access to one or more partitions. The administrator can also assign partition administrators to one
or more partitions. The administrator can create a partition administrator from the default partition
using a NSIP address or switch to a partition and then create a user and assign partition admin access
using a SNIP address.
Partition Administrator. Accesses the specified partition through a NSIP address assigned by the
root administrator. The administrator can assign role-based access to partition user access to that
partition and also configure external server authentication using partition specific configuration.
System User. Accesses partitions through the NSIP address. Has access to the partitions and re-
sources specified by the root administrator.
Partition User. Accesses a partition through a SNIP address. This user account is created by the par-
tition administrator and the user has access to resources, only within the partition.
Points to remember
Following are some points to remember when providing role-based access in a partition.
1. NetScaler users accessing the GUI through NSIP address will use default partition authentica-
tion configuration to log on to the appliance.
2. Partition system users accessing the GUI through partition SNIP address will use partition spe-
cific authentication configuration to log on to the appliance.
3. Partition user created in a partition cannot login using NSIP address.
4. NetScaler user bound to a partition cannot login using partition SNIP address.
5. External users accessing a partition through external server configuration as LDAP, Radius, or
TACACS added in the partition. The user must access using SNIP address to directly log onto the
partition.
Consider a scenario where an enterprise organization, www.example.com has multiple business units
and a centralized administrator who manages all instances in their network. However, they want to
provide exclusive user privileges and environment for each business unit.
Following are the administrators and users managed by default partition authentication configuration
and partition specific configuration in a partitioned appliance.
John, is the root administrator of a partitioned NetScaler appliance. John manages all user accounts
and administrative user accounts across partitions (for example, P1, P2, P3, P4, and P5) within the
appliance. He provides granular role-based access to entities from the default partition of the appli-
ance. John creates user accounts and assigns partition access to each account. George being a net-
work engineer within the organization prefers to have a role based access to few applications running
on partition P2. Based on user management, John creates a partition administrator role for George
and associates his user account with partition-admin command policy in P2 partition. Adam being
another network engineer prefers to access an application running on P2. John creates a system user
account for Adam and associates his user account to P2 partition. Once his account is created, Adam
can log into the appliance to access the NetScaler Management interface through NSIP address and
can switch to partition P2 based on user/group binding.
Suppose, Jane who is another network engineer wants to directly access an application running only
on partition P2, George (partition administrator) can create a partition user account for her and as-
sociate her account with command policies for authorization privileges. Jane’s user account created
within the partition is now directly associated with P2. Now Jane can access the NetScaler Manage-
ment interface through SNIP address and cannot switch to any other partition.
Note
If Jane’s user account is created by a partition administrator in partition P2, she can access the
NetScaler Management interface only through SNIP address (created within the partition) and
not permitted to access the interface through NSIP address. Similarly, if Adam’s user account is
created by a root administrator in the default partition and is bound to P2 partition, he can access
the NetScaler Management interface only through NSIP address or SNIP address created in the
default partition (with management access enabled) and not permitted to access the partition
interface through SNIP address created in the administrative partition.
Creating administrative partitions and system users – A root administrator creates administrative par-
titions and system users in the default partition of the appliance. The administrator then associates
the users to different partitions. If you are bound to one or more partitions, you can switch from one
partition to another based on user bindings. Also, your access to one or more bound partitions is
authorized only by the root administrator.
Authorizing system user as partition administrator for a specific partition – Once a user account is
created, the root administrator switches to a specific partition and authorizes the user as the partition
administrator. This is done by assigning partition-admin command policy to the user account. Now,
the user can access the partition as partition administrator and manage entities within the partition.
Configuring SNIP address in an administrative partition- The partition administrator logs on to the
partition and creates a SNIP address and provides management access to the address.
Creating and Binding a Partition System User with Partition Command Policy -The partition adminis-
trator creates partition users and defines the scope of user access. This is done by binding the user
account to partition command policies.
Creating and Binding a Partition System User Groups with Partition Command Policy -The partition
administrator creates partition user groups and defines the scope of user group access. This is done
by binding the user group account to partition command policies.
Configuring External Server authentication for external users (optional)-This configuration is done for
authenticating external TACACS users accessing the partition using SNIP address.
Following are the tasks performed in configuring role-based access for partition users in an Adminis-
trative Partition.
1. Creating an Administrative Partition – Before you create partition users in an administrative par-
tition, you must first create the partition. As a root administrator, you can create a partition from
the default partition using the configuration utility or a command line interface.
2. Switching user access from default partition to partition P2 – If you are partition administrator
accessing the appliance from the default partition, you can switch from default partition to a
specific partition (for example, partition P2) based on user binding.
3. Adding SNIP address to the Partition user account with Management access enabled-Once you
have switched your access to an administration partition, you must create a SNIP address and
provide management access to the address.
4. Creating and Binding a Partition System User with Partition Command Policy-If you are a parti-
tion administrator, you can create partition users and define the scope of user access. This is
done by binding the user account to partition command policies.
5. Creating and Binding Partition user group with Partition Command Policy-If you are a partition
administrator, you can create partition user groups and define the scope of user access control.
This is done by bind the user group account to partition command policies.
Configuring External Server authentication for external users (optional)-This configuration is done for
authenticating external TACACS users accessing the partition using SNIP address.
You can avail the following benefits by using admin partitions for your deployment:
Let us analyze a couple of cases to understand the scenarios in which you can use admin partitions.
A non-partitioned NetScaler would not be able to satisfy these requirements. However, you can
achieve all these requirements by partitioning a NetScaler.
Simply create a partition for each of the applications, assign the required users to the partitions, spec-
ify a VLAN for each partition, and define global settings on the default partition.
January 6, 2019
Contributed by:
C
Depending on the NetScaler configuration and the partition in which the configuration is performed,
NetScaler configurations can be categorized into three types of configurations as given below.
Note
• Admin partitions cannot be set up on a NetScaler cluster. This means that a NetScaler clus-
ter cannot be partitioned.
Configurations that can be performed ONLY in the default partition and which are available or impact
all the admin partitions.
• Updates to built-in entities for monitors, TCP profiles, HTTP profiles, and so on.
• Updates to global parameters for syslog, nslog, weblog, content switching, IPSEC, SIP, DHCP,
Surge protection, TCP buffering, and system collection.
• High availability (HA) configurations
• Interface and VLAN changes
• User configurations
Configurations that can be performed independently in default and admin partitions. These configu-
rations are applicable only to the partition in which they are performed.
Case 3
Configurations that cannot be performed on admin partitions. These features can be configured in
the default partition, but there is no impact on admin partitions.
Note
Configurations that are supported on admin partitions for a particular release are marked as Yes.
Infra Cache No No No No
Re-direction
Infra Integrated No Yes Yes Yes
Caching
(Restricted
Feature)
Network VXLAN No No Yes Yes
Network Graceful No Yes Yes Yes
Shutdown
Network LSN No No No No
Network IPv6 Ready No No Yes Yes
Logo
Network Vpath No No Yes Yes
Load Datastream No Yes Yes Yes
Balancing
Logging Web logging No Yes Yes Yes
Network L2 Param/L3 No Yes Yes Yes
Param
Network GRE Tunnel No No Yes Yes
Loading Scriptable No Yes Yes Yes
Balancing Monitoring
Load GSLB No Yes Yes Yes
Balancing
Infra Connection No Yes Yes Yes
Mirroring
Infra FEO No Yes Yes Yes
Infra Nstrace No Yes Yes Yes
Load Priority No No Yes Yes
Balancing Queuing
Network HDOSP No No Yes Yes
1.
2. Citrix ADC
3. NetScaler 12.0
December 5, 2018
Contributed by:
C
Important
By partitioning a NetScaler appliance, you are in-effect creating multiple instances of a single
NetScaler appliance. Each instance has its own configurations and the traffic of each of these
partitions is isolated from the other by assigning each partition a dedicated VLAN or a shared VLAN.
A partitioned NetScaler has one default partition and the admin partitions that are created. To set up
an admin partition, you must first create a partition with the relevant resources (memory, maximum
bandwidth, and connections). Then, specify the users that can access the partition and the level of
authorization for each of the users on the partition.
Accessing a partitioned NetScaler is the same as accessing a non-partitioned NetScaler: through the
NSIP address or any other management IP address. As a user, after you provide your valid logon cre-
dentials, you are taken to the partition to which you are bound. Any configurations that you create
are saved to that partition. If you are associated with more than one partition, you are taken to the
first partition with which you were associated. If you want to configure entities on one of your other
partitions, you must explicitly switch to that partition.
After accessing the appropriate partition, configurations that you perform are saved to that partition
and are specific to that partition.
Note
• NetScaler superusers and other non-partition users are taken to the default partition.
• Users of all the 512 partitions can log in simultaneously.
Tip
To access a partitioned NetScaler appliance over HTTPS by using the SNIP (with management access
enabled), make sure that each partition has the certificate of its partition administrator. Within the
partition, the partition admin must do the following:
2. Bind it to a service named “nskrpcs-<SNIP>-3009”, where <SNIP> must be replaced with the
SNIP address, in this case 100.10.10.1.
In a partitioned NetScaler appliance, a network administrator can create a partition with partition
resources such as memory, bandwidth, and connection limit configured as unlimited. This is done by
specifying Zero as the partition resource value, where Zero indicates the resource is unlimited on the
partition and it can be consumed up to system limits. Partition resource configuration is useful when
you migrate a traffic domain deployment to an administrative partition or if you do not know about
resource allocation limit for a partition in a given deployment.
1. Partition memory. This is the maximum allocated memory for a partition. You must make sure
to specify the values when creating a partition.
Note
From NetScaler 12.0 onwards, when you create a partition, you must the set the memory
limit as Zero or if a partition is already created with a specific memory limit, you can reduce
the limit to any value or set the limit as Zero.
Parameter: maxMemLimit
Maximum memory is allocated in megabytes in a partition. A zero value indicates the memory
is unlimited on the partition and it can consume up to the system limits.
Default value: 10
2. Partition bandwidth. Maximum allocated bandwidth for a partition. If you specify a limit, make
sure it is within the appliance’s licensed throughput. Otherwise, you are not limiting the band-
width that can be used by the partition. The specified limit is accountable for the bandwidth
that the application requires. If the application bandwidth exceeds the specified limit, packets
are dropped.
Note
From NetScaler 12.0 onwards, when you can create a partition, you can set the partition
bandwidth limit to Zero or if a partition is already created with a specific bandwidth, you
can reduce bandwidth or set the limit as Zero.
Parameter: maxBandwidth
Maximum bandwidth is allocated in Kbps in a partition. A zero value indicates the bandwidth is
unrestricted. That is, the partition can consume up to the system limits.
3. Partition connection. Maximum number of concurrent connections that can be open in a parti-
tion. The value must accommodate the maximum simultaneous flow expected within the par-
tition. The partition connections are accounted from the partition quota memory. Previously,
the connections were accounted from the default partition quota memory. It is configured only
on the client-side, not on the back-end server-side TCP connections. New connections cannot
be established beyond this configured value.
Note
From NetScaler 12.0 onwards, you can create a partition with number of open connections
set to Zero or if you have already created a partition with a specific number of open con-
nections, you can reduce the connection limit or set the limit as Zero.
Parameter: maxConnections
Maximum number of concurrent connections that can be open in the partition. A zero value
indicates no limit on number of open connections.
Minimum value: 0
2. Check if you are in the correct partition. The command prompt displays the name of the cur-
rently selected partition.
4. If no, get a list of the partitions with which you are associated and switch over to the appropriate
partition.
5. Now, you can perform the required configurations just as a non-partitioned NetScaler.
2. Check if you are in the correct partition. The top bar of the graphical user interface displays the
name of the currently selected partition.
• If no, navigate to Configuration > System > Administrative Partitions > Partitions, right-
click the partition to which you want to switch, and select Switch.
3. Now, you can perform the required configurations just as a non-partitioned NetScaler.
The root administrator adds an administrative partition from the default partition and binds the par-
tition with VLAN 2.
To switch a user account from default partition to an admin partition by using the command line
interface:
Adding SNIP address to a partition user account with management access enabled
To add SNIP address to the partition user account with management access enabled by using the
command line interface:
In partition, create a partition system user and bind the user with partition-admin command policies.
To create and bind a partition system user with partition command policy by using the command
line interface:
Creating and binding partition user group with partition command policy
In Partition Par1, create a partition system user group and bind the group with partition command
policy such as partition admin, partition read-only, partition-operator, or partition-network.
To create and bind a partition user group with partition command policy by using the command
line interface:
In partition Par1 you can configure an external server authentication to authenticate external TACACS
users accessing the partition through SNIP address.
To configure external server authentication for external users by using the command line inter-
face:
To configure a partition user account in an administrative partition, you must create a partition user
or a partition user group and bind it partition command policies. Also, you can configure the external
server authentication for an external user.
Navigate to System > User Administration, click Users to add a partition system user and bind the
user to command policies (partitionadmin/partitionread-only/partition-operator/partition-network).
Navigate to System > User Administration, click Groups to add a partition system user group
and bind the user group to command policies (partitionadmin/partitionread-only/partition-
operator/partition-network).
To configure External server authentication for external users by using the GUI
Navigate to System > Authentication > Basic Actions and click TACACS to configure TACACS server
for authenticating external users accessing the partition.
Sample Configuration
The following configuration shows how to create a partition user or a partition user group and bind
it partition command policies. Also, how to configure the external server authentication for authenti-
cating an external user.
Command Policies for a Partition Users and Partition User Groups in Administrative
Partition
With Link Aggregation Control Protocol (LACP), you can combine multiple ports into a single, high-
speed link (also called a channel). An LACP-enabled appliance exchanges LACP Data Units (LACPDU)
over the channel.
There are three LACP configuration modes that you can enable in the default partition of a NetScaler
appliance:
1. Active. A port in active mode sends LACPDUs. Link aggregation is formed if the other end of the
Ethernet link is in the LACP active or passive mode.
2. Passive. A port in passive mode sends LACPDUs only when it receives LACPDUs. The link aggre-
gation is formed if the other end of the Ethernet link is in the LACP active mode.
3. Disable. Link aggregation is not formed.
Note
By default, the link aggregation is disabled in the default partition of the appliance.
LACP exchanges LACPDU between devices connected by an Ethernet link. These devices are typically
referred as an actor or partner.
After exchanging LACPDUs, the actor and partner negotiate the settings and decide whether to add
the ports to the aggregation.
To configure and verify LACP on a NetScaler appliance by using the command line
When you enable LACP on an interface, the channels are dynamically created. Additionally,
when you enable LACP on an interface and set lacpKey to 1, the interface is automatically bound
to channel LA/1.
Note
When you bind an interface to a channel, the channel parameters take precedence over
the interface parameters, so the interface parameters are ignored. If a channel was cre-
ated dynamically by LACP, you cannot perform add, bind, unbind, or remove operations
on the channel. A channel dynamically created by LACP is automatically deleted when you
disable LACP on all interfaces of the channel.
show channel
show LACP
Note
In some versions of Cisco IOS, running the switchport trunk native vlan <VLAN_ID> com-
mand causes the Cisco switch to tag LACP PDUs. This causes the LACP channel between
the Cisco switch and the NetScaler appliance to fail. However, this issue does not affect
the static link aggregation channels configured in the above procedure.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
VLANs can be bound to a partition as a “Dedicated” VLAN or a “Shared” VLAN. Based on your deploy-
ment, you can bind a VLAN to a partition to isolate its network traffic from other partitions.
Dedicated VLAN – A VLAN bound only to one partition with “Sharing” option disabled and must be a
tagged VLAN. For example, in a client-server deployment, for security reasons a system administrator
creates a dedicated VLAN for each partition on the server side.
Shared VLAN – A VLAN bound (shared across) to multiple partitions with “Sharing” option enabled.
For example, in a client-server deployment, if the system administrator does not have control over
the client side network, a VLAN is created and shared across multiple partitions.
Shared VLAN can be used across multiple partitions. It is created in the default partition and you can
bind a shared VLAN to multiple partitions. By default, a shared VLAN is bound to the default partition
implicitly and hence it cannot be bound explicitly.
Note
If a NetScaler Virtual Appliance is deployed on an ESX platform, you must enable the Promiscu-
ous mode for shared VLANs with partition. Otherwise, if the traffic is through a dedicated VLAN,
you must enable the VLAN with Portgroup properties of the virtual switch.
In a partitioned (multi-tenant) NetScaler appliance, a system administrator can isolate the traffic
flowing to a particular partition or partitions by binding one or more VLANs to each partition. A
VLAN can be dedicated to one partition or Shared across multiple partitions.
Dedicated VLANs
To isolate the traffic flowing into a partition, create a VLAN and associate it with the partition. The
VLAN is then visible only to the associated partition, and the traffic flowing through the VLAN is classi-
fied and processed only in the associated partition.
To implement a dedicated VLAN for a particular partition, do the following.
1. Add a VLAN (100).
2. Bind a network interface to VLAN as a tagged network interface.
3. Create a partition (P1).
4. Bind partition (P1) to the dedicated VLAN (100).
1. Navigate to Configuration > System > Network > VLANs* and click Add to create a VLAN.
2. On the Create VLAN page, set the following parameters:
• VLAN ID
• Alias Name
• Maximum Transmission Unit
• Dynamic Routing
• IPv6 Dynamic Routing
• Partitions Sharing
3. In the Interface Bindings section, select one or more interfaces and bind it to the VLAN.
4. In the IP Bindings section, select one or more IP addresses and bind to the VLAN.
5. Click OK and Done.
Shared VLAN
In a shared VLAN configuration, each partition has a MAC address, and traffic received on the shared
VLAN is classified by MAC address. Only a Layer3 VLAN is recommended because it can restrict the sub-
net traffic. A partition MAC address is applicable and important only for a shared VLAN deployment.
Note
Shared VLAN in a partitioned appliance does not support dynamic routing protocol.
The following diagram shows how a VLAN (VLAN 10) is shared across two partitions.
1. Create a VLAN with the sharing option ‘enabled’, or enable the sharing option on an existing
VLAN. By default, the option is ‘disabled’.
2. Bind partition interface to shared VLAN.
3. Create the partitions, each with its own PartitionMAC address.
4. Bind the partitions to the shared VLAN.
At the command prompt, type one of the following commands to add a new VLAN or set the sharing
parameter of an existing VLAN:
1. Navigate to Configuration > System > Network > VLANs and then select a VLAN profile and
click Edit to set the partition sharing parameter.
2. On the Create VLAN page, select the Partitions Sharing checkbox.
3. Click OK and then Done.
On SDX appliance, you must generate and configure the PMAC address by using the Management Ser-
vice user interface, before using the admin partitions with shared VLANs. Management Service en-
ables you to generate partition MAC addresses by:
Note:
• The randomly generating MAC addresses are used for other deployments other than high
availability.
• After generating the partition MAC addresses, you must restart the Citrix ADC instance be-
fore configuring the admin partitions. For more information on generating partition MAC
addresses from SDX appliance, see Generating Partition MAC Addresses to Configure Admin
Partition on a Citrix NetScaler instance in the SDX Appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
November 6, 2018
Contributed by:
C
In a partitioned NetScaler appliance, similar to configuring a VLAN, you can configure a VXLAN in the
default partition. After configuring a VXLAN, you can bind it to an administrative partition or if a VXLAN
is extending a VLAN that is bound to a partition, the appliance binds the VXLAN to the partition under
the same broadcasting domain. This is applicable in unbinding a VLAN that unbinds a VXLAN from the
partition.
For more information about how VXLAN works in a NetScaler appliance, see VXLAN.
Also, for more information on how VLAN works in a partitioned NetScaler appliance, see Configure
admin partitions.
Remember the following points before you configure a VXLAN in a partitioned NetScaler appliance:
• When you extend a VLAN over VXLAN, make sure VLAN is bound to the partition.
• Only a partition administrator must configure the IP and dynamic routing for the VXAN in the
administrative partition.
A shared VXLAN is not supported in a partitioned appliance and so a VXLAN cannot be tagged to a
shared VLAN or you cannot make a VLAN a shared one when it is tagged to a VXLAN.
Follow the steps given below to extend a VLAN over a VXLAN and vice versa within the same broadcast
domain:
3. Configure a peer vtep to carry all BUM (broadcast unknown multicast) traffic.
Note
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A partitioned NetScaler appliance uses SNMP infrastructure for partition rate limiting and for monitor-
ing partition resource utilization details.
On a partitioned NetScaler appliance, a PARTITION-RATE-LIMIT alarm can generate nine SNMP traps
for notifying a partition resource (such as bandwidth, connection, or memory) has reached its limit or
returned to normal.
The threshold values for the SNMP traps are non-configurable and are as follows are:
• High threshold = 80% (applicable for all partition rate limit traps)
• Low threshold = 60 % (applicable for all partition rate limit traps)
• Memory limit = 95% (applicable only for partition memory traps)
To configure PARTITION-RATE-LIMIT alarm in a specific partition and enable generation of the SNMP
trap messages.
Using SNMP, you can monitor a partition’s resource (such as bandwidth, connection, and memory)
utilization details at real time on a NetScaler appliance. This is done by sending a SNMP request (such
as SNMP GET, SNMP GET BULK, SNMP GETNEXT, or SNMP WALK) from the SNMP Manager.
Note
In order to monitor partition resources, you must configure the SNMP community in the default
partition. Wherein, the partitionTable is maintained in the default partition, and the SNMP com-
munication is done through the NSIP address of the appliance.
Consider a scenario where a NetScaler administrator wants to know the bandwidth usage of partition
P1 on the appliance. The SNMP Manager retrieves this information by sending an SNMP GET request
on the corresponding OID (partitionCurrentBandwidth) to the NSIP address of the appliance. The
SNMP agent on the default partition retrieves and sends the current bandwidth usage of P1 to the
SNMP Manager through the NSIP address.
The following table lists the SNMP counters which are part of partitionTable and its description:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
On a partitioned NetScaler appliance, for enhanced data security, you can configure audit logging in
an administrative partition by using advanced policies. For example, you might want to view logs
(states and status information) of a specific partition that has multiple users accessing different sets
of features on the basis of their levels of authorization in the partition.
Points to remember
1. The audit logs generated from the partition will be stored as a single log file (/var/log/ns.log).
2. You must configure the audit log server’s (syslog or nslog) subnet address as the source IP ad-
dress in the partition for sending the audit-log messages.
3. The default partition uses the NSIP as the source IP address for the audit log messages by de-
fault.
4. You can display the audit-log message by using the “show audit messages” command.
For information on audit-log configuration, see Configuring the NetScaler Appliance for Audit Logging.
To configure the partition’s subnet IP address by using the command line interface
To bind audit-log policy to syslogGlobal entity by using the command line interface.
To bind audit-log policy to nslogGlobal entity by using the command line interface.
At the command prompt, type:
Example
Storing logs
When SYSLOG or NSLOG server collects log information from all partitions, it is stored as log messages
in ns.log file. The log messages contain the following information:
• Partition Name.
• The IP address.
• A time stamp.
• The message type
• The predefined log levels (Critical, Error, Notice, Warning, Informational, Debug, Alert, and
Emergency)
• The message information.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
AppExpert
Contributed by:
C
The following topics provide a conceptual reference and configuration instructions for the AppExpert
and other features of the NetScaler appliance.
Note
• Action Analytics: Collects run-time statistics on the basis of pre-defined criteria. When used with
policies, the feature also provides you with the infrastructure for automatic, real-time traffic
optimization.
• AppExpert Applications and Templates: Simplify configuration steps for the Citrix® NetScaler®
appliance by using applications, application templates, Citrix Gateway applications, and entity
templates.
• AppQoE: Application level Quality of Experience (AppQoE) integrates several existing policy-
based security features of the NetScaler appliance into a single integrated feature that takes
advantage of a new queuing mechanism, fair queuing.
• Entity Template: Describes how to use entity templates to set up and configure individual
NetScaler entities, such as a policy or virtual server. An entity template provides a specification
and a set of defaults for the object.
• HTTP Callouts: An HTTP request that the NetScaler appliance generates and sends to an exter-
nal application when certain criteria are met during policy evaluation.
• Pattern Sets: Allow string matching during the evaluation of a default syntax policy.
• Policies and Expressions: Rules that determine the operations that the NetScaler appliance
must perform.
• Rate Limiting: Defines the maximum load for a given network entity or virtual entity on the
NetScaler appliance.
• Responder: Bases responses on who sends the request, where it is sent from, and other criteria
with security and system management implications.
• Rewrite: Rewrites information in the requests or responses handled by the NetScaler appliance.
• String Maps: Perform pattern matching in all NetScaler features that use the default policy syn-
tax.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Action analytics
Contributed by:
C
The performance of your website or application depends on how well you optimize the delivery of the
most frequently requested content. Techniques such as caching and compression help accelerate the
delivery of services to clients, but you need to be able to identify the resources that are requested most
frequently, and then cache or compress those resources. You can identify the most frequently used re-
sources by aggregating real-time statistics about website or application traffic. Statistics such as how
frequently a resource is accessed relative to other resources and how much bandwidth is consumed
by those resources help you determine whether those resources need to be cached or compressed
to improve server performance and network utilization. Statistics such as response times and the
number of concurrent connections to the application help you determine whether you must enhance
server-side resources.
If the website or application does not change frequently, you can use products that collect statistical
data, and then manually analyze the statistics and optimize the delivery of content. However, if you
do not want to perform manual optimizations, or if your website or application is dynamic in nature,
you need infrastructure that can not only collect statistical data but can also automatically optimize
the delivery of resources on the basis of the statistics. On the NetScaler appliance, this functionality
is provided by the action analytics feature. The feature operates on a single NetScaler appliance and
collects run-time statistics on the basis of criteria that you define. When used with NetScaler policies,
the feature also provides you with the infrastructure that you need for automatic, real-time traffic
optimization.
When configuring the action analytics feature, you specify the request attributes for which you want
to collect statistical data, for example, URLs and HTTP methods by configuring default syntax expres-
sions in an entity called a selector. Then, you configure an identifier to configure settings such as the
sampling interval and sample count. You also configure a policy that enables the appliance to eval-
uate traffic as specified by the selector-identifier pair. Finally, you bind the policy to a bind point to
begin collecting statistics.
The appliance also provides you with a set of built-in selectors, identifiers, and responder policies that
you can use to get started with the feature.
You can configure the feature to perform run-time sorting of the records on an attribute of your choice.
You can view the statistical data by using either the command-line interface or the Stream Sessions
tool in the GUI.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Configure a selector
January 6, 2019
Contributed by:
C
A selector is a filter for identifying requests. It consists of up to five individual default syntax expres-
sions that identify request attributes such as the client IP address and the URL in the request. Each
• HTTP.REQ.URL
• CLIENT.IP.SRC
• HTTP.RES.BODY(1000).AFTER_STR(”<string>”).BEFORE_STR(”<string>”)”
• CLIENT.IP.SRC.SUBNET(24)
Selectors are used in rate limiting and action analytics configurations. A selector is optional in a rate
limiting configuration but is required in an action analytics configuration.
The order in which you specify parameters is significant. For example, if you configure an IP address
and a domain (in that order) in one selector, and then specify the domain and the IP address (in the
reverse order) in another selector, the NetScaler considers these values to be unique. This can lead
to the same transaction being counted twice. Also, if multiple policies invoke the same selector, the
NetScaler, again, can count the same transaction more than once.
If you modify an expression in a selector, you may get an error if any policy that invokes it is bound to
a new policy label or bind point. For example, suppose that you create a selector named myLimitSe-
lector1, invoke it from myLimitID1, and invoke the identifier from a DNS policy named dnsRateLimit1.
If you change the expression in myLimitSelector1, you might receive an error when binding dnsRate-
Limit1 to a new bind point. The workaround is to modify these expressions before creating the policies
that invoke them.
The NetScaler appliance provides built-in selectors for some of the most common use cases. Refer to
the pdf.
You can also configure a selector with expressions that identify the request attributes of your choice.
For example, you might want to create a record for a request that arrives with a specific header. To
evaluate the header, you can add HTTP.REQ.HEADER(“”) to the selector that you intend to use.
At the command prompt, type the following commands to configure a selector and verify the config-
uration:
Example
5 Expressions:
6 1) HTTP.REQ.URL
7 2) CLIENT.IP.SRC
8 Done
9 >
Contributed by:
C
You configure a stream identifier to specify parameters for collecting statistical data from requests
identified by a given selector. An identifier specifies the selector to be used, the statistics collection
interval, the sample count, and the field on which the records are to be sorted.
The NetScaler appliance includes the following built-in stream identifiers for common use cases. All
the built-in identifiers specify a sample count of 1 and an interval of 1 minute. Additionally, they sort
the data on the
REQUESTS attribute. They differ only in being associated with different built-in selectors. Each built-
in identifier is associated with a built-in selector of the same name (for example, the built in identifier
Top_URL is associated with the built-in selector
Top_URL). Following are the built-in identifiers:
• Top_URL
• Top_CLIENTS
• Top_URL_CLIENTS_LBVSERVER
• Top_URL_CLIENTS_CSVSERVER
• Top_MSSQL_QUERY_DB_LBVSERVER
• Top_MYSQL_QUERY_DB_LBVSERVER
For more information about the built-in selectors, see Configuring a Selector.
Note: The maximum length for storing string results of selectors (for example, HTTP.REQ.URL) is 60
characters. If the string (for example, URL) is 1000 characters long, of which 50 characters are enough
to uniquely identify a string, use an expression to extract only the required 50 characters.
You cannot modify a built-in identifier’s configuration. However, you can create an identifier with a
configuration of your choice.
At the command prompt, type the following commands to configure a stream identifier and verify the
configuration:
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
View statistics
Contributed by:
C
You can view the collected statistics in tabular format in the command-line interface and in graphical
format in the GUI.
To view the statistical data collected for a stream identifier by using the command line
At the command prompt, type:
stat stream identifier <name> [<pattern> ...] [-detail] [-fullValues] [-
ntimes <positive_integer>] [-logFile <input_filename>] [-sortBy <sortBy> [<
sortOrder>]
Examples
Example 1 sorts the output on the BandW column, in the descending order. Example 2 sorts the output
in Example 1, on the Req column, and in the ascending order
Example 1
Example 2
To view the statistical data collected for a stream identifier by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Statistical information such as the number of times a particular URL has been accessed overall and
per client, and the total number of GET and POST requests per client can provide valuable insights
into whether any of your resources need to be expanded to meet the demand or be optimized for
delivery. To obtain such statistics, you must use an appropriate set of selector expressions, and then
use the pattern parameter in the stat stream identifier command. The grouping is based on the pattern
that is specified in the command. Grouping can be performed concurrently on the values of multiple
expressions.
In the command-line interface, you can group the output by using patterns of your choice. In the
GUI, the pattern depends on the choices you make when drilling down through the values of vari-
ous selector expressions. For example, consider a selector that has the expressions HTTP.REQ.URL,
CLIENT.IP.SRC, and HTTP.REQ.LB_VSERVER.NAME, in that order. The statistics home page displays
icons for each of these expressions. If you click the icon for CLIENT.IP.SRC, the output is based on the
patterns ?. The output displays statistics for each client IP address. If you click an IP address, the out-
put is based on the patterns * <IP address> ? and ? <IP address> * where <IP address> is the
IP address you selected. In the resulting output, if you click a URL, the pattern used is <URL> <IP
address> ?.
To group the records on the values of selector expressions by using the command line
interface
At the command prompt, enter the following command to group the records on the basis of a selector
expression:
Examples
Each example uses a different pattern to demonstrate the effect of the pattern on the out-
put of the stat stream identifier command. The selector expressions are HTTP.REQ.URL and
HTTP.REQ.HEADER(“UserHeader”), in that order. The requests contain a custom header whose name
is UserHeader. Note that in the examples, a given statistical value changes as determined by the
grouping, but the sum total of the values for a given field remains the same.
Example 1
In the following command, the pattern used is ? ?. The appliance groups the output on the values
collected for both selector expressions. The row headers consist of the expression values separated by
a question mark (?). The row with the header /mysite/mypage1.html?Ed displays statistics for requests
made by user Ed for the URL /mysite/mypage1.html.
Example 2
In the following command, the pattern used is * ?. The appliance groups the output on the values
accumulated for the second expression HTTP.REQ.HEADER(“UserHeader”). The rows display statistics
for all requests made by users Grace, Ed, and Joe.
5 Ed 8 16 0 0
6 Joe 7 2568 6 0
7 Done
Example 3
In the following command, the pattern used is ? *, which is the default pattern. The output is grouped
on the values collected for the first selector expression. Each row displays statistics for one URL.
Example 4
In the following command, the pattern used is * *. The appliance displays one set of collective statistics
for all the requests received, with no row title.
Example 5
In the following command, the pattern is /mysite/mypage1.html *. The appliance displays one set of
collective statistics for all the requests received for the URL /mysite/mypage1.html, with no row title.
To group the records on the values of selector expressions by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can flush all the records that have been accumulated for a stream identifier.
At the command prompt, enter the following commands to clear a stream session and verify the re-
sults:
Example
This example uses the stat stream identifier command first, so that a comparison can be made with
the stat stream identifier command that is used for verifying the result of the clear stream session
command.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To put the selector-identifier pair in your action analytics configuration into effect, you must associate
the pair with the point in the traffic flow at which you want to collect statistics. You can do so by
configuring a default syntax policy and referencing the stream identifier from the policy rule. You can
use compression policies, caching policies, rewrite policies, application firewall policies, responder
policies, and any other policies whose action is based on a Boolean expression.
The action analytics feature introduces a set of default syntax expressions and functions for collecting
and evaluating data. The expression ANALYTICS.STREAM(<identifier_name>) is used for refer-
encing the identifier that you want to use. The expression COLLECT_STATS is used to collect statistical
data. Functions such as IS_TOP(<uint>) and IS_TOP_FREQUENTS(<uint>) are used for making
automatic, real-time traffic optimization decisions.
• **IS_TOP().** Finds if a given object is in the top of elements. For example, is the element among
the top 10 elements. When multiple elements have the count, they are considered to be similar
in nature. The sort function must be turned on to avoid an undef condition.
• **IS_TOP_FREQUENTS().** Finds if a given object is in the top of the elements that are in the top
elements. For example, is the element among the top 50% of all the top elements maintained.
Elements having the same values are considered similar in nature. The sort function must be
turned on to avoid an undef condition.
It is your policy configuration that determines whether the NetScaler appliance must only collect data
from traffic or also perform an action. If the appliance must only collect statistical data, you can con-
figure a policy with the rule ANALYTICS.STREAM().COLLECT_STATS and the action NOOP. The NOOP
policy must be the policy with the highest priority at the bind point. This policy is sufficient if you are
only collecting statistics. Traffic optimization decisions, such as what to compress or cache, must be
based on manual, periodic evaluation of the statistical data.
If, in addition to collecting statistics, the appliance must also perform an action on the traffic, you must
configure the gotoPriorityExpression parameter of the NOOP policy such that another policy that has
the desired rule and action is evaluated subsequently. This second policy must have a rule that begins
with the ANALYTICS.STREAM() prefix and a function that evaluates the data.
Following is an example of two responder policies that are configured and bound globally. The policy
responder_stat_collection enables the appliance to collect statistics based on the identifier, myiden-
tifier. The policy responder_notify evaluates the data that is collected.
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
March 7, 2019
Contributed by:
C
Your web site, application, or file hosting service has finite network and server resources available to it
to serve all its users. One of the most important resources is bandwidth. Substantial bandwidth con-
sumption by only a subset of the user base can result in network congestion and reduced resource
availability to other users. To prevent network congestion, you might have to limit a client’s band-
width consumption by using temporary service denial techniques such as responding to a client re-
quest with an HTML page if it has exceeded a preconfigured bandwidth value over a fixed time period
leading up to the request.
In general, you can regulate bandwidth consumption either per client device or per user. This use
case demonstrates how you can limit bandwidth consumption per client to 100 MB over a time period
of one hour. The use case also demonstrates how you can regulate bandwidth consumption per user
to 100 MB over a time period of one hour, by using a custom header that provides the user name. In
both cases, the tracking of bandwidth consumption over a moving time period of one hour is achieved
by setting the interval parameter in the stream identifier to 60 minutes. The use cases also demon-
strate how you can import an HTML page to send to a client that has exceeded the limit. Importing an
HTML page not only simplifies the configuration of the responder action in these use cases, but also
simplifies the configuration of all responder actions that need the same response.
To limit bandwidth consumption per user or client device by using the command line interface
In the command-line interface, perform the following tasks to configure action analytics for limiting a
client’s or user’s bandwidth consumption. Each step includes sample commands and their output.
1. Set up your load balancing configuration. Configure load balancing virtual server mysitevip,
and then configure all the services that you need. Bind the services to the virtual server. The
following example creates ten services and binds the services to mysitevip.
7 .
8 .
9 .
10 service ”service10” added
11 Done
12 > bind lb vserver vserver1 service[1-10]
13 service ”service1” bound
14 service ”service2” bound
15 service ”service3” bound
16 .
17 .
18 .
19 service ”service10” bound
20 Done
2. Configure the stream selector. Configure one of the following stream selectors:
• To limit bandwidth consumption per client, configure a stream selector that identifies the
client IP address.
• To limit bandwidth consumption per user on the basis of the value of a request header
that provides the user name, configure a stream selector that identifies the header. In the
following example, the name of the header is UserHeader.
3. Configure a stream identifier. Configure a stream identifier that uses the stream selector. Set
the interval parameter to 60 minutes.
4. Configure the responder action. Import the HTML page that you want to send to users or
clients that have exceeded the bandwidth consumption limit, and then use the page in respon-
der action crossed_limits.
3
4 Done
5 > add responder action crossed_limits respondwithhtmlpage crossed-
limits.html
6 Done
5. Configure the responder policies. Configure responder policy myrespol1 with the rule ANA-
LYTICS.STREAM(“myidentifier”).COLLECT_STATS and the action NOOP. Then, configure policy
myrespol2 for determining whether a client or user has crossed the 100 MB limit. The policy
myrespol2 is configured with the responder action crossed_limits.
6. Bind the responder policies to the load balancing virtual server. The policy myrespol1, which
only collects statistical data, must have the higher priority and a GOTO expression of NEXT.
7. Test the configuration. Test the configuration by sending test HTTP requests, from multiple
clients or users, to the load balancing virtual server and using the stat stream identifier com-
mand to view the statistics that are collected for the specified identifier. The following output
displays statistics for clients.
12 Done
13 >
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
An AppExpert application is a collection of configuration information that you set up on the NetScaler
appliance for securing and optimizing traffic for a Web application, such as Microsoft SharePoint. Man-
aging AppExpert applications is simplified by a graphical user interface (GUI) that allows you to specify
application traffic subsets and a distinct set of security and optimization policies for processing each
traffic subset. Additionally, it consolidates all deployment tasks in one view, so you can quickly con-
figure target IP addresses for clients and specify host servers.
Prebuilt application templates for widely used Web applications, such as Microsoft Outlook Web Ac-
cess and Microsoft SharePoint, are available on the AppExpert Templates page of the Citrix Commu-
nity website at “http://community.citrix.com/display/ns/AppExpert+Templates.”
Each prebuilt template provides you with an initial configuration for managing the associated Web
application. You can customize prebuilt application templates for your organization. If a prebuilt
application template does not suit your requirements, you can create a custom application without
using a template.
Regardless of whether you use a prebuilt application template or you create a custom application,
you can export the configuration to a template file. You can then share the template with other ad-
ministrators or import the template to other NetScaler appliances that require a similar AppExpert
application configuration.
To get started with an AppExpert application, you must first obtain the appropriate application tem-
plate and import the template to the NetScaler appliance. After the AppExpert application is set up,
you must verify that the application is working correctly. If required, you can customize the configu-
ration to suit your requirements.
Periodically, you can verify and monitor the configuration by viewing the hit counters for various appli-
cation components, statistics, and the Application Visualizer. You can also configure authentication,
authorization, and auditing (AAA) policies for the application.
Following are the terms used in the AppExpert applications feature and the descriptions of the entities
for which the terms are used:
Public endpoint. The IP address and port combination at which the NetScaler appliance receives
client requests for the associated web application. A public endpoint can be configured to receive
either HTTP or secure HTTP (HTTPS) traffic. All client requests for the web application must be sent
to a public endpoint. An AppExpert application can be assigned multiple endpoints. You configure
public endpoints after you import a template.
Application unit. An AppExpert application entity that processes a subset of web application traffic
and load balances a set of services that host the associated content. The subset of traffic that an appli-
cation unit must manage is defined by a rule. Each application unit also defines its own set of traffic
optimization and security policies for the requests and responses that it manages. The NetScaler ser-
vices associated with these policies are Compression, Caching, Rewrite, Responder, and application
firewall.
By default, every AppExpert application with at least one application unit includes a default applica-
tion unit, which cannot be deleted. The default application unit is not associated with a rule for iden-
tifying requests and is always placed last in the order of application units. It defines a set of policies
for processing any request that does not match the rules that are configured for the other application
units, thereby ensuring that all client requests are processed.
Application units and their associated rules, policies, and actions are included in AppExpert applica-
tion templates.
Service. The combination of the IP address of the server that hosts the web application instance and
the port to which the application is mapped on the server, in the format <IP address>:<Port>. A web
application that serves a large number of requests is usually hosted on multiple servers. Each server
is said to host an instance of the web application, and each such instance of the web application is rep-
resented by a service on the NetScaler appliance. Services are deployment-specific and are therefore
not included in templates. You must configure services after you import a template.
Application unit rule. Either a classic expression or a default syntax expression that defines the char-
acteristics of a traffic subset for an application unit. The following example rule is a default syntax
expression that identifies a traffic subset that consists of four image types:
HTTP.REQ.URL.SUFFIX.EQ(“bmp”)
HTTP.REQ.URL.SUFFIX.EQ(“gif”)
HTTP.REQ.URL.SUFFIX.EQ(“png”)
HTTP.REQ.URL.SUFFIX.EQ
For more information about default syntax expressions and classic policy expressions, see Policies
and Expressions.
Traffic Subset. A set of client requests that require a common set of traffic optimization and security
policies. A traffic subset is managed by an application unit and is defined by a rule.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
When the endpoint receives a client request, the NetScaler appliance evaluates the request against the
rule that is configured for the topmost application unit. If the request satisfies this rule, the request is
processed by the policies that are configured for the application unit, and then forwarded to a service.
The choice of service depends on which services are configured for the application, and on settings
such as the load balancing algorithm and persistence method configured for the application unit.
If the request does not satisfy the rule, the request is evaluated against the rule for the next topmost
application unit. In this order, the request is evaluated against each application unit rule until the
request satisfies a rule. If the request does not satisfy any of the configured rules, it is processed by
the default application unit, which is always the last application unit.
You can configure multiple public endpoints for an AppExpert application. In such a configuration,
by default, each application unit processes requests received by all the public endpoints and load
balances all the services that are configured for the application. However, you can specify that an
application unit processes traffic from only a subset of the public endpoints and load balances only a
subset of the services that are configured for the AppExpert application.
The following flow diagram illustrates the AppExpert Application flow sequence for using a built-in
application template.
If you prefer to create a customized application without using a template, do the following:
4. Import the template files to other NetScaler appliances that require a similar AppExpert appli-
cation configuration
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To get started with an AppExpert application, you must first obtain an application template and im-
port the template to a NetScaler appliance. After the AppExpert application is set up, you must verify
that the application is working correctly. If required, you can customize the configuration to suit your
requirements.
Periodically, you can verify and monitor the configuration by viewing the hit counters for various appli-
cation components. You can also configure authentication, authorization, and auditing (AAA) policies
for the application.
If you prefer to set up the application by using a prebuilt application template, do the following:
NetScaler’s video tutorials enable you to understand NetScaler features in easy and simple way. Watch
https://www.youtube.com/watch?v=aqayflvCR_0 video to learn how to set up an application using
AppExpert Application template.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
AppExpert application setup begins with downloading an application template from the Citrix Com-
munity Web site at http://community.citrix.com/display/ns/AppExpert+Templates to your local com-
puter or NetScaler appliance. The application templates are designed to be imported and exported,
so that you can easily share application-specific configurations within an organization or across orga-
nizations. An application template includes the following set of entities:
1. Application components (for example, web pages, files, archives, and web services)
2. Traffic management entities (for example, virtual server IP addresses and associated load-
balancing algorithms, and SSL offload settings) for the application components.
3. NetScaler policies used for optimizing the application traffic.
Note: Application templates are available in different versions for configuring different types of
NetScaler appliances.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For NetScaler software version 9.3 or later, each AppExpert template has two XML files: a Template file
and a Deployment file. You must import both files from your local computer to a NetScaler appliance.
You can either import the template files from your computer to the AppExpert application templates
directory in NetScaler appliance or upload files to a NetScaler appliance and then import them from
the appliance.
Note: When you import a template from an appliance, you have to provide the variable value
available in the template. By default, the pre-configured value is display https://docs.citrix.
com/en-us/netscaler//11/appexpert/appexpert-application-templates/creating-
managing-templates/netscaler-application-template-deployment-files.html
After you import the template files, the application-configuration and deployment information popu-
lates the target application automatically. The appliance imports all the configuration from the tem-
plate files through the NITRO API. If you do not import the deployment file, the system generates an ap-
plication populated with content switching virtual server configuration. For more information about
the format of application templates and deployment files, see Understanding NetScaler Application
Templates and Deployment Files.
When you import a template, if you do not include a deployment file, you have to configure the public
endpoints in the application that the system automatically generates from the template. One end-
point for HTTP and another endpoint for HTTPS. When configuring a public endpoint of type HTTPS,
make sure you enable the SSL feature, bind the server certificate, and include the server-certificate
and certificate-key files.
For more information about configuring endpoints after you import a template, see Configuring Public
Endpoints.
To import AppExpert application template files to a NetScaler appliance by using the GUI:
NetScaler’s video tutorials enable you to understand NetScaler features in an easy and simply way.
Watch https://www.youtube.com/watch?v=AR9TwSD9uJM video to learn how to import an applica-
tion template.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
The GUI includes icons that indicate the states of the entities in the AppExpert application. These
icons are displayed for applications and application units and are based on the health checks that the
NetScaler appliance performs periodically on services and entities. The following table lists the icons
and describes their meanings.
You must ensure that the icons for each application and its application units are green at all times. If
the icon that is displayed for an application is not green, verify that you have configured the public
endpoints correctly. If the icon that is displayed for an application unit is not green, verify that the
services are configured correctly. However, note that a green indicator does not mean that the state
of all associated entities is UP. It only means that the application has sufficient resources (endpoints
and services) to serve client requests. To verify that the state of all associated entities is UP, check the
health of all the entities on the statistics page for the application.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you verify that the AppExpert application is working correctly, you can customize the configura-
tion to suit your requirements.
After you verify that the AppExpert application configuration is working correctly, you can configure
the application and the deployment settings to suit your requirements. When you import an applica-
tion template and deployment file, the system automatically populates the target application with the
available configuration settings (such as application units, application unit rules, policies, persistence
settings, load balancing methods, profiles, and traffic settings). In this application, you can configure
deployment settings such as public endpoints, services, and service groups for each traffic subset. If
you want the AppExpert application to manage a traffic subset that is not included in the template,
you can either add an application unit for a traffic subset or modify the existing application unit. After
you customize the configuration, you can also specify the order of evaluation for each traffic subset
that the application manages.
Also, you can configure the policies that the template provided. If the AppExpert application template
does not include policies for a particular NetScaler feature, such as Rewrite or application firewall, you
can configure your own policies.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If you did not specify a public endpoint when importing an AppExpert application, you can specify
public endpoints after you create the application. You can configure one public endpoint of type HTTP
and one public endpoint of type HTTPS for your AppExpert application.
If endpoints are already configured for the application, you can dissociate endpoints from the AppEx-
pert application and delete any endpoints that you no longer need. Note that when you dissociate
a public endpoint from the AppExpert application, the endpoint is automatically unbound from the
associated application unit, but it is not deleted from the system.
For more information about the parameters in the Configure Public Endpoint dialog box, see Content
Switching.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you configure a service or service group, you either modify an existing service or service group,
or add new services to the AppExpert application. You add services or service groups if you did not
specify them when you imported the application template. You also add services and service groups
when you increase the number of servers that host instances of the application. You can configure a
service and service group for an application unit only after you configure the service or service group
for the AppExpert application.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You might need to add application units for traffic subsets that are either specific to your web appli-
cation implementation or not defined in the template. When creating an application unit, you must
configure a rule for the application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You might want to configure an application unit rule to include or exclude certain types of traffic. When
you configure the rule, you can also define the syntax of the expression.
1. In the navigation pane of the GUI, expand AppExpert, and then click Applications.
2. In the details pane, right-click the application unit for which you want to modify the rule, and
then click Open.
3. In the Configure Application Unit dialog box, do the following:
a) To specify the format of the new expression, do one of the following:
• To specify that you want to configure a classic expression in the Rule box, click Classic
Syntax.
• To specify that you want to configure an advanced expression in the Rule box, click
Default Syntax.
b) In the Rule box, configure the expression.
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For an AppExpert application, you can configure policies for Compression, Caching, Rewrite, Respon-
der, and Application Firewall. The templates that you download from the Citrix Community web site
provide you with a set of policies that fulfill the most common application management requirements.
You might want to fine-tune or customize these policies. If the set of policies provided for a given ap-
plication unit does not include policies for a particular feature, you can create and bind your own
policies for that feature.
If you create an AppExpert application without using a template, you must configure all the policies
that the web application needs.
The GUI uses various icons to indicate whether or not policies are configured for a feature. For an
application unit, if a policy is configured for a given feature, an icon that represents the feature is
displayed. For example, if a compression policy is configured for an application unit, a compression
icon is displayed in the Compression column for the application unit. For features for which no policy
is configured, an icon depicting a plus sign (+) is displayed.
Note: When configuring policies for application units, you might need to configure policies and ex-
pressions that are either in the classic or
default syntax. Additionally, when you configure
default syntax policies, you might need to specify parameters such as Goto expressions and invoke
policy banks.
For information about configuring policies and expressions in both formats, see Policies and Expres-
sions.
You can use either classic policies or advanced policies to configure compression, but you cannot bind
compression policies of both types to the same application unit.
To configure a compression policy for an application unit:
1. Navigate to AppExpert > Applications.
2. In the details pane, in the row for the application unit you want to configure, click the icon pro-
vided in the Compression column.
3. In the Configure Compression Policies dialog box, do one or more of the following, depending
on the configuration tasks you want to perform:
• Click Switch to Default Syntax if you want to configure a default syntax compression policy.
If you want to bind or configure classic compression policies, and if you are in the default
syntax view, you can click Switch to Classic Syntax to return to the classic policy view and
begin modifying bound classic policies or create and bind new classic compression poli-
cies.
Important: This setting also determines what policies are displayed when you want to in-
sert a policy. For example, if you are in the
default syntax view, when you click
Insert Policy, the list that appears in the
Policy Name column will include only
default syntax policies. You cannot bind policies of both types to an application unit.
• If you want to configure classic policies, click either Request or Response, depending on
whether you want the policy to be evaluated at request-time or at response-time.
You can configure both request-time and response-time classic compression policies for
an application unit. After evaluating all of the request-time policies, if no match is found,
the appliance evaluates response-time policies.
• To modify a compression policy that is already bound to the application unit, click the
name of the policy, and then click Modify Policy. Then, in the Configure Compression Pol-
icy dialog box, modify the policy, and then click OK.
For information about modifying a compression policy, see Compression.
• To unbind a policy, click the name of the policy, and then click Unbind Policy.
• To modify the priority assigned to a policy, double-click the priority value, and then enter
a new value.
• To regenerate assigned priorities, click Regenerate Priorities.
• To insert a new policy, click Insert Policy and, in the list that is displayed in the Policy
Name column, click New Policy. Then, in the Create Compression Policy dialog box,
configure the policy, and then click Create.
For information about modifying a compression policy, see Compression.
• If you are configuring a default syntax expression, do the following:
– In the Goto Expression column, select a Goto expression.
– In the Invoke column, specify the policy bank that you want to invoke if the current
policy evaluates to TRUE.
4. Click Apply Changes, and then click Close.
You can use only default syntax policies and expressions to configure Caching policies.
You can use only default syntax policies and expressions to configure Rewrite policies.
You can use only default syntax policies and expressions to configure Responder policies.
You can configure both classic and default syntax policies and expressions for Application Firewall.
However, if a policy of one type is already bound globally or to a virtual server that is configured on
the appliance, you cannot bind a policy of the other type to an application unit. For example, if a
default syntax policy is already bound either globally or to a virtual server, you cannot bind a classic
policy to an application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Note: You cannot modify the name and rule expression for an existing application unit.
NetScaler’s video tutorials enable you to understand NetScaler features in an easy and simple way.
Watch <https://www.youtube.com/watch?v=bJ5_i8fV2hc> video to learn how configure an
application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
NetScaler’s video tutorials enable you to understand NetScaler features in an easy and simply way.
Watch <https://www.youtube.com/watch?v=z4v-edQiVpw> video to learn how to configure a
public endpoint.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Application unit rules are evaluated in the order in which they are placed in the GUI. The rule that
is configured for the topmost application unit is always configured first, followed by the rule that is
configured for the second topmost application unit, and so on. The default application unit is always
evaluated last.
When a request matches the rule that is configured for an application unit, the request is processed
by the application unit, and no further matching is performed. Therefore, the order of evaluation of
application units becomes an important factor if the traffic subsets for two or more application units
overlap. If the traffic subsets for two or more application units overlap, you must specify the order in
which an incoming request is matched against the application unit rules.
1. Navigate to AppExpert > Applications, select an application and click Edit. In the Application
Unit section, click the Pencil icon and then hover the cursor over the check box to the left of the
name of the application unit. Click the icon that appears next to the check box and hold down
the mouse to drag the application up or down to a new location in the priority list.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure a persistency group for the application units in an AppExpert application. In the
context of an AppExpert application, a persistency group is a group of application units that you can
treat as a single entity for the purpose of applying common persistence settings. When the application
is exported to an application template file, the persistency group settings are included, and they are
automatically applied to the application units when you import the AppExpert application.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The Visualizer feature shows you a graphical representation of an application’s configuration. It in-
cludes the name of the public endpoint, application units assigned to the public endpoint, and the
number of policies and services bound to the application. You can use the Visualizer to obtain a visual
overview of an AppExpert application’s configuration and configure some of the displayed entities. By
default, the Visualizer displays application units, services, and monitors for the selected application.
1. Navigate to AppExpert > Applications, select an application entity, and click Visualizer.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure authorization for users and groups to enable then to access an AppExpert appli-
cation. If the AAA user or group for which you want to configure permissions has not already been
created, you can create it from AppExpert and then configure permissions for application access.
To configure AAA users and AAA user groups for an application by using the configuring utility
1. Navigate to AppExpert > Applications, select an application entity, and then click Edit.
2. In the Advanced Settings section, click Authorization, and configure authorized users and user
groups.
3. Click the AAA user section to bind authorized users to the application.
4. In the AAA User slider, set the parameters .
5. Click Continue, and then click Authorization Policies in the Advanced Settings section.
6. In the Authorization Policy slider, bind an authorization policy to the application.
7. Click Continue, and then click the Authorization Group section in the Advanced Settings sec-
tion.
8. In the AAA Group Binding slider, bind an authorization user group to the application.
9. Click Continue, and then click Policies in the Advanced Settings section.
10. In the Policies **slider, bind an **Audit Syslog or** Audit NSlog** policy to the application.
11. Click Continue and then Done.
To edit AAA users and AAA user groups for an application by using the GUI:
Navigate to AppExpert > Applications > Advanced Settings and click Authorization. Then click the
edit icon and specify values for user or user-group authorization settings.
To delete AAA users and AAA user groups by using the GUI:
Navigate to AppExpert > Applications, select an application and click Edit. In the Applications page,
click Advanced Settings and click Authorization. Click the delete icon next to the entity.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you customize the AppExpert application, you can view application statistics to make sure that
the application and all its entities are working correctly. You can also use the Application Visualizer to
monitor statistics associated with certain entities such as policies and virtual servers.
You can also view the hit counters for various entities at regular intervals to make sure that counters
are being updated.
In the Applications node, you can select an application and view the Statistics page for the applica-
tion. On the Statistics page, you can monitor the health and states of public endpoints and application
units, and view the following statistical information:
• Requests and responses per second for each of the public endpoints and application units.
• Bytes per second, at each endpoint, for incoming and outgoing traffic.
• Application unit hit counters and the number of client and server connections for each applica-
tion unit.
• Statistics for the services that are bound to the application units.
On the Statistics page, you can also view CPU usage, memory usage, and system logs.
You can use the Application Visualizer to monitor the number of requests received per second at a
given point in time by the vservers and the number of hits per second at a given point in time for
Rewrite, Responder, and Cache policies.
To view statistical information for vservers, Rewrite policies, Responder policies, and Cache policies
in the Visualizer:
Viewing Hits
The hit counters that are provided for various AppExpert application entities enable you to monitor the
functioning of public endpoints and application units. For an application, the Hits dialog box displays
the total number of requests received by each configured public endpoint. For an application unit,
the Hits dialog box displays the number of requests that the application unit processed from each of
the public endpoints and the total hit count. For instructions on viewing hit counters, see Verifying
and Testing the Configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Deleting an Application
Contributed by:
C
If you no longer need an application and its application units, you can delete it. When you delete an
AppExpert application, backend services are not deleted, and any public endpoints that the applica-
tion used become available for use by other applications.
When deleting an application, you are also prompted to specify whether you want to delete any bound
policies and actions that are not used elsewhere.
Navigate to AppExpert > Applications, select an application and click Edit. In the Application Unit
section, click the delete icon next to the entity
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure Authentication, Authorization, and Auditing (AAA) for the applications that you con-
figure on the appliance. An authentication policy that is configured for an application defines the type
of authentication to apply when a user or group attempts to access the application. If external authen-
tication is used, the policy also specifies the external authentication server. Authorization policies
configured for an application specify whether a particular user or group can access the application.
Auditing policies define the audit log type, the level at which logging is performed, and other audit
server settings. Authentication and auditing policies use the classic policy format.
Authentication policies, authorization policies, and auditing policies can be configured in any order.
However, before you configure AAA for an application, you must configure a public endpoint for the
application.
You can configure authorization for users and groups to enable then to access an AppExpert appli-
cation. If the AAA user or group for which you want to configure permissions has not already been
created, you can create it from AppExpert and then configure permissions for application access.
Groups node in the application tree. Then, right-click the user or group and click Allow.
• If the AAA user or group for which you want to configure permissions is not configured on
the appliance, in the application tree, right-click Users or Groups, and then click Add. In
the Create AAA Group or Create AAA User dialog box, fill in the values, click Create, and then
click Close.
The user or group is created with the permission set to Allow. To change the permission
setting, right-click the group or user, and then click the permission setting.
5. Click Done and then click Close.
When you configure auditing policies for an application, you must specify the server to which the log
messages must be directed, the format of the messages logged, and the log level. Optionally, you can
configure other settings, such as the log facility and date format. Auditing policies are automatically
bound to all the AppExpert application’s public endpoints.
After you configure AAA for an application, you can disable the AAA configuration for that application.
When you disable AAA for an application, the configuration is not lost. You can enable AAA for the
application when you want to reapply the configuration.
To enable or disable AAA for an application:
1. Navigate to AppExpert > Applications.
2. In the details pane, click the application for which you want to enable or disable AAA, and then
do one of the following:
3. To disable AAA for the application, click Turn Off AAA.
4. To enable AAA for the application, click Turn On AAA.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
After you create the application and application units and configure policies, you must verify the con-
figuration and test it to make sure that it is working correctly, just as you would when you configure
an application by using a prebuilt AppExpert application template. Then, you must monitor the appli-
cation to make sure that the application and its entities are working correctly.
Creating an Application
When you create an AppExpert application, the appliance creates a container to which you can add
application units. The default application unit is not created until you create the first application unit.
For each subset of traffic associated with your web application, you must create an application unit.
To create an application unit for the AppExpert application by using the GUI:
After you have created all the application units that you require, you must configure one or more public
endpoints to enable clients to access the web application through the NetScaler appliance.
• If you want to create a new public endpoint, click Add. Then, in the Create public endpoint
dialog box, configure endpoint settings, and then click OK.
In the Create public endpoint dialog box, you can specify only the name, IP address, port,
and protocol for the endpoint. You can specify additional endpoint settings after you cre-
ate the public endpoint. To specify additional endpoint settings, after you create the end-
point, in the Choose Public Endpoints dialog box, click the endpoint, and then click Open.
Then, in the Configure Public Endpoint dialog box, provide additional settings, and then
click OK.
For more information about the parameters in the Create public endpoint and Configure
Public Endpoint dialog boxes, see Content Switching.
• If you want to modify a public endpoint, click the endpoint, and then click Open. Then, in
the Configure Public Endpoint dialog box, modify settings for the endpoint, and then click
OK.
For more information about the parameters in the Configure Public Endpoint dialog box,
see Content Switching.
4. Click Close.
For an application unit, you specify public endpoints in the same way as you would specify public
endpoints for an application that is created from an AppExpert application template. For more infor-
mation about specifying a subset of the endpoints for an application unit, see Configuring Endpoints
for an Application Unit.
To configure endpoints for an application unit by using the GUI:
1. Navigate to AppExpert > Applications.
2. In the details pane, right-click the application unit for which you want to specify public end-
points, and then click Configure Public Endpoints.
3. In the Choose Public Endpoints dialog box for the application unit, do one of the following:
• If you are specifying endpoints for the application unit for the first time, clear the check
boxes that correspond to the endpoints that you do not want to be bound to the applica-
tion unit.
• If you want to specify endpoints that are listed in the dialog box but not currently bound
to the application unit, click the corresponding check boxes.
4. Click OK.
Services and service groups are available for application units only after you configure the services
and service groups for the AppExpert application. Therefore, you must configure services and service
groups for the AppExpert application before you configure the services for the application units. All
the services and service groups that you configure for an AppExpert application must use the same
protocol (either HTTP or HTTPS). The procedure for configuring services and service groups for an
AppExpert application that is not created from a template is the same as that for an application created
from a template.
To configure a service or service group for the AppExpert application by using the GUI:
1. Navigate to AppExpert > Applications.
2. In the details pane, right-click the application for which you want to configure services or service
groups, and then click Configure Backend Services.
3. In the Configure Backend Services dialog box, do one of the following:
• To configure services, click the Services tab.
• To configure service groups, click the Service Groups tab.
4. On the Service or Service Groups tab, do one of the following:
• If the services or service groups that you want are listed on the tab, click the corresponding
check boxes.
• If you want to specify all the services or service groups, click Activate All.
• If you want to create a new service or service group, click Add. Then, in the Create Service
dialog box or Create Service Group dialog box, configure settings for the service or service
group, respectively, and then click Create.
• If you want to modify a service, click the service, and then click Open. Then, in the Config-
ure Service dialog box or Create Service Group dialog box, configure settings for the service
or service group, respectively, and then click OK.
For information about the settings in the Create Service, Configure Service, and Create Service Group
dialog boxes, see Load Balancing.
After you configure services and service groups, you must configure services and service groups for
each application unit. However, this step is not necessary if each backend service hosts all the content
associated with the web application. You configure services and service groups for an application unit
if the content associated with the application unit is hosted on only a subset of the backend servers.
To configure services or service groups for an application unit by using the GUI:
1. Navigate to AppExpert > Applications.
2. In the details pane, right-click the application unit for which you want to configure a service or
service group, and then click Configure Backend Services.
3. In the Configure Backend Services dialog box, do one of the following:
• To configure services, click the Services tab.
• To configure service groups, click the Service Groups tab.
Configuring Policies
The procedures for configuring policies for an AppExpert application that is created without using a
template are the same as those for an AppExpert application that was created from a template. For
more information, see Configuring Policies for Application Units.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you set up an AppExpert application and customize it to suit your requirements, you can create
a template from the configuration and then share the template with other administrators. Or, you can
create a template and then import the template to other NetScaler appliances that require a similar
AppExpert application configuration. This simplifies and expedites the process of setting up similar
applications on other appliances.
AppExpert application template files can be exported either to the template directory on the NetScaler
appliance or to a folder on your local computer. You can then upload and download the templates to
and from the NetScaler appliance and rename the templates that are stored in the AppExpert applica-
tion templates directory on your appliance.
AppExpert application template files can be exported either to the template directory on the NetScaler
appliance or to a folder on your local computer. You can then upload and download the templates to
and from the NetScaler appliance and rename the templates that are stored in the AppExpert applica-
tion templates directory on your appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
1. Navigate to AppExpert > Application, select an application entity, and then click Edit.
2. On the Applications page, click the Export as a Template link to export the application config-
uration and deployment settings as a template.
3. In the Export Application slider, set the following parameters:
a) Template Filename
b) Deployment Filename
4. Click Continue and Done.
5. Navigate to AppExpert > Application and click Manage Templates to show the exported con-
figuration as files on the Template File and Deployment File tabs.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can also export a content switching configuration as an application template. You can export
a content switching virtual server configuration to an application template either from the Content
Switching Virtual Servers pane or from the Content Switching Visualizer. Configuration information,
which includes the content switching virtual server, all associated load balancing virtual servers, ser-
vices, service groups, and policies, is exported to a template file and all deployment-specific infor-
mation is exported to a deployment file. The string “_deployment” is automatically appended to the
name of the template file to create the name of the deployment file. Both files are in XML format. If you
choose to export the application template file to the NetScaler appliance, the template file is stored
in the /nsconfig/nstemplates/applications directory on the NetScaler appliance and the deployment
file is stored in the /nsconfig/nstemplates/applications/deployment_files/ directory.
For more information about the format of application templates and deployment files, see Under-
standing NetScaler Application Templates and Deployment Files. The configuration information that
is exported includes the content switching virtual server, all associated load balancing virtual servers,
services, service groups, and policies.
However, if the content switching virtual server is already configured as the public endpoint for an
AppExpert application, you cannot export the configuration to a template file . In this scenario, you
must export the associated AppExpert application to a template.
For more information about exporting an AppExpert application to a template file, see Exporting an
AppExpert Application to a Template File.
To export a content switching configuration to an application template file from the Content Switching
Visualizer by using the GUI:
• To export the template file to your computer, click the Browse (Appliance) drop-down
menu, click Local, browse to the location to which you want to save the file, and then
click Save.
5. Provide the following information:
• Introduction Description—Any text that introduces the AppExpert application template
during import. This text is displayed on the Specify Application Name page of the AppEx-
pert Template Wizard when the template is imported.
• Summary Description—Any summary that you might want to display on the Summary
page of the AppExpert Template Wizard when the template is imported.
• Author—The name of the author of the template.
• Major—The major version number of the template.
• Minor—The minor version number of the template. This number is appended to the major
version number and displayed on the Summary page of the AppExpert Template Wizard,
during import, in the format Major.Minor.
6. Click OK.
To export a content switching configuration to an application template file from the Content Switching
Virtual Servers pane by using the GUI:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Application templates support the declaration of variables in the policy expressions and actions that
are configured for an application. The ability to declare variables in policy expressions and actions en-
ables you to replace preconfigured values in expressions (for example, configurable parameters such
as the host name of a server or the target for a Rewrite action) with values that suit the environment
into which you are importing the template. If variables have been configured for an AppExpert ap-
plication template, the AppExpert Template Wizard, which appears when you import an AppExpert
application template, includes a Specify Variable Values page on which you can specify appropriate
values for the variables that are configured for the template.
As an example, consider the following policy expression that is configured to evaluate the value of the
Host header in an HTTP request:
1 HTTP.REQ.HEADER(”Host”).CONTAINS(”server1”)
If you want the server name to be configurable at import time, you can specify the string “server1” as
a variable. When importing the template, you can specify a new value for the variable on the Variables
tab.
After you create a variable, you can do the following:
• Assign additional strings to an existing variable. After you create a variable for a string, you can
select and assign other parts of the same or different expression to the variable. The strings you
assign to a variable need not be the same. At import time, all the strings that are assigned to
the variable are replaced with the value that you provide.
• View the string or strings that are assigned to the variable.
• View a list of all the entities and parameters that use the variable.
In the export application template wizard, you can define variables in certain fields (fields with an
adjacent button) for the following entities:
• Cache policies
• Rewrite policies
• Rewrite actions
• Responder policies
• Responder actions
To configure a variable in a policy expression or action by using the GUI:
1. Navigate to AppExpert > Applications.
2. In the details pane, right-click the application that you want to export to a template file, and
then click Export.
3. In the Export…as Template dialog box, modify the default template file name if required, specify
the location where you want to save the template, and then click Configure Variables.
4. In the Configure Variables dialog box, click the tab that lists the policy expression or action for
which you want to configure a variable, select the expression, and then click Configure Vari-
ables.
5. In the Variables dialog box, click the button next to the expression or value in which you want
to create a variable.
• To create a variable, in the text box that displays the configured expression or value, se-
lect the string that you want to be configurable at import time, and then click Add. In the
Add Variable dialog box, specify a name and a description for the variable, and then click
Create.
• The name of the variable, its value, and the description you provided appear in the Avail-
able Variables listing in the dialog box. The name you provide will be the name of the
associated field in the template import wizard, and the description will appear as alt text
when the user positions the mouse pointer over the field.
• To modify a variable, in the Available Variables list, click the variable, and then click Open.
In the Add Variable dialog box, modify the value and the description, and then click OK.
• To view all the strings that are assigned to a given variable, in the Available Variables listing,
click the name of the variable. The strings that are assigned to the variable are highlighted.
• To view a list of all the entities and parameters in which the variable is used, in the Available
Variables listing, click the variable whose references you want to view, and then click Show
References.
• To assign a string to an existing variable, in the text box that displays the expression you
configured, select the string you want to assign to an existing variable, right-click the se-
lection, click Use Existing Selection, and then click the name of the variable to which you
want to assign the string.
If a variable has multiple strings assigned to it, when you specify a new value for the vari-
able during import, all strings assigned to the variable are replaced with the new value.
7. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Template files can be uploaded from your local computer to the NetScaler appliance or downloaded
from the appliance to your local computer. On the appliance, AppExpert application templates are
always stored in the AppExpert application templates directory, which is
/nsconfig/nstemplates/applications/.
To upload an AppExpert application template from your local computer to the NetScaler appliance:
1. Navigate to AppExpert > Templates.
2. In the details pane, click Manage Templates.
3. In the Manage Application Templates dialog box, click Application Templates, and then click
Upload.
4. In the Upload Application Template dialog box, browse to the directory in which the template
file is stored, click the template file, and then click Select.
The template file is uploaded to the AppExpert application template directory on the appliance.
To download an AppExpert application template from the NetScaler appliance to your local computer:
1. Navigate to AppExpert > Templates.
2. In the details pane, click Manage Templates.
3. In the Manage Application Templates dialog box, click the AppExpert application template that
you want to download, and click Download.
4. In the Download Application Template dialog box, browse to the location to which you want
to save the file, and then click Save.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Note: After you export a NetScaler application, you can add elements, remove elements, and modify
existing elements before importing the application to a NetScaler appliance.
Following is an example of a template file that was created from a NetScaler application called Share-
Point_Team_Site:
29 .
30 .
31 .
32 </rewriteaction_list>
33 <rewritepolicy_list>
34 <rewritepolicy>
35 <name>Rw_number_NA</name>
36 <rule>HTTP.REQ.BODY(100000).CONTAINS(”admin”)</rule>
37 <action>Rw_name</action>
38 </rewritepolicy>
39 <rewritepolicy>
40 .
41 .
42 .
43 </rewritepolicy>
44 .
45 .
46 .
47 </rewritepolicy_list>
48 </rewrite>
49 <appunit_list>
50 <appunit>
51 <name>SharePoint_Team_Sitedefault</name>
52 <rule />
53 <expressiontype>PE</expressiontype>
54 <servicetype>HTTP</servicetype>
55 <ipv46>0.0.0.0</ipv46>
56 <ipmask>*</ipmask>
57 <port>0</port>
58 <range>1</range>
59 <persistencetype>NONE</persistencetype>
60 <timeout>2</timeout>
61 <persistencebackup>NONE</persistencebackup>
62 <backuppersistencetimeout>2</backuppersistencetimeout>
63 <lbmethod>LEASTCONNECTION</lbmethod>
64 <persistmask>255.255.255.255</persistmask>
65 <v6persistmasklen>128</v6persistmasklen>
66 <pq>OFF</pq>
67 <sc>OFF</sc>
68 <m>IP</m>
69 <datalength>0</datalength>
70 <dataoffset>0</dataoffset>
71 <sessionless>DISABLED</sessionless>
72 <state>ENABLED</state>
73 <connfailover>DISABLED</connfailover>
74 <clttimeout>180</clttimeout>
75 <somethod>NONE</somethod>
76 <sopersistence>DISABLED</sopersistence>
77 <redirectportrewrite>DISABLED</redirectportrewrite>
78 <downstateflush>DISABLED</downstateflush>
79 <gt2gb>DISABLED</gt2gb>
80 <ipmapping>0.0.0.0</ipmapping>
81 <disableprimaryondown>DISABLED</disableprimaryondown>
82 <insertvserveripport>OFF</insertvserveripport>
83 <authentication>OFF</authentication>
84 <authn401>OFF</authn401>
85 <push>DISABLED</push>
86 <pushlabel>none</pushlabel>
87 <l2conn>OFF</l2conn>
88 </appunit>
89 <appunit>
90 .
91 .
92 .
93 </appunit>
94 .
95 .
96 .
97 </appunit_list>
98 </apptemplate>
99 <parameters>
100 <property_list>
101 <property>
102 <variable_definition_list>
103 <variable_definition>
104 <name>body_size</name>
105 <defaultvalue>10000</defaultvalue>
106 <description>Evaluation Scope</description>
107 <startindex>14</startindex>
108 <length>5</length>
109 </variable_definition>
110 .
111 .
112 .
113 </variable_definition_list>
114 <object_type>rewriteaction</object_type>
115 <object_name>Rw_name</object_name>
116 <name>target</name>
117 </property>
118 .
119 .
120 .
121 </property_list>
122 </parameters>
123 </template>
Following is the deployment file associated with the SharePoint_Team_Site application in the pre-
ceding example:
32 .
33 .
34 .
35 </service_list>
36 <variable_list>
37 <variable>
38 <name>body_size</name>
39 <description>Evaluation Scope</description>
40 <value>10000</value>
41 </variable>
42 <variable>
43 .
44 .
45 .
46 </variable>
47 .
48 .
49 .
50 </variable_list>
51 </template_deployment>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If you no longer need an application template and its configuration, you can delete it. When you delete
a template, the template XML file that is stored in the application template directory gets deleted.
When you delete a template file, you are prompted to confirm the deletion. Click Yes to confirm and
delete the selected file from the directory.
To delete a template file from the application template directory by using the GUI:
1. Navigate to AppExpert > Applications and then click Manage Template. Select a file from Tem-
plate Files tab page or Deployment Files tab page and click Delete.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you configure an AppExpert application to manage a web application through the Citrix®
NetScaler® appliance, you also create a set of application units and configure a set of traffic opti-
mization and security policies for each unit. The policies that you configure for each application
unit (policies for features such as Compression, Caching, and Rewrite) evaluate traffic that is meant
only for that unit. In addition to these policies, you might want to configure Access Gateway policies
for the application as a whole to optimize the application traffic when accessed through the Access
Gateway. The Access Gateway Applications feature enables you to configure Access Gateway policies
(Authorization, Traffic, Clientless Access, and TCP Compression) for an AppExpert application. After
you configure NetScaler Gateway policies for AppExpert applications, you can include the policy
configuration in the AppExpert application templates that you create.
You can also configure NetScaler Gateway policies for intranet subnets, file shares, and other network
resources. Finally, you can create bookmarks for AppExpert applications and certain resources if you
want users to be able to access them from the NetScaler Gateway home page.
You can configure the entities in the NetScaler Gateway Applications feature only by using the GUI.
When you create an AppExpert application in the Applications node in the GUI, a corresponding Access
Gateway application is automatically created in the Access Gateway Applications node. Additionally, a
rule that uses the AppExpert application’s configured public endpoint is automatically created for the
Access Gateway application entry. If multiple endpoints are configured for the AppExpert application,
the rule includes all the configured public endpoints. The NetScaler appliance uses this rule to apply
any configured Access Gateway policies to the traffic received at the AppExpert application’s public
endpoint. Traffic received at the AppExpert application’s public endpoint is first evaluated against the
NetScaler Gateway policies and then evaluated against the policies configured for AppExpert applica-
tion’s application units.
The rule that is created for the Clientless Access policies for an Access Gateway application is an ad-
vanced expression that also uses the public endpoint that is configured for the AppExpert application.
Therefore, before you configure NetScaler Gateway policies for an AppExpert application, you must
configure public endpoints for the AppExpert application.
When you include the NetScaler Gateway configuration in an application template, deployment-
specific information, such as IP address and port information, and the rule that is created from this
information are not included in the template.
On the NetScaler appliance, you can configure Authorization policies for a file share that is hosted on
your organization’s network.
When you create a file share, you specify a name for the file share and the network path to the file
share. In the network path, you can specify either the name of the server or the server IP address. A
rule that uses the components of the file share path is automatically created for the file share. This rule
enables the appliance to identify requests for files hosted on the file share server. Any Authorization
policies that are configured for the file share are applied to incoming requests.
The NetScaler configuration for a file share cannot be saved in AppExpert application templates.
For the intranet subnets that form a part of your network, you can configure policies for Authoriza-
tion, Traffic, and TCP Compression on the NetScaler appliance. When adding an intranet subnet, you
specify the IP address and the netmask of the intranet subnet. A rule that uses these two parameters
is automatically created for the intranet subnet. The appliance applies the configured policies to any
request that has a destination IP address and netmask set to the subnet’s IP address and netmask,
respectively.
The NetScaler configuration for an intranet subnet cannot be saved in AppExpert application tem-
plates.
The Other Resources category enables you to configure Access Gateway policies for any network re-
source by using a rule of your choice. When you configure the NetScaler appliance to process requests
for the network resource, you configure a classic expression to identify the requests that are associ-
ated with the network resource. You can configure Authorization, Traffic, Clientless Access, and TCP
Compression policies for a network resource in Other Resources. The NetScaler appliance applies the
configured NetScaler Gateway policies to any requests that match the configured rule.
The NetScaler configuration for a network resource in Other Resources cannot be saved in AppExpert
application templates.
The NetScaler Gateway Applications feature enforces a naming convention for some of the entities
that you create in this feature. For example, the names of the profiles that you create for Traffic poli-
cies for an intranet subnet always begin with a string that consists of the name of the intranet subnet
followed by an underscore (_). The name that you provide for the entity is appended to this string. If
the name of a subnet is “subnet1,” the name of the profile begins with “subnet1_.” When such a nam-
ing convention is required (in the text box in which you type the name of an entity, for example), the
user interface automatically inserts the string with which the name of the entity must begin and does
not allow you to modify it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can specify authorization and Traffic policies for traffic that is bound for the intranet subnets that
are configured in your network. The rules for these policies are automatically created by using the
parameters you specify for the subnet.
1. In the navigation pane of the GUI, expand AppExpert, and then click Access Gateway Applica-
tions.
2. In the details pane, do one of the following:
• To add an intranet subnet, click Intranet Subnets, and then click Add.
• To modify an intranet subnet, click an intranet subnet, and then click Open.
3. In the Create Intranet Subnet or Configure Intranet Subnet dialog box, do the following:
a) In the Name box, type a name for the intranet subnet you are adding. This parameter
cannot be changed for an existing intranet subnet.
b) In the IP Address box, type the IP address of the intranet subnet.
c) In the Netmask box, type the netmask that will be used for the intranet subnet.
d) Click Create or OK, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For a network resource that you add to Other Resources, you must configure a classic expression that
identifies the subset of traffic associated with the resource. For more information about configuring
a classic expression, see the .
1. In the navigation pane of the GUI, expand AppExpert, and then click Access Gateway Applica-
tions.
2. In the details pane, do one of the following:
• To add a resource, click Other Resources, and then click Add.
• To modify a resource, click a resource, and then click Open.
3. In the Create Resource or Configure Resource dialog box, do the following:
a) In the Name box, type a name for the resource you are adding. This parameter cannot be
changed for an existing resource.
b) In the Rule box, type the rule that will identify the subset of traffic that is associated with
the resource you are adding.
Alternatively, click Configure, and then create the rule in the Create Expression dialog box.
c) Click Create or OK, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
The traffic policies that you configure for the resources in the NetScaler Gateway Applications node
control client connections to the application. You do not have to configure a rule for the resource. The
rule created automatically when you create the resource. You only need to associate a request profile
with the traffic policy. In the traffic profile, you specify parameters such as the protocol, application
time-out, and file type association.
1. In the navigation pane of the GUI, expand AppExpert, and then click Access Gateway Applica-
tions.
2. In the details pane, in the Traffic column, click the icon provided for the application, file share,
intranet subnet, or resource for which you want to configure traffic policies.
3. In the Configure Traffic Policies dialog box, do the following:
• To specify an existing traffic policy, click Insert Policy, and then, in the Policy Name col-
umn, click the name of the policy.
• To configure a new policy, click Insert Policy, and then, in the Policy Name column, click
New Policy. In the Create Traffic Policy dialog box, in the Name box, after the underscore
(_), type a name for the policy. Then, in Request Profile, either select an existing request
profile or click New to configure a new request profile. You can also select an existing pro-
file and then click Modify to modify the profile.
For more information about configuring a traffic policy or profile, see NetScaler Gateway.
• To modify a policy that you have inserted, in the Policy Name column, click the policy
name, and then click Modify Policy. To modify only the associated profile, in the Profile
column, click the name of the profile, and then click Modify Profile.
• To regenerate the priorities assigned to the policies, click Regenerate Priorities.
• To specify a new priority value for a policy, in the Priority column, double-click the as-
signed priority, and then enter the value you want.
• To unbind a policy, click the policy, and then click Unbind Policy.
4. Click Apply Changes, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
Clientless access, when configured for a resource on the NetScaler appliance, allows end-users to
access the resource without using the NetScaler Gateway client software. Users can use web browsers
to access resources such as Outlook Web Access. You configure clientless access for a resource by
configuring a clientless access policy that is associated with a clientless access profile.
To configure a clientless access policy for a resource in the NetScaler Gateway Applications node:
1. In the navigation pane of the GUI, expand AppExpert, and then click Access Gateway Applica-
tions.
2. In the details pane, in the **Clientless Access **column, click the icon for the application, file
share, intranet subnet, or resource for which you want to configure a clientless access policy.
3. In the Configure Clientless Access Policies dialog box, do the following:
• To specify an existing clientless access policy, click Insert Policy, and then, in the Policy
Name column, click the name of the policy.
• To configure a new clientless access policy, click Insert Policy, and then, in the Policy Name
column, click New Policy. In the Create Clientless Access Policy dialog box, in the Name
box, after the underscore (_), type a name for the policy. Then, in Profile, either select
an existing profile or click New to configure a new profile. You can also select an existing
profile and then click Modify to modify the profile.
For more information about configuring a clientless access policy or profile, see NetScaler
Gateway.
• To modify a policy that you have inserted, in the Policy Name column, click the policy
name, and then click Modify Policy. To modify only the associated profile, in the Profile
column, click the name of the profile, and then click Modify Profile.
• To specify a new priority value for a policy, in the Priority column, double-click the as-
signed priority, and then enter the value you want.
• To unbind a policy, click the policy, and then click Unbind Policy.
4. Click Apply Changes, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure TCP compression policies for an application to increase the performance of the
application. TCP compression reduces network latency, reduces bandwidth requirements, and in-
creases the speed of transmission. When configuring a TCP compression policy, you associate a com-
pression action with the policy. The compression action specifies either Compress, GZIP, Deflate, or
NoCompress as the compression type. For more information about the compression policies, and
compression actions, see NetScaler Gateway.
To configure a TCP compression policy for a resource in the NetScaler Gateway Applications node
1. In the navigation pane of the GUI, expand AppExpert, and then click Access Gateway Applica-
tions.
2. In the details pane, in the TCP Compression column, click the icon for the application, file share,
intranet subnet, or resource for which you want to configure a TCP compression policy.
3. In the Configure TCP Compression Policies dialog box, do the following:
• To specify an existing TCP compression policy, click Insert Policy, and then, in the **Policy
Name **column, click the name of the policy.
• To create a new TCP compression policy, click Insert Policy, and then, in the Policy Name
column, click New Policy. In the Create TCP Compression Policy dialog box, in the Policy
Name box, after the underscore (“_”), type a name for the policy. Then, in Action, either
select an existing action or click New and configure a new action. You can also click View
to view the configured compression type.
For more information about configuring a TCP compression policy or action, see NetScaler
Gateway , Enterprise Edition at NetScaler Gateway.
• To modify a policy that you have inserted, in the Policy Name column, click the policy
name, and then click Modify Policy.
• To regenerate the priorities assigned to the policies, click Regenerate Priorities.
• To specify a new priority value for a policy, in the Priority column, double-click the as-
signed priority, and then enter the value you want.
• To unbind a policy, click the policy, and then click Unbind Policy.
4. Click Apply Changes, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Configuring Bookmarks
available configuration settings (such as application units, application unit rules, policies, persistence
settings, load balancing methods, profiles, and traffic settings). In this application, you can configure
deployment settings such as public endpoints, services, and service groups for each traffic subset. If
you want the AppExpert application to manage a traffic subset that is not included in the template,
you can either add an application unit for a traffic subset or modify the existing application unit. After
you customize the configuration, you can also specify the order of evaluation for each traffic subset
that the application manages.
Also, you can configure the policies that the template provided. If the AppExpert application template
does not include policies for a particular NetScaler feature, such as Rewrite or application firewall, you
can configure your own policies.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If you did not specify a public endpoint when importing an AppExpert application, you can specify
public endpoints after you create the application. You can configure one public endpoint of type HTTP
and one public endpoint of type HTTPS for your AppExpert application.
If endpoints are already configured for the application, you can dissociate endpoints from the AppEx-
pert application and delete any endpoints that you no longer need. Note that when you dissociate
a public endpoint from the AppExpert application, the endpoint is automatically unbound from the
associated application unit, but it is not deleted from the system.
2. In the details pane, right-click the application for which you want to configure public endpoints,
and then click Edit.
3. In the Applications page, go to Public Endpoint section and click the pencil icon.
4. In the Public Endpoint slider, set the following parameters.
a) Public endpoint type. Select the radio button to define the endpoint type.
b) Name. Name of the public endpoint.
c) IP address. IP address of the public endpoint.
d) Port. Port number of the public endpoint.
e) Protocol. Select a protocol type as HTTP or HTTPS.
5. Click Continue.
6. In the Application Units section, select an application unit from the list.
7. Click Continue to set the policy and server details.
8. Click OK and then Done.
9. Click Close.
For more information about the parameters in the Configure Public Endpoint dialog box, see Content
Switching.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you configure multiple public endpoints for an AppExpert application, by default, all endpoints
are bound to each application unit, and each application unit processes the requests received by all
the endpoints. However, you can specify that a given application unit manages the traffic that is re-
ceived by only a subset of the endpoints that are configured for the AppExpert application.
• If you are specifying endpoints for the application unit for the first time, clear the check
boxes that correspond to the endpoints that you do not want to be bound to the applica-
tion unit.
• If you want to specify endpoints that are listed in the dialog box but not currently bound
to the application unit, click the corresponding check boxes.
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you configure a service or service group, you either modify an existing service or service group,
or add new services to the AppExpert application. You add services or service groups if you did not
specify them when you imported the application template. You also add services and service groups
when you increase the number of servers that host instances of the application. You can configure a
service and service group for an application unit only after you configure the service or service group
for the AppExpert application.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you configure services and service groups for an AppExpert application, by default, all the ser-
vices and service groups are bound to each application unit. However, depending on how you have
configured your web application, the application resources that are managed by an application unit
might be hosted on only some of the servers that are configured as services for the AppExpert appli-
cation. Or, a set of servers might host content that is meant for the requests received at one or more
specific public endpoints. In such scenarios, if all the services and service groups that are configured
for the AppExpert application are associated with the application unit, a request that is forwarded to
a server that does not host the requested content might not be served or might be served incorrect
content. Therefore, you must ensure that each application unit is configured to manage only those
services that can serve the requested content.
When configuring services and service groups for an application unit, you might choose to specify load
balancing settings such as the weights that services must be assigned and the desired load balancing,
persistence, and spillover methods. For more information about these settings, see Load Balancing.
to the services or service groups that you want configured for the application unit are se-
lected. Then, in the Weight column, specify the weight that you want to assign to each
configured service.
• To specify all services or service groups, click Activate All.
5. On the Method and Persistence and Advanced tabs, specify the desired parameters.
6. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You might need to add application units for traffic subsets that are either specific to your web appli-
cation implementation or not defined in the template. When creating an application unit, you must
configure a rule for the application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You might want to configure an application unit rule to include or exclude certain types of traffic. When
you configure the rule, you can also define the syntax of the expression.
1. In the navigation pane of the GUI, expand AppExpert, and then click Applications.
2. In the details pane, right-click the application unit for which you want to modify the rule, and
then click Open.
3. In the Configure Application Unit dialog box, do the following:
a) To specify the format of the new expression, do one of the following:
• To specify that you want to configure a classic expression in the Rule box, click Classic
Syntax.
• To specify that you want to configure an advanced expression in the Rule box, click
Default Syntax.
b) In the Rule box, configure the expression.
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For an AppExpert application, you can configure policies for Compression, Caching, Rewrite, Respon-
der, and Application Firewall. The templates that you download from the Citrix Community web site
provide you with a set of policies that fulfill the most common application management requirements.
You might want to fine-tune or customize these policies. If the set of policies provided for a given ap-
plication unit does not include policies for a particular feature, you can create and bind your own
policies for that feature.
If you create an AppExpert application without using a template, you must configure all the policies
that the web application needs.
The GUI uses various icons to indicate whether or not policies are configured for a feature. For an
application unit, if a policy is configured for a given feature, an icon that represents the feature is
displayed. For example, if a compression policy is configured for an application unit, a compression
icon is displayed in the Compression column for the application unit. For features for which no policy
is configured, an icon depicting a plus sign (+) is displayed.
Note: When configuring policies for application units, you might need to configure policies and ex-
pressions that are either in the classic or
default syntax. Additionally, when you configure
default syntax policies, you might need to specify parameters such as Goto expressions and invoke
policy banks.
For information about configuring policies and expressions in both formats, see Policies and Expres-
sions.
You can use either classic policies or advanced policies to configure compression, but you cannot bind
compression policies of both types to the same application unit.
begin modifying bound classic policies or create and bind new classic compression poli-
cies.
Important: This setting also determines what policies are displayed when you want to in-
sert a policy. For example, if you are in the
default syntax view, when you click
Insert Policy, the list that appears in the
Policy Name column will include only
default syntax policies. You cannot bind policies of both types to an application unit.
• If you want to configure classic policies, click either Request or Response, depending on
whether you want the policy to be evaluated at request-time or at response-time.
You can configure both request-time and response-time classic compression policies for
an application unit. After evaluating all of the request-time policies, if no match is found,
the appliance evaluates response-time policies.
• To modify a compression policy that is already bound to the application unit, click the
name of the policy, and then click Modify Policy. Then, in the Configure Compression Pol-
icy dialog box, modify the policy, and then click OK.
For information about modifying a compression policy, see Compression.
• To unbind a policy, click the name of the policy, and then click Unbind Policy.
• To modify the priority assigned to a policy, double-click the priority value, and then enter
a new value.
• To regenerate assigned priorities, click Regenerate Priorities.
• To insert a new policy, click Insert Policy and, in the list that is displayed in the Policy
Name column, click New Policy. Then, in the Create Compression Policy dialog box,
configure the policy, and then click Create.
For information about modifying a compression policy, see Compression.
• If you are configuring a default syntax expression, do the following:
– In the Goto Expression column, select a Goto expression.
– In the Invoke column, specify the policy bank that you want to invoke if the current
policy evaluates to TRUE.
4. Click Apply Changes, and then click Close.
You can use only default syntax policies and expressions to configure Caching policies.
3. In the Configure Cache Policies dialog box, do one or more of the following, depending on the
configuration tasks you want to perform:
• Click either Request or Response, depending on whether you want the policy to be evalu-
ated at request-time or at response-time.
You can configure both request-time and response-time Caching policies for an applica-
tion unit. After evaluating all of the request-time policies, if no match is found, the appli-
ance evaluates response-time policies.
• To modify a Caching policy that is already bound to the application unit, click the name of
the policy, and then click Modify Policy. Then, in the Configure Cache Policy dialog box,
modify the policy, and then click OK.
For information about modifying a Caching policy, see Integrated Caching.
• To unbind a policy, click the name of the policy, and then click Unbind Policy.
• To modify the priority assigned to a policy, double-click the priority value, and then enter
a new value.
• To regenerate assigned priorities, click Regenerate Priorities.
• To insert a new policy, click Insert Policy and, in the list that is displayed in the Policy
Name column, click New Policy. Then, in the Create Cache Policy dialog box, configure
the policy, and then click Create.
For information about modifying a Caching policy, see Integrated Caching.
• In the Goto Expression column, select a Goto expression.
• In the Invoke column, specify the policy bank that you want to invoke if the current policy
evaluates to TRUE.
4. Click Apply Changes, and then click Close.
You can use only default syntax policies and expressions to configure Rewrite policies.
• To modify a Rewrite policy that is already bound to the application unit, click the name of
the policy, and then click Modify Policy. Then, in the Configure Rewrite Policy dialog box,
modify the policy, and then click OK.
For information about modifying a Rewrite policy, see Rewrite.
• To unbind a policy, click the name of the policy, and then click Unbind Policy.
• To modify the priority assigned to a policy, double-click the priority value, and then enter
a new value.
• To regenerate assigned priorities, click Regenerate Priorities.
• To insert a new policy, click Insert Policy and, in the list that is displayed in the Policy
Name column, click New Policy. Then, in the Create Rewrite Policy dialog box, configure
the policy, and then click Create.
For information about modifying a Rewrite policy, see Rewrite.
• In the Goto Expression column, select a Goto expression.
• In the Invoke column, specify the policy bank that you want to invoke if the current policy
evaluates to TRUE.
4. Click Apply Changes, and then click Close.
You can use only default syntax policies and expressions to configure Responder policies.
• In the Invoke column, specify the policy bank that you want to invoke if the current policy
evaluates to TRUE.
4. Click Apply Changes, and then click Close.
You can configure both classic and default syntax policies and expressions for Application Firewall.
However, if a policy of one type is already bound globally or to a virtual server that is configured on
the appliance, you cannot bind a policy of the other type to an application unit. For example, if a
default syntax policy is already bound either globally or to a virtual server, you cannot bind a classic
policy to an application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You might need to add application units for traffic subsets that are either specific to your web appli-
cation implementation or not defined in the template. When creating an application unit, you must
configure a rule for the application unit.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Application unit rules are evaluated in the order in which they are placed in the GUI. The rule that
is configured for the topmost application unit is always configured first, followed by the rule that is
configured for the second topmost application unit, and so on. The default application unit is always
evaluated last.
When a request matches the rule that is configured for an application unit, the request is processed
by the application unit, and no further matching is performed. Therefore, the order of evaluation of
application units becomes an important factor if the traffic subsets for two or more application units
overlap. If the traffic subsets for two or more application units overlap, you must specify the order in
which an incoming request is matched against the application unit rules.
1. Navigate to AppExpert > Applications, select an application and click Edit. In the Application
Unit section, click the Pencil icon and then hover the cursor over the check box to the left of the
name of the application unit. Click the icon that appears next to the check box and hold down
the mouse to drag the application up or down to a new location in the priority list.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure a persistency group for the application units in an AppExpert application. In the
context of an AppExpert application, a persistency group is a group of application units that you can
treat as a single entity for the purpose of applying common persistence settings. When the application
is exported to an application template file, the persistency group settings are included, and they are
automatically applied to the application units when you import the AppExpert application.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The Visualizer feature shows you a graphical representation of an application’s configuration. It in-
cludes the name of the public endpoint, application units assigned to the public endpoint, and the
number of policies and services bound to the application. You can use the Visualizer to obtain a visual
overview of an AppExpert application’s configuration and configure some of the displayed entities. By
default, the Visualizer displays application units, services, and monitors for the selected application.
1. Navigate to AppExpert > Applications, select an application entity, and click Visualizer.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
AppQoE
Contributed by:
C
Application level Quality of Experience (AppQoE) integrates several existing policy-based security fea-
tures of the NetScaler appliance into a single integrated feature that takes advantage of a new queuing
mechanism, fair queuing. Fair queuing manages requests to load-balanced web servers and applica-
tions at the virtual server level instead of at the service level, allowing it to handle queuing of all re-
quests to a web site or application as one group before load balancing, instead of as separate streams
after load balancing.
The features that are integrated into AppQoE are HTTP Denial-of-Service Protection (HDOSP), Priority
Queuing (PQ), and SureConnect. Collectively these services provide protection against a number of
problems:
• Simple overload. Any server, no matter how robust, can accept only a limited number of con-
nections at one time. When a protected web site or application receives too many requests at
once, the Surge Protection feature detects the overload and queues the excess connections til
the server can accept them. The Priority Queuing feature ensures that whoever most needs
access to a resource is provided access without having to wait behind other lower-priority re-
quests. The SureConnect feature displays an alternate web page that notifies users that the
resource that they requested is not available.
Until the current version of the NetScaler operating system, these features were implemented at the
service level, which means that each service was assigned its own queues. While service-level queues
work, they also have some disadvantages, most of which are due to the NetScaler appliance having
to load balance requests before implementing any of the protection features that rely on queuing.
Implementing protection features before queuing has a number of advantages, some of which are
listed below:
• Absolute priority of connections as configured in the priority queuing feature can be main-
tained.
• Connections are not flushed if a service transitions state, as they are in a service-level queue.
• During periods of high load, such as a denial-of-service attack, HTTP DoS and SureConnect
come into play before load balancing, allowing these features to detect and divert unwanted
or lower-priority traffic from the load balancer before the load balancer must cope with it.
In addition to implementing fair queuing, AppQoE integrates a set of features that each provide a
different set of tools to achieve a common goal: protecting your networked resources from excessive
or inappropriate demand. Putting these features into a common framework enables you to configure
and implement them more easily.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Enabling AppQoE
Contributed by:
C
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
AppQOE actions
Contributed by:
C
After enabling the AppQoE feature, you must configure one or more actions for handling requests.
Important: No specific individual parameters are required to create an action, but you must
include at least one parameter or you cannot create the action.
Example
To configure priority queuing with policy queue depths of 10 and 1000 for medium and lowest priority
queues, respectively:
24 ActionType: PRIORITY_QUEUING
25 Priority: LOW
26 PolicyQdepth: 1000
27 Qdepth: 0
28 Done
• name
A name for the new action, or the name of the existing action that you want to modify. The
name can begin with a letter, number, or the underscore symbol, and can consist of from one to
letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=), colon
(:), and underscore (_) symbols.
• priority
The priority queue to which the request is assigned. When a protected web server or application
is heavily loaded and cannot accept additional requests, specifies the order in which waiting
requests are to be fulfilled when resources are available. The choices are:
4. LOWEST. Fulfills the request only after it has fulfilled all requests in higher-priority queues.
If priority is not configured, then the NetScaler appliance assigns the request to the LOWEST
priority queue by default.
• respondWith
Configures the NetScaler to take the specified Responder action when the specified threshold
is reached. Must be used with one of the following settings:
– ACS: Serves content from an alternate content service. Threshold: maxConn (maximum
connections) or delay.
– NS: Serves a built-in response from the NetScaler. Threshold: maxConn (maximum con-
nections) or delay.
– NO ACTION: Serves no alternative content. Assigns connections to the LOWEST priority
queue if the maxConn (maximum connections) or delay threshold is reached.
• altContentSvcName
If
-responseWith ACS is specified, the name of the alternative content service, usually an absolute
URL to the web server that hosts the alternate content.
• altContentPath
If
-responseWith ( ACS | NS ) is specified, the path to the alternative content.
• polqDepth
Policy queue depth threshold value for the policy queue associated with this action. When the
number of connections in the policy queue associated with this action increases to the speci-
fied number, subsequent requests are assigned to the LOWEST policy queue. Minimum value:
1 Maximum value: 4,294,967,294
• priqDepth
Policy queue depth threshold value for the specified priority queue. If the number of requests in
the specified queue on the virtual server to which the policy associated with the current action
is bound increases to the specified number, subsequent requests are assigned to the LOWEST
priority queue. Minimum value: 1 Maximum value: 4,294,967,294
• maxConn
The maximum number of connections that can be open for requests that match the policy rule.
Minimum value: 1 Maximum value: 4,294,967,294
• delay
The delay threshold, in microseconds, for requests that match the policy rule. If a matching
request has been delayed for longer than the threshold, the
NetScaler appliance performs the specified action. If NO ACTION is specified, then the appliance
assigns requests to the LOWEST priority queue. Minimum value: 1 Maximum value: 599999,999
• dosTrigExpression
Adds an optional second-level check to trigger DoS actions.
• dosAction
Action to take when the ADC determines that it or a protected server is under DoS attack. Possi-
ble values: SimpleResponse, HICResponse.
These values specify HTTP challenge-response methods for validating the authenticity of incoming
requests to mitigate an HTTP-DDoS attack.
In the HTTP challenge-response generation and validation process, AppQoE uses cookies to validate
the client’s response and verify that the client seems to be genuine. When sending a challenge, a
NetScaler appliance generates two cookies:
Header cookie (_DOSQ). Contains client-specific information, so that the NetScaler appliance can ver-
ify the response.
Body cookie (_DOSH). Information used to validate the client machine. The client’s browser (or the
user, in the case of HIC) computes a value for this cookie. The NetScaler appliance compares that
value with the expected value to verify the client.
The information that the appliance sends to the client for computing the _DOSH value is based on the
DoS Action configuration.
1. SimpleResponse: In this case, a NetScaler appliance splits the value and generates a JavaScript
code to combine the final value. A client machine capable of computing the original value is
considered genuine.
2. HICResponse: in this case, a NetScaler appliance generates two single-digit numbers and gen-
erates images for those numbers. Then, using a backpatch framework, the appliance inserts
those images as base64 strings.
Limitations:
1. This is not a trivial CAPTCHA implementation, which is why that term not used.
2. The validation number is based on a NetScaler-generated number that does not change for 120s.
This number should be dynamic or client specific.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
AppQoE parameters
Contributed by:
C
In the AppQoE parameters, you configure the session life of an AppQoE session, the file name of the
file containing the customized response, and the number of client connections that can be placed in
a queue.
• sessionLife
Number of seconds to wait after displaying alternate content before the ADC displays the same
content again. Default value: 300 Maximum Minimum value: 1 Maximum value: 4,294,967,294
• avgwaitingclient
The average number of client requests that can be in the service waiting queue. Default value:
1000000 Maximum value: 4,294,967,294
• MaxAltRespBandWidth
The maximum bandwidth to consume when sending alternate responses. If the maximum is
reached, the ADC quits sending the alternate content til bandwidth consumption drops. Default
value: 100 Minimum value: 1 Maximum value: 4,294,967,294
• dosAtckThrsh
The denial-of-service attack threshold. The number of connections that must be waiting in
queues before the ADC responds with DoS protection measures. Default value: 2000 Minimum
value: 0 Maximum value: 4,294,967,294
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
AppQoE Policies
Contributed by:
C
To implement AppQoE, you must configure at least one policy to tell your NetScaler how to distinguish
the connections to be queued in a specific queue.
Example:
The following example selects requests with a User-Agent header that contains “Android”, and assigns
them to the medium priority queue. These requests come from smartphones and tablets that run the
Google Android operating system.
• name
A name for the AppQoE policy. The name can begin with a letter, number, or the underscore
symbol, and can consist of from one to
127 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at sign (@), equals (=),
colon (:), and underscore (_) symbols. You should chose a name that helps identify the type of
action.
• rule
A
NetScaler expression that tells the appliance which connections it should handle. For complete
information about policy expressions, see the
NetScaler Policy Configuration and Reference Guide at .
• action
The AppQoE action to perform when a connection matches the policy.
The default choice is HTTP. After you make a choice in the first drop-down list (or accept
the default), you can choose the next term in your expression from the drop-down list to
the right of it. The terms in that list and other lists that follow change depending on your
previous choices; the lists offer only terms that are valid choices. Continue to select terms
until you have finished the expression.
Use the Help and Preview Expression areas for assistance when creating the expression.
For a complete description of the available choices, see the NetScaler Policy Configuration
and Reference Guide at .
c) When you have created the expression that you want, click OK. The expression is added in
the Expression text box.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Entity templates
Contributed by:
C
Entity templates are available only in the GUI. You use the NetScaler GUI to create, manage, and use
any type of entity template. You can share entity templates with other administrators and manage
local folders that contain the templates. You can also import entity templates from and export entity
templates to your local computer.
Before creating a template, you should be familiar with the configuration of the entity.
Note: You use entity templates to configure individual entities. To configure multiple entities related
to a particular Web application, you must use an application template. For more information, see “
AppExpert Applications and Templates.”
When you create a template for a NetScaler entity, you specify default values for the entity. You specify
what values must be read-only, what values must not be displayed, and what values users can config-
ure. You also configure the pages that compose the template import wizard. All the information and
settings you provide are stored in the template file.
When a user imports the entity template to a NetScaler appliance, a wizard guides the user through
the various pages that you configured for the template. The wizard displays the read-only parameter
values and prompts the user to specify values for the configurable parameters. After the user follows
the instructions in the wizard, the appliance creates the entity with the configured values.
For example, you can create an entity template for HTTP services that provides a text box for a service
name and assigns preset values for the service protocol, timeouts, thresholds, and monitors. Later,
when you use the template to create new HTTP services, a wizard prompts you for a service name and
supplies the preset values that you would otherwise have configured manually.
The procedure for creating entity templates for load balancing virtual servers is different than the App-
Expert procedure for creating other entity templates. For more information, see “Creating an Entity
Template.”
In addition, the procedure for using the template to create the load balancing virtual server entity is
different. For more information, see “Creating an Entity from a Template.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can create or modify an entity template either from the AppExpert feature node or from the asso-
ciated NetScaler feature node for the entity. For example, you can create a content switching virtual
server entity template in either the AppExpert feature node or the content switching feature node in
the GUI.
If you create a template that is not based on an existing entity, you can specify the following options
and settings for the template:
• The default value of a parameter.
• Whether the default values are visible to users.
• Whether the default values can be changed by users.
• The number of pages in the entity import wizard, including the page names, text, and available
parameters.
• The entities that must be bound to the entity for which the template is being created.
For example, when you are creating a cache redirection virtual server template, you can specify
the policies that you want to bind to the cache redirection virtual servers that you create from
the template. However, only binding information is included in the template. The bound en-
tities are not included. If the entity template is imported to another NetScaler appliance, the
bound entities must exist on the appliance at import time for the binding to succeed. If none of
the bound entities exist on the target appliance, the entity (for which the template was config-
ured) is created without any bindings. If only a subset of the bound entities exist on the target
appliance, they are bound to the entity that is created from the template.
When you create a template based on an existing entity, the configuration settings of the entity appear
in the template. All bound entities are selected by default, but you can modify bindings as necessary.
As in the case of a template that is not based on an existing entity, only binding information is included
and not the entities. You can either save the template with the existing configuration settings or use
the settings as a basis for creating a new configuration for a template.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Load balancing virtual server templates support the declaration of variables in the configured load
balancing parameters and in bound policies and actions. The ability to declare variables enables you
to replace preconfigured values with values that suit the environment into which you are importing
the template. The Entity Template Wizard, which appears when you import a template, includes a
Specify Variable Values page on which you can specify appropriate values for the variables that are
configured for the entity template. This wizard page appears only when you import a template that is
configured with existing variables.
As an example, consider the following expression configured for a policy that is bound to a load bal-
ancing virtual server for which you are creating a template. The expression evaluates the value of the
Accept-Language header in an HTTP request.
HTTP.REQ.HEADER(”Accept-Language”).CONTAINS(”en-us”)
If you want the value of the header to be configurable at import time, you can specify the string en-
us as a variable. When importing the template, you can specify a new value for the variable on the
Specify Variable Values page.
• Assign additional strings to an existing variable. After you create a variable for a string, you can
select and assign other parts of the same or different expression to the variable. The strings you
assign to a variable need not be the same. At import time, all the strings that are assigned to
the variable are replaced with the value that you provide.
• View the string or strings that are assigned to the variable.
• View a list of all the entities and parameters that use the variable.
2. In the details pane, right-click the virtual server that you want to export to a template file, and
then click Create Template.
3. In the Create Template dialog box, modify the default template file name if required, specify
the location where you want to save the template, and then click Configure Variables.
4. In the Configure Variables dialog box, click the tab that lists the entity for which you want to
configure a variable, select the entity, and then click Configure Variables.
5. In the Variables for Entity Type: Entity Name dialog box, click the button next to the parameter
value or expression in which you want to create a variable.
• To create a variable, in the text box that displays the configured expression or value, select
the string that you want to be configurable at import time, and then click Add. In the Cre-
ate Variable dialog box, specify a name and a description for the variable, and then click
Create.
The name of the variable, its value, and the description you provided appear in the Avail-
able Variables listing in the dialog box. The name you provide will be the name of the
associated field in the template import wizard, and the description will appear as alt text
when the user positions the mouse pointer over the field.
• To modify a variable, in the Available Variables list, click the variable, and then click Open.
In the Create Variable dialog box, modify the value and the description, and then click OK.
The new value that you specify will not replace the text selected in the text box that dis-
plays the configured expression or value. However, when you import the template, the
new value will be displayed as the default value for the variable in the template import
wizard.
• To view all the strings that are assigned to a given variable, in the Available Variables listing,
click the name of the variable. The strings that are assigned to the variable are highlighted.
• To view a list of all the parameters, expressions, and actions in which the variable is used,
in the Available Variables listing, click the variable whose references you want to view, and
then click Show References.
• To assign a string to an existing variable, in the text box that displays the expression you
configured, select the string you want to assign to an existing variable, right-click the se-
lection, click Use existing Variable, and then click the name of the variable to which you
want to assign the string.
If a variable has multiple strings assigned to it, when you specify a new value for the vari-
able during import, all strings assigned to the variable are replaced with the new value.
7. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can modify only the parameters, bindings, and pages configured for a template. The name and
location of the template specified when the template was created cannot be changed. The NetScaler
appliance does not provide you with the option of modifying a load balancing virtual server template.
1. Navigate to Traffic Management, select the feature (for example, Content Switching), and then
select the entity (for example, Virtual Servers) for which you want to modify the entity template.
2. At the top of the details pane, click Entity Templates, and then click Manage Template.
3. In the** Manage <feature entity name> Entity Templates** dialog box, select the template
that you want to modify, and then click Modify.
4. In the Modify <template name> Template dialog box, follow the instructions to modify a tem-
plate.
5. Click Finish, and then click Exit.
6. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Deleting an entity template does not affect any objects that have been created by using the template.
You can delete a load balancing virtual server template only from the AppExpert feature node.
1. Navigate to Traffic Management, and select the feature (for example, Content Switching) and
then select the entity (for example, Virtual Servers), for which you want to delete the entity tem-
plate.
2. At the top of the details pane, click Entity Templates, and then click Manage Template.
3. In the Manage…Entity Templates dialog box, select the template that you want to delete, and
then click Delete.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can create an entity from an entity template either from the AppExpert feature node in the
NetScaler GUI or from the NetScaler feature node that corresponds to the type of entity that you
want to create. For example, you can create a content switching virtual server from a template with
either the AppExpert feature node or the content switching feature node in the GUI.
The procedure for creating a load balancing virtual server from a template is different than the App-
Expert procedure for creating other entities from templates.
After you create an instance of an entity using an entity template, you can configure it in the same way
that you would any other object of that type, such as by using the GUI or the command line.
1. Navigate to Traffic Management, and expand a feature node (for example, Content Switching),
and then click an entity subnode (for example, Virtual Servers).
2. At the top of the details pane, click Entity Templates, and then click Use Template.
4. In the Use <template name> Template wizard, follow the instructions to create the entity.
Only templates that match the current context are displayed. For example, in the details pane
for content switching virtual servers, only entity templates for content switching virtual servers
appear, if configured.
To create a load balancing virtual server by using a load balancing virtual server
template
3. In the Entity Template Wizard, follow the instructions to create a load balancing virtual server
on the NetScaler.
Only templates that match the current context are displayed. For example, when you click
Browse (Appliance), only entity templates for load balancing virtual servers appear, if config-
ured.
Note: The Entity Template Wizard includes a Specify Variable Values page on which you
can specify new values for variables. For more information about configuring variables in
load balancing virtual server templates, see Configuring Variables in Load Balancing Vir-
tual Server Templates.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can organize only load balancing virtual server template folders.
• To change the name of a folder, select the folder and click Rename.
You can also click the folder that you want to rename, and then press F2. You cannot re-
name the top-level default folder.
1 You can also click the folder that you want to remove, and then
press the Delete key. You cannot remove the top-level default
folder.
3. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can import the entity templates that are stored on your local computer. You can also download
entity templates from the NetScaler appliance to your local computer and then import them to other
NetScaler appliances.
1. Navigate to Traffic Management, and expand a feature node (for example, Content Switching),
and then click a subnode (for example, Virtual Servers) for which you want to upload an entity
template.
2. At the top of the details pane, click Entity Templates, and then click Manage Template.
3. In the Manage…Entity Templates dialog box, click the top-level folder, and then click Upload.
4. In the Upload Entity Template dialog box, navigate to the template file that you want to upload,
and then click Select.
5. Click Close.
1. Navigate to Traffic Management, and expand a feature node (for example, Content Switching),
and then click a subnode (for example, Virtual Servers) for which you want to upload an entity
template.
2. At the top of the details pane, click Entity Templates, and then click Manage Template.
3. In the Manage…Entity Templates dialog box, click the template that you want to download,
and then click Download.
4. In the Download Entity Template dialog box, navigate to the location at which you want to
save the template on your local computer, enter a file name, and then click Save.
5. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Load balancing entity templates are created in the same way that NetScaler application templates are
created. When you export a load balancing virtual server to a template file, the following two files are
automatically created:
• Load balancing virtual server template file. Contains XML elements that store the values of
the parameters that are configured for the load balancing virtual server. The file also contains
XML elements for storing information about bound policies.
• Deployment file. Contains XML elements that store deployment-specific information such as
services, service groups, and configured variables.
In the template and deployment files, each unit of configuration information is encapsulated in a spe-
cific XML element that is meant for that unit type. For example, the load balancing method parameter,
lbMethod, is encapsulated within the
<lbmethod> and
<lbmethod> tags.
Note: After you export a load balancing virtual server, you can add elements, remove elements, and
modify existing elements before importing the configuration information to a NetScaler appliance.
Following is an example of a template file that was created from a load balancing virtual server called
“Lbvip”:
13 <servicetype>HTTP</servicetype>
14 <ipv46>0.0.0.0</ipv46>
15 <ipmask>*</ipmask>
16 <port>0</port>
17 <range>1</range>
18 <persistencetype>NONE</persistencetype>
19 <timeout>2</timeout>
20 <persistencebackup>NONE</persistencebackup>
21 <backuppersistencetimeout>2</backuppersistencetimeout>
22 <lbmethod>LEASTCONNECTION</lbmethod>
23 <persistmask>255.255.255.255</persistmask>
24 <v6persistmasklen>128</v6persistmasklen>
25 <pq>OFF</pq>
26 <sc>OFF</sc>
27 <m>IP</m>
28 <datalength>0</datalength>
29 <dataoffset>0</dataoffset>
30 <sessionless>DISABLED</sessionless>
31 <state>ENABLED</state>
32 <connfailover>DISABLED</connfailover>
33 <clttimeout>180</clttimeout>
34 <somethod>NONE</somethod>
35 <sopersistence>DISABLED</sopersistence>
36 <sopersistencetimeout>2</sopersistencetimeout>
37 <redirectportrewrite>DISABLED</redirectportrewrite>
38 <downstateflush>DISABLED</downstateflush>
39 <gt2gb>DISABLED</gt2gb>
40 <ipmapping>0.0.0.0</ipmapping>
41 <disableprimaryondown>DISABLED</disableprimaryondown>
42 <insertvserveripport>OFF</insertvserveripport>
43 <authentication>OFF</authentication>
44 <authn401>OFF</authn401>
45 <push>DISABLED</push>
46 <pushlabel>none</pushlabel>
47 <l2conn>OFF</l2conn>
48 <appflowlog>DISABLED</appflowlog>
49 <icmpvsrresponse>PASSIVE</icmpvsrresponse>
50 <lbvserver_cmppolicy_binding_list>
51 <lbvserver_cmppolicy_binding>
52 <name>Lbvip</name>
53 <policyname>NOPOLICY-COMPRESSION</policyname>
54 <priority>100</priority>
55 <gotopriorityexpression>END</gotopriorityexpression>
56 <bindpoint>REQUEST</bindpoint>
57 </lbvserver_cmppolicy_binding>
58 </lbvserver_cmppolicy_binding_list>
59 </lbvserver>
60 </lbvserver_list>
61 </entitytemplate>
62 </template>
Following is the deployment file associated with the virtual server in the preceding example:
35 <port>80</port>
36 </servicegroup_servicegroupmember_binding>
37 </servicegroup_servicegroupmember_binding_list>
38 </servicegroup>
39 </servicegroup_list>
40 </template_deployment>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
HTTP callouts
Contributed by:
C
For certain types of requests, or when certain criteria are met during policy evaluation, you might want
to stall policy evaluation briefly, retrieve information from a server, and then perform a specific action
that depends on the information that is retrieved. At other times, when you receive certain types of
requests, you might want to update a database or the content hosted on a Web server. HTTP callouts
enable you to perform all these tasks.
An HTTP callout is an HTTP or HTTPS request that the NetScaler appliance generates and sends to an
external application when certain criteria are met during policy evaluation. The information that is
retrieved from the server can be analyzed by default syntax policy expressions, and an appropriate
action can be performed. You can configure HTTP callouts for HTTP content switching, TCP content
switching, rewrite, responder, and for the token-based method of load balancing.
Before you configure an HTTP callout, you must set up an application on the server to which the call-
out will be sent. The application, which is called the HTTP callout agent , must be configured to re-
spond to the HTTP callout request with the required information. The HTTP callout agent can also
be a Web server that serves the data for which the NetScaler appliance sends the callout. You must
make sure that the format of the response to an HTTP callout does not change from one invocation
to another.
After you set up the HTTP callout agent, you configure the HTTP callout on the NetScaler appliance.
Finally, to invoke the callout, you include the callout in a default syntax policy in the appropriate
NetScaler feature and then bind the policy to the bind point at which you want the policy to be evalu-
ated.
After you have configured the HTTP callout, you must verify the configuration to make sure that the
callout is working correctly.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
When the NetScaler appliance receives a client request, the appliance evaluates the request against
the policies bound to various bind points. During this evaluation, if the appliance encounters the
HTTP callout expression, SYS.HTTP_CALLOUT(<name>), it stalls policy evaluation briefly and sends a
request to the HTTP callout agent by using the parameters configured for the specified HTTP callout.
Upon receiving the response, the appliance inspects the specified portion of the response, and then
either performs an action or evaluates the next policy, depending on whether the evaluation of the
response from the HTTP callout agent evaluates to TRUE or FALSE, respectively. For example, if the
HTTP callout is included in a responder policy, if the evaluation of the response evaluates to TRUE,
the appliance performs the action associated with the responder policy.
If the HTTP callout configuration is incorrect or incomplete, or if the callout invokes itself recursively,
the appliance raises an UNDEF condition, and updates the undefined hits counter.
The following figure illustrates the working of an HTTP callout that is invoked from a globally bound
responder policy. The HTTP callout is configured to include the IP address of the client that is asso-
ciated with an incoming request. When the NetScaler appliance receives a request from a client, the
appliance generates the callout request and sends it to the callout server, which hosts a database of
blacklisted IP addresses and an HTTP callout agent that checks whether the client’s IP address is listed
in the database. The HTTP callout agent receives the callout request, checks whether the client’s IP ad-
dress is listed, and sends a response that the NetScaler appliance evaluates. If the response indicates
that the client’s IP address is not blacklisted, the appliance forwards the response to the configured
service. If the client’s IP address is blacklisted, the appliance resets the client connection
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The NetScaler appliance does not check for the validity of the HTTP callout request. Therefore, before
you configure HTTP callouts, you must know the format of an HTTP request. You must also know the
format of an HTTP response, because configuring an HTTP callout involves configuring expressions
that evaluate the response from the HTTP callout agent.
An HTTP request contains a series of lines that each end with a carriage return and a line feed, repre-
sented as either <CR><LF> or \r\n.
The first line of a request (the message line ) contains the HTTP method and target. For example, a
message line for a GET request contains the keyword GET and a string that represents the object that
is to be fetched, as shown in the following example:
The rest of the request contains HTTP headers, including a required Host header and, if applicable, a
message body.
The request ends with a bank line (an extra <CR><LF> or \r\n).
An HTTP response contains a status message, response HTTP headers, and the requested object or, if
the requested object cannot be served, an error message.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 2, 2018
Contributed by:
C
When configuring an HTTP callout, you specify the type of request (HTTP or HTTPS), destination and
format of the request, the expected format of the response, and, finally, the portion of the response
that you want to analyze.
For the destination, you either specify the IP address and port of the HTTP callout agent or engage
a load balancing, content switching, or cache redirection virtual server to manage the HTTP callout
requests. In the first case, the HTTP callout requests will be sent directly to the HTTP callout agent. In
the second case, the HTTP callout requests will be sent to the virtual IP address (VIP) of the specified
virtual server. The virtual server will then process the request in the same way as it processes a client
request. For example, if you expect a large number of callouts to be generated, you can configure
instances of the HTTP callout agent on multiple servers, bind these instances (as services) to a load
balancing virtual server, and then specify the load balancing virtual server in the HTTP callout con-
figuration. The load balancing virtual server then balances the load on those configured instances as
determined by the load balancing algorithm.
For the format of the HTTP callout request, you can specify the individual attributes of the HTTP call-
out request (an attribute-based HTTP callout), or you can specify the entire HTTP callout request as
a default syntax expression (an expression-based HTTP callout).
Note: The appliance does not check for the validity of the request. You must make sure that the re-
quest is a valid request. An incorrect or incomplete HTTP callout configuration results in a runtime
UNDEF condition that is not associated with an action. The UNDEF condition merely updates the Un-
defined Hits counter, which enables you to troubleshoot an incorrectly configured HTTP callout. How-
ever, the appliance parses the HTTP callout request to enable you to configure certain
NetScaler features for the callout. This can lead to an HTTP callout invoking itself. For information
about callout recursion and how you can avoid it, see “
Avoiding HTTP Callout Recursion.”
Finally, regardless of whether you use HTTP request attributes or an expression to define the format
of the HTTP callout request, you must specify the format of the response from the HTTP callout agent
and the portion of the response that you want to evaluate. The response can be a Boolean value, a
number, or text. The portion of the response that you want to evaluate is specified by an expression.
For example, if you specify that the response contains text, you can use HTTP.RES.BODY(<unit>) to
specify that the appliance must evaluate only the first <unit> bytes of the response from the callout
agent.
At the command line, you first create an HTTP callout by using the
add command. When you add a callout, all parameters are set to a default value of NONE, except the
HTTP method, which is set to a default value of GET. You then configure the callout’s parameters by
using the set command. The
set command is used to configure both types of callouts (attribute-based and expression-based). The
difference lies in the parameters that are used for configuring the two types of callouts. Accordingly,
the command-line instructions that follow include a
set command for configuring an attribute-based callout and a
set command for configuring an expression-based callout. In the GUI, all of these configuration tasks
are performed in a single dialog box.
Note: Before you put an HTTP callout into a policy, you can modify all configured parameters except
the return type. Once an HTTP callout is in a policy, you cannot completely modify an expression that
is configured in the callout. For example, you cannot change
1 HTTP.REQ.HEADER(”myval”) to
2 CLIENT.IP.SRC. However, you can modify the operators and arguments that
are passed to the expression. For example, you can change
3 HTTP.REQ.HEADER(”myVal1”) to
4 HTTP.REQ.HEADER(”myVal2”), or
5 HTTP.REQ.HEADER(”myVal”) to
6 HTTP.REQ.HEADER(”myVal”).AFTER_STR(<string>). If the set command fails,
create a new HTTP callout.
1 **Example**
Example:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
For an HTTP callout to work correctly, all the HTTP callout parameters and the entities associated
with the callout must be configured correctly. While the NetScaler appliance does not check the va-
lidity of the HTTP callout parameters, it indicates the state of the bound entities, namely the server or
virtual server to which the HTTP callout is sent. The following table lists the icons and describes the
conditions under which the icons are displayed.
Table 1. Icons That Indicate the States of Entities Bound to an HTTP Callout
For an HTTP callout to function correctly, the icon must be green at all times. If the icon is not green,
check the state of the callout server or virtual server to which the HTTP callout is sent. If the HTTP
callout is not working as expected even though the icon is green, check the parameters configured for
the callout.
You can also verify the configuration by sending test requests that match the policy from which the
HTTP callout is invoked, checking the hits counter for the policy and the HTTP callout, and verifying
the responses that the NetScaler appliance sends to the client.
Note: An HTTP callout can sometimes invoke itself recursively a second time. If this happens, the hits
counter is incremented by two counts for each callout that is generated by the appliance. For the hits
counter to display the correct value, you must configure the HTTP callout in such a way that it does not
invoke itself a second time. For more information about how you can avoid HTTP callout recursion,
see
Avoiding HTTP Callout Recursion.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you configure an HTTP callout, you invoke the callout by including the SYS.HTTP_CALLOUT(<
name>) expression in a default syntax policy rule. In this expression, <name> is the name of the HTTP
callout that you want to invoke.
You can use default syntax expression operators with the callout expression to process the response
and then perform an appropriate action. The return type of the response from the HTTP callout agent
determines the set of operators that you can use on the response. If the part of the response that you
want to analyze is text, you can use a text operator to analyze the response. For example, you can use
the CONTAINS(<string>) operator to check whether the specified portion of the response contains a
particular string, as in the following example:
1 SYS.HTTP_CALLOUT(mycallout).contains(”Good IP address”)
If you use the preceding expression in a responder policy, you can configure an appropriate responder
action.
Similarly, if the part of the response that you want to evaluate is a number, you can use a numeric
operator such as GT(int). If the response contains a Boolean value, you can use a Boolean operator.
Note: An HTTP callout can invoke itself recursively. HTTP callout recursion can be avoided by com-
bining the HTTP callout expression with a default syntax expression that prevents recursion. For in-
formation about how you can avoid HTTP callout recursion, see
Avoiding HTTP Callout Recursion.
You can also cascade HTTP callouts by configuring policies that each invoke a callout after evaluating
previously generated callouts. In this scenario, after one policy invokes a callout, when the NetScaler
appliance is parsing the callout before sending the callout to the callout server, a second set of policies
can evaluate the callout and invoke additional callouts, which can in turn be evaluated by a third set
of policies, and so on. Such an implementation is described in the following example.
First, you could configure an HTTP callout called myCallout1, and then configure a responder policy,
Pol1, to invoke myCallout1. Then, you could configure a second HTTP callout, myCallout2, and a re-
sponder policy, Pol2. You configure Pol2 to evaluate myCallout1 and invoke myCallout2. You bind
both responder policies globally.
To avoid HTTP callout recursion, myCallout1 is configured with a unique custom HTTP header called
“Request1.” Pol1 is configured to avoid HTTP callout recursion by using the default syntax expression,
1 HTTP.REQ.HEADER(”Request1”).EQ(”Callout Request”).NOT.
Pol2 uses the same default syntax expression, but excludes the .NOT operator so that the policy eval-
uates myCallout1 when the NetScaler appliance is parsing it. Note that myCallout2 identifies its own
unique header called “Request2,” and Pol2 includes a default syntax expression to prevent myCallout2
from invoking itself recursively.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Even though the NetScaler appliance does not check for the validity of the HTTP callout request, it
parses the request once before it sends the request to the HTTP callout agent. This parsing allows
the appliance to treat the callout request as any other incoming request, which in turn allows you
to configure several useful NetScaler features (such as integrated caching, SureConnect, and Priority
Queuing) to work on the callout request.
However, during this parsing, the HTTP callout request can hit the same policy and therefore invoke
itself recursively. The appliance detects the recursive invocation and raises an undefined (UNDEF)
condition. However, the recursive invocation results in the policy and HTTP callout hit counters being
incremented by two counts each instead of one count each.
To prevent a callout from invoking itself, you must identify at least one unique characteristic of the
HTTP callout request, and then exclude all requests with this characteristic from being processed by
the policy rule that invokes the callout. You can do so by including another default syntax expression
in the policy rule. The expression must precede the
SYS.HTTP_CALLOUT(<name>) expression so that it is evaluated before the callout expression is eval-
uated. For example:
When you configure a policy rule in this way, when the appliance generates the request and parses it,
the compound rule evaluates to FALSE, the callout is not generated a second time, and the hit counters
are incremented correctly.
One way by which you can assign a unique characteristic to an HTTP callout request is to include a
unique custom HTTP header when you configure the callout. Following is an example of an HTTP
callout called “myCallout.” The callout generates an HTTP request that checks whether a client’s IP
address is present in a database of blacklisted IP addresses. The callout includes a custom header
called “Request,” which is set to the value “Callout Request.” A globally bound responder policy,
“Pol1,” invokes the HTTP callout but excludes all requests whose Request header is set to this value,
thus preventing a second invocation of myCallout. The expression that prevents a second invocation
is HTTP.REQ.HEADER(\“Request\”).EQ(\“Callout Request\”).NOT.
Example:
Note:
You can also configure an expression to check whether the URL of the request includes the URL
stem expression that is configured for the HTTP callout. If you want to implement this scenario,
make sure that the HTTP callout agent is dedicated to respond only to HTTP callouts and not to
other client requests directed through the appliance. If the HTTP callout agent is an application
or Web server that serves other client requests, such an expression will prevent the appliance
from processing those client requests. Instead, use a unique custom header as described earlier.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For improved performance while using callouts, you can use the integrated caching feature to cache
callout responses. The responses are stored in an integrated caching content group named callout-
ContentGroup for a specified time duration.
Note: To cache callout responses, make sure that the integrated caching feature is enabled.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
HTTP callouts can be used to block requests from clients that are blacklisted by the administrator.
The list of clients can be a publicly known blacklist, a blacklist that you maintain for you organization,
or a combination of both.
The NetScaler appliance checks the IP address of the client against the pre-configured blacklist and
blocks the transaction if the IP address has been blacklisted. If the IP address is not in the list, the
appliance processes the transaction.
Enabling Responder
Create an HTTP callout, HTTP_Callout, with the parameter settings shown in the following table. For
more information about creating an HTTP callout, see
Configuring an HTTP Callout pdf.
After you configure the HTTP callout, verify the callout configuration, and then configure a responder
policy to invoke the callout. While you can create a responder policy in the
Policies sub-node and then bind it globally by using the
Responder Policy Manager, this demonstration uses the
Responder Policy Manager to create the responder policy and bind the policy globally.
You must now create an HTTP callout agent on the remote callout server that will receive callout re-
quests from the NetScaler appliance and respond appropriately. The HTTP callout agent is a script
that is different for each deployment and must be written with the server specifications in mind, such
as the type of database and the scripting language supported.
Following is a sample callout agent that verifies whether the given IP address is part of an IP blacklist.
The agent has been written in the Perl scripting language and uses a MYSQL database.
The following CGI script checks for a given IP address on the callout server.
1 #!/usr/bin/perl -w
2 print ”Content-type: text/html\n\n”;
3 use DBI();
4 use CGI qw(:standard);
5 #Take the Client IP address from the request query
6 my $ip_to_check = param(’cip’);
7 # Where a MYSQL database is running
8 my $dsn = ’DBI:mysql:BAD_CLIENT:localhost’;
9 # Database username to connect with
10 my $db_user_name = ‘ dbuser ’ ;
11 # Database password to connect with
12 my $db_password = ’dbpassword’;
13 my ($id, $password);
14 # Connecting to the database
15 my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
16 my $sth = $dbh->prepare(qq{
17 select * from bad_clnt }
18 );
19 $sth->execute();
20 while (my ($ip_in_database) = $sth->fetchrow_array()) {
21
22 chomp($ip_in_database);
23 # Check for IP match
24 if ($ip_in_database eq $ip_to_check) {
25
26 print ”\n IP Matched\n”;
27 $sth->finish();
28 exit;
29 }
30
31 }
32
33 print ”\n IP Failed\n”;
34 $sth->finish();
35 exit;
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Use Case: ESI Support for Fetching and Updating Content Dynamically
January 6, 2019
Contributed by:
C
Edge Side Includes (ESI) is a markup language for edge-level dynamic Web content assembly. It helps
in accelerating dynamic Web-based applications by defining a simple markup language to describe
cacheable and non-cacheable Web page components that can be aggregated, assembled, and deliv-
ered at the network edge. By using HTTP callouts on the NetScaler appliance, you can read through
the ESI constructs and aggregate or assemble content dynamically.
Enabling Rewrite
Rewrite must be enabled before it is used on the NetScaler appliance. The following procedure de-
scribes the steps to enable the rewrite feature.
Create a rewrite action, Action-Rewrite-1, to replace the ESI content with the callout response body.
Use the parameter settings shown in the following table.
Parameter Value
Name Action-Rewrite-1
Type Replace
Expression to choose target text reference “HTTP.RES.BODY(500).AFTER_STR (\”
<example>\”).BEFORE_STR (\”</example>\”)”
String expression for replacement text “SYS.HTTP_CALLOUT(HTTP-Callout-2)”
5. In Expression to choose target text reference, type the following default syntax expression:
1 ”HTTP.RES.BODY(500).AFTER_STR(\”<example>\”).BEFORE_STR(\”</example>\”)
”
1. In the String expression for replacement text, type the following string expression:
1 ”SYS.HTTP_CALLOUT(HTTP-Callout-2)”
Create a rewrite policy, Policy-Rewrite-1, with the parameter settings shown in the following table.
You can create a rewrite policy in the
Policies subnode and then bind it globally by using the
Rewrite Policy Manager. Alternatively, you can use the
Rewrite Policy Manager to perform both these tasks simultaneously. This demonstration uses the
Rewrite Policy Manager to perform both tasks.
Parameter Value
Name Policy-Rewrite-1
Action Action_Rewrite-1
Undefined Result Action -Global undefined-result action-
Expression “HTTP.REQ.HEADER(”Name”).CONTAINS
(”Callout”).NOT”
1 ”HTTP.REQ.HEADER(\”Name\”).CONTAINS(\”Callout\”).NOT”
Contributed by:
C
In high security zones, it is mandatory to externally authenticate the user before a resource is accessed
by clients. On the NetScaler appliance, you can use HTTP callouts to externally authenticate the user
by evaluating the credentials supplied. In this example, the assumption is that the client is sending
the user name and password through HTTP headers in the request. However, the same information
could be fetched from the URL or the HTTP body.
Enabling responder
The responder feature must be enabled before it is used on the NetScaler appliance.
Create an HTTP callout, HTTP-Callout-3, with the parameter settings shown in the following table. For
more information about creating an HTTP callout, see Configuring an HTTP Callout.
Parameter
Value
Name
HTTP-Callout-3
IP Address
10.103.9.95
Port
80
Method
GET
Host Expression
10.102.3.95
“/cgi-bin/authenticate.pl”
Headers:
Name
Request
Value-expression
Callout Request
Parameters:
Name
Username
Value-expression
HTTP.REQ.HEADER(“Username”).VALUE(0)
Name
Password
Value-expression
HTTP.REQ.HEADER(“Password”).VALUE(0)
Server Response:
Return Type
TEXT
HTTP.RES.BODY(100)
Create a responder policy, Policy-Responder-3, that will check the response from the callout server
and RESET the connection if the source IP address has been blacklisted. Create the policy with the
parameters settings shown in the following table. While you can create a responder policy in the
Policies subnode and then bind it globally by using the
Responder Policy Manager, this demonstration uses the
Responder Policy Manager to create the responder policy and bind the policy globally.
Parameter Value
Name Policy-Responder-3
Action RESET
Undefined-Result-Action -Global undefined-result action-
Expression “HTTP.REQ.HEADER(\“Request\”).EQ(\“Callout
Request\”).NOT && SYS.HTTP_CALLOUT(HTTP-
Callout-3).CONTAINS(\“Authentication
Failed\”)”
You now need to create an HTTP callout agent on the remote callout server. The HTTP callout agent
receives callout requests from the NetScaler appliance and responds appropriately. The callout agent
is a script that is different for each deployment and must be written with server specifications in mind,
such as the type of database and the scripting language supported.
Following is sample callout agent pseudo-code that verifies whether the supplied user name and pass-
word are valid. The agent can be implemented in any programming language of your choice. The
pseudo-code is to be used only as a guideline for developing the callout agent. You can build addi-
tional functionality into the program.
1. Accept the user name and password supplied in the request and format them appropriately.
2. Connect to the database that contains all the valid user names and passwords.
3. Check the supplied credentials against your database.
4. Format the response as required by the HTTP callout.
5. Send the response to the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Spam filtering is the ability to dynamically block emails that are not from a known or trusted source or
that have inappropriate content. Spam filtering requires an associated business logic that indicates
that a particular kind of message is spam. When the NetScaler appliance processes Outlook Web Ac-
cess (OWA) messages based on the HTTP protocol, HTTP callouts can be used to filter spam.
You can use HTTP callouts to extract any portion of the incoming message and check with an external
callout server that has been configured with rules that are meant for determining whether a message
is legitimate or spam. In case of spam email, for security reasons, the NetScaler appliance does not
notify the sender that the email is marked as spam.
The following example conducts a very basic check for various listed keywords in the email subject.
These checks can be more complex in a production environment.
Enabling Responder
The responder feature must be enabled before it can be used on the NetScaler appliance.
Create an HTTP callout, HTTP-Callout-4, with the parameter settings shown in the following table. For
more information about creating an HTTP callout, see
Configuring an HTTP Callout.
For more information, see Parameters and Values for HTTP-Callout-4 pdf.
Create a responder action, Action-Responder-4. Create the action with the parameter settings shown
in the following table.
Parameter Value
Name Action-Responder-4
Type Respond with
Parameter Value
5. In Target, type:
Create a responder policy, Policy-Responder-4, that will check the request body and, if the body con-
tains the word “
subject,” invoke the HTTP callout to verify the email. Create the policy with the parameter settings
shown in the following table. While you can create a responder policy in the
Policies subnode and then bind it globally by using the
Responder Policy Manager, this demonstration uses the
Responder Policy Manager to create the responder policy and bind it globally.
Parameter Value
Name Policy-Responder-4
Parameter Value
Action Action-Responder-4
Undefined-Result-Action -Global undefined-result action-
Expression “HTTP.REQ.BODY(1000).CONTAINS(”urn:schemas:httpmail:su
&& SYS.HTTP_CALLOUT(HTTP-Callout-4)”
1 ”HTTP.REQ.BODY(1000).CONTAINS(\”urn:schemas:httpmail:subject
\”) && SYS.HTTP_CALLOUT(HTTP-Callout-4)”
You will now need to create an HTTP callout agent on the remote callout server. The HTTP callout
agent receives callout requests from the NetScaler appliance and responds accordingly. The callout
agent is a script that is different for each deployment and must be written with server specifications
in mind, such as the type of database and the scripting language supported.
The following pseudo-code provides instructions for creating a callout agent that checks a list of words
that are generally understood to indicate spam mails. The agent can be implemented in any program-
ming language of your choice. The pseudo-code is to be used only as a guideline for developing the
callout agent. You can build additional functionality into the program.
2. Connect to the database that contains all the terms against which the email subject is checked.
3. Check the words in the email subject against the spam word list.
4. Format the response as required by the HTTP callout.
5. Send the response to the NetScaler appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
This use case provides dynamic content switching by using an HTTP callout to get the name of the
load balancing virtual server to which the request is forwarded.
3. Configure the HTTP callout to respond with the name of the load balancing virtual server from
a request that contains the client IP address in the HTTP header “X-CLIENT-IP”.
Note: You must bind a load balancing virtual server to the content switching virtual server to
account for:
• The non-availability of the load balancing virtual server that the callout resolves to.
• A UNDEF condition that results from the execution of the callout.
6. Binding the content switching policy to the content switching virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Policy expressions for string matching operations on a large set of string patterns tend to become long
and complex. Resources consumed by the evaluation of such complex expressions are significant in
terms of processing cycles, memory, and configuration size. You can create simpler, less resource-
intensive expressions by using pattern matching.
Depending on the type of patterns that you want to match, you can use one of the following features
to implement pattern matching:
• A pattern set is an array of indexed patterns used for string matching during default syntax policy
evaluation. Example of a pattern set: imagetypes {svg, bmp, png, gif, tiff, jpg}.
• A data set is a specialized form of pattern set. It is an array of patterns of types number (integer),
IPv4 address, or IPv6 address.
In many cases, you can use either pattern sets or data sets. However, in cases where you want specific
matches for numerical data or IPv4 and IPv6 addresses, you must use data sets.
Note:
Pattern sets
and data sets can be used only in default syntax policies.
To use pattern sets or data sets, first create the pattern set or data set and bind patterns to it. Then,
when you configure a policy for comparing a string in a packet, use an appropriate operator and pass
the name of the pattern set or data set as an argument.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
How string matching works with pattern sets and data sets
January 6, 2019
Contributed by:
C
A pattern set or data set contains a set of patterns, and each pattern is assigned a unique index. When
a policy is applied to a packet, an expression identifies a string to be evaluated, and the operator
compares the string to the patterns defined in the pattern set or data set until a match is found or all
patterns have been compared. Then, depending on its function, the operator returns either a boolean
value that indicates whether or not a matching pattern was found or the index of the pattern that
matches the string.
Note: This topic explains the working of a pattern set. Data sets work the same way. The only differ-
ence between pattern sets and data sets is the type of patterns defined in the set.
Consider the following use case to understand how patterns can be used for string matching.
You want to determine whether the URL suffix (target text) contains any of the image file extensions.
Without using pattern sets, you would have to define a complex expression, as follows:
1 HTTP.REQ.URL.SUFFIX.CONTAINS(”svg”) ¦¦ HTTP.REQ.URL.SUFFIX.CONTAINS(”
bmp”) ¦¦ HTTP.REQ.URL.SUFFIX.CONTAINS(”png”) ¦¦
2 HTTP.REQ.URL.SUFFIX.CONTAINS(”gif”) ¦¦ HTTP.REQ.URL.SUFFIX.CONTAINS(”
tiff”) ¦¦ HTTP.REQ.URL.SUFFIX.CONTAINS(”jpg”)
If the URL has a suffix of “jpg,” with the above compound expression, the Citrix ADC appliance has to
iterate through the entire compound expression sequentially, from one sub expression to the next, to
determine that the request refers to a jpg image. The following figure shows the steps in the process.
When a compound expression includes hundreds of sub expressions, the above process is resource
intensive. A better alternative is an expression that invokes a pattern set, as shown in the following
figure.
During policy evaluation as shown above, the operator (CONTAINS_ANY) compares the string identi-
fied in the request with the patterns defined in the pattern set until a match is found. With the Sam-
ple_Patset expression, the multiple iterations through six sub expressions are reduced to just one.
By eliminating the need to configure compound expressions that perform string matching with mul-
tiple OR operations, pattern sets or data sets simplify configuration and accelerate processing of re-
quests and responses.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To configure a pattern set, you must specify the strings that are to serve as patterns. You can manually
assign a unique index value to each of these patterns, or you can allow the index values to be assigned
automatically.
Note: Pattern sets are case sensitive (unless you specify the expression to ignore case). Therefore, the
string pattern “product1,” for example, is not the same as the string pattern “Product1.”
• You cannot bind the same index value to more than one pattern.
• An automatically assigned index value is one number larger than the highest index value of the
existing patterns within the pattern set. For example, if the highest index value of existing pat-
terns in a pattern set is 104, the next automatically assigned index value will be 105.
• If you do not specify an index for the first pattern, index value 1 is automatically assigned to that
pattern.
• Index values are not regenerated automatically if one or more patterns are deleted or modified.
For example, if the set contains five patterns, with indexes from 1 through 5, and if the pattern
with an index of 3 is deleted, the other index values in the pattern set are not automatically
regenerated to produce values from 1 through 4.
• The maximum index value that can be assigned to a pattern is 4294967290. If that value is
already assigned to a pattern in the set, you must manually assign index values to any newly
added patterns. An unused index value that is lower than a currently used value cannot be as-
signed automatically.
Example:
Example:
Note: Repeat this step for all the patterns you want to bind to the pattern set.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To configure a data set, you must specify the strings that are to serve as patterns, and assign a type
(number, IPv4 address, or IPv6 address) to each pattern. You can manually assign a unique index value
to each of these patterns, or you can allow the index values to be assigned automatically. Dataset is
not related to HTTP or any 7 layer protocol. It works only on text/string. There are different types
of dataset such as num, ulong, ipv4, and ipv6. To use a dataset on IP, we have to convert the input into
text/string.
Note: Data sets are case sensitive (unless you specify the expression to ignore case). Therefore, the
string pattern “product1,” for example, is not the same as the string pattern “Product1.”
The rules applied for index values of data sets are the same as those applied for pattern sets. For
information about index values, see Configuring a Pattern Set.
1 **Example:**
2
3 ‘‘‘
4 > add policy dataset sampledataset ipv4
5 ‘‘‘
Example:
Note: Repeat this step for all the patterns you want to bind to the data set.
Navigate to AppExpert > Data Sets, click Add and specify the relevant details.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Default syntax policy expressions that take pattern sets or data sets as an argument can be used to
perform string matching operations.
1 <text>.<operator>(”<name>”)
where,
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Sample usage
Contributed by:
C
To understand the usage of pattern sets in expressions, consider the example of a pattern set named
“imagetypes.”
svg 1
bmp 2
png 3
gif 4
tiff 5
jpg 6
Example 1: Determine whether the suffix of an HTTP request is one of the file extensions defined in
the “imagetypes” pattern set.
• Expression. HTTP.REQ.URL.SUFFIX.EQUALS_ANY(“imagetypes”)
• Sample URL. http://www.example.com/homepageicon.jpg
• Result. TRUE
Example 2: Determine whether the suffix of an HTTP request is one of the file extensions defined in
the “imagetypes” pattern set, and return the index of that pattern.
• Expression. HTTP.REQ.URL.SUFFIX.EQUALS_INDEX(“imagetypes”)
• Sample URL. http://www.example.com/mylogo.gif
• Result. 4 (The index value of the pattern “gif”.)
Example 3: Use the index value of a pattern to determine whether the URL suffix is within a specified
index-value range.
Example 4: Implement one set of policies for file extensions bmp, jpg, and png, and a different set of
policies for gif, tiff, and svg files.
An expression that returns the index of a matched pattern can be used to define traffic subsets for
a web application. The following two expressions could be used in content switching policies for a
content switching virtual server:
• HTTP.REQ.URL.SUFFIX.EQUALS_INDEX(“imagetypes”).LE(3)
• HTTP.REQ.URL.SUFFIX.EQUALS_INDEX(“imagetypes”).GE(4)
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Variables
Values for these variables are set using assignments which must be invoked on policy actions.
Variables Scope
A map variable or a singleton variable can have a global scope. Alternatively, the scope of a singleton
variable can be limited to a single transaction.
• Global Scope Variable - A variable with global scope (the default) has only one instance, and
that instance has the same value(s) across all cores of a NetScaler appliance and across all nodes
of a cluster or HA configuration. Global variable values exist until they are explicitly deleted,
until they expire, or until a standalone appliance is restarted or all nodes of a cluster or HA con-
figuration are restarted.
• Transaction Scope Variable - A variable with transaction scope has a separate instance, with
its own value, for each transaction processed by the NetScaler appliance. When the transaction
processing is complete, the transaction variable value is deleted.
Note: Transaction scope variables are available in NetScaler release 10.5.e or later.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You must first create a variable and then assign a value or specify the operation that must be per-
formed on the variable. After performing these operations, you can use the assignment as a policy
action.
Note: Once configured, a variable’s settings cannot be modified or reset. If the variable needs to
be changed, the variable and all references to the variable (expressions and assignments) must be
deleted. The variable can then be re-added with new settings, and the references (expressions and
assignments) can be re-added.
1. Create a variable.
Note: Refer to the man page “man add ns variable” for description of the command parameters.
Example 2: Create a map named “user_privilege_map”. The map will contain keys of maximum length
15 characters and text values of maximum length 10 characters, with a maximum of 10000 entries.
Note: If the map contains 10000 unexpired entries, assignments for new keys reuse one of the least
recently used entries. By default, an expression trying to get a value for a non-existent key will initialize
an empty text value.
Assign the value or specify the operation to be performed on the variable. This is done by creating an
assignment.
Note: If an entry for that key already exists, the value will be replaced. Otherwise a new entry for the
key and value will be added. Based on the previous declaration for user_privilege_map, if the map
already has 10000 entries, one of the least recently used entries will be reused for the new key and
value.
• $name.valueCount. Returns the number of values currently held by the variable. This is
the number of entries in a map. For a singleton variable, this is 0 if the variable is uninitial-
ized or 1 otherwise.
Add a singleton variable of type text. This variable can hold maximum 100 Bytes data.
Add an assignment action, which will be used to store the HTTP request data into the variable.
Add a rewrite action to insert HTTP header, whose value will be fetched from the variable.
Add a rewrite policy which will evaluate in the request time, and take assignment action to store
data. When we hit this policy, we’ll take assignment action and store the data into the ns variable
(http_req_data)
Add a rewrite policy which will evaluate in the response time, and add an HTTP header in the response.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
In this use case, user privileges (“GOLD”, “SILVER”, and so on) must be retrieved from an external web
service.
Create an HTTP callout to fetch the user privileges from the external web service.
Create a policy to check if there is already a cached entry for the client’s IP address; if not, it calls the
HTTP callout to set a map entry for the client.
Create a policy that compresses if the cached privilege entry for the client is “GOLD”.
2
3 bind cmp global set_user_privilege_pol -priority 10 NEXT
4
5 bind cmp global compress_if_gold_privilege_pol -priority 20 END
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
In this use case, the requirement is to limit the number of active backend sessions. In the deployment,
each session login has login in the URL and each session logout has logout in the URL. On successful
login, the backend sets a sessionid cookie with a unique 10 character value.
1. Create a map variable that can store each active session. The key of the map is the sessionid.
The expiry time for the variable is set to 600 seconds (10 minutes).</span>
• Create an entry for the sessionid and set that value to 1 (this value is not actually
used).</span>
• Deallocate the entry for a session ID, which implicitly decrements the value count for ses-
sion_map.</span>
• To check if a map entry exists for that sessionid in the HTTP request. The add_session
assignment is executed if the map entry does not exist.</span>
Note: The
valueExists() function in the
add_session_pol policy counts as a reference to the session’s map entry, so each request
resets the expiration timeout for its session. If no requests for a session are received after
10 minutes, the session’s entry will be deallocated.
• To check when the session is logged out. The delete_session assignment is exe-
cuted.</span>
• To check for login requests and if the number of active sessions exceed 100. If these condi-
tions are satisfied, in order to limit the number of sessions, the user is redirected to a page
that indicates that the server is busy.</span>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following topics provide the conceptual and reference information that you require for configur-
ing advanced policies on the Citrix® NetScaler® appliance.
You can also download a list of all the expressions supported on the NetScaler appliance and the hi-
erarchical order in which they can be invoked. The reference is in a zip file which you can download
from:
Advanced Expressions: Parsing SSL Certificates Describes how to configure expressions for SSL
traffic and client certificates, for example, how
to retrieve the expiration date of a certificate or
the certificate issuer.
Advanced Expressions: IP and MAC Addresses, Describes expressions that you can use to work
Throughput, VLAN IDs with any other client- or server-related data not
discussed in other chapters.
Typecasting Data Describes expressions for transforming data of
one type to another.
Regular Expressions Describes how to pass regular expressions as
arguments to operators in advanced
expressions.
Configuring Classic Policies and Expressions Provides details on how to configure the
simpler policies and expressions known as
classic policies and classic expressions.
Expressions Reference A reference for classic and advanced
expression arguments.
Summary Examples of Advanced Expressions Examples of classic and advanced expressions
and Policies and policies, in both quick reference and
tutorial format, that you can customize for
your own use.
Tutorial Examples of Advanced Policies for Examples of advanced policies for use in the
Rewrite Rewrite feature.
Tutorial Examples of Classic Policies Examples of classic policies for NetScaler
features such as application firewall and SSL.
Migration of Apache mod_rewrite Rules to Examples of functions that were written using
Advanced Policies the Apache HTTP Server mod_rewrite engine,
with examples of these functions after
translation into Rewrite and Responder
policies on the NetScaler.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
For many NetScaler features, policies control how a feature evaluates data, which ultimately deter-
mines what the feature does with the data. A policy uses a logical expression, also called a rule, to
evaluate requests, responses, or other data, and applies one or more actions determined by the out-
come of the evaluation. Alternatively, a policy can apply a profile, which defines a complex action.
Some NetScaler features use default syntax policies, which provide greater capabilities than do the
older, classic, policies. If you migrated to a newer release of the NetScaler software and have con-
figured classic policies for features that now use default syntax policies, you might have to manually
migrate policies to the default syntax.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Warning
Classic policy expressions are no longer supported from NetScaler 12.0 build 56.20 onwards and
as an alternative, Citrix recommends you to use Advanced policies. For more information, see
Advanced Policies
Classic policies evaluate basic characteristics of traffic and other data. For example, classic policies
can identify whether an HTTP request or response contains a particular type of header or URL.
Advanced policies can perform the same type of evaluations as classic policies. In addition, default
syntax policies enable you to analyze more data (for example, the body of an HTTP request) and to
configure more operations in the policy rule (for example, transforming data in the body of a request
into an HTTP header).
In addition to assigning a policy an action or profile, you bind the policy to a particular point in the
processing associated with the NetScaler features. The bind point is one factor that determines when
the policy will be evaluated.
Default syntax policies use a powerful expression language that is built on a class-object model, and
they offer several options that enhance your ability to configure the behavior of various NetScaler
features. With default syntax policies, you can do the following:
• Perform fine-grained analyses of network traffic from layers 2 through 7.
• Evaluate any part of the header or body of an HTTP or HTTPS request or response.
• Bind policies to the multiple bind points that the default syntax policy infrastructure supports
at the default, override, and virtual server levels.
• Use goto expressions to transfer control to other policies and bind points, as determined by the
result of expression evaluation.
• Use special tools such as pattern sets, policy labels, rate limit identifiers, and HTTP callouts,
which enable you to configure policies effectively for complex use cases.
Additionally, the GUI extends robust graphical user interface support for default syntax policies and
expressions and enables users who have limited knowledge of networking protocols to configure poli-
cies quickly and easily. The GUI also includes a policy evaluation feature for default syntax policies.
You can use this feature to evaluate a default syntax policy and test its behavior before you commit it,
thus reducing the risk of configuration errors.
For example, a rule can enable the NetScaler to determine whether an HTTP request originated
from a particular IP address, or whether a Cache-Control header in an HTTP request has the
value “No-Cache.”
Advanced policies can use all of the expressions that are available in a classic policy, with the
exception of classic expressions for the SSL VPN client. In addition, Advanced policies enable
you to configure more complex expressions.
• Bindings.
To ensure that the NetScaler can invoke a policy when it is needed, you associate the policy, or
bind it, to one or more bind points.
You can bind a policy globally or to a virtual server. For more information, see “About policy
bindings.”
• An associated action.
An action is a separate entity from a policy. Policy evaluation ultimately results in the NetScaler
performing an action.
For example, a policy in the integrated cache can identify HTTP requests for .gif or .jpeg files.
An action that you associate with this policy determines that the responses to these types of
requests are served from the cache.
For some features, you configure actions as part of a more complex set of instructions known
as a profile.
The NetScaler supports a variety of features that rely on policies for operation. The following table
summarizes how the NetScaler features use policies.
Policies do not themselves take action on data. Policies provide read-only logic for evaluating traffic.
To enable a feature to perform an operation based on a policy evaluation, you configure actions or
profiles and associate them with policies.
Note: Actions and profiles are specific to particular features. For information about assigning actions
and profiles to features, see the documentation for the individual features.
About actions
Actions are steps that the NetScaler takes, depending on the evaluation of the expression in the policy.
For example, if an expression in a policy matches a particular source IP address in a request, the action
that is associated with this policy determines whether the connection is permitted.
The types of actions that the NetScaler can take are feature specific. For example, in Rewrite, ac-
tions can replace text in a request, change the destination URL for a request, and so on. In Integrated
Caching, actions determine whether HTTP responses are served from the cache or an origin server.
In some NetScaler features actions are predefined, and in others they are configurable. In some cases,
(for example, Rewrite), you configure the actions using the same types of expressions that you use to
configure the associated policy rule.
About profiles
Some NetScaler features enable you to associate profiles, or both actions and profiles, with a policy.
A profile is a collection of settings that enable the feature to perform a complex function. For example,
in the application firewall, a profile for XML data can perform multiple screening operations, such as
examining the data for illegal XML syntax or evidence of SQL injection.
The following table summarizes the use of actions and profiles in different NetScaler features. The
table is not exhaustive. For more information about specific uses of actions and profiles for a feature,
see the documentation for the feature.
A policy is associated with, or bound to, an entity that enables the policy to be invoked. For example,
you can bind a policy to request-time evaluation that applies to all virtual servers. A collection of
policies that are bound to a particular bind point constitutes a policy bank.
For classic policies, policy groups and policies within a group are evaluated in a particular order, de-
pending on the following:
• The bind point for the policy, for example, whether the policy is bound to request-time process-
ing for a virtual server or global response-time processing. For example, at request time, the
NetScaler evaluates all request-time classic policies before evaluating any virtual server-specific
policies.
• The priority level for the policy. For each point in the evaluation process, a priority level that
is assigned to a policy determines the order of evaluation relative to other policies that share
the same bind point. For example, when the NetScaler evaluates a bank of request-time, virtual
server-specific policies, it starts with the policy that is assigned to the lowest priority value. In
classic policies, priority levels must be unique across all bind points.
For Advanced policies, as with classic policies, the NetScaler selects a grouping, or bank, of policies
at a particular point in overall processing. Following is the order of evaluation of the basic groupings,
or banks, of Advanced policies:
However, within any of the preceding banks of policies, the order of evaluation is more flexible than
in classic policies. Within a policy bank, you can point to the next policy to be evaluated regardless of
the priority level, and you can invoke policy banks that belong to other bind points and user-defined
policy banks.
As traffic flows through the NetScaler and is processed by various features, each feature performs pol-
icy evaluation. Whenever a policy matches the traffic, the NetScaler stores the action and continues
processing until the data is about to leave the NetScaler. At that point, the NetScaler typically applies
all matching actions. Integrated Caching, which only applies a final Cache or NoCache action, is an
exception.
Some policies affect the outcome of other policies. Following are examples:
• If a response is served from the integrated cache, some other NetScaler features do not process
the response or the request that initiated it.
• If the Content Filtering feature prevents a response from being served, no subsequent features
evaluate the response.
If the application firewall rejects an incoming request, no other features can process it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
One of the most fundamental components of a policy is its rule. A policy rule is a logical expression that
enables the policy to analyze traffic. Most of the policy’s functionality is derived from its expression.
An expression matches characteristics of traffic or other data with one or more parameters and values.
For example, an expression can enable the NetScaler to accomplish the following:
• Determine whether a request contains a certificate.
• Determine the IP address of a client that sent a TCP request.
• Identify the data that an HTTP request contains (for example, a popular spreadsheet or word
processing application).
• Calculate the length of an HTTP request.
Classic expressions enable you to evaluate basic characteristics of data. They have a structured syntax
that performs string matching and other operations.
Following are a few simple examples of classic expressions:
• An HTTP response contains a particular type of Cache Control header.
res.http.header Cache-Control contains public
• An HTTP response contains image data.
res.http.header Content-Type contains image/
• An SSL request contains a certificate.
req.ssl.client.cert exists
Any feature that uses default syntax policies also uses Advanced expressions. For information about
which features use Advanced policies, see the table NetScaler Feature, Policy Type, and Policy Usage.
Advanced policy expressions have a few other uses. In addition to configuring Advanced expressions
in policy rules, you configure Advanced
expressions in the following situations:
• Integrated Caching:
You use Advanced policy expressions to configure a selector for a content group in the integrated
cache.
• Load Balancing:
You use Advanced policy expressions to configure token extraction for a load balancing virtual
server that uses the TOKEN method for load balancing.
• Rewrite:
• Rate-based policies:
You use Advanced policy expressions to configure limit selectors when configuring a policy to
control the rate of traffic to various servers.
• An HTTP request contains a cookie that has fewer than 500 characters.
http.req.url.contains(”.html”)
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
You can convert a classic expression to the Advanced policy expression by using the nspepi conversion
tool. You can also use the tool to convert all the classic expressions in the NetScaler configuration
to the Advanced policy (with the exception of NetScaler entities that currently support only classic
expressions).
The conversion tool does not convert policies configured for the following features because the fea-
tures currently support only classic policies:
• Authentication, Pre-authentication
• SSL
• Cache redirection
• VPN (session, traffic, and tunnel traffic)
• Content filtering (The responder feature not only provides you with functionality that is equiv-
alent to that provided by the content filtering feature but also surpasses the content filtering
feature in the use cases that it supports. Additionally, responder supports the more powerful
default syntax for policy expressions.)
The following NetScaler features support both classic and Advanced policy expression and, therefore,
support the conversion of classic expressions to Advanced policy expressions:
When parsing a NetScaler configuration file, the conversion tool performs the following actions:
1. In commands that create classic named expressions, the conversion tool replaces the names of
the classic expressions with Advanced policy expression.
2. In commands that support only the classic policy, if classic named expressions are used, the
conversion tool replaces the names of the classic expressions with the actual classic expressions
they represent. This action ensures that the names of expressions in classic-only features do not
reference the Advanced policy expression created from Step 1.
3. In commands associated with entities that support both the classic syntax and the Advanced
policies, the conversion tool replaces all classic expressions in commands with Advanced policy
expressions.
Example:
In the commands that create the classic named expressions ne_c1 and ne_c2, the tool replaces the
names of the expressions with actual Advanced policy expression. This action, which corresponds to
Step 1 described earlier, results in the following commands:
The filter policy command supports only the classic syntax. Therefore, the conversion tool replaces
the classic named expression ne_c1 with the actual classic expression it represents. Note that the
tool replaces ne_c1 in the expression for ne_c2, and then replaces ne_c2 in the filter policy with the
classic expression. This action, which corresponds to Step 2 described earlier, results in the following
command:
The compression feature supports both classic and Advanced policy expression. Therefore, in the
command that creates the compression policy pol2, the conversion tool replaces the expression with
Advanced policy expression. This action, which corresponds to Step 3 described earlier, results in the
following command:
The command that creates the compression policy pol3 is unaffected by the conversion process be-
cause, after the conversion process is complete, ne_c1 and ne_c2 reference the Advanced policy ex-
pression that results from Step 1.
Client security messages are not supported in the newer default policy format and, therefore, are lost.
The
SYS.EVAL_CLASSIC_EXPR function is replaced with a Advanced policy expression. The following enti-
ties support the
SYS.EVAL_CLASSIC_EXPR function:
• DNS policies
• Rate limit selectors
• Cache selectors
• Cache policies
• Content switching policies
• Rewrite policies
• URL transformation policies
• Responder policies
• Application firewall policies
• Authorization policies
• Compression policies
• CVPN access policies
After performing the conversion, the tool saves the changes in a new configuration file. The new config-
uration file is created in the directory in which the input file exists. The name of the new configuration
file is the same as the name of the input configuration file except for the string new_ used as a prefix.
Conversion warnings are reported in a warning line at the end of the screen output. Additionally, a
warning file is created in the directory in which the input configuration file resides. For more informa-
tion about the warning file and the types of warnings that are reported, see “Conversion warnings.”
Convert expressions
You can use the nspepi tool to convert a single classic expression to the Advanced policy expression.
The nspepi tool must be run from the shell prompt on the NetScaler appliance.
Example:
You can use the nspepi tool to convert all the classic expressions in a NetScaler configuration file to the
Advanced policy (except for those commands that do not support the Advanced policy). The nspepi
tool must be run from the shell prompt on the NetScaler appliance.
Convert all the classic expressions in a NetScaler configuration file to the default syntax by
using the CLI
Example:
5 WARNINGS: Line numbers which has bind command issues: 305, 306, 706,
707, 708, 709, 710, 711, 712, 713,
6 714, 715, 767, 768, 774, 775, 776, 777
7 root@NS#
Conversion warnings
When classic expressions that are included in CLI commands are upgraded to the Advanced policy,
the number of characters in the expression might exceed the 1499-character limit. The commands
that include expressions longer than 1499 characters fail when the configuration is being applied. You
must manually update these commands.
In addition, multiple classic policies can be bound to a given bind point with priority 0 or with equal
priority, but the Advanced policy infrastructure does not support a priority value of 0 or policies with
the same priority at a given bind point. These commands fail when the configuration is being applied.
The commands must be updated manually with the correct priority values.
The line numbers of lines that threw a warning during conversion are listed at the end of the output in
a warning line. In addition, a warning file is created in the same directory as the one in which the old
and new configuration files reside. The name of the warning file is the same as the name of the input
configuration file except that the string warn_ is added as a prefix.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Before configuring expressions and policies, be sure you understand the relevant NetScaler feature
and the structure of your data, as follows:
You may want to run a trace on the type of traffic or content that you want to configure. This will give
you an idea of the parameters and values, and operations on these parameters and values, that you
need to specify in an expression.
Note: The NetScaler supports either classic or Advanced policy within a feature. You cannot have
both types in the same feature. Over the past few releases, some NetScaler features have migrated
from using classic policies and expressions to Advanced policy and expressions. If a feature of inter-
est to you has changed to the Advanced policy format, you may have to manually migrate the older
information. Following are guidelines for deciding if you need to migrate your policies:
• If you configured classic policies in a version of the Integrated Caching feature prior to release
9.0 and then upgrade to version 9.0 or later, there is no impact. All legacy policies are migrated
to the Advanced policy format.
• For other features, you need to manually migrate classic policies and expressions to the Ad-
vanced syntax if the feature has migrated to the Advanced policy.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can create advanced policies for various NetScaler features, including DNS, Rewrite, Responder,
and Integrated Caching, and the clientless access function in the NetScaler Gateway. Policies control
the behavior of these features.
When you create a policy, you assign it a name, a rule (an expression), feature-specific attributes, and
an action that is taken when data matches the policy. After creating the policy, you determine when
it is invoked by binding it globally or to either request-time or response-time processing for a virtual
server.
Policies that share the same bind point are known as a policy bank. For example, all policies that are
bound to a virtual server constitute the policy bank for the virtual server. When binding the policy, you
assign it a priority level to specify when it is invoked relative to other policies in the bank. In addition
to assigning a priority level, you can configure an arbitrary evaluation order for policies in a bank by
specifying Goto expressions.
In addition to policy banks that are associated with a built-in bind point or a virtual server, you can
configure policy labels. A policy label is a policy bank that is identified by an arbitrary name. You
invoke a policy label, and the policies in it, from a global or virtual-server-specific policy bank. A policy
label or a virtual-server policy bank can be invoked from multiple policy banks.
For some features, you can use the policy manager to configure and bind policies.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Note: The NetScaler appliance performs a case-insensitive comparison of identifiers with these words
and enumeration constants. For example, names of the identifiers cannot begin with
TRUE,
True, or
true.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
All policies have some common elements. Creating a policy consists, at minimum, of naming the pol-
icy and configuring a rule. The policy configuration tools for the various features have areas of overlap,
but also differences. For the details of configuring a policy for a particular feature, including associat-
ing an action with the policy, see the documentation for the feature.
To create a policy, begin by determining the purpose of the policy. For example, you may want to
define a policy that identifies HTTP requests for image files, or client requests that contain an SSL
certificate. In addition to knowing the type of information that you want the policy to work with, you
need to know the format of the data that the policy is analyzing.
Next, determine whether the policy is globally applicable, or if it pertains to a particular virtual server.
Also consider the effect that the order in which your policies are evaluated (which will be determined
by how you bind the policies) will have on the policy that you are about to configure.
At the command prompt, type the following commands to create a policy and verify the configuration:
Example 1:
Example 2:
Note: At the command line, quote marks within a policy rule (the expression) must be escaped or
delimited with the q delimiter. For more information, seeConfigure advanced policy expressions: Get
started.
1. In the navigation pane, expand the name of the feature for which you want to configure a policy,
and then click Policies. For example, you can select Content Switching, Integrated Caching,
DNS, Rewrite, or Responder.
2. In the details pane, click Add, or select an existing policy and click Open. A policy configuration
dialog box appears.
3. Specify values for the following parameters. (An asterisk indicates a required parameter. For a
term in parentheses, see the corresponding parameter in “Parameters for creating or modifying
a policy.”)
4. Click Create, and then click Close.
5. Click Save. A policy is added.
Note: After you create a policy, you can view the policy’s details by clicking the policy entry in the
configuration pane. Details that are highlighted and underlined are links to the corresponding
entity (for example, a named expression).
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
These examples show how policies and their associated actions are entered at the command line inter-
face. In the GUI, the expressions would appear in the Expression window of the feature-configuration
dialog box for the integrated caching or rewrite feature.
Following is an example of creating a caching policy. Note that actions for caching policies are built
in, so you do not need to configure them separately from the policy.
Note: At the command line, quote marks within a policy rule (the expression) must be escaped or
delimited with the q delimiter. For more information, see Configure advanced policy expressions: Get
started.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After defining a policy, you indicate when the policy is to be invoked by binding the policy to a bind
point and specifying a priority level. You can bind a policy to only one bind point. A bind point can
be global, that is, it can apply to all virtual servers that you have configured. Or, a bind point can
be specific to a particular virtual server, which can be either a load balancing or a content switching
virtual server. Not all bind points are available for all features.
The order in which policies are evaluated determines the order in which they are applied, and features
typically evaluate the various policy banks in a particular order. Sometimes, however, other features
can affect the order of evaluation. Within a policy bank, the order of evaluation depends on the values
of parameters configured in the policies. Most features apply all of the actions associated with policies
whose evaluation results in a match with the data that is being processed. The integrated caching
feature is an exception.
You can bind policies to built-in, global bind points (or banks), to virtual servers, or to policy labels.
However, the NetScaler features differ in terms of the types of bindings that are available. The follow-
ing table summarizes how you use policy bindings in various NetScaler features that use policies.
NetScaler Gate- VPN server Clientless Access VPN Global, VPN To determine
way (clientless policies server how
VPN functions the NetScaler
only) Gateway per-
forms
authentication,
authorization,
auditing, and
other functions,
and to define
rewrite rules for
general Web
access using
the NetScaler
Gateway.
For a policy to take effect, you must ensure that the policy is invoked at some point during processing.
To do so, you associate the policy with a bind point. The collection of policies that is bound to a bind
point is known as a policy bank.
Following are the bind points that the NetScaler evaluates, listed in the typical order of evaluation
within a policy bank
1. Request-time override. When a request flows through a feature, the NetScaler first evaluates
request-time override policies for the feature.
2. Request-time Load Balancing virtual server. If policy evaluation cannot be completed after all
the request-time override policies have been evaluated, the NetScaler processes request-time
policies for load balancing virtual servers.
3. Request-time Content Switching virtual server. If policy evaluation cannot be completed
after all the request-time policies for load balancing virtual servers have been evaluated, the
NetScaler processes request-time policies for content switching virtual servers.
4. Request-time default. If policy evaluation cannot be completed after all request-time, virtual
server-specific policies have been evaluated, the NetScaler processes request-time Advanced
policies.
5. Response-time override. At response time, the NetScaler starts with policies that are bound
to the response-time override bind point.
6. Response-time Load Balancing virtual server. If policy evaluation cannot be completed after
all response-time override policies have been evaluated, the NetScaler process the response-
time policies for load balancing virtual servers.
7. Response-time Content Switching virtual server. If policy evaluation cannot be completed
after all policies have been evaluated for load balancing virtual servers, the NetScaler process
the response-time policies for content switching virtual servers.
8. Response-time default. If policy evaluation cannot be completed after all response-time,
virtual-server-specific policies have been evaluated, the NetScaler processes response-time
Advanced policies.
In addition to attending to evaluation of policies within a feature, if you have bound policies to a con-
tent switching virtual server, note that these policies are evaluated before other policies. Binding a
policy to a content switching vserver produces a different result in NetScaler versions 9.0.x and later
than in 8.x versions. In NetScaler 9.0 and later versions, evaluation occurs as follows:
• Content switching policies are evaluated before other policies. If a content switching policy
evaluates to TRUE, the target load balancing vserver is selected.
• If all content switching policies evaluate to FALSE, the default load balancing vserver under the
content switching VIP is selected.
After a target load balancing vserver is selected by the content switching process, policies are evalu-
ated in the following order:
1. Policies that are bound to the global override bind point.
2. Policies that are bound to the default load balancing vserver.
3. Policies that are bound to the target content switching vserver.
4. Policies that are bound to the global default bind point.
To be sure that the policies are evaluated in the intended order, follow these guidelines:
• Make sure that the default load balancing vserver is not directly reachable from the outside; for
example, the vserver IP address can be 0.0.0.0.
• To prevent exposing internal data on the load balancing default vserver, configure a policy to re-
spond with a “503 Service Unavailable” status and bind it to the default load balancing vserver.
Each entry in a policy bank has, at minimum, a policy and a priority level. You can also configure
entries that change the priority-based evaluation order, and you can configure entries that invoke
Policy Bank to
Policy Name Priority Goto Expression Invocation Type Be Invoked
If the policy evaluates to TRUE, the NetScaler stores the action that is associated with the policy. If
the policy evaluates to FALSE, the NetScaler evaluates the next policy. If the policy is neither TRUE
nor FALSE, the NetScaler uses the associated Undef (undefined) action.
Within a policy bank, the evaluation order depends on the following items:
• A priority.
The most minimal amount of information about evaluation order is a numeric priority level. The
lower the number, the higher the priority.
• A Goto expression.
If supplied, the Goto expression indicates the next policy to be evaluated, typically within the
same policy bank.. Goto expressions can only proceed forward in a bank. To prevent looping, a
policy bank configuration is not valid if a Goto statement points backwards in the bank.
Any entry can invoke an external policy bank. The NetScaler provides a built-in entity named
NOPOLICY that does not have a rule. You can add a NOPOLICY entry in a policy bank when you
want to invoke another policy bank, but do not want to process any other rules prior to the
invocation. You can have multiple NOPOLICY entries in multiple policy banks.
• NEXT.
This keyword selects the policy with the next higher priority level in the current policy bank.
• An integer.
If you supply an integer, it must match the priority level of another policy in the current policy
bank.
• END.
This keyword stops evaluation after processing the current policy, and no additional policies in
this bank are processed.
• Blank.
• A numeric expression.
This is an advanced policy expression that resolves to a priority number for another policy in
the current bank.
• USE_INVOCATION_RESULT.
This phrase can be used only if you are invoking an external policy bank. Entering this phrase
causes the NetScaler to perform one of the following actions:
– If the final Goto in the invoked policy bank has a value of END or is empty, the invocation
result is END, and evaluation stops.
– If the final Goto expression in the invoked policy bank is anything other than END, the
NetScaler performs a NEXT.
The following table illustrates a policy bank that uses Goto statements and policy bank invocations.
Policy Bank to
Policy Name Priority Goto Invocation Be Invoked
ClientCertificatePolicy
100 300 None None
(rule: does the
request contain
a client
certificate?)
Policy Bank to
Policy Name Priority Goto Invocation Be Invoked
Table 3. Example of a Policy Bank That Uses Gotos and External Bank Invocations
Evaluation of a policy bank ends when one of the following takes place:
• An external policy bank is invoked, its evaluation returns an END, and the Goto statement uses
a value of USE_INVOCATION_RESULT or END.
Evaluation continues with the next policy bank for this feature. For example, if the current bank
is the request-time override bank, the NetScaler next evaluates request-time policy banks for
the virtual servers.
• The NetScaler has walked through all the policy banks in this feature, but has not encountered
an END.
If this is the last entry to be evaluated in this policy bank, the NetScaler proceeds to the next
feature.
After evaluating all relevant policies for a particular data point (for example, an HTTP request), the
NetScaler stores all the actions that are associated with any policy that matched the data.
For most features, all the actions from matching policies are applied to a traffic packet as it leaves the
NetScaler. The Integrated Caching feature only applies one action: CACHE or NOCACHE. This action
is associated with the policy with the lowest priority value in the “highest priority” policy bank (for
example, request-time override policies are applied before virtual server-specific policies).
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following binding procedures are typical. However, refer to the documentation for the feature of
interest to you for complete instructions.
At the command prompt, type the following commands to bind an Integrated Caching policy and ver-
ify the configuration:
Example:
6
7 2) Global bindpoint: RES_DEFAULT
8 Number of bound policies: 1
9 Done
The type argument is optional to maintain backward compatibility. If you omit the type, the policy is
bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy rule is a response-time or
a request-time expression.
At the command prompt, type the following commands to bind a Rewrite policy and verify the config-
uration:
Example:
The type argument is optional for globally bound policies, to maintain backward compatibility. If you
omit the type, the policy is bound to REQ_DEFAULT or RES_DEFAULT, depending on whether the policy
rule is a response-time or a request-time expression.
At the command prompt, type the following commands to bind a compression policy and verify the
configuration:
2
3 - show cmp global
Example:
At the command prompt, type the following commands to bind a Responder policy and verify the
configuration:
Example:
At the command prompt, type the following commands to bind a DNS policy and verify the configura-
tion:
Example:
1. In the navigation pane, click the name of the feature for which you want to bind the policy.
2. In the details pane, click <Feature Name> policy manager.
3. In the Policy Manager dialog box, select the bind point to which you want to bind the policy
(for example, for Integrated Caching, Rewrite, or Compression, you could select Request and
Default Global). The Responder does not differentiate between request-time and response-time
policies.
4. Click Insert Policy and, from the Policy Name pop-up menu, select the policy name. A priority is
assigned automatically to the policy, but you can click the cell in the Priority column and drag it
anywhere within the dialog box if you want the policy to be evaluated after other policies in this
bank. The priority is automatically reset. Note that priority values within a policy bank must be
unique.
5. Click Apply Changes.
6. Click Close. A message in the status bar indicates that the policy is bound successfully.
5. Click OK. A message in the status bar indicates that the policy is bound successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
A globally bound policy applies to all load balancing and content switching virtual servers.
Note that when binding a policy to a virtual server, you must identify it as a request-time or a response-
time policy.
Bind a policy to a load balancing or content switching virtual server by using the CLI
At the command prompt, type the following commands to bind a policy to a load balancing or content
switching virtual server and verify the configuration:
Example:
At the command prompt, type the following commands to bind a policy to an SSL offload virtual server
and verify the configuration:
1. In the navigation pane, expand Traffic Management > Load Balancing, Traffic Management >
Content Switching, Traffic Management > SSL Offload, Security > AAA- Application Traffic, or
NetScaler Gateway, and then click Virtual Servers.
2. In the details pane, double-click the virtual server to which you want to bind the policy, and
then click Open.
3. On the Policies tab, click the icon for the type of policy that you want to bind (the choices are
feature-specific), and then click the name of the policy. Note that for some features, you can
bind both classic policies and policies that use the default syntax to the virtual server.
4. If you are binding a policy to a Content Switching virtual server, in the Target field select a load
balancing virtual server to which traffic that matches the policy is sent.
5. Click OK. A message in the status bar indicates that the policy is bound successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can display policy bindings to verify that they are correct.
At the command prompt, type the following commands to display policy bindings and verify the con-
figuration:
Example:
Display global policy bindings for integrated caching, rewrite, or responder by using
the GUI
1. In the navigation pane, expand the feature that contains the policy that you want to view, and
then click Policies.
2. In the details pane, click the policy. Bound policies have a check mark next to them.
3. At the bottom of the page, under Details, next to Bound to, view the entity to which the policy
is bound.
Display global policy bindings for DNS or clientless access in the NetScaler Gateway by
using the GUI
Display global policy bindings for content switching by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Unbind a policy
Contributed by:
C
If you want to re-assign a policy or delete it, you must first remove its binding.
At the command prompt, type the following commands to unbind an integrated caching, rewrite, or
compression Advanced policy globally and verify the configuration:
Example:
The priority is required only for the “dummy” policy named NOPOLICY.
At the command prompt, type the following commands to unbind a responder policy globally and
verify the configuration:
Example:
The priority is required only for the “dummy” policy named NOPOLICY.
At the command prompt, type the following commands to unbind a DNS policy globally and verify the
configuration:
Example:
At the command prompt, type the following commands to unbind an Advanced policy from a virtual
server and verify the configuration:
Example:
The priority is required only for the “dummy” policy named NOPOLICY.
1. In the navigation pane, click the feature with the policy that you want to unbind (for example,
Integrated Caching).
2. In the details pane, click <Feature Name> policy manager.
3. In the Policy Manager dialog box, select the bind point with the policy that you want to unbind,
for example, Advanced Global.
4. Click the policy name that you want to unbind, and then click Unbind Policy.
5. Click Apply Changes.
6. Click Close. A message in the status bar indicates that the policy is unbound successfully.
Unbind an advanced policy from a load balancing or content switching virtual server
by using the GUI
1. Navigate to Traffic Management, and expand Load Balancing or Content Switching, and then
click Virtual Servers.
2. In the details pane, double-click the virtual server from which you want to unbind the policy.
3. On the Policies tab, in the Active column, clear the check box next to the policy that you want
to unbind.
4. Click OK. A message in the status bar indicates that the policy is unbinded successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
In addition to the built-in bind points where you set up policy banks, you can also configure user-
defined policy labels and associate policies with them.
Within a policy label, you bind policies and specify the order of evaluation of each policy relative to
others in the bank of policies for the policy label. The NetScaler also permits you to define an arbitrary
evaluation order as follows:
• You can use “goto” expressions to point to the next entry in the bank to be evaluated after the
current one.
• You can use an entry in a policy bank to invoke another bank.
Each feature determines the type of policy that you can bind to a policy label, the type of load balanc-
ing virtual server that you can bind the label to, and the type of content switching virtual server from
which the label can be invoked. For example, a TCP policy label can only be bound to a TCP load bal-
ancing virtual server. You cannot bind HTTP policies to a policy label of this type. And you can invoke
a TCP policy label only from a TCP content switching virtual server.
After configuring a new policy label, you can invoke it from one or more banks for the built-in bind
points.
At the command prompt, type the following commands to create a Caching policy label and verify the
configuration:
Example:
At the command prompt, type the following commands to create a Content Switching policy label and
verify the configuration:
Example:
At the command prompt, type the following commands to create a Rewrite policy label and verify the
configuration:
Example:
At the command prompt, type the following commands to create a Responder policy label and verify
the configuration:
Example:
Note: Invoke this policy label from a policy bank. For more information, see the “Binding a Policy to
a Policy Label” section.
1. In the navigation pane, expand the feature for which you want to create a policy label, and then
click Policy Labels. The choices are Integrated Caching, Rewrite, Content Switching, or Respon-
der.
2. In the details pane, click Add.
3. In the Name box, enter a unique name for this policy label.
4. Enter feature-specific information for the policy label. For example, for Integrated Caching, in
the Evaluates drop-down menu, you would select REQ if you want this policy label to contain
request-time policies, or select RES if you want this policy label to contain response-time poli-
cies. For Rewrite, you would select a Transform name.
5. Click Create.
6. Configure one of the built-in policy banks to invoke this policy label. For more information, see
the “Binding a Policy to a Policy Label” section. A message in the status bar indicates that the
policy label is created successfully.
As with policy banks that are bound to the built-in bind points, each entry in a policy label is a policy
that is bound to the policy label. As with policies that are bound globally or to a vserver, each policy
that is bound to the policy label can also invoke a policy bank or a policy label that is evaluated after
the current entry has been processed. The following table summarizes the entries in a policy label.
• Name. The name of a policy, or, to invoke another policy bank without evaluating a policy, the
“dummy” policy name NOPOLICY.
You can specify NOPOLICY more than once in a policy bank, but you can specify a named policy
only once.
• Priority. An integer. This setting can work with the Goto expression.
• Goto Expression. Determines the next policy to evaluate in this bank. You can provide one of
the following values:
• Invocation Type. Designates a policy bank type. The value can be one of the following:
– Request Vserver. Invokes request-time policies that are associated with a virtual server.
– Response Vserver. Invokes response-time policies that are associated with a virtual
server.
– Policy label. Invokes another policy bank, as identified by the policy label for the bank.
• Invocation Name. The name of a virtual server or a policy label, depending on the value that
you specified for the Invocation Type.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you have created policies, and created policy banks by binding the policies, you can perform
additional configuration of policies within a label or policy bank. For example, before you configure
invocation of an external policy bank, you might want to wait until you have configured that policy
bank.
A policy label consists of a set of policies and invocations of other policy labels and virtual server-
specific policy banks. An Invoke parameter enables you to invoke a policy label or a virtual server-
specific policy bank from any other policy bank. A special-purpose NoPolicy entry enables you to
invoke an external bank without processing an expression (a rule). The NoPolicy entry is a “dummy”
policy that does not contain a rule.
For configuring policy labels from the NetScaler command line, note the following elaborations of the
command syntax:
At the command prompt, type the following commands to configure a policy label and verify the con-
figuration:
Example:
Invoke a policy label from a rewrite policy bank with a NOPOLICY entry by using the CLI
At the command prompt, type the following commands to invoke a policy label from a Rewrite policy
bank with a NOPOLICY entry and verify the configuration:
Example:
2 Done
3 > show rewrite global
4 1) Global bindpoint: REQ_DEFAULT
5 Number of bound policies: 1
6
7 2) Global bindpoint: REQ_OVERRIDE
8 Number of bound policies: 1
9 Done
Invoke a policy label from an Integrated Caching policy bank by using the CLI
At the command prompt, type the following commands to invoke a policy label from an Integrated
Caching policy bank and verify the configuration:
Example:
Invoke a policy label from a Responder policy bank by using the CLI
At the command prompt, type the following commands to invoke a policy label from a Responder
policy bank and verify the configuration:
2
3 - show responder global
Example:
1 > bind responder global NOPOLICY 100 NEXT -type DEFAULT -invoke
policylabel lbl-respndr-pol
2 Done
3 > show responder global
4 1) Global bindpoint: REQ_DEFAULT
5 Number of bound policies: 2
6
7 Done
1. In the navigation pane, expand the feature for which you want to configure a policy label, and
then click Policy Labels. The choices are Integrated Caching, Rewrite, or Responder.
2. In the details pane, double-click the label that you want to configure.
3. If you are adding a new policy to this policy label, click Insert Policy, and in the Policy Name
field, select New Policy. For more information about adding a policy, see Create or modify a
policy. Note that if you are invoking a policy bank, and do not want a rule to be evaluated prior
to the invocation, click Insert Policy, and in the Policy Name field select NOPOLICY.
• Policy Name:
This is already determined by the Policy Name, new policy, or NOPOLICY entry that you
inserted in this bank.
• Priority:
A numeric value that determines either an absolute order of evaluation within the bank,
or is used in conjunction with a Goto expression.
• Expression:
The policy rule. Policy expressions are described in detail in the following chapters. For
an introduction, see
Configure advanced policy expressions: Get started.
• Action:
• Goto Expression:
Optional. Used to augment the Priority level to determine the next policy or policy bank
to evaluate. For more information on possible values for a Goto expression, see Table 2.
Format of Each Entry in a Policy Bank of the section “Entries in a Policy Bank” in
Bind policies using advanced policy.
• Invoke:
5. Click OK. A message in the status bar indicates that the policy label is configured successfully.
You can configure a bank of policies for a virtual server. The policy bank can contain individual policies,
and each entry in the policy bank can optionally invoke a policy label or a bank of policies that you
configured for another virtual server. If you invoke a policy label or policy bank, you can do so without
triggering an expression (a rule) by selecting a NOPOLICY “dummy” entry instead of a policy name.
At the command prompt, type the following commands to add policies to a virtual server policy bank
and verify the configuration:
Example:
Invoke a policy label from a virtual server policy bank with a NOPOLICY entry by using the CLI
At the command prompt, type the following commands to invoke a policy label from a virtual server
policy bank with a NOPOLICY entry and verify the configuration:
Example:
1. In the left navigation pane, expand ** **Traffic Management > Load Balancing, Traffic Man-
agement > Content Switching, Traffic Management > SSL Offload, Security > AAA - Applica-
tion Traffic, or NetScaler Gateway, as appropriate, and then click Virtual Servers.
2. In the details pane, select the virtual server that you want to configure, and then click Open.
3. In the Configure Virtual Server dialog box click the Policies tab.
4. To create a new policy in this bank, click the icon for the type of policy or policy label that you
want to add to the virtual server’s bank of policies, click Insert Policy. Note that if you want to
invoke a policy label without evaluating a policy rule, select the NOPOLICY “dummy” policy.
5. To configure an existing entry in this policy bank, enter the following:
• Priority:
A numeric value that determines either an absolute order of evaluation within the bank or
is used in conjunction with a Goto expression.
• Expression:
The policy rule. Policy expressions are described in detail in the following chapters. For
an introduction, see
Configuring Advanced Policy Expressions: Getting Started.
• Action:
The action to be taken if this policy evaluates to TRUE.
• Goto Expression:
Optional. Determines the next policy or policy bank evaluate. For more information on
possible values for a Goto expression, see the section “Entries in a Policy Bank” in
Bind policies using advanced policy.
• Invoke:
Optional. To invoke another policy bank, select the name of the policy label or virtual
server policy bank that you want to invoke.
6. Click OK. A message in the status bar indicates that the policy is configured successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Unlike a policy, which can only be bound once, you can use a policy label or a virtual server’s policy
bank any number of times by invoking it. Invocation can be performed from two places:
Typically, the policy label must be of the same type as the policy from which it is invoked. For example,
you would invoke a responder policy label from a responder policy.
Note: When binding or unbinding a global NOPOLICY entry in a policy bank at the command line, you
specify a priority to distinguish one NOPOLICY entry from another.
At the command prompt, type the one of the following commands to invoke a rewrite or integrated
caching policy label and verify the configuration:
Example:
At the command prompt, type the following commands to invoke a responder policy label and verify
the configuration:
Example:
At the command prompt, type the following commands to invoke a Virtual Server Policy Bank and
verify the configuration:
Example:
At the command prompt, type one of the following commands to remove a rewrite or integrated
caching policy label and verify the configuration:
Example:
At the command prompt, type the following commands to remove a responder policy label and verify
the configuration:
Example:
At the command prompt, type one of the following commands to remove a Virtual Server policy label
and verify the configuration:
Example:
Invoke a policy label or virtual server policy bank by using the GUI
1. Bind a policy, as described in Bind a policy globally, Bind a policy to a virtual server, or Bind a
policy to a policy label. Alternatively, you can enter a NOPOLICY “dummy” entry instead of a
policy name. You do this if you do not want to evaluate a policy before evaluating the policy
bank.
2. In the Invoke field, select the name of the policy label or virtual server policy bank that you want
to evaluate if traffic matches the bound policy. A message in the status bar indicates that the
policy label or virtual server policy bank is invoked successfully.
1. Open the policy and clear the Invoke field. Unbinding the policy also removes the invocation of
the label. A message in the status bar indicates that the policy label is removed successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Warning:
Classic policy expressions are no longer supported from NetScaler 12.0 build 56.20 onwards and
as an alternative, Citrix recommends you to use Advanced policies. For more information, see
Advanced Policies.
Some applications provide a specialized Policy Manager in the NetScaler GUI to simplify configuring
policy banks. It also lets you find and delete policies and actions that are not being used.
The Policy Manager is currently available for the Rewrite, Integrated Caching, Responder, and Com-
pression features.
The following are keyboard equivalents for the procedures in this section:
• For editing a cell in the Policy Manager, you can tab to the cell and click F2 or press the SPACE
bar on the keyboard.
• To select an entry in a drop-down menu, you can tab to the entry, press the space bar to view the
drop-down menu, use the UP and DOWN ARROW keys to navigate to the entry that you want,
and press the space bar again to select the entry.
• To cancel a selection in a drop-down menu, press the Escape key.
• To insert a policy, tab to the row above the insertion point and press Control + Insert, or click
Insert Policy.
• To remove a policy, tab to the row that contains the policy and press Delete.
Note: Note that when you delete the policy, the NetScaler searches the Goto Expression values of
other policies in the bank. If any of these Goto Expression values match the priority level of the deleted
policy, they are removed.
1. In the navigation pane, click the feature for which you want to configure policies. The choices
are Responder, Integrated Caching, Rewrite or Compression.
3. If you are configuring classic policy bindings for compression, in the Compression Policy Man-
ager dialog box, click Switch to Classic Syntax. The dialog box switches to the classic syntax
view and displays the Switch to Advanced Policy button. At any time before you complete con-
figuring policy bindings, if you want to configure bindings for policies that use the Advanced
Policy click the Switch to Advanced Policy button.
4. For features other than Responder, to specify the bind point, click Request or Response, and
then click one of the request-time or response-time bind points. The options are Override
Global, LB Virtual Server, CS Virtual Server, Default Global, or Policy Label. If you are configuring
the Responder, the Request and Response flow types are not available.
5. To bind a policy to this bind point, click Insert Policy, and select a previously configured policy,
a NOPOLICY label, or the New policy option. Depending on the option that you select, you have
the following choices:
• New policy: Create the policy as described in “Create or modify a policy,” and then con-
figure the priority level, GoTo expression, and policy invocation as described in the table,
“Format of each entry in a policy bank.”
• Existing policy, NOPOLICY, or NOPOLICY<feature name>: Configure the priority level,
GoTo expression, and policy invocation as described in the table, “Format of each entry in
a policy bank.” The NOPOLICY or NOPOLICY<feature name> options are available only
for policies that use Advanced Policies.
7. To modify the priority level for an entry, you can do any of the following:
• Double-click the Priority field for an entry and edit the value.
• Click and drag a policy to another row in the table.
• Click Regenerate Priorities.
In all three cases, priority levels of all other policies are modified as needed to accommodate the
new value. Goto Expressions with integer values are also updated automatically. For example,
if you change a priority value of 10 to 100, all policies with a Goto Expression value of 10 are
updated to the value 100.
8. To change the policy, action, or policy bank invocation for an row in the table, click the down
arrow to the right of the entry and do one of the following:
• To change the policy, select another policy name or select New Policy and follow the steps
in Create or modify a policy.
• To change the Goto Expression, select Next, End, USE_INVOCATION_RESULT, or select
more and enter an expression whose result returns the priority level of another entry in
this policy bank.
• To modify an invocation, select an existing policy bank, or click New Policy Label and fol-
low the steps in Bind a policy to a policy label.
9. To unbind a policy or a policy label invocation from this bank, click any field in the row that
contains the policy or policy label, and then click Unbind Policy.
10. When you are done, click Apply Changes. A message in the status bar indicates that the policy
is bound successfully.
1. In the navigation pane, click the feature for which you want to configure the policy bank. The
choices are Responder, Integrated Caching, or Rewrite.
2. In the details pane, click <Feature Name> policy manager.
3. In the <Feature Name> Policy Manager dialog box, click Cleanup Configuration.
4. In the Cleanup Configuration dialog box, select the items that you want to delete, and then
click Remove.
5. In the Remove dialog box, click Yes.
6. Click Close. A message in the status bar indicates that the policy is removed successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Advanced policies evaluate data on the basis of information that you supply in Advanced policy expres-
sions. An Advanced policy expression analyzes data elements (for example, HTTP headers, source
IP addresses, the NetScaler system time, and POST body data). In addition to configuring an Ad-
vanced policy expression in a policy, in some NetScaler features, you configure Advanced policy ex-
pression outside of the context of a policy.
To create an Advanced policy expression, you select a prefix that identifies a piece of data that you
want to analyze, and then you specify an operation to perform on the data. For example, an opera-
tion can match a piece of data with a text string that you specify, or it can transform a text string into
an HTTP header. Other operations match a returned string with a set of strings or a string pattern.
You configure compound expressions by specifying Boolean and arithmetic operators, and by using
parentheses to control the order of evaluation.
Advanced policy expression can also contain classic expressions. You can assign a name to a fre-
quently used expression to avoid having to build the expression repeatedly.
Policies and a few other entities include rules that the NetScaler uses to evaluate a packet in the traffic
flowing through it, to extract data from the NetScaler system itself, to send a request (a “callout”) to an
external application, or to analyze another piece of data. A rule takes the form of a logical expression
that is compared against traffic and ultimately returns values of TRUE or FALSE.
The elements of the rule can themselves return TRUE or FALSE, string, or numeric values.
Before configuring an Advanced policy expression, you need to understand the characteristics of the
data that the policy or other entity is to evaluate. For example, when working with the Integrated
Caching feature, a policy determines what data can be stored in the cache. With Integrated Caching,
you need to know the URLs, headers, and other data in the HTTP requests and responses that the
NetScaler receives. With this knowledge, you can configure policies that match the actual data and
enable the NetScaler to manage caching for HTTP traffic. This information helps you determine the
type of expression that you need to configure in the policy.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
An Advanced policy expression consists of, at a minimum, a prefix (or a single element used in place
of a prefix). Most expressions also specify an operation to be performed on the data that the prefix
identifies. You format an expression of up to 1,499 characters as follows:
where
• <prefix>
The prefix is a period-delimited key that identifies a unit of data. For example, the following
prefix examines HTTP requests for the presence of a header named Content-Type:
http.req.header(“Content-Type”)
Prefixes can also be used on their own to return the value of the object that the prefix identifies.
• <operation>
http.req.header(“Content-Type”).eq(“text/html”)
eq(“text/html”)
This operator causes the NetScaler to evaluate any HTTP requests that contain a Content-Type
header, and in particular, to determine if the value of this header is equal to the string “tex-
t/html.” For more information, see Operations.
• <compound-operator>
is a Boolean or arithmetic operator that forms a compound expression from multiple prefix or
prefix.operation elements.
Prefixes
An expression prefix represents a discrete piece of data. For example, an expression prefix can rep-
resent an HTTP URL, an HTTP Cookie header, or a string in the body of an HTTP POST request. An
expression prefix can identify and return a wide variety of data types, including the following:
In most cases, an expression prefix begins with one of the following keywords:
• CLIENT:
– Identifies a characteristic of the client that is either sending a request or receiving a re-
sponse, as in the following examples:
– The prefix client.ip.dst designates the destination IP address in the request or response.
– The prefix client.ip.src designates the source IP address.
• HTTP:
• SERVER:
Identifies an element in the server that is either processing a request or sending a response.
• SYS:
Note: Note that DNS policies support only SYS, CLIENT, and SERVER objects.
In addition, in the NetScaler Gateway, the Clientless VPN function can use the following types
of prefixes:
• TEXT:
• TARGET:
• URL:
As a general rule of thumb, any expression prefix can be a self-contained expression. For example, the
following prefix is a complete expression that returns the contents of the HTTP header specified in the
string argument (enclosed in quotation marks):
http.res.header.(”myheader”)
Or you can combine prefixes with simple operations to determine TRUE and FALSE values. For exam-
ple, the following returns a value of TRUE or FALSE:
http.res.header.(”myheader”).exists
You can also use complex operations on individual prefixes and multiple prefixes within an expression,
as in the following example:
Which expression prefixes you can specify depends on the NetScaler feature. The following table de-
scribes the expression prefixes that are of interest on a per-feature basis
Note: For details on the permitted expression prefixes in a feature, see the documentation for that
feature.
Single-element expressions
The simplest type of Advanced policy expression contains a single element. This element can be one
of the following:
• true. An Advanced policy expression can consist simply of the value true. This type of expres-
sion always returns a value of TRUE. It is useful for chaining policy actions and triggering Goto
expressions.
• false. An Advanced policy expression can consist simply of the value false. This type of expres-
sion always returns a value of FALSE.
• A prefix for a compound expression. For example, the prefix HTTP.REQ.HOSTNAME is a complete
expression that returns a host name and HTTP.REQ.URL is a complete expression that returns
a URL. The prefix could also be used in conjunction with operations and additional prefixes to
form a compound expression.
Operations
In most expressions, you also specify an operation on the data that the prefix identifies. For example,
suppose that you specify the following prefix:
http.req.url
This prefix extracts URLs in HTTP requests. This expression prefix does not require any operators to
be used in an expression. However, when you configure an expression that processes HTTP request
URLs, you can specify operations that analyze particular characteristics of the URL. Following are a
few possibilities:
The following is an example of a prefix that identifies an HTTP header named Server and an operation
that searches for the string IIS in the header value:
http.res.header(”Server”).contains(”IIS”)
Following is an example of a prefix that identifies host names and an operation that searches for the
string “www.mycompany.com” as the value of the name:
http.req.hostname.eq(”www.mycompany.com”)
The following table describes a few of the basic operations that can be performed on expression pre-
fixes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure an Advanced policy expression that contains Boolean or arithmetic operators and
multiple atomic operations. The following compound expression contains a boolean AND:
http.req.hostname.eq(”mycompany.com”)&& http.req.method.eq(post)
The following expression adds the value of two targets, and compares the result to a third value:
A compound expression can contain any number of logical and arithmetic operators. The following
expression evaluates the length of an HTTP request on the basis of its URL and cookie, evaluates text
in the header, and performs a Boolean AND on these two results:
You can use parentheses to control the order of evaluation in a compound expression.
• &&.
This operator is a logical AND. For the expression to evaluate to TRUE, all components that are
joined by the And must evaluate to TRUE. Following is an example:
• This operator is a logical OR. If any component of the expression that is joined by the OR evalu-
ates to TRUE, the entire expression is TRUE.
• !.
You can use parentheses to control the order of evaluation of an expression. The following is an ex-
ample:
http.req.url.contains(”myCompany.com”)|| (http.req.url.hostname.eq(”myHost”
)&& http.req.header(”myHeader”).exists)
The following table describes operators that you can use to configure compound operations on string
data.
str1 ALT str2 Uses the string1 or string2 value that is derived
from the expression on either side of the
operator, as long as neither of these
expressions is a compound expressions.
Following is an example: http.req.hostname alt
client.ip.src
Logical operations on
strings Description
You can configure compound numeric expressions. For example, the following expression returns a
numeric value that is the sum of an HTTP header length and a URL length:
http.req.header.length + http.req.url.length
The following tables describes operators that you can use to configure compound expressions for nu-
meric data.
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
Arithmetic operations
on numbers Description
The NetScaler policy infrastructure supports the following numeric data types:
Simple expressions can return all of these data types. Therefore, you can create compound expres-
sions that use arithmetic operators and logical operators to evaluate or return values of these data
types. Additionally, you can use all of these values in policy expressions. Literal constants of type
unsigned long can be specified by appending the string ul to the number. Literal constants of type
double contain a period (.), an exponent, or both.
In compound expressions, the following standard arithmetic and logical operators can be used for the
double and unsigned long data types:
• +, -, *, and /
•
• ==, !=, >, <, >=, and <=
All of these operators have the same meaning as in the C programming language.
In all cases of mixed operations between operands of type integer, unsigned long, and double, type
promotion is performed so that the operation can be performed on operands of the same type. A
type of lower precedence is automatically promoted to the type of the operand with the highest prece-
dence involved in the operation. The order of precedence (higher to lower) is as follows:
• Double
• Unsigned long
• Integer
Therefore, an operation that returns a numeric result returns a result of the highest type involved in
the operation.
For example, if the operands are of type integer and unsigned long, the integer operand is
automatically converted to type unsigned long. This type conversion is performed even in
simple expressions in which the type of data identified by the expression prefix does not
match the type of data that is passed as the argument to the function. To illustrate such
an example, in the operation HTTP.REQ.CONTENT_LENGTH.DIV(3ul), the integer returned
by the prefix HTTP.REQ.CONTENT_LENGTH is automatically converted to unsigned long (the
type of the data passed as the argument to the DIV() function), and an unsigned long divi-
sion is performed. Similarly, the argument can be promoted in an expression. For example,
HTTP.REQ.HEADER(“myHeader”).TYPECAST_DOUBLE_AT.DIV(5) promotes the integer 5 to type
double and performs double-precision division.
For information about expressions for casting data of one type to data of another type, see Typecasting
data.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The policy infrastructure on the Citrix® NetScaler® appliance supports the ASCII and UTF-8 character
sets. The default character set is ASCII. If the traffic for which you are configuring an expression con-
sists of only ASCII characters, you need not specify the character set in the expression. However, you
must specify the character set in every simple expression that is meant for UTF-8 traffic. To specify the
UTF-8 character set in a simple expression, you must include the SET_CHAR_SET(<charset>) function,
with <charset> specified as UTF_8, as shown in the following examples:
1 HTTP.REQ.BODY(10).SET_CHAR_SET(UTF_8).CONTAINS(”ß”)
2
3 HTTP.RES.BODY(100).SET_CHAR_SET(UTF_8).BEFORE_STR(”Bücher”).AFTER_STR(”
Wörterbuch”)
In an expression, the SET_CHAR_SET() function must be introduced at the point in the expression
after which data processing must be carried out in the specified character set. For example, in the
expression HTTP.REQ.BODY(1000).AFTER_REGEX(re/following example/).BEFORE_REGEX(re/In the
preceding example/).CONTAINS_ANY(“Greek_ alphabet”), if the strings stored in the pattern set
“Greek_alphabet” are in UTF-8, you must include the SET_CHAR_SET(UTF_8) function immediately
before the CONTAINS_ANY(“<string>”) function, as follows:
HTTP.REQ.BODY(1000).AFTER_REGEX(re/following example/).BEFORE_REGEX(re/In
the preceding example/).SET_CHAR_SET(UTF_8).CONTAINS_ANY(”Greek_ alphabet”)
The SET_CHAR_SET() function sets the character set for all further processing (that is, for all
subsequent functions) in the expression unless it is overridden later in the expression by another
SET_CHAR_SET() function that changes the character set. Therefore, if all the functions in a given
simple expression are intended for UTF-8, you can include the SET_CHAR_SET(UTF_8) function
immediately after functions that identify text (for example, the HEADER(“<name>”) or BODY(<int>)
functions). In the second example that follows the first paragraph above, if the ASCII arguments
passed to the AFTER_REGEX() and BEFORE_REGEX() functions are changed to UTF-8 strings, you can
include the SET_CHAR_SET(UTF_8) function immediately after the BODY(1000) function, as follows:
HTTP.REQ.BODY(1000).SET_CHAR_SET(UTF_8).AFTER_REGEX(re/Bücher/).BEFORE_REGEX
(re/Wörterbuch/).CONTAINS_ANY(”Greek_alphabet”)
The UTF-8 character set is a superset of the ASCII character set, so expressions configured for the ASCII
character set continue to work as expected if you change the character set to UTF-8.
In a compound expression, if one subset of expressions is configured to work with data in the ASCII
character set and the rest of the expressions are configured to work with data in the UTF-8 character
set, the character set specified for each individual expression is considered when the expressions are
evaluated individually. However, when processing the compound expression, just before processing
the operators, the appliance promotes the character set of the returned ASCII values to UTF-8. For
example, in the following compound expression, the first simple expression evaluates data in the ASCII
character set while the second simple expression evaluates data in the UTF-8 character set:
HTTP.REQ.HEADER(”MyHeader”)== HTTP.REQ.BODY(10).SET_CHAR_SET(UTF_8)
However, when processing the compound expression, just before evaluating the “is equal to”
Boolean operator, the NetScaler appliance promotes the character set of the value returned by
HTTP.REQ.HEADER(“MyHeader”) to UTF-8.
The first simple expression in the following example evaluates data in the ASCII character set. How-
ever, when the NetScaler appliance processes the compound expression, just before concatenating
the results of the two simple expressions, the appliance promotes the character set of the value re-
turned by HTTP.REQ.BODY(10) to UTF-8.
HTTP.REQ.BODY(10)+ HTTP.REQ.HEADER(”MyHeader”).SET_CHAR_SET(UTF_8)
Consequently, the compound expression returns data in the UTF-8 character set.
You can set the character set to UTF-8 on the basis of traffic characteristics. If you are not sure whether
the character set of the traffic being evaluated is UTF-8, you can configure a compound expression in
which the first expression checks for UTF-8 traffic and subsequent expressions set the character set
to UTF-8. Following is an example of a compound expression that first checks the value of “charset”
in the request’s Content-Type header for “UTF-8” before checking whether the first 1000 bytes in the
request contain the UTF-8 string Bücher:
HTTP.REQ.HEADER(”Content-Type”).SET_TEXT_MODE(IGNORECASE).TYPECAST_NVLIST_T
(’=’, ’; ’, ’”’).VALUE(”charset”).EQ(”UTF-8”)&& HTTP.REQ.BODY(1000).SET_CHAR_SET
(UTF_8).CONTAINS(”Bücher”)
If you are sure that the character set of the traffic being evaluated is UTF-8, the second expression in
the example is sufficient.
During expression evaluation, even if the current character set is ASCII, character literals and string
literals, which are enclosed in single quotation marks (‘’) and quotation marks (“”), respectively, are
considered to be literals in the UTF-8 character set. In a given expression, if a function is operating
on character or string literals in the ASCII character set and you include a non-ASCII character in the
literal, an error is returned.
When configuring an expression, you can enter values in octal and hexadecimal formats. However,
each hexadecimal or octal byte is considered a UTF-8 byte. Invalid UTF-8 bytes result in errors regard-
less of whether the value is entered manually or pasted from the clipboard. For example, “\xce\x20” is
an invalid UTF-8 character because “c8” cannot be followed by “20” (each byte in a multi-byte UTF-8
string must have the high bit set). Another example of an invalid UTF-8 character is “\xce \xa9,” since
the hexadecimal characters are separated by a white-space character.
Only the
<text>.XPATH and
<text>.XPATH_JSON functions always return UTF-8 strings. The following MYSQL routines determine
at runtime which character set to return, depending on the data in the protocol:
• MYSQL_CLIENT_T.USER
• MYSQL_CLIENT_T.DATABASE
• MYSQL_REQ_QUERY_T.COMMAND
• MYSQL_REQ_QUERY_T.TEXT
• MYSQL_REQ_QUERY_T.TEXT(<unsigned int>)
• MYSQL_RES_ERROR_T.SQLSTATE
• MYSQL_RES_ERROR_T.MESSAGE
• MYSQL_RES_FIELD_T.CATALOG
• MYSQL_RES_FIELD_T.DB
• MYSQL_RES_FIELD_T.TABLE
• MYSQL_RES_FIELD_T.ORIGINAL_TABLE
• MYSQL_RES_FIELD_T.NAME
• MYSQL_RES_FIELD_T.ORIGINAL_NAME
• MYSQL_RES_OK_T.MESSAGE
• MYSQL_RES_ROW_T.TEXT_ELEM(<unsigned int>)
When you set up a connection to the NetScaler appliance by using a terminal connection (by using
PuTTY, for example), you must set the character set for transmission of data to UTF-8.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Warning
Classic policy expressions are no longer supported from NetScaler 12.0 build 56.20 onwards and
as an alternative, Citrix recommends you to use Advanced policies. For more information, see
Configure advanced policy expressions: Get started.
Classic expressions describe basic characteristics of traffic. In some cases, you may want to use a clas-
sic expression in an Advanced policy expression are no longer supported from NetScaler 12.0 build
56.20 onwards and as an alternative, Citrix recommends you to use Advanced policies. For more in-
formation, see Advanced Policies topic. You can do so with the Advanced policy expression configura-
tion tool. This can be helpful when manually migrating the older classic expressions to the Advanced
policy.
Note that when you upgrade the NetScaler to version 9.0 or higher, Integrated Caching policies are
automatically upgraded to Advanced policies, and the expressions in these policies are upgraded to
the Advanced policies.
The following is the syntax for all Advanced policy expressions that use a classic expression:
SYS.EVAL_CLASSIC_EXPR(“expression”)
Note
The syntax and the metadata for the SYS.EVAL_CLASSIC_EXPR expression is getting deprecated.
You can manually convert or use nspepi tool to convert the Classic expression to advanced ex-
pression.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure an Advanced policy expression of up to 1,499 characters in a policy. The user inter-
face for Advanced policy expressions depends to some extent on the feature for which you are con-
figuring the expression, and on whether you are configuring an expression for a policy or for another
use.
When configuring expressions on the command line, you delimit the expression by using quotation
marks (“. . .” or ‘. . .’). Within an expression, you escape additional quotation marks by using a
back-slash (). For example, the following are standard methods for escaping quotation marks in an
expression:
”\”abc\””
‘ \”abc\”’
You must also use a backslash to escape question marks and other backslashes on the command
line. For example, the expression http.req.url.contains(“\?”) requires a backslash so that the question
mark is parsed. Note that the backslash character will not appear on the command line after you
type the question mark. On the other hand, if you escape a backslash (for example, in the expression
‘http.req.url.contains(“\\http”)’), the escape characters are echoed on the command line.
You enter only the special character at the end of the expression, as follows:
For some features (for example, Integrated Caching and Responder), the policy configuration dialog
box provides a secondary dialog box for configuring expressions. This dialog enables you to choose
from drop-down lists that show the available choices at each point during expression configuration.
You cannot use arithmetic operators when using these configuration dialogs, but most other advanced
policy expression features are available. To use arithmetic operators , write your expressions in free-
form format.
Note:
At the command prompt, type the following commands to configure a default syntax rule and verify
the configuration:
Example:
1. In the navigation pane, click the name of the feature where you want to configure a policy, for
example, you can select Integrated Caching, Responder, DNS, Rewrite, or Content Switching,
and then click Policies.
2. Click Add.
3. For most features, click in the Expression field. For content switching, click Configure.
4. Click the Prefix icon (the house) and select the first expression prefix from the drop-down list.
For example, in Responder, the options are HTTP, SYS, and CLIENT. The next set of applicable
options appear in a drop-down list.
5. Double-click the next option to select it, and then type a period (.). Again, a set of applicable
options appears in another drop-down list.
6. Continue selecting options until an entry field (signalled by parentheses) appears. When you
see an entry field, enter an appropriate value in the parentheses. For example, if you select
GT(int) (greater-than, integer format), you specify an integer in the parentheses. Text strings
are delimited by quotation marks. Following is an example:
HTTP.REQ.BODY(1000).BETWEEN(”this”,”that”)
7. HTTP.REQ.URL.EQ(”www.mycompany.com”)||HTTP.REQ.BODY(1000).BETWEEN(”this
”,”that”)
8. To insert a named expression, click the down arrow next to the Add icon (the plus sign) and
select a named expression.
9. To configure an expression using drop-down menus, and to insert built-in expressions, click the
Add icon (the plus sign). The Add Expression dialog box works in a similar way to the main dia-
log box, but it provides drop-down lists for selecting options, and it provides text fields for data
entry instead of parentheses. This dialog box also provides a Frequently Used Expressions drop-
down list that inserts commonly used expressions. When you are done adding the expression,
click OK.
10. When finished, click Create. A message in the status bar indicates that the policy expression is
configured successfully.
1. In the navigation pane, click the name of the feature for which you want to configure a policy (for
example, you can select Integrated Caching, Responder, DNS, Rewrite, or Content Switching),
and then click Policies.
2. Select a policy and click Open.
3. To test the expression, click the Evaluate icon (the check mark).
4. In the expression evaluator dialog box, select the Flow Type that matches the expression.
5. In the HTTP Request Data or HTTP Response Data field, paste the HTTP request or response
that you want to parse with the expression, and click Evaluate. Note that you must supply a
complete HTTP request or response, and the header and body should be separated by blank
line. Some programs that trap HTTP headers do not also trap the response. If you are copying
and pasting only the header, insert a blank line at the end of the header to form a complete
HTTP request or response.
6. Click Close to close this dialog box.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Instead of retyping the same expression multiple times in multiple policies, you can configure a named
expression and refer to the name any time you want to use the expression in a policy. For example,
you could create the following named expressions:
• ThisExpression:
http.req.body(100).contains(”this”)
• ThatExpression:
http.req.body(100).contains(”that”)
You can then use these named expressions in a policy expression. For example, the following is a legal
expression based on the preceding examples:
ThisExpression ThatExpression
You can use the name of an advanced policy expression as the prefix to a function. The named expres-
sion can be either a simple expression or a compound expression. The function must be one that can
operate on the type of data that is returned by the named expression.
The following simple named expression, which identifies a text string, can be used as a prefix to the
AFTER_STR(“<string>“)function, which works with text data:
HTTP.REQ.BODY(1000)
If the name of the expression is top1KB, you can use top1KB.AFTER_STR(“username”) instead of
HTTP.REQ.BODY(1000).AFTER_STR(“username”).
You can create a compound named expression called basic_header_value to concatenate the user
name in a request, a colon (:), and the user’s password, as follows:
You can then use the name of the expression in a rewrite action, as shown in the following example:
In the example, in the expression that is used to construct the value of the custom header, the B64
encoding algorithm is applied to the string returned by the compound named expression.
You can also use a named expression (either by itself or as a prefix to a function) to create the text
expression for the replacement target in a rewrite.
At the command prompt, type the following commands to configure a named expression and verify
the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
A number of functions, including the following, can require an advanced policy expression that is not
part of a policy:
You define multiple non-compound expressions (selectlets) in the definition of the selector.
Each selectlet is in an implicit logical AND relationship with the others.
• Load Balancing:
You configure an expression for the TOKEN method of load balancing for a load balancing virtual
server.
• Rewrite actions:
Expressions define the location of the rewrite action and the type of rewriting to be performed,
depending on the type of rewrite action that you are configuring. For example, a DELETE action
only uses a target expression. A REPLACE action uses a target expression and an expression to
configure the replacement text.
• Rate-based policies:
You use advanced policy xpressions to configure Limit Selectors. You can use these selectors
when configuring policies to throttle the rate of traffic to various servers. You define up to five
non-compound expressions (selectlets) in the definition of the selector. Each selectlet is in an
implicit logical AND with the others.
Configure an advanced policy expression outside a policy by using the CLI (cache
selector example)
At the command prompt, type the following commands to configure an advanced policy expression
outside a policy and verify the configuration:
Example:
5 Name: mainpageSelector
6 Expressions:
7 1) http.req.cookie.value(”ABC_def”)
8 2) http.req.url.query.value(”_ghi”)
9 Done
Following is an equivalent command that uses the more readable q delimiter, as described in Config-
ure advanced policy expressions in a policy:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure a policy with an advanced policy expression that evaluates text in a request or
response. Advanced policy text expressions can range from simple expressions that perform string
matching in HTTP headers to complex expressions that encode and decode text. You can configure
text expressions to be case sensitive or case insensitive and to use or ignore spaces. You can also
configure complex text expressions by combining text expressions with Boolean operators
You can use expression prefixes and operators for evaluating HTTP requests, HTTP responses, and
VPN and Clientless VPN data. However, text expression prefixes are not restricted to evaluating these
elements of your traffic.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
December 7, 2018
Contributed by:
C
You can configure various expressions for working with text that flows through the NetScaler appli-
ance. Following are some examples of how you can parse text by using a default syntax expression:
For example, you may want to identify HTTP requests that contains a particular Accept-
Language header for the purpose of directing the request to a particular server.
For example, you may want to block requests for particular URLs. Note that the string can occur
at the beginning, middle, or end of another string.
For example, you may want to identify all POST requests that are directed to a database appli-
cation for the purpose of refreshing cached application data.
Note that there are specialized tools for viewing the data stream for HTTP requests and responses.
A text-based expression consists of at least one prefix to identify an element of data and usually (al-
though not always) an operation on that prefix. Text-based operations can apply to any part of a
request or a response. Basic operations on text include various types of string matches.
For example, the following expression compares a header value with a string:
http.req.header(”myHeader”).contains(”some-text”)
http.req.url.suffix.contains(”jpeg”)
http.req.url.suffix.eq(”jpeg”)
In the preceding examples, the contains operator permits a partial match and the eq operator looks
for an exact match.
Other operations are available to format the string before evaluating it. For example, you can use text
operations to strip out quotes and white spaces, to convert the string to all lowercase, or to concate-
nate strings.
Note: Complex operations are available to perform matching based on patterns or to convert
one type of text format to another type.
You can apply various operators to combine text prefixes or expressions. For example, the following
expression concatenates the returned values of each prefix:
http.req.hostname + http.req.url
Following is an example of a compound text expression that uses a logical AND. Both components of
this expression must be TRUE for a request to match the expression:
http.req.method.eq(post)&& http.req.body(1024).startswith(”destination=”)
The primary categories of text expressions that you can configure are:
• Information in HTTP headers, HTTP URLs, and the POST body in HTTP requests.
For more information, see Expression prefixes for text in HTTP requests and responses.
For more information, see Expression prefixes for VPNs and clientless VPNs.
For more information about TCP payload expressions, see Default syntax expressions: Parsing
HTTP, TCP, and UDP data.
For information about text expressions for SSL and SSL certificate data, see Default syntax ex-
pressions: Parsing SSL certificates and Expressions for SSL certificate dates.
Note: Parsing a document body, such as the body of a POST request, can affect performance.
You may want to test the performance impact of policies that evaluate a document body.
HTTP.REQ.URL.QUERY
The previous expression performs better than the following equivalent expression, which is based on
string parsing:
HTTP.REQ.URL.AFTER_STR(”?”)
In the first case, the expression looks specifically at the URL query. In the second case, the expression
scans the data for the first occurrence of a question mark.
There is also a performance benefit from structured parsing of text, as in the following expression:
HTTP.REQ.HEADER(”Example”).TYPECAST_LIST_T(’,’).GET(1)
(For more information on typecasting, seeTypecasting data. The typecasting expression, which col-
lects comma-delimited data and structures it into a list, typically would perform better than the fol-
lowing unstructured equivalent:
HTTP.REQ.HEADER(”Example”).AFTER_STR(”,”).BEFORE_STR(”,”)
Finally, unstructured text expressions typically have better performance than regular expressions. For
example, the following is an unstructured text expression:
HTTP.REQ.HEADER(”Example”).AFTER_STR(”more”)
The previous expression would generally provide better performance than the following equivalent,
which uses a regular expression:
HTTP.REQ.HEADER(”Example”).AFTER_REGEX(re/more/)
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
An HTTP request or response typically contains text, such as in the form of headers, header values,
URLs, and POST body text. You can configure expressions to operate on one or more of these text-
based items in an HTTP request or response.
Refer to the Expression Prefix table for information on how to configure and extract text from different
parts of an HTTP request or response.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The Advanced policy engine provides prefixes that are specific to parsing VPN or Clientless VPN data.
This data includes the following:
These text elements are often URLs and components of URLs. In addition to applying the text-based
operations on these elements, you can parse these elements by using operations that are specific to
parsing URLs. For more information, see Expressions for extracting segments of URLs
For information about VPN expression prefixes, see VPN expression table.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Basic operations on text include operations for string matching, calculating the length of a string, and
controlling case sensitivity. You can include white space in a string that is passed as an argument to
an expression, but the string cannot exceed 255 characters.
The following table lists basic string matching operations in which the functions return a Boolean
TRUE or FALSE.
Function Description
Function Description
Function Description
The <text>.LENGTH operation returns a numeric value that is equal to the number of characters (not
bytes) in a string:
<text>.LENGTH
For example, you may want to identify request URLs that exceed a particular length. Following is an
expression that implements this example:
After taking a count of the characters or elements in a string, you can apply numeric operations to
them. For more information, see Default Syntax Expressions: Working with Dates, Times, and Num-
bers.
The following functions operate on the case (upper-case or lower-case) of the characters in the string.
Function Description
<text>.SET_TEXT_MODE(IGNORECASE
NOIGNORECASE) This function turns case
sensitivity on or off for all text
operations.
Function Description
You can use the STRIP_CHARS(<string>) function to remove specific characters from the text that is
returned by a default syntax expression prefix (the input string). All instances of the characters that
you specify in the argument are stripped from the input string. You can use any text method on the
resulting string, including the methods used for matching the string with a pattern set.
In the following example, the resulting string is compared with a pattern set called “listofdomains”:
CLIENT.UDP.DNS.DOMAIN.STRIP_CHARS(”.-_”).CONTAINS_ANY(”listofdomains”)
Note: You cannot perform a rewrite on the string that is returned by the
STRIP_CHARS(<string>) function.
The following functions strip matching characters from the beginning and end of a given string input.
Function Description
You can use the APPEND() function to append the string representation of the argument to the string
representation of the value returned by the preceding function. The preceding function can be one
that returns a number, unsigned long, double, time value, IPv4 address, or IPv6 address. The argu-
ment can be a text string, number, unsigned long, double, time value, IPv4 address, or IPv6 address.
The resulting string value is the same string value that is obtained by using the + operator.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
In addition to performing simple string matching, you can configure expressions that examine more
complex aspects of text, including examining the length of a string and looking within a text block for
patterns rather than specific strings.
• For any operation that takes a string argument, the string cannot exceed 255 characters.
• You can include white space when you specify a string in an expression.
Refer to the String operations table to know how to extract a subset of a larger string by using one of
the operations.
The COMPARE operation examines the first nonmatching character of two different strings. This oper-
ation is based on lexicographic order, which is the method used when ordering terms in dictionaries.
This operation returns the arithmetic difference between the ASCII values of the first nonmatching
characters in the compared strings. The following differences are examples:
• The difference between “abc” and “abd” is -1 (based on the third pair-wise character compari-
son).
• The difference between “@” and “abc” is -33.
• The difference between “1” and “abc” is -47.
<text>.COMPARE(<string>)
Refer to the Integer extraction table to know how to treat a string of bytes that represent text as a
sequence of bytes, extract 8, 16, or 32 bits from the sequence, and then convert the extracted bits to
an integer.
You can convert a text string to a hash value by using the HASH function. This function returns a 31-bit
positive integer as a result of the operation. Following is the format of the expression:
<text>.HASH
This function ignores case and white spaces. For example, after the operation, the two strings Ab c
and a bc would produce the same hash value.
The following two functions encode and decode a text string by applying the Base64 encoding algo-
rithm
Function Description
The EXTEND function is used in rewrite actions that specify patterns or pattern sets and target the
bodies of HTTP packets. When a pattern match is found, the EXTEND function extends the scope of
the search by a predefined number of bytes on both sides of the matching string. A regular expression
can then be used to perform a rewrite on matches in this extended region. Rewrite actions that are
configured with the EXTEND function perform rewrites faster than rewrite actions that evaluate entire
HTTP bodies using only regular expressions.
The format of the EXTEND function is EXTEND(m,n ), where m and n are the number of bytes by which
the scope of the search is extended before and after the matching pattern, respectively. When a match
is found, the new search scope comprises m bytes that immediately precede the matching string, the
string itself, and the n bytes that follow the string. A regular expression can then be used to perform a
rewrite on a portion of this new string.
The EXTEND function can be used only if the rewrite action in which it is used fulfills the following
requirements:
• The search is performed by using patterns or patterns sets (not regular expressions)
• The rewrite action evaluates only the bodies of HTTP packets.
Additionally, the EXTEND function can be used only with the following types of rewrite actions:
• replace_all
• insert_after_all
• delete_all
• insert_before_all
For example, you might want to delete all instances of ”<http://exampleurl.com/>” and ”<http
://exampleurl.au/>” in the first 1000 bytes of the body. To do this, you can configure a rewrite
action to search for all instances of the string exampleurl, extend the scope of the search on both
sides of the string when a match is found, and then use a regular expression to perform the rewrite
in the extended region. The following example extends the scope of the search by 20 bytes to the left
and 50 bytes to the right of the matching string:
add rewrite action delurl_example delete_all ’HTTP.REQ.BODY(1000)’-pattern
exampleurl -refineSearch ’extend(20,50).regex_select(re##http://exampleurl
.(com|au)##)’
The following function converts text to hexadecimal format and extracts the resulting string:
<text>.BLOB_TO_HEX(<string>)
For example, this function converts the byte string “abc” to “61:62:63”.
In default syntax expressions, you can use the ENCRYPT and DECRYPT functions to encrypt and de-
crypt text. Data encrypted by the ENCRYPT function on a given NetScaler appliance or high availabil-
ity (HA) pair is intended for decryption by the DECRYPT function on the same NetScaler appliance or
HA pair. The appliance supports the RC4, DES3, AES128, AES192, and AES256 encryption methods.
The key value that is required for encryption is not user-specifiable. When an encryption method is
set, the appliance automatically generates a random key value that is appropriate for the specified
method. The default method is AES256 encryption, which is the most secure encryption method and
the one that Citrix recommends.
You do not need to configure encryption unless you want to change the encryption method or you
want the appliance to generate a new key value for the current encryption method.
Note: You can also encrypt and decrypt XML payloads. For information about the functions for en-
crypting and decrypting XML payloads, see Encrypt and decrypt XML payloads.
Configure encryption
During startup, the appliance runs the set ns encryptionParams command with, by default, the
AES256 encryption method, and uses a randomly generated key value that is appropriate for AES256
encryption. The appliance also encrypts the key value and saves the command, with the encrypted
key value, to the NetScaler configuration file. Consequently, the AES256 encryption method is
enabled for the ENCRYPT and DECRYPT functions by default. The key value that is saved in the
configuration file persists across reboots even though the appliance runs the command each time
you restart it.
You can run the set ns encryptionParams command manually, or use the GUI, if you want to change the
encryption method or if you want the appliance to generate a new key value for the current encryption
method. To use the CLI to change the encryption method, set only the method parameter, as shown
in “Example 1: Changing the Encryption Method.” If you want the appliance to generate a new key
value for the current encryption method, set the method parameter to the current encryption method
and the keyValue parameter to an empty string (“”), as shown in “Example 2: Generating a New Key
Value for the Current Encryption Method.” After you generate a new key value, you must save the
configuration. If you do not save the configuration, the appliance uses the newly generated key value
only until the next restart, after which it reverts to the key value in the saved configuration.
You can use the ENCRYPT and DECRYPT functions with any expression prefix that returns text. For
example, you can use the ENCRYPT and DECRYPT functions in rewrite policies for cookie encryption.
In the following example, the rewrite actions encrypt a cookie named MyCookie, which is set by a
back-end service, and decrypt the same cookie when it is returned by a client:
2
3 add rewrite action my-cookie-decrypt-action replace ”HTTP.REQ.COOKIE.
VALUE(”MyCookie”)” ”HTTP.REQ.COOKIE.VALUE(”MyCookie”).DECRYPT” -
bypassSafetyCheck YES
After you configure policies for encryption and decryption, save the configuration to bring the policies
into effect.
In default syntax expressions, you can use ENCRYPT and DECRYPT functions for encrypting and de-
crypting text in a request or response. The data encrypted by the ENCRYPT function on an appliance
(standalone, high availability or cluster) is intended to be decrypted by the DECRYPT function by the
same appliance. The appliance supports RC4, DES, Triple-DES, AES92, and AES256 encryption meth-
ods and each of these methods use a secret key for both encryption and decryption of data. You can
use the any of these methods to encrypt and decrypt data in two ways - self-encryption and third-party
encryption.
The self-encryption feature in an appliance (standalone, high availability or cluster) encrypts and then
decrypts data by evaluating the header value. One example to understand this is the HTTP Cookie
encryption. The expression evaluates the header, encrypts the HTTP cookie value in the Set-Cookie
header in the outgoing response and then decrypts the cookie value when it is returned in the cookie
header of a subsequent incoming request from the client. The key value is not user configurable,
instead when an encryption method is configured in the set ns encryptionParams command, the
appliance automatically generates a random key value for the configured method. By default, the
command uses the AES256 encryption method, which is the highly secured method and Citrix recom-
mends this method.
The third-party encryption feature encrypts or decrypts data with a third-party application. For ex-
ample, a client may encrypt data in a request and the appliance decrypts the data before sending it
the back-end server or vice versa. To perform this, the appliance and the third party application must
share a secret key. On the appliance, you can directly configure the secret key using an encryption
key object and key value is automatically generated by the appliance for a stronger encryption. The
same key is manually configured on the third-party appliance so that both appliance and third-party
application can use the same key for encrypting and decryption data.
Note:
Using third-party encryption, you can also encrypt and decrypt XML payloads. For information
about the functions for encrypting and decrypting XML payloads, see “Encrypting and Decrypt-
ing XML Payloads.
Cipher methods
A cipher method provides two functions: an encryption function that transforms a plaintext byte se-
quence into a ciphertext byte sequence, and a decryption function that transforms the ciphertext
back to the plaintext. Cipher methods use byte sequences called keys to perform encryption and
decryption. Cipher methods that use the same key for encryption and decryption are called symmet-
ric. Cipher methods that use different keys for encryption and decryption are asymmetric. The most
notable examples of asymmetric ciphers are in public key cryptography, which uses a public key avail-
able to anyone for encryption and a private key known only to the decryptor.
A good cipher method makes it infeasible to decrypt (“crack”) ciphertext if you don’t possess the key.
“Infeasible” really means that cracking the cyphertext would take more time and computing resources
than it is worth. As computers become more powerful and cheaper, ciphers that were formerly in-
feasible to crack become more feasible. Also, over time, flaws are found in cipher methods (or their
implementations), making cracking easier. Newer cipher methods are therefore preferred over older
ones. In general, longer length keys provide better security than shorter keys, at the cost of longer
encryption and decryption times.
A cipher method can use stream ciphers or block ciphers. RC4 is the mostly secured stream ciphers
and it is used only for legacy application. Block ciphers can include padding.
Stream ciphers
A stream cipher method operates on individual bytes. Only one stream cipher is available on
NetScaler- appliances: RC4, which uses a 128 bit (16 byte) key length. For a given key, RC4 generates
a pseudo-random sequence of bytes, call a keystream, which is X-ORed with the plaintext to produce
the ciphertext. RC4 is no longer considered secure and should be used only if required by legacy
applications.
Block ciphers
A block cipher method operates on a fixed block of bytes. A NetScaler appliance provides two block
ciphers: Data Encryption Standard (DES) and the Advanced Encryption Standard (AES). DES uses a
block size of 8 bytes and (on a NetScaler appliance) two choices for key length: 64 bits (8 bytes), of
which 56 bits are data and 8 bits are parity, and Triple-DES, a 192 bit (24 byte) key length. AES has a
block size of 16 bytes and (on NetScaler) three choices for key length: 128 bits (16 bytes), 192 bits (24
bytes) and 256 bits (32 bytes).
Padding
If the plaintext for a block cipher is not an integral number of blocks, padding with additional bytes
might be required. For example, suppose the plaintext is “xyzzy” (hex 78797a7a79). For an 8-byte
Triple-DES block, this value would have to be padded to create 8 bytes. The padding scheme must
allow the decryption function to determine the length of the original plaintext after decryption. Fol-
lowing are some padding schemes currently in use (n is the number of bytes added):
• PKCS7: Adds n bytes of value n each. For example, 78797a7a79030303. This is the padding
scheme used by OpenSSL and ENCRYPT() policy function. The PKCS5 padding scheme is the
same as PKCS7.
• ANSI X.923: Adds n-1 zero bytes and a final byte of value n. For example, 78797a7a79000003.
• ISO 10126: Adds n-1 random bytes and a final byte of value n. For example, 78797a7a79xxxx03,
where xx can be any byte value. The DECRYPT() policy function accepts this padding scheme,
which also allows it to accept the PKCS7 and ANSI X.923 schemes.
• ISO/IEC 7816-4: Adds a 0x80 byte and n-1 zero bytes. For example, 78797a7a79800000. This is
also call OneAndZeros padding.
• Zero: Adds n zero bytes. Example: 78797a7a79000000. This can only be used with plaintext
that does not include NUL bytes.
If padding is used and the plaintext is an integral number of blocks, an additional block is typically
added so that the decryption function can unambiguously determine the original plaintext length.
For PCKS7 and 8 byte block, this would be 0808080808080808.
Modes of operation
There are a number of different modes of operation for block ciphers, which specify how multiple
blocks of plaintext are encrypted. Some modes use an initialization vector (IV), a block of data apart
from the plaintext that is used to start the encryption process. It is a good practice to use a different
IV for each encryption, so that the same plaintext produces different ciphertext. The IV does not need
to be secret, and so is usually prepended to the ciphertext. Modes include:
• Electronic Codebook (ECB): Each block of plaintext is encrypted independently. An IV is not
used. Padding is required if the plaintext is not a multiple of the cipher block size. The same
plaintext and key always produces the same ciphertext. Because of this, ECB is considered less
secure than other modes and should only be used for legacy applications.
• Cipher Block Chaining (CBC): Each block of plaintext is XORed with the previous ciphertext
block, or the IV for the first block, before being encrypted. Padding is required if the plain-
text is not a multiple of the cipher block size. This is the mode used with the NetScaler
encryptionParams method.
• Cipher Feedback (CFB): The previous ciphertext block, or the IV for the first block, is encrypted
and the output is XORed with the current plaintext block to create the current ciphertext block.
The feedback can be 1 bit, 8 bits, or 128 bits. Since the plaintext is XORed with the cipher text,
padding is not required.
• Output Feedback (OFB): A keystream is generated by applying the cipher successively to the IV
and XORing the keystream blocks with the plaintext. Padding is not required.
1. Adding an encryption key. Configures an encryption key for a specified cipher method with a
specified key value.
2. Modifying an encryption key. You can edit parameters for a configured encryption key.
3. Unsetting an encryption key. Sets parameters for a configured encryption key to their default
values. An encryptionKey value with the name must exist. Sets padding to DEFAULT (deter-
mined by the method), Deletes an existing IV, which causes ENCRYPT() to generate a random IV.
Deletes an existing comment. The method and key value cannot be reset.
4. Removing an encryption key. Deletes a configured encryption key. The key cannot have any
references.
5. Show an encryption key. Displays parameters for the configured encryption key or all config-
ured keys. If the name is omitted, the key value is not displayed.
Where,
The above encryption methods specify the operation mode with CBC as the default mode of opera-
tion. Therefore, DES, DES2, AES128, AES192, and AES256 methods are equivalent to DES-CBC, DES3-
CBC, AES128-CBC, AES192-CBC, and AES256-CBC methods.
Where,
encryptionKey: An optional string parameter that specifies the configured encryption key object to
provide the encryption method, secret key value and other encryption parameters. If omitted, the
method uses the automatically generated key value associated with the set ns encryptionParamS
command.
out_encoding: This value specifies how the output is encoded. If omitted, BASE64 encoding is used.
Input:
Output: The output is a text encrypted using the specified method and key and encoded using a speci-
fied output encoding. It inserts a generated IV before the encrypted text for block methods and modes
that require an IV, and either no IV is specified for the encryptionKey or the encryptionKey is omitted.
DECRYPT(encryptionKey, in_encoding)
Where,
Input data is an encrypted text using the specified method and key encoded using the specified input
encoding. This text is expected to include a generated IV before the encrypted text for block methods
and modes that require an IV, and either no IV is specified for the encryptionKey or the encryptionKey
is omitted.
encryptionKey—An optional string parameter that specifies the configured encryptionKey object to
provide the encryption method, secret key and other encryption parameters. If omitted, the method
and automatically generated key associated with the encryptionParams setting will be used
in_encoding—An optional enumeration parameter that specifies how the input is expected to be en-
coded. The values are the same as the out_encoding of ENCRYPT. If omitted, BASE64 encoding will
be expected.
Following are the variants of these functions with the optional parameters:
Variant Description
NetScaler appliances support a Hashed Message Authentication Code (HMAC) function that calculates
a digest method or hash of input text by using a secret key shared between a message sender and mes-
sage receiver. The digest method (derived from an RFC 2104 technique) authenticates the sender and
verifies that the message content has not been altered. For example, when a client sends a message
with the shared HMAC key to a NetScaler appliance, advanced (PI) policy expressions use the HMAC
function to compute the hash-based code on the selected text. Then, when the receiver receives the
message with the secret key, it recomputes the HMAC by comparing it with the original HMAC to de-
termine whether the message has been altered. The HMAC function is supported by standalone ap-
pliances and by appliances in a high availability configuration or in a cluster. Using it is similar to
configuring an encryption key.
The add ns hmackey and set ns hmackey commands include a parameter that specifies the digest
method and the shared secret key to use for the HMAC computation.
1. Adding an HMAC key. Configures an HMAC key with a specified key value.
2. Modifying an HMAC key. Modifies parameters for a configured HMAC key. The digest method
can be changed without changing the key value, since the key value length is not determined
by the digest. However, it is advisable to specify a new key when changing the digest.
3. Unsetting an HMAC key. Sets parameters for a configured HMAC key to their default values. An
hmacKey object with the name must exist. The only parameter that can be unset is the com-
ment, which is deleted.
4. Removing an HMAC key. Deletes a configured key. The key cannot have any references.
5. Show an HMAC key. Displays parameters for the configured HMAC ac key or all configured keys.
If the name is omitted, the key value is not displayed.
Where,
This command configures a key for the HMAC () function with the specified digest and key value and
also validates the following:
• Name syntax is correct and does not duplicate the name of an existing key.
• Key value is valid hex. As specified by RFC 2104, the key can any length. On a NetScaler appli-
ance, the key value can range from 0 to 255 bytes (0 to 510 hex characters). If the key is shorter
than the digest block size, a warning is issued and the key is padded with zeroes. If the key is
longer than the block size, it is run through the digest to produce an effective key that is the
same length as the block.
Example:
The above encryption methods specify the operation mode with CBC as the default mode of opera-
tion. Therefore, DES, DES2, AES128, AES192, and AES256 methods are equivalent to DES-CBC, DES3-
CBC, AES128-CBC, AES192-CBC, and AES256-CBC methods.
This command modifies the parameters configured for a HMAC key. You can change the digest without
changing the key value, since the key value length is not determined by the digest. However, it is
advisable to specify a new key when changing the digest. At the command prompt, type:
This command sets parameters configured for a HMAC key with their default values. An hmacKey
object with the name must exist. The only parameter that you can unset is the comment option, which
is deleted. At the command prompt, type:
This command deletes the configured hmac key. The key cannot have references. At the command
prompt, type:
rm ns hmacKey <name>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Most numeric data that the NetScaler appliance processes consists of dates and times. In addition
to working with dates and times, the appliance processes other numeric data, such as the lengths of
HTTP requests and responses. To process this data, you can configure advanced policy expressions
that process numbers.
A numeric expression consists of an expression prefix that returns a number and sometimes,
but not always, an operator that can perform an operation on the number. Examples of ex-
pression prefixes that return numbers are SYS.TIME.DAY, HTTP.REQ.CONTENT_LENGTH, and
HTTP.RES.BODY.LENGTH. Numeric operators can work with any prefix expression that returns data in
numeric format. The GT(<int>) operator, for example, can be used with any prefix expression, such as
HTTP.REQ.CONTENT_LENGTH, that returns an integer. Numeric expression prefixes and operators
are also covered in Compound Operations for Numbers and Advanced Policy Expressions: Parsing
HTTP, TCP, and UDP Data.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When configuring an advanced policy expression in a policy that works with dates and times (for ex-
ample, the NetScaler system time or a date in an SSL certificate), you specify a time format as follows:
Where:
• <month> is a three-character abbreviation for the month, for example, Jan, Dec.
You cannot specify the day as Monday, Tuesday, and so on. You specify either an integer for a
specific day of the month, or you specify a date as the first, second, third weekday of the month,
and so on. Following are examples of specifying a day of the week:
The following example expression is true if the date is between 2008 Jan and 2009 Jan, based on GMT.
The following example expression is true for March and all months that follow March in the calendar
year, based on GMT:
When you specify a date and time, note that the format is case sensitive and must preserve the exact
number of blank spaces between entries.
1 **Note:**
2
3 In an expression that requires two time values, both must use GMT or
both must use LOCAL. You cannot mix the two in an expression.
4
5 Unlike when you use the SYS.TIME prefix in an advanced policy
expression, if you specify SYS.TIME in a rewrite action, the
NetScaler returns a string in conventional date format (for example,
Sun, 06 Nov 1994 08:49:37 GMT). For example, the following rewrite
action replaces the http.res.date header with the NetScaler system
time in a conventional date format:
6
7 add rewrite action sync_date replace http.res.date sys.time
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The SYS.TIME expression prefix extracts the NetScaler system time. You can configure expressions that
establish whether a particular event occurred at a particular time or within a particular time range
according to the NetScaler system time.
The following table describes the expressions that you can create by using the SYS.TIME prefix.
• SYS.TIME.BETWEEN(<time1>, <time2>):
Returns a Boolean TRUE if the returned value is later than <time1> and earlier than <time2>.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following:
• SYS.TIME.DAY:
Returns the current day of the month as a number from 1 through 31.
• SYS.TIME.EQ(<time>):
Returns a Boolean TRUE if the current time is equal to the <time> argument.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.NE(<time>):
Returns a Boolean TRUE if the current time is not equal to the <time> argument.
• SYS.TIME.GE(<time>):
Returns a Boolean TRUE if the current time is later than or equal to <time>.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.GT(<time>):
Returns a Boolean TRUE if the time value is later than the <time> argument.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.HOURS:
• SYS.TIME.LE(<time>):
Returns a Boolean TRUE if the current time value precedes or is equal to the <time> argument.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.LT(<time>):
Returns a Boolean TRUE if the current time value precedes the <time> argument.
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.MINUTES:
• SYS.TIME.MONTH:
Extracts the current month and returns an integer from 1 (January) to 12 (December).
• SYS.TIME.RELATIVE_BOOT:
Calculates the number of seconds to the closest previous or scheduled reboot, and returns an
integer.
If the closest boot time is in the past, the integer is negative. If it is in the future, the integer is
positive.
• SYS.TIME.RELATIVE_NOW:
Calculates the number of seconds between the current NetScaler system time and the specified
time, and returns an integer showing the difference.
If the designated time is in the past, the integer is negative; if it is in the future, the integer is
positive.
• SYS.TIME.SECONDS:
Extracts the seconds from the current NetScaler system time, and returns that value as an inte-
ger from 0 to 59.
• SYS.TIME.WEEKDAY:
If you omit an element of time in <time1>, for example, the day or hour, it is assumed to have the
lowest value in its range. If you omit an element in <time2>, it is assumed to have the highest
value of its range.
The ranges for the elements of time are as follows: month 1-12, day 1-31, weekday 0-6, hour 0-
23, minutes 0-59 and seconds 0-59. If you specify the year, you must do so in both <time1> and
<time2>.
For example, if the time is GMT 2005 May 10 10h 15m 30s, and it is the second Tuesday of the
month, you can specify the following (evaluation results are shown in parentheses):
• SYS.TIME.YEAR:
Extracts the year from the current system time and returns that value as a four-digit integer.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can determine the validity period for SSL certificates by configuring an expression that contains
the following prefix:
CLIENT.SSL.CLIENT_CERT
The following example expression matches a particular time for expiration with the information in the
certificate:
client.ssl.client_cert.valid_not_after.eq(GMT 2009)
The following table describes time-based operations on SSL certificates. To obtain the expres-
sion you want, replace certificate in the expression in the first column with the prefix expression,
“CLIENT.SSL.CLIENT_CERT”.
• <certificate>.VALID_NOT_AFTER:
Returns the last day before certificate expiration. The return format is the number of seconds
since GMT January 1, 1970 (0 hours, 0 minutes, 0 seconds).
• <certificate>.VALID_NOT_AFTER.BETWEEN(<time1>, <time2>):
Returns a Boolean TRUE value if the certificate validity is between the <time1> and <time2> ar-
guments. Both <time1> and <time2> must be fully specified. Following are examples:
The <time1> and <time2> arguments must be both GMT or both LOCAL, and <time2> must be
greater than <time1>.
For example, if it is GMT 2005 May 1 10h 15m 30s, and the first Sunday of the month, you can
specify the following (evaluation results are in parentheses).
• <certificate>.VALID_NOT_AFTER.DAY:
Extracts the last day of the month that the certificate is valid, and returns a number from 1
through 31, as appropriate for the date.
• <certificate>.VALID_NOT_AFTER.EQ(<time>):
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following (evaluation results for this example are in parentheses):
• <certificate>.VALID_NOT_AFTER.GE(<time>):
Returns a Boolean TRUE if the time value is greater than or equal to the argument <time>.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_AFTER.GT(<time>):
Returns a Boolean TRUE if the time value is greater than the argument <time>.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_AFTER.HOURS:
Extracts the last hour that the certificate is valid and returns that value as an integer from 0 to
23.
• <certificate>.VALID_NOT_AFTER.LE(<time>):
Returns a Boolean TRUE if the time precedes or is equal to the <time> argument.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_AFTER.LT(<time>):
For example, if the current time is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month, you can specify the following:
• <certificate>.VALID_NOT_AFTER.MINUTES:
Extracts the last minute that the certificate is valid and returns that value as an integer from 0
to 59.
• <certificate>.VALID_NOT_AFTER.MONTH:
Extracts the last month that the certificate is valid and returns that value as an integer from 1
(January) to 12 (December).
• <certificate>.VALID_NOT_AFTER.RELATIVE_BOOT:
Calculates the number of seconds to the closest previous or scheduled reboot and returns an
integer. If the closest boot time is in the past, the integer is negative. If it is in the future, the
integer is positive.
• <certificate>.VALID_NOT_AFTER.RELATIVE_NOW;
Calculates the number of seconds between the current system time and the specified time and
returns an integer. If the time is in the past, the integer is negative; if it is in the future, the integer
is positive.
• <certificate>.VALID_NOT_AFTER.SECONDS:
Extracts the last second that the certificate is valid and returns that value as an integer from 0
to 59.
• <certificate>.VALID_NOT_AFTER.WEEKDAY:
Extracts the last weekday that the certificate is valid. Returns a number between 0 (Sunday) and
6 (Saturday) to give the weekday in the time value.
• <certificate>.VALID_NOT_AFTER.WITHIN(<time1>, <time2>):
Returns a Boolean TRUE if the time lies within all the ranges defined by the elements in <time1>
and <time2>.
If you omit an element of time from <time1>, it is assumed to have the lowest value in its range.
If you omit an element from <time2>, it is assumed to have the highest value of its range. If you
specify a year in <time1>, you must specify it in <time2>.
The ranges for elements of time are as follows: month 1-12, day 1-31, weekday 0-6, hour 0-23,
minutes 0-59 and seconds 0-59. For the result to be TRUE, each element in the time must exist
in the corresponding range that you specify in <time1>, <time2>.
For example, if time is GMT 2005 May 10 10h 15m 30s, and it is the second Tuesday of the month,
you can specify the following (evaluation results are in parentheses):
• <certificate>.VALID_NOT_AFTER.YEAR:
Extracts the last year that the certificate is valid and returns a four-digit integer.
• <certificate>.VALID_NOT_BEFORE:
The return format is the number of seconds since GMT January 1, 1970 (0 hours, 0 minutes, 0
seconds).
• <certificate>.VALID_NOT_BEFORE.BETWEEN(<time1>, <time2>):
Returns a Boolean TRUE if the time value is between the two time arguments. Both <time1> and
<time2> arguments must be fully specified.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_BEFORE.DAY:
Extracts the last day of the month that the certificate is valid and returns that value as a number
from 1 through 31 representing that day.
• <certificate>.VALID_NOT_BEFORE.EQ(<time>):
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_BEFORE.GE(<time>):
Returns a Boolean TRUE if the time is greater than (after) or equal to the <time> argument.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results are in parentheses):
• <certificate>.VALID_NOT_BEFORE.GT(<time>):
Returns a Boolean TRUE if the time occurs after the <time> argument.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results are in parentheses):
• <certificate>.VALID_NOT_BEFORE.HOURS:
Extracts the last hour that the certificate is valid and returns that value as an integer from 0 to
23.
• **<certificate>.VALID_NOT_BEFORE.LE(<time>)
Returns a Boolean TRUE if the time precedes or is equal to the <time> argument.
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_BEFORE.LT(<time>):
For example, if the time value is GMT 2005 May 1 10h 15m 30s, and it is the first Sunday of the
month of May in 2005, you can specify the following (evaluation results for this example are in
parentheses):
• <certificate>.VALID_NOT_BEFORE.MINUTES:
Extracts the last minute that the certificate is valid. Returns the current minute as an integer
from 0 to 59.
• <certificate>.VALID_NOT_BEFORE.MONTH:
Extracts the last month that the certificate is valid. Returns the current month as an integer from
1 (January) to 12 (December).
• <certificate>.VALID_NOT_BEFORE.RELATIVE_BOOT:
Calculates the number of seconds to the closest previous or scheduled NetScaler reboot and
returns an integer. If the closest boot time is in the past, the integer is negative; if it is in the
future, the integer is positive.
• <certificate>.VALID_NOT_BEFORE.RELATIVE_NOW:
Returns the number of seconds between the current NetScaler system time and the specified
time as an integer. If the designated time is in the past, the integer is negative. If it is in the
future, the integer is positive.
• <certificate>.VALID_NOT_BEFORE.SECONDS:
Extracts the last second that the certificate is valid. Returns the current second as an integer
from 0 to 59.
• <certificate>.VALID_NOT_BEFORE.WEEKDAY:
Extracts the last weekday that the certificate is valid. Returns the weekday as a number between
0 (Sunday) and 6 (Saturday).
• <certificate>.VALID_NOT_BEFORE.WITHIN(<time1>, <time2>):
Returns a Boolean TRUE if each element of time exists within the range defined in the <time1>,
<time2> arguments.
If you omit an element of time from <time1>, it is assumed to have the lowest value in its range.
If you omit an element of time from <time2>, it is assumed to have the highest value in its range.
If you specify a year in <time1>, it must be specified in <time2>. The ranges for elements of time
are as follows: month 1-12, day 1-31, weekday 0-6, hour 0-23, minutes 0-59 and seconds 0-59.
For example, if the time is GMT 2005 May 10 10h 15m 30s, and it is the second Tuesday of the
month, you can specify the following (evaluation results are in parentheses):
• <certificate>.VALID_NOT_BEFORE.YEAR:
Extracts the last year that the certificate is valid. Returns the current year as a four-digit integer.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following expression prefixes return the contents of the HTTP Date header as text or as a date
object. These values can be evaluated as follows:
• As a number. The numeric value of an HTTP Date header is returned in the form of the number
of seconds since Jan 1, 1970.
For example, the expression http.req.date.mod(86400) returns the number of seconds since
the beginning of the day. These values can be evaluated using the same operations as other
non-date-related numeric data. For more information, see Expression prefixes for numeric data
other than date and time.
• As an HTTP header. Date headers can be evaluated using the same operations as other HTTP
headers.
For more information, see Default syntax expressions: Parsing HTTP, TCP, and UDP data.
• As text. Date headers can be evaluated using the same operations as other strings.
Prefix Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Generate the day of the week, as a string, in short and long formats
Contributed by:
C
The functions, WEEKDAY_STRING_SHORT and WEEKDAY_STRING, generate the day of the week, as a
string, in short and long formats, respectively. The strings that are returned are always in English. The
prefix used with these functions must return the day of the week in integer format and the acceptable
range for the value returned by the prefix is 0-6. Therefore, you can use any prefix that returns an
integer in the acceptable range. An UNDEF condition is raised if the returned value is not in this range
or if memory allocation fails.
Function Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Expression prefixes for numeric data other than date and time
Contributed by:
C
In addition to configuring expressions that operate on time, you can configure expressions for the
following types of numeric data:
• The length of HTTP requests, the number of HTTP headers in a request, and so on.
For more information, see Expressions for numeric HTTP payload data other than dates.
• Client and server data in regard to interface IDs and transaction throughput rate.
For more information, see Expressions for numeric client and server data.
For information on these prefixes, including the number of days until certificate expiration and
the encryption key size, see Prefixes for numeric data in SSL certificates.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following functions produce binary strings from a number returned by an expression prefix. These
functions are particularly useful in the TCP rewrite feature as replacement strings for binary data. For
more information about the TCP rewrite feature, see Rewrite.
All the functions return a value of type text. The endianness that some of the functions accept as a
parameter is either LITTLE_ENDIAN or BIG_ENDIAN.
Function Description
Function Description
<unsigned_long_number>.UNSIGNED32_STRING(<endianness>)
Produces a 32-bit unsigned binary string
representing the number. If the value is
out of range, an undef condition is raised. Exam-
ple: HTTP.REQ.BODY(100).AFTER_STR(“delim2”).GET_UNSIGN
BIG_ENDIAN).ADD(2).UNSIGNED32_STRING(BIG_ENDIAN)
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The
SYS.VSERVER(“<vserver-name>”) expression prefix enables you to identify a virtual server. You can use
the following functions with this prefix to retrieve information related to the specified virtual server:
• THROUGHPUT. Returns the throughput of the virtual server in Mbps (Megabits per second). The
value returned is an unsigned long number.
Usage: SYS.VSERVER(“vserver”).THROUGHPUT
• CONNECTIONS. Returns the number of connections being managed by the virtual server. The
value returned is an unsigned long number.
Usage: SYS.VSERVER(“vserver”).CONNECTIONS
• STATE. Returns the state of the virtual server. The value returned is UP, DOWN, or
OUT_OF_SERVICE. One of these values can therefore be passed as an argument to the
EQ() operator to perform a comparison that results in a Boolean TRUE or FALSE.
Usage: SYS.VSERVER(“vserver”).STATE
• HEALTH. Returns the percentage of services in an UP state for the specified virtual server. The
value returned is an integer.
Usage: SYS.VSERVER(“vserver”).HEALTH
• RESPTIME. Returns the response time as an integer representing the number of microseconds.
Response time is the average TTFB (Time To First Byte) from all the services bound to the virtual
server.
Usage: SYS.VSERVER(“vserver”).RESPTIME
• SURGECOUNT. Returns the number of requests in the surge queue of the virtual server. The
value returned is an integer.
Usage: SYS.VSERVER(“vserver”).SURGECOUNT
Example 1:
The following rewrite policy aborts rewrite processing if the number of connections at the load bal-
ancing virtual server LBvserver exceeds 10000:
Example 2:
The following rewrite action inserts a custom header, TP, whose value is the throughout at the virtual
server LBvserver:
Example 3:
The following audit log message action writes the average TTFB of the services bound to a virtual
server, to the newnslog log file:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure Advanced policy expressions to evaluate and process the payload in HTTP requests
and responses. The payload associated with an HTTP connection includes the various HTTP headers
(both standard and custom headers), the body, and other connection information such as the URL.
Additionally, you can evaluate and process the payload in a TCP or UDP packet. For HTTP connec-
tions, for example, you can check whether a particular HTTP header is present or if the URL includes
a particular query parameter.
You can configure expressions to transform the URL encoding and apply HTML or XML “safe” coding
for subsequent evaluation. You can also use XPATH and JSON prefixes to evaluate date in XML and
JSON files, respectively.
You can also use text-based and numeric Advanced policy expressions to evaluate HTTP request and
response data. For more information, see Advanced policy expressions: Evaluating text. and Default
Syntax Expressions: Working with Dates, Times, and Numbers.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The payload of an HTTP request or response consists of HTTP protocol information such as headers,
a URL, body content, and version and status information. When you configure a default syntax ex-
pression to evaluate HTTP payload, you use a default syntax expression prefix and, if necessary, an
operator.
For example, you use the following expression, which includes the http.req.header(“<header_name>“)
prefix and the exists operator, if you want to determine whether an HTTP connection includes a
custom header named “myHeader”:
http.req.header(”myHeader”).exists
You can also combine multiple Advanced policy expressions with Boolean and arithmetic operators.
For example, the following compound expression could be useful with various NetScaler features,
such as Integrated Caching, Rewrite, and Responder. This expression first uses the && Boolean op-
erator to determine whether an HTTP connection includes the Content-Type header with a value of
“text/html.” If that operation returns a value of FALSE, the expression determines whether the HTTP
connection includes a “Transfer-Encoding” or “Content-Length” header.
(http.req.header(”Content-Type”).exists && http.req.header(”Content-Type”)
.eq(”text/html”))|| (http.req.header(”Transfer-Encoding”).exists)|| (http.
req.header(”Content-Length”).exists)
The payload of a TCP or UDP packet is the data portion of the packet. You can configure Advanced
policy expressions to examine features of a TCP or UDP packet, including the following:
• Source and destination domains
• Source and destination ports
• The text in the payload
• Record types
The following expression prefixes extract text from the body of the payload:
• HTTP.REQ.BODY(integer). Returns the body of an HTTP request as a multiline text object, up to
the character position designated in the integer argument. If there are fewer characters in the
body than is specified in the argument, the entire body is returned.
• HTTP.RES.BODY(integer). Returns a portion of the HTTP response body. The length of the re-
turned text is equal to the number in the integer argument. If there are fewer characters in the
body than is specified in integer, the entire body is returned.
• CLIENT.TCP.PAYLOAD(integer). Returns TCP payload data as a string, starting with the first char-
acter in the payload and continuing for the number of characters in the integer argument.
Following is an example that evaluates to TRUE if a response body of 1024 bytes contains the string
“https”, and this string occurs after the string “start string” and before the string “end string”:
http.res.body(1024).after_str(”start_string”).before_str(”end_string”).
contains(”https”)
Note: You can apply any text operation to the payload body. For information on operations that you
can apply to text, see
Advanced policy expressions: Evaluating text.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following table lists the expressions that you can use to identify the protocol in an incoming
packet.
Expression Description
You can pass the Internet Assigned Numbers Authority (IANA) protocol number to the PROTOCOL func-
tion. For example, if you want to determine whether the protocol in an incoming packet is TCP, you
can use CLIENT.IP.PROTOCOL.EQ(6), where 6 is the IANA-assigned protocol number for TCP. For some
protocols, you can pass an enumeration value instead of the protocol number. For example, instead
of CLIENT.IP.PROTOCOL.EQ(6), you can use CLIENT.IP.PROTOCOL.EQ(TCP). The following table lists
the protocols for which you can use enumeration values, and the corresponding enumeration values
for use with the PROTOCOL function.
The protocol expressions can be used in both request-based and response-based policies. You can
use the expressions in various NetScaler features, such as load balancing, WAN optimization, content
switching, rewrite, and listen policies. You can use the expressions with functions such as EQ() and
NE(), to identify the protocol in a policy and perform an action.
• In Branch Repeater load balancing configurations, you can use the expressions in a listen policy
for the wildcard virtual server. For example, you can configure the wildcard virtual server with
the listen policy CLIENT.IP.PROTOCOL.EQ(TCP) so that the virtual server processes only TCP traf-
fic and simply bridges all non-TCP traffic. Even though you can use an Access Control List instead
of the listen policy, the listen policy provides better control over what traffic is processed.
• For content switching virtual servers of type ANY, you can configure content switching policies
that switch requests on the basis of the protocol in incoming packets. For example, you can
configure content switching policies to direct all TCP traffic to one load balancing virtual server
and all non-TCP traffic to another load balancing virtual server.
• You can use the client-based expressions to configure persistence based on the protocol. For ex-
ample, you can use CLIENT.IP.PROTOCOL to configure persistence on the basis of the protocols
in incoming IPv4 packets.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
One common method of evaluating HTTP traffic is to examine the headers in a request or a response.
A header can perform a number of functions, including the following:
Note
If an operation is used to evaluate both header and text data, the header-based operation always
overrides the text-based operation. For example, the AFTER_STR operation, when applied to a
header, overrides text-based AFTER_STR operations for all instances of the current header type.
The following table describes expression prefixes that extract HTTP headers.
HTTP.RES.SET_COOKIE(<name>).DOMAIN
Returns the valueorofHTTP.RES.SET_COOKIE2(<name>).DOMAIN
the first Domain field
in the cookie. For
example, if the cookie
is Set-Cookie :
Customer = “ABC”;
DOMAIN=”.abc.com”;
DOMAIN=.xyz.com,
the follow-
ing expression returns
.abc.com: http.res.set_cookie.cookie(“customer”).domain. A
string of zero length is
returned if the
Domain field or its
value is absent.
HTTP.RES.SET_COOKIE.EXISTS(<name>)
Returns a Boolean or HTTP.RES.SET_COOKIE2.EXISTS(<name>)
TRUE if a Cookie with
the name specified in
the <name>
argument exists in the
Set-Cookie header.
This prefix returns
UNDEF if more than
15 Set-Cookie headers
are present and the
named cookie is not
in the first 15 headers.
HTTP.RES.SET_COOKIE.COOKIE(<name>).EXPIRES
Returns the Expires or HTTP.RES.SET_COOKIE2.COOKIE(<name>).EXPIRES
field of the cookie.
This is a date string
that can be evaluated
as a number, as a
time object, or as text.
If multiple Expires
fields are present, the
first one is returned.
If the Expires field is
absent, a text object
of length zero is
returned. To evaluate
the returned value as
a time object, see
Default Syntax
Expressions: Working
with Dates, Times,
and Numbers.
HTTP.RES.SET_COOKIE.COOKIE(<name>).PATH
PATH.GET(n)
HTTP.RES.SET_COOKIE.COOKIE(<name>).PATH.IGNORE_EMPTY_ELEMENTS
Ignores the empty or HTTP.RES.SET_COOKIE2.COOKIE
elements in the list.
For example, in the
list a=10,b=11, ,c=89,
the element delimiter
in the list is , and the
list has an empty
element following
a=10. The element
following b=11 is not
considered an empty
element. As another
example, in the
following expression,
if a request contains
Cust_Header : 123„24,
,15 the following
expression returns a
value of
4: http.req.header(“Cust_Header”).typecast_list_t(‘,’).ignore_empty_elements.count. T
following expression
returns a value of
5: http.req.header(“Cust_Header”).typecast_list_t(‘,’).count
HTTP.RES.SET_COOKIE.COOKIE(<name>).PORT
Returns the value of or HTTP.RES.SET_COOKIE2.COOKIE(<name>).PORT
Port field of the
cookie. Operate as a
comma-separated
list. For example, the
following expression
returns 80. 2580 from
Set-Cookie :
Customer = “ABC”;
PATH=”/a/b/c”;
PORT= “80,
2580”: http.res.set_cookie.cookie(“ABC”).port. A
string of zero length is
returned if the Port
field or value is
absent.
HTTP.RES.SET_COOKIE.COOKIE(<name>).PORT.IGNORE_EMPTY_ELEMENTS
Ignores the empty or HTTP.RES.SET_COOKIE2.COOKIE
elements in the list.
For example, in the
list a=10,b=11, ,c=89,
the element delimiter
in the list is , and the
list has an empty
element following
a=10. The element
following b=11 is not
considered an empty
element.As another
example, in the
following expression,
if a request contains
Cust_Header : 123„24,
,15 the following
expression returns a
value of
4: http.req.header(“Cust_Header”).typecast_list_t(‘,’).ignore_empty_elements.count. T
following expression
returns a value of
5: http.req.header(“Cust_Header”).typecast_list_t(‘,’).count
HTTP.RES.SET_COOKIE.COOKIE(<name>).VERSION
Returns the value of or HTTP.RES.SET_COOKIE2.COOKIE(<name>).VERSION
the first Version field
in the cookie as a
decimal integer. For
example, the
following expression
returns 1 from the
cookie Set-Cookie :
Customer = “ABC”;
VERSION = “1”;
VERSION =
“0”: http.res.set_cookie.cookie(“CUSTOMER”).version. A
zero is returned if the
Version field or its
value is absent or if
the value is not a
decimal number.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Returns the nth
<integer>) or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
instance (0-based) of
<integer>) the cookie with the
specified name. If the
cookie is absent,
returns a text object
of length 0. Returns
UNDEF if more than
15 Set-Cookie headers
are present and the
cookie is not found.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Returns the value of
<integer>).DOMAIN or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
the Domain field of
<integer>).DOMAIN the first cookie with
the specified name.
For example, the
following expression
returns a value of
abc.com from the
cookie Set-Cookie :
Customer = “ABC”;
DOMAIN=”.abc.com”;
DO-
MAIN=.xyz.com: http.res.set_cookie.cookie(“CUSTOMER”).domain. A
string of zero length is
returned if the
Domain field or its
value is absent.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Returns the nth
<integer>).EXPIRES or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
instance (0-based) of
<integer>).EXPIRES the Expires field of
the cookie with the
specified name as a
date string. The value
can be operated upon
as a time object that
supports a number of
date formats. If the
Expires attribute is
absent a string of
length zero is
returned.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
PATH.GET(i) or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
PATH.GET(i) Returns the value of
<integer>).PATH <integer>).PATH the Path field of the
nth cookie, as a ‘/’
separated list.
Multiple /s are treated
as a single /. For
example, the
following expression
returns /a//b/c from
the cookie Set-Cookie
: Customer = “ABC”;
PATH=”/a//b/c”;
PATH= ”/x/y/z”: http.res.set_cookie.co
following returns
b: http.res.set_cookie.cookie(“CUSTO
string of zero length is
returned if the Path
field or its value is
absent.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Ignores the empty
<integer>).PATH.IGNORE_EMPTY_ELEMENTS
elements in the list. or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
<integer>).PATH.IGNORE_EMPTY_ELEMENTS
For example, in the
list a=10,b=11, ,c=89,
the element delimiter
in the list is , and the
list has an empty
element following
a=10. The element
following b=11 is not
considered an empty
element. As another
example, in the
following expression,
if a request contains
Cust_Header : 123„24,
,15 the following
expression returns a
value of
4: http.req.header(“Cust_Header”).typecast_list_t(‘,’).ignore_empty_elements.count. T
following expression
returns a value of
5: http.req.header(“Cust_Header”).typecast_list_t(‘,’).count
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Returns the value or
<integer>).PORT or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
values of the Port
<integer>).PORT field of the named
cookie as a ‘,’
separated list. For
example, the
following expression
returns 80, 2580 from
the cookie Set-Cookie
: Customer = “ABC”;
PATH=”/a/b/c”;
PORT= “80,
2580”: http.res.set_cookie.cookie(“ABC”).port. A
string of zero length is
returned if the Port
field or its value is
absent.
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Ignores the empty
<integer>).PORT.IGNORE_EMPTY_ELEMENTS
elements in the list. or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
<integer>).PORT.IGNORE_EMPTY_ELEMENTS
For example, in the
list a=10,b=11, ,c=89,
the element delimiter
in the list is , and the
list has an empty
element following
a=10. The element
following b=11 is not
considered an empty
element. As another
example, in the
following expression,
if a request contains
Cust_Header : 123„24,
,15 the following
expression returns a
value of
4: http.req.header(“Cust_Header”).typecast_list_t(‘,’).ignore_empty_elements.count. T
following expression
returns a value of
5: http.req.header(“Cust_Header”).typecast_list_t(‘,’).count
HTTP.RES.SET_COOKIE.COOKIE(<name>,
Returns the value of
<integer>).VERSION or HTTP.RES.SET_COOKIE2.COOKIE(<name>,
Version field of
<integer>).VERSION the nth cookie as a
decimal integer. A
string of zero length is
returned if the Port
field or its value is
absent.
The following table describes operations that you can specify with the prefixes for HTTP headers.
You can apply any of the operations for HTTP headers to Cache-Control headers. For more informa-
tion, see Operations for HTTP headers.
In addition, the following operations identify specific types of Cache-Control headers. See RFC 2616
for information about these header types.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
You can extract URLs and portions of URLs, such as the host name, or a segment of the URL path.
For example, the following expression identifies HTTP requests for image files by extracting image file
suffixes from the URL:
http.req.url.suffix.eq(”jpeg”)|| http.req.url.suffix.eq(”gif”)
Most expressions for URLs operate on text and are described in Expression Prefixes for Text in HTTP
Requests and Responses. This section discusses the GET operation. The GET operation extracts text
when used with the following prefixes:
• HTTP.REQ.URL.PATH
• VPN.BASEURL.PATH
• VPN.CLIENTLESS_BASEURL.PATH
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Expressions for HTTP status codes and numeric HTTP payload data
other than dates
Contributed by:
C
The following table describes prefixes for numeric values in HTTP data other than dates.
Prefix Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
SIP expressions
Contributed by:
C
The NetScaler Advanced policy expressions language contains a number of expressions that operate
on Session Initiation Protocol (SIP) connections. These expressions are intended to be used in policies
for any supported protocol that operates on a request/response basis. These expressions can be used
in content switching, rate limiting, responder, and rewrite policies.
Certain limitations apply to SIP expressions used with responder policies. Only the DROP, NOOP or
RESPONDWITH actions are allowed on a SIP load balancing virtual server. Responder policies can be
bound to a load balancing virtual server, an override global bind point, a default global bind point, or
a sip_udp policy label.
The header format used by the SIP protocol is similar to that used by the HTTP protocol, so many of
the new expressions look and function much like their HTTP analogs. Each SIP header consists of a
line that includes the SIP method, the URL, and the version, followed by a series of name-value pairs
that look like HTTP headers.
Following is a sample SIP header that is referred to in the expressions tables beneath it:
The following tables contain lists of expressions that operate on SIP headers. The first table contains
expressions that apply to request headers. Most response-based expressions are nearly the same as
the corresponding request-based expressions. To create a response expression from the correspond-
ing request expression, you change the first two sections of the expression from SIP.REQ to SIP.RES,
and make other obvious adjustments. The second table contains those response expressions that are
unique to responses and have no request equivalents. You can use any element in the following tables
as a complete expression on its own, or you can use various operators to combine these expression
elements with others to form more complex expressions.
Expression Description
Expression Description
Expression Description
Expression Description
Expression Description
Expression Description
Expression Description
Expression Description
SIP.REQ.HEADER(<header_name>).CONTAINS(<string>).
Returns boolean true if the specified text string
is present in any instance of the specified
header. Operates on all the instances of the
specified header. Header instances are
matched from last (0) to first.
SIP.REQ.HEADER(<header_name>).EQUALS_ANY(<patset>)
Returns boolean true if any pattern associated
with <patset> matches any content in any
instance of the specified header. Operates on
all the instances of the specified header.
Header instances are matched from last (0) to
first.
SIP.REQ.HEADER(<header_name>).CONTAINS_ANY(<patset>)
Returns Boolean true if any pattern associated
with <patset> matches any content in any
instance of the specified header. Operates on
all the instances of the specified header.
Header instances are matched from last (0) to
first.
SIP.REQ.HEADER(<header_name>).CONTAINS_INDEX(<patset>)
Returns the index of the matching pattern
associated with <patset> if that pattern
matches any content in any instance of the
specified header. Operates on all the instances
of the specified header. Header instances are
matched from last (0) to first.
SIP.REQ.HEADER(<header_name>).EQUALS_INDEX(<patset>)
Returns the index of the matching pattern
associated with <patset> if that pattern
matches any instance of the specified header.
Operates on all the instances of the specified
header. Header instances are matched from
last (0) to first.
Expression Description
SIP.REQ.HEADER(<header_name>).SUBSTR(<string>)
If the specified string is present in any instance
of the specified header, this expression returns
that string. For example, for the SIP header Via:
SIP/2.0/UDP
10.102.84.180:5060;branch=z9hG4bK03e76d0b;rport=5060;re
turns “rport=5060”.SIP.REQ.HEADER(“Via”).SUBSTR(“rport=50
turns an empty
string.
SIP.REQ.HEADER(<header_name>).AFTER_STR(<string>)
If the specified string is present in any instance
of the specified header, this expression returns
the string immediately after that string. For
example, for the SIP header Via: SIP/2.0/UDP
10.102.84.180:5060;branch=z9hG4bK03e76d0b;rport=5060;re
the expres-
sion SIP.REQ.HEADER(“Via”).AFTER_STR(“rport=”) re-
turns 5060.
Expression Description
SIP.REQ.HEADER(<header_name>).REGEX_MATCH(<regex>)
Returns boolean true if the specified regular
expression (regex) matches any instance of the
specified header. You must specify the regular
expression in the following format:
re<delimiter>regular expression<same
delimiter>. The regular expression cannot be
larger than 1499 characters in length. It must
conform to the PCRE regular expression
library. See http://www.pcre.org/pcre.txt for
documentation on PCRE regular expression
syntax. The pcrepattern man page also has
useful information on specifying patterns by
using PCRE regular expressions. The regular
expression syntax supported in this expression
has some differences from PCRE. Back
references are not allowed. You should avoid
recursive regular expressions; although some
work, many do not. The dot (.) metacharacter
matches newlines. Unicode is not sup-
ported.SET_TEXT_MODE(IGNORECASE) over-
rides the (?i) internal option specified in the
regular expression.
SIP.REQ.HEADER(<header_name>).REGEX_SELECT(<regex>)
If the specified regex matches any text in any
instance of the specified header, this
expression returns the text. For example, for
the SIP header Via: SIP/2.0/UDP
10.102.84.180:5060;branch=z9hG4bK03e76d0b;rport=5060;re
the expres-
sion SIP.REQ.HEADER(“Via”).REGEX_SELECT(“received=[0-
9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}”) returns re-
ceived=10.102.84.160.
Expression Description
SIP.REQ.HEADER(<header_name>).AFTER_REGEX(<regex>)
If the specified regex matches any text in any
instance of the specified header, this
expression returns the string immediately after
that text. For example, for the SIP header Via:
SIP/2.0/UDP
10.102.84.180:5060;branch=z9hG4bK03e76d0b;rport=5060;re
the expres-
sion SIP.REQ.HEADER(“Via”).AFTER_REGEX(“received=”) re-
turns10.102.84.160.
SIP.REQ.HEADER(<header_name>).BEFORE_REGEX(<regex>)
If the specified regex matches any text in any
instance of the specified header, this
expression returns the string immediately
before that text. For example, for the SIP
header Via: SIP/2.0/UDP
10.102.84.180:5060;branch=z9hG4bK03e76d0b;rport=5060;re
the expres-
sion SIP.REQ.HEADER(“Via”).BEFORE_REGEX(“[0-
9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}”) returns re-
ceived=.
SIP.REQ.FULL_HEADER Returns the entire SIP header, including the
terminating CR/LF.
SIP.REQ.IS_VALID Returns boolean true if the request format is
valid.
SIP.REQ.BODY(<length>) Returns the request body, up to the specified
length. If the specified length is greater than
the length of the request body, this expression
returns the entire request body.
SIP.REQ.LB_VSERVER Returns the name of the load balancing virtual
server (LB vserver) that is serving the current
request.
SIP.REQ.CS_VSERVER Returns the name of the content switching
virtual server (CS vserver) that is serving the
current request.
Expression Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Operations for HTTP, HTML, and XML encoding and “safe” characters
Contributed by:
C
The following operations work with the encoding of HTML data in a request or response and XML data
in a POST body.
• <text>.HTML_XML_SAFE:
Transforms special characters into XML safe format, as in the following examples:
After applying the transformation, additional operators that you specify in the expression are
applied to the selected text. Following is an example:
http.req.url.query.html_xml_safe. contains(“myQueryString”)
• <text>.HTTP_HEADER_SAFE:
Converts all new line (‘\n’) characters in the input text to ‘%0A’ to enable the input to be used
safely in HTTP headers.
The maximum length of the transformed text is 2048 bytes. This is a read-only operation.
• <text>.HTTP_URL_SAFE:
Converts unsafe URL characters to ‘%xx’ values, where “xx” is a hex-based representation of the
input character. For example, the ampersand (&) is represented as %26 in URL-safe encoding.
The maximum length of the transformed text is 2048 bytes. This is a read-only operation.
• <text>.MARK_SAFE:
Marks the text as safe without applying any type of data transformation.
• **<text>.SET_TEXT_MODE(URLENCODED|NOURLENCODED)
Transforms all %HH encoding in the byte stream. This operation works with characters (not
bytes). By default, a single byte represents a character in ASCII encoding. However, if you specify
URLENCODED mode, three bytes can represent a character.
In the following example, a PREFIX(3) operation selects the first 3 characters in a target.
http.req.url.hostname.prefix(3)
In the following example, the NetScaler can select up to 9 bytes from the target:
http.req.url.hostname.set_text_mode(urlencoded).prefix(3)
• <text>.SET_TEXT_MODE(PLUS_AS_SPACE|NO_PLUS_AS_SPACE):
Specifies how to treat the plus character (+). The PLUS_AS_SPACE option replaces a plus
character with white space. For example, the text “hello+world” becomes “hello world.” The
NO_PLUS_AS_SPACE option leaves plus characters as they are.
• <text>.SET_TEXT_MODE(BACKSLASH_ENCODED|NO_BACKSLASH_ENCODED):
Specifies whether or not backslash decoding is performed on the text object represented by
<text>.
– All occurrences of “\XXX” will be replaced with the character “Y” (where XXX represents a
number in the octal system and Y represents the ASCII equivalent of XXX). The valid range of
octal values for this type of encoding is 0 to 377. For example, the encoded text “http\72//”
and http\072//” will both be decoded to http://, where the colon (:) is the ASCII equivalent
of the octal value “72”.
– All occurrences of “\xHH” will be replaced with the character “Y” (HH represents a num-
ber in the hexadecimal system and Y denotes the ASCII equivalent of HH. For example,
the encoded text “http\x3a//” will be decoded to http://, where the colon (:) is the ASCII
equivalent of the hexadecimal value “3a“.
– All occurrences of “\uWWXX” will be replaced with the character sequence “YZ” (Where
WW and XX represent two distinct hexadecimal values and Y and Z represent their ASCII
equivalents of WW and XX respectively. For example, the encoded text “http%u3a2f/” and
“http%u003a//” will both be decoded to http://, where “3a” and “2f” are two hexadecimal
values and the colon (:) and forward slash (“/”) represent their ASCII equivalents respec-
tively.
– All occurrences of “\b”, “\n”, “\t”, “\f”, and “\r” are replaced with the corresponding ASCII
characters.
If NO_BACKSLASH_ENCODED is specified, backslash decoding is not performed on the text
object.
• <text>.SET_TEXT_MODE(BAD_ENCODE_RAISE_UNDEF|NO_BAD_ENCODE_RAISE_UNDEF):
Performs the associated undefined action if either the URLENCODED or the BACKSLASH_ENCODED
mode is set and bad encoding corresponding to the specified encoding mode is encountered
in the text object represented by <text>.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
TCP and UDP data take the form of a string or a number. For expression prefixes that return string
values for TCP and UDP data, you can apply any text-based operations. For more information, see
Advanced policy expressions: Evaluating text.
For expression prefixes that return numeric value, such as a source port, you can apply an arithmetic
operation. For more information, see Basic operations on expression prefixes and Compound opera-
tions for numbers.
The following table describes prefixes that extract TCP and UDP data.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can evaluate DNS requests and responses by using expressions that begin with DNS.REQ and
DNS.RES, respectively. You can also identify the transport layer protocol that is being used to send
the DNS messages.
Function Description
Function Description
Function Description
Function Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Parameters:
xpathex - XPath Boolean expression
• <text>.XPATH(xpathex):
Operate on an XML file and return a value of data type “double.”
For example, the following expression converts the string “36” (a price value) to a value of data
type “double” if the string is in the first 1000 bytes of the XML file:
HTTP.REQ.BODY(1000).XPATH(xp%number(/Book/price)%)
Parameters:
xpathex - XPath numeric expression
• <text>.XPATH(xpathex):
Operate on an XML file and return a node-set or a string. Node-sets are converted to correspond-
ing strings by using the standard XPath string conversion routine.
For example, the following expression selects all the nodes that are enclosed by “/Book/creator”
(a node-set) in the first 1000 bytes of the body:
HTTP.REQ.BODY(1000).XPATH(xp%/Book/creator%)
Parameters:
• <text>.XPATH_HTML(xpathex)
For example, the following expression operates on an HTML file and returns the text enclosed
in <title></title> tags if the title HTML element is found in the first 1000 bytes:
HTTP.REQ.BODY(1000).XPATH_HTML(xp%/html/head/title%)
Parameters:
• <text>.XPATH_HTML_WITH_MARKUP(xpathex)
Operate on an HTML file and return a string that contains the entire selected portion of the doc-
ument, including markup such as including the enclosing element tags.
The following expression operates on the HTML file and selects all content within the <title> tag,
including markup.
HTTP.REQ.BODY(1000).XPATH_HTML_WITH_MARKUP( xp%/html/head/title%)
The portion of the HTML body that is selected by the expression is marked for further processing.
Parameters:
• <text>.XPATH_JSON(xpathex)
The following expression operates on the JSON file and returns a Boolean TRUE if the JSON file
contains a node named “creator,” whose parent node is “Book,” in the first 1000 bytes:
HTTP.REQ.BODY(1000).XPATH_JSON(xp%boolean(/Book/creator)%)
Parameters:
• <text>.XPATH_JSON(xpathex)
Operate on a JSON file and return a value of data type “double.”
The following expression operates on the JSON file and converts the string “36” to a value of
data type “double” if the string is present in the first 1000 bytes of the JSON file.
HTTP.REQ.BODY(1000).XPATH_JSON(xp%number(/Book/price)%)
Parameters:
• <text>.XPATH_JSON(xpathex)
Operate on a JSON file and return a node-set or a string. Node-sets are converted to correspond-
ing strings by using the standard XPath string conversion routine.
The following expression selects all the nodes that are enclosed by “/Book” (a node-set) in the
first 1000 bytes of the body of the JSON file and returns the corresponding string value, which
is “<name><title>”:
HTTP.REQ.BODY(1000).XPATH_JSON(xp%/Book%)
Parameters:
• <text>.XPATH_JSON_WITH_MARKUP(xpathex)
Operate on an XML file and return a string that contains the entire portion of the document for
the result node, including markup such as including the enclosing element tags.
The following expression operates on the JSON file and selects all the nodes that are enclosed by
“/Book/creator” in the first 1000 bytes of the body, which is “creator:{ person:{ name:’<name>’
} }.”
HTTP.REQ.BODY(1000).XPATH_JSON_WITH_MARKUP(xp%/Book/creator%)
The portion of the JSON body that is selected by the expression is marked for further processing.
Parameters:
• <text>.XPATH_WITH_MARKUP(xpathex):
Operate on an XML file and return a string that contains the entire portion of the document for
the result node, including markup such as including the enclosing element tags.
For example, the following expression operates on an XML file and selects all the nodes enclosed
by “/Book/creator” in the first 1000 bytes of the body.
HTTP.REQ.BODY(1000).XPATH_WITH_MARKUP(xp%/Book/creator%)
The portion of the JSON body that is selected by the expression is marked for further processing.
Parameters:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can use the XML_ENCRYPT() and XML_DECRYPT() functions in Advanced policy expressions to
encrypt and decrypt, respectively, XML data. These functions conform to the W3C XML Encryption
standard defined at “http://www.w3.org/TR/2001/PR-xmldsig-core-20010820/.” XML_ENCRYPT()
and XML_DECRYPT() support a subset of the XML Encryption specification. In the subset, data
encryption uses a bulk cipher method (RC4, DES3, AES128, AES192, or AES256), and an RSA public
key is used to encrypt the bulk cipher key.
Note: If you want to encrypt and decrypt text in a payload, you must use the
ENCRYPT and
DECRYPT functions. For more information about these functions, see
Encrypt and decrypt text.
The
XML_ENCRYPT() and
XML_DECRYPT() functions are not dependent on the encryption/decryption service that is used by the
ENCRYPT and
DECRYPT commands for text. The cipher method is specified explicitly as an argument to the
Note: The
<xenc:EncryptedData> element is defined in the W3C XML Encryption specification.
• certKeyName: Selects an X.509 certificate with an RSA public key for XML_ENCRYPT() or an RSA
private key for XML_DECRYPT(). The certificate key must have been previously created by an add
ssl certKey command.
• method: Specifies which cipher method to use for encrypting the XML data. Possible values:
RC4, DES3, AES128, AES192, AES256.
The XML encryption feature uses SSL certificate-key pairs to provide X.509 certificates (with RSA pub-
lic keys) for key encryption and RSA private keys for key decryption. Therefore, before you use the
XML_ENCRYPT() function in an expression, you must create an SSL certificate-key pair. The following
command creates an SSL certificate-key pair, my-certkey, with the X.509 certificate, my-cert.pem, and
the private key file, my-key.pem.
The following CLI commands create rewrite actions and policies for encrypting and decrypting XML
content.
In the above example, the rewrite action my-xml-encrypt-action encrypts the entire XML document (
XPATH_WITH_MARKUP(xp%/%)) in the request by using the AES-256 bulk encryption method and the
RSA public key from my-certkey to encrypt the bulk encryption key. The action replaces the document
with an <xenc:EncryptedData> element containing the encrypted data and an encrypted key. The
flags represented by 31 include all of the optional <ds:KeyInfo> elements.
The action my-xml-decrypt-action decrypts the first <xenc:EncryptedData> element in the response
(XPATH_WITH_MARKUP(xp%//xenc:EncryptedData%)). This requires the prior addition of the xenc
XML namespace by use of the following CLI command:
The my-xml-decrypt-action action uses the RSA private key in my-certkey to decrypt the encrypted key
and then uses the bulk encryption method specified in the element to decrypt the encrypted contents.
Finally, the action replaces the encrypted data element with the decrypted content.
The rewrite policy my-xml-encrypt-policy applies my-xml-encrypt-action to requests for URLs contain-
ing xml-encrypt. The action encrypts the entire response from a service configured on the NetScaler
appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
There are advanced policy expressions to parse SSL certificates and SSL client hello messages.
You can use advanced policy expressions to evaluate X.509 Secure Sockets Layer (SSL) client certifi-
cates. A client certificate is an electronic document that can be used to authenticate a user’s identity. A
client certificate contains (at a minimum) version information, a serial number, a signature algorithm
ID, an issuer name, a validity period, a subject (user) name, a public key, and signatures.
You can examine both SSL connections and data in client certificates. For example, you may want to
send SSL requests that use low-strength ciphers to a particular load balancing virtual server farm. The
following command is an example of a Content Switching policy that parses the cipher strength in a
request and matches cipher strengths that are less than or equal to 40:
As another example, you can configure a policy that determines whether a request contains a client
certificate:
Or, you might want to configure a policy that examines particular information in a client certificate.
For example, the following policy verifies that the certificate has one or more days before expiration:
Note
For information on parsing dates and times in a certificate, see Format of Dates and Times in an
Expression” and
Expressions for SSL Certificate Dates.
The following table describes expression prefixes that identify text-based items in SSL transactions
and client certificates.
Table 1. Prefixes That Return Text or Boolean Values for SSL and Client Certificate Data
Prefix Description
The following table describes prefixes that evaluate numeric data other than dates in SSL certificates.
These prefixes can be used with the operations that are described in Basic Operations on Expression
Prefixes” and Compound Operations for Numbers.
Table 2. Prefixes That Evaluate Numeric Data Other Than Dates in SSL Certificates
Prefix Description
Note
You can parse SSL certificates by configuring expressions that use the following prefix:
CLIENT.SSL.CLIENT_CERT
This section discusses the expressions that you can configure for certificates, with the exception of
expressions that examine certificate expiration. Time-based operations are described in Advanced
Policy Expressions: Working with Dates, Times, and Numbers.
The following table describes operations that you can specify for the CLIENT.SSL.CLIENT_CERT prefix.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
You can use Advanced policy expression prefixes that return IPv4 and IPv6 addresses, MAC addresses,
IP subnets, useful client and server data such as the throughput rates at the interface ports (Rx, Tx,
and RxTx), and the IDs of the VLANs through which packets are received. You can then use various
operators to evaluate the data that is returned by these expression prefixes.
You can use Advanced policy expressions to evaluate addresses and subnets that are in Internet Proto-
col version 4 (IPv4) or Internet Protocol version 6 (IPv6) format. Expression prefixes for IPv6 addresses
and subnets include IPv6 in the prefix. Expression prefixes for IPv4 addresses and subnets include IP
in the prefix. Following is an example of an expression that identifies whether a request has originated
from a particular IPv4 subnet.
1 client.ip.src.in_subnet(147.1.0.0/16)
Following are two examples of Rewrite policies that examine the subnet from which the packet is
received and perform a rewrite action on the Host header. With these two policies configured, the
rewrite action that is performed depends on the subnet in the request. These two policies evaluate IP
addresses that are in the IPv4 address format.
Note
The preceding examples are commands that you type at the NetScaler command-line interface
(CLI) and, therefore, each quotation mark must be preceded by a backslash (\). For more infor-
mation, see Configuring advanced policy expressions in a policy.
The following table describes prefixes that return IPv4 addresses and subnets, and segments of IPv4
addresses. You can use numeric operators and operators that are specific to IPv4 addresses with these
prefixes. For more information about numeric operations, see Basic Operations on Expression Pre-
fixes and Compound Operations for Numbers.
Prefix Description
The following table describes the operators that can be used with prefixes that return an IPv4 address.
Prefix Description
Prefix Description
The IPv6 address format allows more flexibility than the older IPv4 format. IPv6 addresses are in the
hexadecimal format (RFC 2373). In the following examples, Example 1 is an IPv6 address, Example 2 is
a URL that includes the IPv6 address, and Example 3 includes the IPv6 address and a port number.
Example 1:
1 9901:0ab1:22a2:88a3:3333:4a4b:5555:6666
Example 2:
1 http://[9901:0ab1:22a2:88a3:3333:4a4b:5555:6666]/
Example 3:
1 https://[9901:0ab1:22a2:88a3:3333:4a4b:5555:6666]:8080/
In Example 3, the brackets separate the IP address from the port number (8080).
Note that you can only use the ‘+’ operator to combine IPv6 expressions with other expressions. The
output is a concatenation of the string values that are returned from the individual expressions. You
cannot use any other arithmetic operator with an IPv6 expression. The following syntax is an example:
1 client.ipv6.src + server.ip.dst
For example, if the client source IPv6 address is ABCD:1234::ABCD, and the server destination IPv4
address is 10.100.10.100, the preceding expression returns “ABCD:1234::ABCD10.100.10.100”.
Note that when the NetScaler appliance receives an IPv6 packet, it assigns a temporary IPv4 address
from an unused IPv4 address range and changes the source address of the packet to this temporary
address. At response time, the outgoing packet’s source address is replaced with the original IPv6
address.
Note
You can combine an IPv6 expression with any other expression except an expression that pro-
duces a Boolean result.
The IPv6 addresses that are returned by the expression prefixes in the following table can be treated
as text data. For example, the prefix client.ipv6.dst returns the destination IPv6 address as a string
that can be evaluated as text.
The following table describes expression prefixes that return an IPv6 address.
Prefix Description
The following table describes the operators that can be used with prefixes that return an IPv6 address:
A MAC address consists of colon-delimited hexadecimal values in the format ##:##:##:##:##:##, where
each “#” represents either a number from 0 through 9 or a letter from A through F. Default syntax
expression prefixes and operators are available for evaluating source and destination MAC addresses.
Prefix Description
The following table describes the operators that can be used with prefixes that return a MAC address.
Prefix Description
The following table describes prefixes for working with numeric client and server data, including
throughput, port numbers, and VLAN IDs.
Prefix Description
Prefix Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
• COLLECT_STATS
Collect statistical data from the requests that are evaluated against the policy and create a
record for each request.
• REQUESTS
Return the number of requests that exist for the specified record grouping. The value returned
is of type unsigned long.
• BANDWIDTH
Return the bandwidth statistic for the specified record grouping. The value returned is of type
unsigned long.
• RESPTIME
Return the response time statistic for the specified record grouping. The value returned is of
type unsigned long.
• CONNECTIONS
Return the number of concurrent connections that exist for the specified record grouping. The
value returned is of type unsigned long.
• IS_TOP(n)
Return a Boolean
TRUE if the statistical value for the specified record grouping is one among the top
n groups. Otherwise, return a Boolean
FALSE.
• CHECK_LIMIT
Return a Boolean
TRUE if the statistic for the specified record grouping has hit the preconfigured limit. Otherwise,
return a Boolean
FALSE.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The policy infrastructure on the NetScaler appliance includes expressions that you can use to evaluate
and process database server traffic when the appliance is deployed between a farm of application
servers and their associated database servers.
The following expressions evaluate traffic associated with MySQL database servers. You can use the
request-based expressions (expressions that begin with MYSQL.CLIENT and MYSQL.REQ) in policies
to make request switching decisions at the content switching virtual server bind point and the
response-based expressions (expressions that begin with MYSQL.RES) to evaluate server responses
to user-configured health monitors.
• MYSQL.CLIENT.CAPABILITIES. Returns the set of flags that the client has set in the capabilities
field of the handshake initialization packet during authentication. Examples of the flags that
are set are CLIENT_FOUND_ROWS, CLIENT_COMPRESS, and CLIENT_SSL.
– LATIN2_CZECH_CS
– DEC8_SWEDISH_CI
– CP850_GENERAL_CI
– GREEK_GENERAL_CI
– LATIN1_GERMAN1_CI
– HP8_ENGLISH_CI
– KOI8R_GENERAL_CI
– LATIN1_SWEDISH_CI
– LATIN2_GENERAL_CI
– SWE7_SWEDISH_CI
– ASCII_GENERAL_CI
– CP1251_BULGARIAN_CI
– LATIN1_DANISH_CI
– HEBREW_GENERAL_CI
– LATIN7_ESTONIAN_CS
– LATIN2_HUNGARIAN_CI
– KOI8U_GENERAL_CI
– CP1251_UKRAINIAN_CI
– CP1250_GENERAL_CI
– LATIN2_CROATIAN_CI
– CP1257_LITHUANIAN_CI
– LATIN5_TURKISH_CI
– LATIN1_GERMAN2_CI
– ARMSCII8_GENERAL_CI
– UTF8_GENERAL_CI
– CP1250_CZECH_CS
– CP866_GENERAL_CI
– KEYBCS2_GENERAL_CI
– MACCE_GENERAL_CI
– MACROMAN_GENERAL_CI
– CP852_GENERAL_CI
– LATIN7_GENERAL_CI
– LATIN7_GENERAL_CS
– MACCE_BIN
– CP1250_CROATIAN_CI
– LATIN1_BIN
– LATIN1_GENERAL_CI
– LATIN1_GENERAL_CS
– CP1251_BIN
– CP1251_GENERAL_CI
– CP1251_GENERAL_CS
– MACROMAN_BIN
– CP1256_GENERAL_CI
– CP1257_BIN
– CP1257_GENERAL_CI
– ARMSCII8_BIN
– ASCII_BIN
– CP1250_BIN
– CP1256_BIN
– CP866_BIN
– DEC8_BIN
– GREEK_BIN
– HEBREW_BIN
– HP8_BIN
– KEYBCS2_BIN
– KOI8R_BIN
– KOI8U_BIN
– LATIN2_BIN
– LATIN5_BIN
– LATIN7_BIN
– CP850_BIN
– CP852_BIN
– SWE7_BIN
– UTF8_BIN
– GEOSTD8_GENERAL_CI
– GEOSTD8_BIN
– LATIN1_SPANISH_CI
– UTF8_UNICODE_CI
– UTF8_ICELANDIC_CI
– UTF8_LATVIAN_CI
– UTF8_ROMANIAN_CI
– UTF8_SLOVENIAN_CI
– UTF8_POLISH_CI
– UTF8_ESTONIAN_CI
– UTF8_SPANISH_CI
– UTF8_SWEDISH_CI
– UTF8_TURKISH_CI
– UTF8_CZECH_CI
– UTF8_DANISH_CI
– UTF8_LITHUANIAN_CI
– UTF8_SLOVAK_CI
– UTF8_SPANISH2_CI
– UTF8_ROMAN_CI
– UTF8_PERSIAN_CI
– UTF8_ESPERANTO_CI
– UTF8_HUNGARIAN_CI
– INVAL_CHARSET
• MYSQL.CLIENT.USER. Returns the user name (in the authentication packet) with which the client
is attempting to connect to the database. This is the user attribute.
– SLEEP
– QUIT
– INIT_DB
– QUERY
– FIELD_LIST
– CREATE_DB
– DROP_DB
– REFRESH
– SHUTDOWN
– STATISTICS
– PROCESS_INFO
– CONNECT
– PROCESS_KILL
– DEBUG
– PING
– TIME
– DELAYED_INSERT
– CHANGE_USER
– BINLOG_DUMP
– TABLE_DUMP
– CONNECT_OUT
– REGISTER_SLAVE
– STMT_PREPARE
– STMT_EXECUTE
– STMT_SEND_LONG_DATA
– STMT_CLOSE
– STMT_RESET
– SET_OPTION
– STMT_FETCH
• MYSQL.REQ.QUERY.SIZE. Returns the size of the request query in integer format. The SIZE
method is similar to the CONTENT_LENGTH method that returns the length of an HTTP request
or response.
• MYSQL.REQ.QUERY.TEXT(<n>). Returns the first n bytes of the MySQL query as a string. This is
similar to HTTP.BODY(<n>).
Parameters:
Parameters:
i - Number of rows
• MYSQL.RES.ERROR. Identifies the MySQL error object. The error object includes the error num-
ber and the error message.
• MYSQL.RES.ERROR.MESSAGE. Returns the error message that is retrieved from the server’s
error response.
• MYSQL.RES.ERROR.NUM. Returns the error number that is retrieved from the server’s error
response.
• MYSQL.RES.ERROR.SQLSTATE. Returns the value of the SQLSTATE field in the server’s error
response. The MySQL server translates error number values to SQLSTATE values.
Parameters:
i - Packet number
• MYSQL.RES.FIELD(<i>).CHAR_SET. Returns the character set of the column. The EQ(<m>) and
NE(<m>) operators, which return Boolean values to indicate the result of a comparison, are used
with this prefix.
– DECIMAL
– TINY
– SHORT
– LONG
– FLOAT
– DOUBLE
– NULL
– TIMESTAMP
– LONGLONG
– INT24
– DATE
– TIME
– DATETIME
– YEAR
– NEWDATE
– VARCHAR (new in MySQL 5.0)
– BIT (new in MySQL 5.0)
– NEWDECIMAL (new in MySQL 5.0)
– ENUM
– SET
– TINY_BLOB
– MEDIUM_BLOB
– LONG_BLOB
– BLOB
– VAR_STRING
– STRING
– GEOMETRY
• MYSQL.RES.FIELD(<i>).DB. Returns the database identifier (db) attribute of the field packet.
• MYSQL.RES.FIELD(<i>).FLAGS. Returns the flags property of the field packet. Following are
the possible hexadecimal flag values:
– 0001: NOT_NULL_FLAG
– 0002: PRI_KEY_FLAG
– 0004: UNIQUE_KEY_FLAG
– 0008: MULTIPLE_KEY_FLAG
– 0010: BLOB_FLAG
– 0020: UNSIGNED_FLAG
– 0040: ZEROFILL_FLAG
– 0080: BINARY_FLAG
– 0100: ENUM_FLAG
– 0200: AUTO_INCREMENT_FLAG
– 0400: TIMESTAMP_FLAG
– 0800: SET_FLAG
• MYSQL.RES.FIELD(<i>).LENGTH. Returns the length of the column. This is the value of the
length attribute of the field packet. The value that is returned might be larger than the actual
value. For example, an instance of a VARCHAR(2) column might return a value of 2 even when it
contains only one character.
• MYSQL.RES.FIELD(<i>).NAME. Returns the column identifier (the name after the AS clause, if
any). This is the name attribute of the field packet.
• MYSQL.RES.FIELD(<i>).TABLE. Returns the table identifier of the column (after the AS clause,
if any). This is the table attribute of the field packet.
• MYSQL.RES.OK.STATUS. Identifies the bit string in the server_status attribute of the OK packet.
Clients can use the server status to check whether the current command is a part of a running
transaction. The bits in the server_status bit string correspond to the following fields (in the
given order):
– IN TRANSACTION
– AUTO_COMMIT
– MORE RESULTS
– MULTI QUERY
– BAD INDEX USED
– NO INDEX USED
– CURSOR EXISTS
– LAST ROW SEEN
– DATABASE DROPPED
– NO BACKSLASH ESCAPES
Parameters:
i - Row number
Parameters:
i - Row number
j - Column number
Parameters:
i - Row number
j - Column number
Parameters:
i - Row number
j - Column number
from 0. Therefore, row i and column j are actually the (i+1)<sup>th</sup> row and the
(j+1)<sup>th</sup> column, respectively.
Parameters:
i - Row number
j - Column number
• MYSQL.RES.TYPE. Returns an enumeration constant for the response type. Its values can be ER-
ROR, OK, and RESULT_SET. The EQ(<m>) and NE(<m>) operators, which return Boolean values
to indicate the result of a comparison, are used with this prefix.
The following expressions evaluate traffic associated with Microsoft SQL Server database servers. You
can use the request-based expressions (expressions that begin with MSSQL.CLIENT and MSSQL.REQ)
in policies to make request switching decisions at the content switching virtual server bind point
and the response-based expressions (expressions that begin with MSSQL.RES) to evaluate server re-
sponses to user-configured health monitors.
Expression Description
MSSQL.CLIENT.CAPABILITIES Returns
the OptionFlags1, OptionFlags2, OptionFlags3,
and TypeFlags fields of
the LOGIN7authentication packet, in that
order, as a 4-byte integer. Each field is 1 byte
long and specifies a set of client capabilities.
MSSQL.CLIENT.DATABASE Returns the name of the client database. The
value returned is of type text.
MSSQL.CLIENT.USER Returns the user name with which the client
authenticated. The value returned is of
type text.
Expression Description
Expression Description
MSSQL.REQ.RPC.BODY(n)
Note: Not available for releases before 10.1. Returns part of the body of the SQL request as
a string in the form of parameters represented
as “a=b” clauses separated by commas, where
“a” is the RPC parameter name and “b” is its
value. Parameters are returned from only the
first “n” bytes of the request, skipping the SQL
header. Only complete name-value pairs are
returned.
MSSQL.RES.ATLEAST_ROWS_COUNT(i) Checks whether the response has at
least i number of rows. The value returned is a
Boolean TRUE or FALSEvalue. Parameters: i -
Number of rows
MSSQL.RES.DONE.ROWCOUNT Returns a count of the number of rows affected
by an INSERT, UPDATE, or DELETE query. The
value returned is of type unsigned long.
MSSQL.RES.DONE.STATUS Returns the status field from the DONE token
sent by a Microsoft SQL Server database server.
The value returned is a number.
MSSQL.RES.ERROR.MESSAGE Returns the error message from
the ERROR token sent by a Microsoft SQL
Server database server. This is the value of
the MsgText field in the ERROR token. The
value returned is of type text.
MSSQL.RES.ERROR.NUM Returns the error number from
the ERROR token sent by a Microsoft SQL
Server database server. This is the value of
the Number field in the ERROR token. The
value returned is a number.
MSSQL.RES.ERROR.STATE Returns the error state from the ERROR token
sent by a Microsoft SQL Server database server.
This is the value of the State field in
the ERROR token. The value returned is a
number.
Expression Description
Expression Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Typecasting data
January 6, 2019
Contributed by:
C
You can extract data of one type (for example, text or an integer) from requests and responses and
transform it to data of another type. For example, you can extract a string and transform the string to
time format. You can also extract a string from an HTTP request body and treat it like an HTTP header
or extract a value from one type of request header and insert it in a response header of a different type.
After typecasting the data, you can apply any operation that is appropriate for the new data type. For
example, if you typecast text to an HTTP header, you can apply any operation that is applicable to
HTTP headers to the returned value.
For more information about typecasting data, see the Typecasting Operations pdf.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Regular Expressions
Contributed by:
C
When you want to perform string matching operations that are more complex than the operations that
you perform with the CONTAINS(“<string>”) or EQ(“<string>“) operators, you use regular expressions.
The policy infrastructure on the Citrix® NetScaler® appliance includes operators to which you can pass
regular expressions as arguments for text matching. The names of the operators that work with reg-
ular expressions include the string REGEX. The regular expressions that you pass as arguments must
conform to the regular expression syntax that is described in “http://www.pcre.org/pcre.txt.” You can
learn more about regular expressions at “http://www.regular-expressions.info/quickstart.html” and
at “http://www.silverstones.com/thebat/Regex.html.”
The target text for an operator that works with regular expressions can be either text or the value of
an HTTP header. Following is the format of a default syntax expression that uses a regular expression
operator to operate on text:
<text>.<regex_operator>(re<delimiter><regex_pattern><delimiter>)
The string <text> represents the default syntax expression prefix that identifies a text string in a
packet (for example, HTTP.REQ.URL). The string <regex_operator> represents the regular expres-
sion operator. The regular expression always
begins with the string re. A pair of matching delimiters, represented by <delimiter>, enclose the
string <regex_pattern>, which represents the regular expression.
The following example expression checks whether the URL in an HTTP packet contains the string *.
jpeg (where * is a wildcard) and returns a Boolean TRUE or FALSE to indicate the result. T he regular
expression is enclosed within a pair of
slash marks (/), which act as delimiters..
http.req.url.regex_match(re/.<asterisk>\.jpeg/)
Regular expression operators can be combined to define or refine the scope of a search. For exam-
ple, <text>.AFTER_REGEX(re/regex_pattern1/).BEFORE_REGEX(re/regex_pattern2/) specifies that the
target for string matching is the text between the patterns regex_pattern1 and regex_pattern2. You
can use a text operator on the scope that is defined by the regular expression operators. For exam-
ple, you can use the CONTAINS(“<string>”) operator to check whether the defined scope contains the
string abc:
<text>.AFTER_REGEX(re/regex_pattern1/).BEFORE_REGEX(re/regex_pattern2/).CONTAINS(“abc”)
Note
The process of evaluating a regular expression inherently takes more time than that for an oper-
ator such as CONTAINS(“<string>”) or EQ(“<string>”), which work with simple string arguments.
You should use regular expressions only if your requirement is beyond the scope of other opera-
tors.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Following are notable characteristics of regular expressions as defined on the NetScaler appliance:
• A regular expression always begins with the string “re” followed by a pair of delimiting charac-
ters (called delimiters) that enclose the regular expression that you want to use.
• Digit matching can be done by using the string \d (a backslash followed by d).
Following are the differences between the NetScaler syntax and the PCRE syntax:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following table describes the operators that work with regular expressions. The operation per-
formed by a regular expression operator in a given default syntax expression depends on whether the
expression prefix identifies text or HTTP headers. Operations that evaluate headers override any text-
based operations for all instances of the specified header type. When you use an operator, replace
<text> with the default syntax expression prefix that you want to configure for identifying text.
<text>.BEFORE_REGEX(<regular expression>) Selects the text that precedes the string that
matches the <regular expression> argument. If
the regular expression does not match any
data in the target, the expression returns a text
object of length 0. The following expression
selects the string “text” from
“text/plain”. http.res.header(“content-
type”).before_regex(re#/#)
<text>.AFTER_REGEX(<regular expression>) Selects the text that follows the string that
matches the <regular expression> argument. If
the regular expression does not match any text
in the target, the expression returns a text
object of length 0. The following expression
extracts “Example” from “myExam-
ple”: http.req.header(“etag”).after_regex(re/my/)
<text>.REGEX_SELECT(<regular expression>) Selects a string that matches the <regular
expression> argument. If the regular
expression does not match the target, a text
object of length 0 is returned. The following
example extracts the string “NS-CACHE-9.0:
90” from a Via
header: http.req.header(“via”).regex_select(re!NS-
CACHE-\d.\d:\s*\d{1,3}!)
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Some NetScaler features use classic policies and classic expressions. As with default syntax policies,
classic policies can be either global or specific to a virtual server. However, to a certain extent, the
configuration method and bind points for classic policies are different from those of default syntax
policies. As with default syntax expressions, you can configure named expressions and use a named
expression in multiple classic policies.
The following table summarizes NetScaler features that can be configured by using classic policies.
Click here to view the table.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
At the command prompt, type the following commands to set the parameters and verify the configu-
ration:
Example
The following commands first create a compression action and then create a compression policy that
applies the action:
1. In the navigation pane, expand the feature for which you want to configure a policy and, de-
pending on the feature, do the following:
• For Content Switching, Cache Redirection, and the application firewall, click Policies.
• For SSL, click Policies, and then in the details pane, click the Policies tab.
• For System Authentication, click Authentication, and then in the details pane, click the
Policies tab.
• For Filter, SureConnect, and Priority Queuing, expand Protection Features, select the de-
sired function, and then in the details pane, click the Policies tab.
• For the NetScaler Gateway, expand NetScaler Gateway, expand Policies, select the desired
function, and then in the details pane, click the Policies tab.
3. In the Create <feature name> Policy dialog box, in the Name* text box, enter a name for the
policy.
Note: You must begin a policy name with a letter or underscore. A policy name can consist of 1
to 31 characters, including letters, numbers, hyphen (-), period (.), pound sign (#), space ( ), and
underscore (_).
4. For most features, you associate an action or a profile. For example, you may be required to
select an action, or, in the case of an NetScaler Gateway or application firewall policy, you select
a profile to associate with the policy. A profile is a set of configuration options that operate as a
set of actions that are applied when the data being analyzed matches the policy rule.
5. Create an expression that describes the type of data that you want this policy to match.
Depending on the type of policy you want to create, you can choose a predefined expression,
or you can create a new expression.
Named expressions are predefined expressions that you can reference by name in a policy rule.
7. Click Close to return to the Policies screen for the type of policy you were creating.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Classic expressions consist of the following expression elements, listed in hierarchical order:
• Flow Type. Specifies whether the connection is incoming or outgoing. The flow type is REQ for
incoming connections and RES for outgoing connections.
• Protocol. Specifies the protocol, the choices for which are HTTP, SSL, TCP, and IP.
• Qualifier. The protocol attribute, which depends on the selected protocol.
• Operator. The type of test you want to perform on the connection data. Your choice of operator
depends upon the connection information you are testing. If the connection information you
are testing is text, you use text operators. If it is a number, you use standard numeric operators.
• Value. The string or number against which the connection data element—defined by the flow
type, protocol, and qualifier—is tested. The value can be either a literal or an expression. The
literal or expression must match the data type of the connection data element.
In a policy, classic expressions can be combined to create more complex expressions using Boolean
and comparative operators.
Expression elements are parsed from left to right. The leftmost element is either REQ or RES and des-
ignates a request or a response, respectively. Successive terms define a specific connection type and
a specific attribute for that connection type. Each term is separated from any preceding or following
term by a period. Arguments appear in parentheses and follow the expression element to which they
are passed.
The following classic expression fragment returns the client source IP for an incoming connection.
REQ.IP.SOURCEIP
The example identifies an IP address in a request. The expression element SOURCEIP designates the
source IP address. This expression fragment may not be useful by itself. You can use an additional
expression element, an operator, to determine whether the returned value meets specific criteria.
The following expression tests whether the client IP is in the subnet 200.0.0.0/8 and returns a Boolean
TRUE or FALSE:
At the command prompt, type the following commands to set the parameters and verify the configu-
ration:
Example
This procedure documents the Add Expression dialog box. Depending on the feature for which you
are configuring a policy, the route by which you arrive at this dialog box may be different.
1. Perform steps 1-4 in “To create a policy with classic expressions by using the GUI.”
2. In the Add Expression dialog box, in Expression Type, click the type of expression you want to
create.
3. Under Flow Type, click the down arrow and choose a flow type.
The flow type is typically REQ or RES. The REQ option specifies that the policy applies to all in-
coming connections or requests. The RES option applies the policy to all outgoing connections
or responses.
For Application Firewall policies, you should leave the expression type set to General Expres-
sion, and the flow type set to REQ. The Application Firewall treats each request and response as
a single paired entity, so all Application Firewall policies begin with REQ.
4. Under Protocol, click the down arrow and choose the protocol you want for your policy expres-
sion. Your choices are:
• HTTP. Evaluates HTTP requests that are sent to a Web server. For classic expressions, HTTP
includes HTTPS requests.
• SSL. Evaluates SSL data associated with the current connection.
• TCP. Evaluates the TCP data associated with the current connection.
• IP. Evaluates the IP addresses associated with the current connection.
5. Under Qualifier, click the down arrow and choose a qualifier for your policy.
The qualifier defines the type of data to be evaluated. The list of qualifiers that appears depends
on which protocol you selected in step 4.
6. Under Operator, click the down arrow and choose the operator for your policy expression. Some
common operators are:
Operator Description
7. If a Value text box appears, type a string or numeric value, as appropriate. For example, chose
REQ as the Flow Type, HTTP as the Protocol, and HEADER as the qualifier, and then type the
value of the header string in the Value field and the header type for which you want to match
the string in the Header Name text box.
8. Click OK.
9. To create a compound expression, click Add. Note that the type of compounding that is done
depends on the following choices in the Create Policy dialog box:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Depending on the policy type, you can bind a classic policy either globally or to a virtual server. Policy
bind points are described in the table, “Policy Type and Bind Points for Policies in Features That Use
Classic Policies.”
At the command prompt, type the following commands to set the parameters and verify the configu-
ration:
Example
At the command prompt, type the following commands to set the parameters and verify the configu-
ration:
Example
Note: This procedure documents the Global Bindings dialog box. Depending on the feature for which
you want to globally bind a policy, the route by which you arrive at this dialog box may be different.
1. In the navigation pane, expand the feature for which you want to globally bind a classic policy,
and then locate the policy that you want to bind globally.
Note: You cannot globally bind policies for Content Switching, Cache Redirection, SureConnect,
Priority Queuing, or
NetScaler Gateway Authorization.
3. In the Bind/Unbind <feature name> Policy(s) to Global dialog box, click Insert Policy.
4. In the Policy Name column, click the name of an existing policy that you want to globally bind,
or click New Policy to open the Create <feature name> Policy dialog box.
5. After you have selected the policy or created a new policy, in the Priority column, type the pri-
ority value.
The lower the number, the sooner this policy is applied relative to other policies. For example,
a policy assigned a priority of 10 is applied before a policy with a priority of 100. You can use
the same priority for different policies. All features that use classic policies implement only the
first policy that a connection matches, so policy priority is important for getting the results you
intend.
As a best practice, leave room to add policies by setting priorities with intervals of 50 (or 100)
between each policy.
6. Click OK.
1. In the navigation pane, expand the feature that contains the virtual server to which you want
to bind a classic policy (for example, if you want to bind a classic policy to a content switching
virtual server, expand Traffic Management > Content Switching), and then click Virtual Servers.
2. In the details pane, select the virtual server, and then click Open.
3. In the Configure <Feature> Virtual Server dialog box, on the Policies tab, click the feature icon
for the type policy that you want, and then click Insert Policy.
4. In the Policy Name column, click the name of an existing policy that you want to bind to a virtual
server, or click A to open the Create <feature name> Policy dialog box.
5. After you have selected the policy or created a new policy, in the Priority column, set the priority.
If you are binding a policy to a content switching virtual server, in the Target column, select a
load balancing virtual server to which traffic that matches the policy should be sent.
6. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can view classic policies by using either the GUI or the command line. You can view details such
as the policy’s name, expression, and bindings.
View a classic policy and its binding information by using the CLI
At the command prompt, type the following commands to view a classic policy and its binding infor-
mation:
Example
Note: If you omit the policy name, all policies are listed without the binding details.
1. In the navigation pane, expand the feature whose policies you want to view, (for example, if you
want to view application firewall policies, expand Application Firewall), and then click Policies.
2. In the details pane, do one or more of the following:
• To view details for a specific policy, click the policy. Details appear in the Details area of
the configuration pane.
• To view bindings for a specific policy, click the policy, and then click Show Bindings.
• To view global bindings, click the policy, and then click Global Bindings. Note that you
cannot bind a Content Switching, Cache Redirection, SureConnect, Priority Queuing, or
NetScaler Gateway Authorization policy globally.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
A named classic expression is a classic expression that can be referenced through an assigned name.
Often, you need to configure classic expressions that are large or complex and form a part of a larger
compound expression. You might also configure classic expressions that you need to use frequently
and in multiple compound expressions or classic policies. In these scenarios, you can create the clas-
sic expression you want, save it with a name of your choice, and then reference the expression from
compound expressions or policies through its name. This saves configuration time and improves the
readability of complex compound expressions. Additionally, any modifications to a named classic
expression need to be made only once.
Some named expressions are built-in, and a subset of these are read-only. Built-in named expressions
are divided into four categories: General, Anti-Virus, Personal Firewall, and Internet Security. General
named expressions have a wide variety of uses. For example, from the General category, you can use
the expressions ns_true and ns_false to specify a value of TRUE or FALSE, respectively, to be returned
for all traffic. You can also identify data of a particular type (for example, HTM, DOC, or GIF files),
determine whether caching headers are present, or determine whether the round trip time for packets
between a client and the NetScaler is high (over 80 milliseconds).
Anti-Virus, Personal Firewall, and Internet Security named expressions test clients for the presence of
a particular program and version and are used primarily in NetScaler Gateway policies.
At the command prompt, type the following commands to set the parameters and verify the configu-
ration:
Example
1. In the navigation pane, expand AppExpert, expand Expressions, and then click Classic Expres-
sions.
Note: Some of the built-in expressions in the Expressions list are read-only.
3. In the Create Policy Expression dialog box, specify values for the following parameters:
• Expression Name*—name
• Client Security Message—clientSecurityMessage
• Comments—comment
*A required parameter
• You can choose inputs to this expression from the Named Expressions drop-down list.
• You can create a new expression, as described in Add an expression for a classic policy by
using the GUI.
5. When you are done, click Close. Verify that your new expression was created by scrolling to the
bottom of the Classic Expressions list to view it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Warning
Q and S prefixes are deprecated from NetScaler 12.0 build 56.20 onwards and are no longer sup-
ported in Advanced policy expressions.
The following table is a listing of default syntax expression prefixes, with cross-references to descrip-
tions of these prefixes and the operators that you can specify for them. Note that some prefixes can
work with multiple types of operators. For example, a cookie can be parsed by using operators for
text or operators for HTTP headers.
You can use any element in the following tables as a complete expression on its own, or you can use
various operators to combine these expression elements with others to form more complex expres-
sions.
Note: The Description column in the following table contains cross-references to additional informa-
tion about prefix usage and applicable operators for the prefix.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Warning
Classic policy expressions are no longer supported from NetScaler 12.0 build 56.20 onwards and
as an alternative, Citrix recommends you to use Advanced policies. For more information, see
Advanced Policies
The subtopics listed in the table of contents on the left side of your screen contain tables listing the
NetScaler classic expressions.
In the table of operators, the result type of each operator is shown at the beginning of the description.
In the other tables, the level of each expression is shown at the beginning of the description. For
named expressions, each expression is shown as a whole.
Operators
General expressions
The expressions to configure client settings on the Access Gateway with the following software:
• Antivirus
• Personal firewall
• Antispam
• Internet Security
Network-based expressions
Expression Definition
Expression Definition
Date/time expressions
Expression Definition
You can specify file system expressions in authorization policies for users and groups who access file
sharing through the NetScaler Gateway file transfer utility (the VPN portal). These expressions work
with the NetScaler Gateway file transfer authorization feature to control user access to file servers,
folders, and files. For example, you can use these expressions in authorization policies to control
access based on file type and size.
Expression Definition
Expression Definition
Expression Definition
Expression Definition
Expression Definition
Expression Definition
Expression Definition
Expression Definition
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following table provides examples of default syntax expressions that you can use as the basis for
your own default syntax expressions.
The following table shows examples of policy configurations and bindings for commonly used func-
tions.
Purpose Example
Purpose Example
Purpose Example
Purpose Example
Check the client IP address but pass the add rewrite policy
request without modifying the request. check_client_ip_policy ’HTTP.REQ.
HEADER (”x-forwarded-for”).EXISTS
HTTP.REQ.HEADER (”client-ip”).
EXISTS’NOREWRITE bind rewrite
global check_client_ip_policy 100
END
Remove old headers from a request and insert add rewrite action
an NS-Client header. del_x_forwarded_for
delete_http_header x-forwarded-for
add rewrite action del_client_ip
delete_http_header client-ip add
rewrite policy
check_x_forwarded_for_policy ’HTTP.
REQ.HEADER(”x-forwarded-for”).
EXISTS’del_x_forwarded_for add
rewrite policy
check_client_ip_policy ’HTTP.REQ.
HEADER(”client-ip”).EXISTS’
del_client_ip add rewrite action
insert_ns_client_header
insert_http_header NS-Client ’
CLIENT.IP.SRC’add rewrite policy
insert_ns_client_policy ’HTTP.REQ.
HEADER(”x-forwarded-for”).EXISTS
HTTP.REQ.HEADER(”client-ip”).EXISTS
’insert_ns_client_header bind
rewrite global
check_x_forwarded_for_policy 100
200 bind rewrite global
check_client_ip_policy 200 300 bind
rewrite global
insert_ns_client_policy 300 END
Purpose Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
With the rewrite feature, you can modify any part of an HTTP header, and, for responses, you can mod-
ify the HTTP body. You can use this feature to accomplish a number of useful tasks, such as removing
unnecessary HTTP headers, masking internal URLs, redirecting Web pages, and redirecting queries or
keywords.
In the following examples, you first create a rewrite action and a rewrite policy. Then you bind the
policy globally.
For more information about the commands and syntax descriptions, see Rewrite Command Reference
page.
Updated: 2013-10-29
This example describes how to create a rewrite action and rewrite policy that redirects an external URL
to an internal URL. You create an action, called act_external_to_internal, that performs the rewrite.
Then you create a policy called pol _external _to _internal.
To redirect an external URL to an internal URL by using the command line interface
3. In the Create Rewrite Action dialog box, enter the name act_external_to_internal.
4. To replace the HTTP server host name with the internal server name, choose Replace from the
Type list box.
6. In the String expression for replacement text field, type the internal host name of your Web
server.
10. In the Name field, type pol_external_to_internal. This policy will detect connections to the Web
server.
1 HTTP.REQ.HOSTNAME.SERVER.EQ(”www.example.com”)
Redirecting a query
This example describes how to create a rewrite action and rewrite policy that redirects a query to the
proper URL. The example assumes that the request contains a Host header set to www.example.com
and a GET method with the string /query.cgi?server=5. The redirect extracts the domain name from
the host header and the number from the query string, and redirects the user’s query to the server
Web5.example.com, where the rest of the user’s query is processed.
Note: Although the following commands appears on multiple lines, you should enter them on a single
line without line breaks.
• To create a rewrite action named act_redirect_query that replaces the HTTP server host name
with the internal server name, type:
• To create a rewrite policy named pol_redirect_query, type the following commands at the
NetScaler command prompt.. This policy detects connections, to the Web server, that contain
a query string. Do not apply this policy to connections that do not contain a query string:
Because this rewrite policy is highly specific and should be run before any other rewrite policies, it is
advisable to assign it a high priority. If you assign it a priority of 1, it will be evaluated first.
This example describes how to rewrite Web server responses to find all URLs that begin with the string
“http” and replace that string with “https.” You can use this to avoid having to update Web pages after
moving a server from HTTP to HTTPS.
• To create a rewrite action named act_replace_http_with_https that replaces all instances of the
string “http” with the string “https,” enter the following command:
This example explains how to use a Rewrite policy to remove unwanted headers. Specifically, the
example shows how to remove the following headers:
• Accept Encoding header. Removing the Accept Encoding header from HTTP responses pre-
vents compression of the response.
• Content Location header. Removing the Content Location header from HTTP responses pre-
vents your server from providing a hacker with information that might allow a security breach.
To delete headers from HTTP responses, you create a rewrite action and a rewrite policy, and you bind
the policy globally.
To create the appropriate Rewrite action by using the command line interface
At the command prompt, type one of the following commands to either remove the Accept Encoding
header and prevent response compression or remove the Content Location header:
• add rewrite action ”act_remove-ae”delete_http_header ”Accept-Encoding”
• add rewrite action ”act_remove-cl”delete_http_header ”Content-Location”
To create the appropriate Rewrite policy by using the command line interface
At the command prompt, type one of the following commands to remove either the Accept Encoding
header or the Content Location header:
• add rewrite policy ”pol_remove-ae”true ”act_remove-ae”
• add rewrite policy ”pol_remove-cl”true ”act_remove-cl”
At the command prompt, type one of the following commands, as appropriate, to globally bind the
policy that you have created:
• bind rewrite global pol_remove_ae 100
• bind rewrite global pol_remove_cl 200
This example explains how to use a Rewrite policy to modify connections to your home page and other
URLs that end with a forward slash (/) to the default index page for your server, preventing redirects
and reducing load on your server.
To modify directory-level HTTP requests to include the default home page by using the
command line
• To create a Rewrite action named action-default-homepage that modifies URLs that end in a
forward slash to include the default home page index.html, type:
This example explains how to use a Rewrite policy to mask the information in the Server header in
HTTP responses from your Web server. That header contains information that hackers can use to
compromise your Web site. While masking the header will not prevent a skilled hacker from finding
out information about your server, it will make hacking your Web server more difficult and encourage
hackers to choose less well protected targets.
1. To create a Rewrite action named act_mask-server that replaces the contents of the Server
header with an uninformative string, type:
2. To create a Rewrite policy named pol_mask-server that detects all connections, type:
The following expressions convert plain text to URL encoded string and vice-versa:
Example
1 (”abc def&123”).URL_RESERVED_CHARS_SAFE
2 Output will be
3 “ abc%20def%26123 ” which is url encoded.
Example:
1 (”abc%20def%26123”).SET_TEXT_MODE(URLENCODED).
DECODE_USING_TEXT_MODE
2 Output will be
3 “ abc def&123 ”
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following examples describe useful examples of classic policy configuration for certain NetScaler
features, such as NetScaler Gateway, application firewall, and SSL.
Updated: 2014-09-25
The following policies enable the NetScaler to ensure that a client presents a valid certificate before
establishing a connection to a company’s SSL VPN.
To check for a valid client certificate by using the command line interface
• Add a rewrite action to insert the certificate issuer details into the HTTP header of the requests
being sent to web server.
• Create a rewrite policy to insert the certificate issuer details, if the client certificate exists.
Bind these new policies to the NetScaler VIP to put them into effect.
Shopping cart applications handle sensitive customer information, for example, credit card numbers
and expiration dates, and they access back-end database servers. Many shopping cart applications
also use legacy CGI scripts, which can contain security flaws that were unknown at the time they were
written, but are now known to hackers and identity thieves.
• Cookie tampering. If a shopping cart application uses cookies, and does not perform the ap-
propriate checks on the cookies that users return to the application, an attacker could modify a
cookie and gain access to the shopping cart application under another user’s credentials. Once
logged on as that user, the attacker could obtain sensitive private information about the legiti-
mate user or place orders using the legitimate user’s account.
• SQL injection. A shopping cart application normally accesses a back-end database server. Un-
less the application performs the appropriate safety checks on the data users return in the form
fields of its Web forms before it passes that information on to the SQL database, an attacker can
use a Web form to inject unauthorized SQL commands into the database server. Attackers nor-
mally use this type of attack to obtain sensitive private information from the database or modify
information in the database.
The following configuration will protect a shopping cart application against these and other attacks.
1. Navigate to Security > Application Firewall > Profiles, and then click Add.
2. In the Create Application Firewall Profile dialog box, in the Profile Name field, enter shop-
ping_cart.
3. In the Profile Type drop-down list, select Web Application.
4. In the Configure Select Advanced defaults.
5. Click Create and then click Close.
6. In the details view, double-click the new profile.
7. In the Configure Web Application Profile dialog box, configure your new profile as described
below:
• Click the Checks tab, double-click the Start URL check, and in the Modify Start URL Check
dialog box, click the General tab and disable blocking, and enable learning, logging, statis-
tics, and URL closure. Click OK and then click Close.
Note that if you are using the command line, you configure these settings by typing the
following at the prompt, and pressing ENTER:
set appfw profile shopping\\_cart -startURLAction LEARN LOG STATS -
startURLClosure ON
• For the Cookie Consistency check and Form Field Consistency checks, disable blocking,
and enable learning, logging, statistics, using a similar method to the Modify Start URL
Check configuration.
If you are using the command line, you configure these settings by typing the following
commands:
set appfw profile shopping\\_cart -cookieConsistencyAction LEARN
LOG STATS
• For the SQL Injection check, disable blocking, and enable learning, logging, statistics, and
transformation of special characters in the Modify SQL Injection Check dialog box, General
tab, Check Actions section.
If you are using the command line, you configure these settings by typing the following at
the prompt, and pressing ENTER:
• For the Credit Card check, disable blocking; enable logging, statistics, and masking of
credit card numbers; and enable protection for those credit cards you accept as forms of
payment.
– If you are using the GUI, you configure blocking, logging, statistics, and masking (or
x-out) in the Modify Credit Card Check dialog box, General tab, Check Actions section.
You configure protection for specific credit cards in the Settings tab of the same dialog
box.
– If you are using the command line, you configure these settings by typing the following
at the prompt, and pressing ENTER:
For <name> you substitute the name of the credit card you want to protect. For Visa, you
substitute VISA. For Master Card, you substitute MasterCard. For American Express, you
substitute Amex. For Discover, you substitute Discover. For Diners Club, you substitute
DinersClub. For JCB, you substitute JCB.
8. Create a policy named shopping_cart that detects connections to your shopping cart applica-
tion and applies the shopping_cart profile to those connections.
To detect connections to the shopping cart, you examine the URL of incoming connections. If
you host your shopping cart application on a separate host (a wise measure for security and
other reasons), you can simply look for the presence of that host in the URL. If you host your
shopping cart in a directory on a host that handles other traffic, as well, you must determine
that the connection is going to the appropriate directory and/or HTML page.
The process for detecting either of these is the same; you create a policy based on the following
expression, and substitute the proper host or URL for .
• If you are using the GUI, you navigate to the application firewall Policies page, click the
Add… button to add a new policy, and follow the policy creation process described in “To
create a policy with classic expressions using the GUI” beginning on page 201 and follow-
ing.
• If you are using the command line, you type the following command at the prompt and
press Enter:
Because you want to ensure that this policy will match all connections to the shopping cart, and not
be preempted by another more general policy, you should assign a high priority to it. If you assign one
(1) as the priority, no other policy can preempt this one.
Web pages with embedded scripts, especially legacy JavaScripts, often violate the “same origin rule,”
which does not allow scripts to access or modify content on any server but the server where they are
located. This security vulnerability is called cross-site scripting. The application firewall Cross-Site
Scripting rule normally filters out requests that contain cross-site scripting.
Unfortunately, this can cause Web pages with older JavaScripts to stop functioning, even when your
system administrator has checked those scripts and knows that they are safe. The example below ex-
plains how to configure the application firewall to allow cross-site scripting in Web pages from trusted
sources without disabling this important filter for the rest of your Web sites.
To protect Web pages with cross-site scripting by using the command line interface
• Create a policy that detects connections to your scripted Web pages and applies the pr_xssokay
profile, type:
3. In the Create Application Firewall Profile dialog box, create a Web Application profile with
advanced defaults and name it pr_xssokay. Click Create and then click Close.
4. In the details view, click the profile, click Open, and in the Configure Web Application Profile
dialog box, configure the pr_xssokay profile as shown below.
This should prevent blocking of legitimate requests involving Web pages with cross-site script-
ing that you know are nonetheless safe.
6. In the Create Application Firewall Policy dialog box, create a policy that detects connections
to your scripted Web pages and applies the pr_xssokay profile:
The following example describes how to create a DNS action and DNS policy that detects connections
from unwanted IPs or networks, such as those used in a DDOS attack, and drops all packets from
those locations. The example shows networks within the IANA reserved IP block 192.168.0.0/16. A
hostile network will normally be on publicly routable IPs.
To drop packets from specific IPs by using the command line interface
• To create a DNS policy named pol_ddos_drop that detects connections from hostile networks
and drops those packets, type:
add dns policy pol_ddos_drop ’client.ip.src.in_subnet(192.168.253.128/25)
|| client.ip.src.in_subnet(192.168.254.32/27)’-drop YES’
For the example networks in the 192.168.0.0/16 range, you substitute the IP and netmask in
###.###.###.###/## format of each network you want to block. You can include as many net-
works as you want, separating each CLIENT.IP.SRC.IN_SUBNET(###.###.###.###./##) command
with the OR operator.
The following example shows an SSL policy that checks the user’s client certificate validity before
initiating an SSL connection with a client.
If you are using the GUI, navigate to the SSL Policies page, then in the Data area, click the Actions
tab.
• Create an SSL action named act_current_client_cert that requires that users have a current
client certificate to establish an SSL connection with the NetScaler.
• Create an SSL policy named pol_current_client_cert that detects connections to the Web server
that contain a query string.
Because this SSL policy should apply to any user’s SSL connection unless a more specific SSL
policy applies, you may want to assign it a low priority. If you assign it a priority of one thousand
(1000), that should ensure that other SSL policies are evaluated first, meaning that this policy
will apply only to connections that do not match more specific policy criteria.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
November 5, 2018
Contributed by:
C
The Apache HTTP Server provides an engine known as mod_rewrite for rewriting HTTP request URLs.
If you migrate the mod_rewrite rules from Apache to the NetScaler, you boost back-end server per-
formance. In addition, because the NetScaler typically load balances multiple (sometimes thousands
of) Web servers, after migrating the rules to the NetScaler you will have a single point of control for
these rules.
Following are examples of mod_rewrite functions, and translations of these functions into Rewrite
and Responder policies on the NetScaler.
On some Web servers you can have multiple URLs for a resource. Although the canonical URLs should
be used and distributed, other URLs can exist as shortcuts or internal URLs. You can make sure that
users see the canonical URL regardless of the URL used to make an initial request.
In the following examples, the URL /~user is converted to /u/user.
You can enforce the use of a particular host name for reaching a site. For example, you can enforce
the use of www.example.com instead of example.com.
Apache mod_rewrite solution for enforcing a particular host name for sites running on
a port other than 80
1 RewriteCond %{
2 HTTP_HOST }
3 !^www.example.com
4 RewriteCond %{
5 HTTP_HOST }
6 !^$
7 RewriteCond %{
8 SERVER_PORT }
9 !^80$
10 RewriteRule ^/(.*) http://www.example.com:%{
11 SERVER_PORT }
12 /$1 [L,R]
Apache mod_rewrite solution for enforcing a particular host name for sites running on
port 80
1 RewriteCond %{
2 HTTP_HOST }
3 !^www.example.com
4 RewriteCond %{
5 HTTP_HOST }
6 !^$
7 RewriteRule ^/(.*) http://www.example.com/$1 [L,R]
NetScaler solution for enforcing a particular host name for sites running on a port
other than 80
NetScaler solution for enforcing a particular host name for sites running on port 80
Usually the document root of a Web server is based on the URL “/”. However, the document root can
be any directory. You can redirect traffic to the document root if it changes from the top-level “/”
directory to another directory.
In the following examples, you change the document root from / to /e/www. The first two examples
simply replace one string with another. The third example is more universal because, along with re-
placing the root directory, it preserves the rest of the URL (the path and query string), for example,
redirecting /example/file.html to /e/www/example/file.html.
1 RewriteEngine on
2 RewriteRule ^/$ /e/www/ [R]
NetScaler solution for moving the document root and appending path information to
the request
You may want to redirect requests that are sent to home directories on a Web server to a different
Web server. For example, if a new Web server is replacing an old one over time, as you migrate home
directories to the new location you need to redirect requests for the migrated home directories to the
new Web server.
In the following examples, the host name for the new Web server is newserver.
Typically, a site with thousands of users has a structured home directory layout. For example,
each home directory may reside under a subdirectory that is named using the first character
of the user name. For example, the home directory for jsmith (/~jsmith/anypath) might be
/home/j/smith/.www/anypath, and the home directory for rvalveti (/~rvalveti/anypath) might be
/home/r/rvalveti/.www/anypath.
If a URL is not valid, it should be redirected to another Web server. For example, you should redirect
to another Web server if a file that is named in a URL does not exist on the server that is named in the
URL.
On Apache, you can perform this check using mod_rewrite. On the NetScaler, an HTTP callout can
check for a file on a server by running a script on the server. In the following NetScaler examples, a
script named file_check.cgi processes the URL and uses this information to check for the presence of
the target file on the server. The script returns TRUE or FALSE, and the NetScaler uses the value that
the script returns to validate the policy.
In addition to performing the redirection, the NetScaler can add custom headers or, as in the second
NetScaler example, it can add text in the response body.
1 RewriteCond /your/docroot/%{
2 REQUEST_FILENAME }
3 !-f
4 RewriteRule ^(.+) http://webserverB.com/$1 [R]
You can rewrite a URL based on the time. The following examples change a request for example.html
to example.day.html or example.night.html, depending on the time of day.
1 RewriteCond %{
2 TIME_HOUR }
3 %{
4 TIME_MIN }
5 >0700
6 RewriteCond %{
7 TIME_HOUR }
8 %{
9 TIME_MIN }
10 <1900
11 RewriteRule ^example\.html$ example.day.html [L]
12 RewriteRule ^example\.html$ example.night.html
If you rename a Web page, you can continue to support the old URL for backward compatibility while
preventing users from recognizing that the page was renamed.
In the first two of the following examples, the base directory is /~quux/. The third example accommo-
dates any base directory and the presence of query strings in the URL.
Apache mod_rewrite solution for managing a file name change in a fixed location
1 RewriteEngine on
2 RewriteBase /~quux/
3 RewriteRule ^foo\.html$ bar.html
NetScaler solution for managing a file name change regardless of the base directory or
query strings in the URL
If you rename a Web page, you may want to continue to support the old URL for backward compati-
bility and allow users to see that the page was renamed by changing the URL that is displayed in the
browser.
In the first two of the following examples, redirection occurs when the base directory is /~quux/. The
third example accommodates any base directory and the presence of query strings in the URL.
Apache mod_rewrite solution for changing the file name and the URL displayed in the
browser
1 RewriteEngine on
2 RewriteBase /~quux/
3 RewriteRule ^old\.html$ new.html [R]
NetScaler solution for changing the file name and the URL displayed in the browser
NetScaler solution for changing the file name and the URL displayed in the browser
regardless of the base directory or query strings in the URL
The following examples act on the HTTP header “User-Agent”, such that if this header begins with
“Mozilla/3”, the page MyPage.html is rewritten to MyPage.NS.html. If the browser is “Lynx” or “Mozilla”
version 1 or 2, the URL becomes MyPage.20.html. All other browsers receive page MyPage.32.html.
1 RewriteCond %{
2 HTTP_USER_AGENT }
3 ^Mozilla/3.*
4 RewriteRule ^MyPage\.html$ MyPage.NS.html [L]
5 RewriteCond %{
6 HTTP_USER_AGENT }
7 ^Lynx/.* [OR]
8 RewriteCond %{
9 HTTP_USER_AGENT }
10 ^Mozilla/[12].*
11 RewriteRule ^MyPage\.html$ MyPage.20.html [L]
12 RewriteRule ^fMyPage\.html$ MyPage.32.html [L]
13 NetScaler solution for browser-specific settings
14 add patset pat1
15 bind patset pat1 Mozilla/1
16 bind Patset pat1 Mozilla/2
17 bind patset pat1 Lynx
18 bind Patset pat1 Mozilla/3
19 add rewrite action act1 insert_before ’HTTP.REQ.URL.SUFFIX’ ’”NS.”’
20 add rewrite action act2 insert_before ’HTTP.REQ.URL.SUFFIX’ ’”20.”’
21 add rewrite action act3 insert_before ’HTTP.REQ.URL.SUFFIX’ ’”32.”’
22 add rewrite policy pol1 ’HTTP.REQ.HEADER(”User-Agent”).STARTSWITH_INDEX
(”pat1”).EQ(4)’ act1
23 add rewrite policy pol2 ’HTTP.REQ.HEADER(”User-Agent”).STARTSWITH_INDEX
(”pat1”).BETWEEN(1,3)’ act2
You can block a robot from retrieving pages from a specific directory or a set of directories to ease up
the traffic to and from these directories. You can restrict access based on the specific location or you
can block requests based on information in User-Agent HTTP headers.
In the following examples, the Web location to be blocked is /~quux/foo/arc/, the IP addresses to be
blocked are 123.45.67.8 and 123.45.67.9, and the robot’s name is NameOfBadRobot.
1 RewriteCond %{
2 HTTP_USER_AGENT }
3 ^NameOfBadRobot.*
4 RewriteCond %{
5 REMOTE_ADDR }
6 ^123\.45\.67\.[8-9]$
7 RewriteRule ^/~quux/foo/arc/.+ - [F]
If you find people frequently going to your server to copy inline graphics for their own use (and gen-
erating unnecessary traffic), you may want to restrict the browser’s ability to send an HTTP Referer
header.
1 RewriteCond %{
2 HTTP_REFERER }
3 !^$
4 RewriteCond %{
5 HTTP_REFERER }
6 !^http://www.quux-corp.de/~quux/.*$
7 RewriteRule .*\.gif$ - [F]
To prevent users from knowing application or script details on the server side, you can hide file ex-
tensions from users. To do this, you may want to support extensionless links. You can achieve this
behavior by using rewrite rules to add an extension to all requests, or to selectively add extensions to
requests.
The first two of the following examples show adding an extension to all request URLs. In the last exam-
ple, one of two file extensions is added. Note that in the last example, the mod_rewrite module can
easily find the file extension because this module resides on the Web server. In contrast, the NetScaler
must invoke an HTTP callout to check the extension of the requested file on the Web server. Based on
the callout response, the NetScaler adds the .html or .php extension to the request URL.
Note
In the second NetScaler example, an HTTP callout is used to query a script named
file_check.cgi hosted on the server. This script checks whether the argument that is provided in
the callout is a valid file name.
Apache mod_rewrite solution for adding either .html or .php extensions to requests
1 RewriteCond %{
2 REQUEST_FILENAME }
3 .php -f
4 RewriteRule ^/?([a-zA-Z0-9]+)$ $1.php [L]
5 RewriteCond %{
6 REQUEST_FILENAME }
7 .html ‒ f
8 RewriteRule ^/?([a-zA-Z0-9]+)$ $1.html [L]
Suppose that you have a set of working URLs that resemble the following:
1 /index.php?id=nnnn
To change these URLs to /nnnn and make sure that search engines update their indexes to the new
URI format, you need to do the following:
• Redirect the old URIs to the new ones so that search engines update their indexes.
• Rewrite the new URI back to the old one so that the index.php script runs correctly.
To accomplish this, you can insert marker code into the query string (making sure that the marker
code is not seen by visitors), and then removing the marker code for the index.php script.
The following examples redirect from an old link to a new format only if a marker is not present in the
query string. The link that uses the new format is re-written back to the old format, and a marker is
added to the query string.
1 RewriteCond %{
2 QUERY_STRING }
3 !marker
4 RewriteCond %{
5 QUERY_STRING }
6 id=([-a-zA-Z0-9_+]+)
7 RewriteRule ^/?index\.php$ %1? [R,L]
8 RewriteRule ^/?([-a-zA-Z0-9_+]+)$ index.php?marker&id=$1 [L]
9 NetScaler solution
To make sure that only secure servers are used for selected Web pages, you can use the following
Apache mod_rewrite code or NetScaler Responder policies.
1 RewriteCond %{
2 SERVER_PORT }
3 !^443$
4 RewriteRule ^/?(page1|page2|page3|page4|page5)$ https://www.example.
com/%1 [R,L]
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Rate limiting
Contributed by:
C
The rate limiting feature enables you to define the maximum load for a given network entity or virtual
entity on the NetScaler appliance. The feature enables you to configure the appliance to monitor the
rate of traffic associated with the entity and take preventive action, in real time, based on the traffic
rate. This feature is particularly useful when the network is under attack from a hostile client that
is sending the appliance a flood of requests. You can mitigate the risks that affect the availability of
resources to clients, and you can improve the reliability of the network and the resources that the
appliance manages.
You can monitor and control the rate of traffic that is associated with virtual and user-defined entities,
including virtual servers, URLs, domains, and combinations of URLs and domains. You can throttle the
rate of traffic if it is too high, base information caching on the traffic rate, and redirect traffic to a given
load balancing virtual server if the traffic rate exceeds a predefined limit. You can apply rate-based
monitoring to HTTP, TCP, and DNS requests.
To monitor the rate of traffic for a given scenario, you configure a rate limit identifier. A rate limit iden-
tifier specifies numeric thresholds such as the maximum number of requests or connections (of a par-
ticular type) that are permitted in a specified time period called a time slice.
Optionally, you can configure filters, known as stream selectors, and associate them with rate limit
identifiers when you configure the identifiers. After you configure the optional stream selector and
the limit identifier, you must invoke the limit identifier from a default syntax policy. You can invoke
identifiers from any feature in which the identifier may be useful, including rewrite, responder, DNS,
and integrated caching.
You can globally enable and disable SNMP traps for rate limit identifiers. Each trap contains cumula-
tive data for the rate limit identifier’s configured data collection interval (time slice), unless you speci-
fied multiple traps to be generated per time slice. For more information about configuring SNMP traps
and managers, see “SNMP.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
1 http.req.url
2 http.res.body(1000>after_str(”car_model”).before_str(”made_in”)”
3 ”client.ip.src.subnet(24)”
The order in which you specify parameters is significant. For example, if you configure an IP address
and a domain (in that order) in one selector, and then specify the domain and the IP address (in the
reverse order) in another selector, the NetScaler considers these values to be unique. This can lead
to the same transaction being counted twice. Also, if multiple policies invoke the same selector, the
NetScaler, again, can count the same transaction more than once.
Note: If you modify an expression in a
stream selector, you may get an error if any policy that invokes it is bound to a new policy label or bind
Example:
Navigate to AppExpert > Rate Limiting > Selectors, click Add and specify the relevant details.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If traffic through one or more virtual servers matches a rate-based policy, you can view the rate of this
traffic. The rate statistics are maintained in the limit identifier that you named in the rule for the rate-
based policy. If more than one policy uses the same limit identifier, you can view the traffic rate as
defined by hits to all of the policies that use the particular limit identifier.
At the command prompt, type the following command to view the traffic rate:
Example:
1 sh limitsession myLimitSession
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To test a rate-based policy, you can send traffic to any virtual server to which a rate-based policy is
bound.
1. Configure a stream selector (optional) and a rate limit identifier (required). For example:
2. Configure the action that you want to associate with the policy that uses the rate limit identifier.
For example:
3. Configure a policy that uses the sys.check_limit expression prefix to call the rate limit identifier.
For example, the policy can apply a rate limit identifier to all requests arriving from a particular
subnet, as follows:
5. In a browser address bar, send a test HTTP query to a virtual server. For example:
1 http://<IP of a vserver>/testsite/test.txt
Example
7. Repeat the query and check the limit identifier statistics again to verify that the statistics are
being updated correctly.</span>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If traffic through one or more virtual servers matches a rate-based policy, you can view the rate of this
traffic. The rate statistics are maintained in the limit identifier that you named in the rule for the rate-
based policy. If more than one policy uses the same limit identifier, you can view the traffic rate as
defined by hits to all of the policies that use the particular limit identifier.
At the command prompt, type the following command to view the traffic rate:
Example:
1 sh limitsession myLimitSession
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To test a rate-based policy, you can send traffic to any virtual server to which a rate-based policy is
bound.
1. Configure a stream selector (optional) and a rate limit identifier (required). For example:
2. Configure the action that you want to associate with the policy that uses the rate limit identifier.
For example:
3. Configure a policy that uses the sys.check_limit expression prefix to call the rate limit identifier.
For example, the policy can apply a rate limit identifier to all requests arriving from a particular
subnet, as follows:
5. In a browser address bar, send a test HTTP query to a virtual server. For example:
1 http://<IP of a vserver>/testsite/test.txt
Example
7. Repeat the query and check the limit identifier statistics again to verify that the statistics are
being updated correctly.</span>
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following scenarios describe two uses of rate-based policies in global server load balancing
(GSLB):
• The first scenario describes the use of a rate-based policy that sends traffic to a new data center
if the rate of DNS requests exceed 1000 per second.
• In the second scenario, if more than five DNS requests arrive for a local DNS (LDNS) client within
a particular period, the additional requests are dropped.
In this scenario, you configure a proximity-based load balancing method, and a rate-limiting pol-
icy that identifies DNS requests for a particular region. In the rate-limiting policy, you specify a
threshold of 1000 DNS requests per second. A DNS policy applies the rate limiting policy to DNS
requests for the region “Europe.GB.17.London.UK-East.ISP-UK.” In the DNS policy, DNS requests
that exceed the rate limiting threshold, starting with request 1001 and continuing to the end of the
one-second interval, are to be forwarded to the IP addresses that are associated with the region
“North America.US.TX.Dallas.US-East.ISP-US.”
In the following example of global server load balancing, you configure a rate limiting policy that per-
mits a maximum of five DNS requests in a particular interval, per domain, to be directed to an LDNS
client for resolution. Any requests that exceed this rate are dropped. This type of policy can help pro-
tect the NetScaler from resource exploitation. For example, in this scenario, if the time to live (TTL)
for a connection is five seconds, this policy prevents the LDNS from requerying a domain. Instead, it
uses data that is cached on the NetScaler.
2
3 add ns limitIdentifier LDNSLimitIdentifier1 -threshold 5 -timeSlice
1000 -selectorName LDNSSelector1
4
5 add dns policy LDNSPolicy1 ”client.udp.dns.domain.contains(\”.\”) &&
sys.check_limit(\”LDNSLimitIdentifier1\”)” -drop YES
6
7 bind dns global LDNSPolicy1 6
8
9 show gslb vserver gvip
10
11 gvip - HTTP State: UP
12 Last state change was at Mon Sep 8 11:50:48 2008 (+711 ms)
13 Time since last state change: 1 days, 02:55:08.830
14 Configured Method: STATICPROXIMITY
15 BackupMethod: ROUNDROBIN
16 No. of Bound Services : 3 (Total) 3 (Active)
17 Persistence: NONE Persistence ID: 100
18 Disable Primary Vserver on Down: DISABLED Site Persistence: NONE
19 Backup Session Timeout: 0
20 Empty Down Response: DISABLED
21 Multi IP Response: DISABLED Dynamic Weights: DISABLED
22 Cname Flag: DISABLED
23 Effective State Considered: NONE
24 1) site11_svc(10.100.00.00: 80)- HTTP State: UP Weight: 1
25 Dynamic Weight: 0 Cumulative Weight: 1
26 Effective State: UP
27 Threshold : BELOW
28 Location: Europe.GB.17.London.UK-East.ISP-UK
29 2) site12_svc(10.101.00.100: 80)- HTTP State: UP Weight: 1
30 Dynamic Weight: 0 Cumulative Weight: 1
31 Effective State: UP
32 Threshold : BELOW
33 Location: North America.US.TX.Dallas.US-East.ISP-US
34 3) site13_svc(10.102.00.200: 80)- HTTP State: UP Weight: 1
35 Dynamic Weight: 0 Cumulative Weight: 1
36 Effective State: UP
37 Threshold : BELOW
38 Location: North America.US.NJ.Salem.US-Mid.ISP-US
39 1) www.gslbindia.com TTL: 5 secn
40 Cookie Timeout: 0 min Site domain TTL: 3600 sec
41 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure rate limiting for traffic domains. The following expression in the NetScaler expres-
sions language for identifies traffic associated with traffic domains.
• client.traffic_domain.id
You can configure rate limiting for traffic associated with a particular traffic domain, a set of traffic
domains, or all traffic domains.
For configuring rate limiting for traffic domains, you perform the following steps on a NetScaler appli-
ance by using the GUI or the NetScaler command line:
1. Configure a stream selector that uses the client.traffic_domain.id expression for identifying the
traffic, associated with traffic domains, to be rate limited.
2. Configure a rate limit identifier that specifies parameters such as maximum threshold for traffic
to be rate limited. You also associate a stream selector to the rate limiter in this step.
3. Configure an action that you want to associate with the policy that uses the rate limit identifier.
4. Configure a policy that uses the sys.check_limit expression prefix to call the rate limit identifier,
and associate the action with this policy.
5. Bind the policy globally.
Consider an example in which two traffic domains, with IDs 10 and 20, are configured on NetScaler NS1.
On traffic domain 10, LB1-TD-1 is configured to load balance servers S1 and S2; LB2-TD1 is configured
to load balance servers S3 and S4.
On traffic domain 20, LB1-TD-2 is configured to load balance servers S5 and S6; LB2-TD2 is configured
to load balance servers S7 and S8.
The following table lists some examples of rate limiting policies for traffic domains in the example
setup.
Limit the number of requests to 10 per second add stream selector tdratelimit-1
for each of the traffic domains. CLIENT.TRAFFIC_DOMAIN.ID add ns
limitIdentifier limitidf-1 -threshold 10
-selectorName tdratelimit-1 -trapsInTimeSlice 0
add responder policy ratelimit-pol
“sys.check_limit(\“limitidf-1\”)” DROP bind
responder global ratelimit-pol 1
Limit the number of requests to 5 per client per add stream selector tdandclientip
second for each of the traffic domains. CLIENT.IP.SRC,CLIENT.TRAFFIC_DOMAIN.ID add
ns limitIdentifier td_limitidf -threshold 5
-selectorName tdandclientip -trapsInTimeSlice
5 add responder policy tdratelimit-pol
“sys.check_limit(\“td_limitidf\”)” DROP bind
responder global tdratelimit-pol 2
Limit the number of requests sent for a add stream selector tdratelimit
particular traffic domain (for example traffic CLIENT.TRAFFIC_DOMAIN.ID add ns
domain 10) to 30 requests every 3 seconds. limitIdentifier td10_limitidf -threshold 30
-timeSlice 3000 -selectorName tdratelimit
-trapsInTimeSlice 5 add responder policy
td10ratelimit “client.traffic_domain.id==10 &&
sys.check_limit(\“td10_limitidf\”)” DROP bind
responder global td10ratelimit 3
Limit the number of connections to 5 per client add stream selector tdandclientip
per second for a particular traffic domain (for CLIENT.IP.SRC CLIENT.TRAFFIC_DOMAIN.ID add
example traffic domain 20). ns limitIdentifier td20_limitidf -threshold 5
-mode CONNECTION -selectorName
tdandclientip -trapsInTimeSlice 5 add
responder policy td20_ratelimit
“client.traffic_domain.id==20 &&
sys.check_limit(\“td20_limitidf\”)” DROP bind
responder global td20_ratelimit 4
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Note: This feature was introduced in NetScaler release 11.1 build 51.21.
You can collect statistics at the packet level to determine bad/attack prone packets flowing through
all the connections identified by the selector. At any point, if the percentage of bad or attack-prone
packets exceed the configured threshold, a corrective action (RESET or DROP) is triggered as per the
configuration. This functionality can be used to address DDoS attacks involving small TCP packets in
which PUSH flag is enabled.
The following configuration demonstrates this functionality. This configuration tracks packet cred-
its for all the TCP connections flowing through the system. This creates a session and associates on
pcb/natpcb and the performs the per packet check.
Example:
After the configuration is complete, we must bind this responder policy globally.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Responder
Contributed by:
C
Warning
Responder and Rewrite filters are deprecated and as an alternative, Citrix recommends you to
use filters using advanced policy infrastructure.
Today’s complex Web configurations often require different responses to HTTP requests that appear,
on the surface, to be similar. When users request a Web site’s home page, you may want to provide
a different home page depending on where each user is located, which browser the user is using, or
which language(s) the browser accepts and the order of preference. You might want to break the con-
nection immediately if the request is coming from an IP range that has been generating DDoS attacks
or initiating hacking attempts.
With the Responder feature, responses can be based on who sends the request, where it is sent from,
and other criteria with security and system management implications. The feature is simple and quick
to use. By avoiding the invocation of more complex features, it reduces CPU cycles and time spent in
handling requests that do not require complex processing.
For handling sensitive data such as financial information, if you want to ensure that the client uses a
secure connection to browse a site, you can redirect the request to secure connection by using https
:// instead of http://.
You can specify a default action for requests that do not match any policy, and you can bypass the
safety check for actions that would otherwise generate error messages.
The Rewrite feature of NetScaler helps in rewriting some information in the requests or responses
handled by NetScaler. The following section shows some differences between the two features.
The main difference between the rewrite feature and the responder feature is as follows:
Responder cannot be used for response or server-based expressions. Responder can be used only for
the following scenarios depending on client parameters:
In case of a responder policy, the NetScaler examines the request from the client, takes action accord-
ing to the applicable policies, sends the response to the client, and closes the connection with the
client.
In case of a rewrite policy, the NetScaler examines the request from the client or response from the
server, takes action according to the applicable policies, and forwards the traffic to the client or the
server.
In general, it is recommended to use responder if you want the NetScaler to reset or drop a connec-
tion based on a client or request-based parameter. Use responder to redirect traffic, or respond with
custom messages. Use rewrite for manipulating data on HTTP requests and responses.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
At the command prompt, type the following commands to enable the responder feature and verify
the configuration:
• show ns feature
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After enabling the responder feature, you must configure one or more actions for handling requests.
The responder supports the following types of actions:
• Respond with. Sends the response defined by the Target expression without forwarding the
request to a web server. (The NetScaler appliance substitutes for and acts as a web server.) Use
this type of action to manually define a simple HTML-based response. Normally the text for a
Respond with action consists of a web server error code and brief HTML page.
• Respond with SQL OK. Sends the designated SQL OK response defined by the Target expres-
sion. Use this type of action to send an SQL OK response to an SQL query.
• Respond with SQL Error. Sends the designated SQL Error response defined by the Target ex-
pression. Use this type of action to send an SQL Error response to an SQL query.
• Respond with HTML page. Sends the designated HTML page as the response. You can choose
from a drop-down list of HTML pages that were previously uploaded, or upload a new HTML
page. Use this type of action to send an imported HTML page as the response.
• Redirect. Redirects the request to a different web page or web server. A Redirect action can
redirect requests originally sent to a “dummy” web site that exists in DNS, but for which there is
no actual web server, to an actual web site. It can also redirect search requests to an appropriate
URL. Normally, the redirection target for a Redirect action consists of a complete URL.
Displays the current settings for the specified responder action. If no action name is provided, dis-
plays a list of all responder actions currently configured on the NetScaler appliance, with abbreviated
settings.
At the command prompt, type the following commands to configure a responder action and verify the
configuration:
Parameters:
• bypassSafetyCheck. The safety check to allow unsafe expressions. Note: This attribute is dep-
recated.
31 Hits: 0
32 Undef Hits: 0
33 Action Reference Count: 0
34 Done
At the command prompt, type the following command to modify an existing responder action and
verify the configuration:
Example:
At the command prompt, type the following command to remove a responder action and verify the
configuration:
• rm responder action
• show responder action
Example:
You can configure the global HTTP action to invoke a responder action when an HTTP request times
out. To configure this feature, you must first create the responder action that you want to invoke.
Then, you configure the global HTTP timeout action to respond to a timeout with that responder ac-
tion.
To configure the global HTTP action by using the NetScaler command line:
• save ns config
For <responder action name>, substitute the name of the responder action.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you configure a responder action, you must next configure a responder policy to select the re-
quests to which the NetScaler appliance should respond. A responder policy is based on a rule, which
consists of one or more expressions. The rule is associated with an action, which is performed if a
request matches the rule.
Note: For creating and managing responder policies, the GUI provides assistance that is not available
at the NetScaler command prompt.
Example:
5 Name: policyThree
6 Rule: CLIENT.IP.SRC.IN_SUBNET(222.222.0.0/16)
7 Responder Action: RESET
8 UndefAction: Use Global
9 Hits: 0
10 Undef Hits: 0
11 Done
• rm responder policy
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
To put a policy into effect, you must bind it either globally, so that it applies to all traffic that flows
through the NetScaler, or to a specific virtual server, so that the policy applies only to requests whose
destination IP address is the VIP of that virtual server.
When you bind a policy, you assign a priority to it. The priority determines the order in which the
policies you define are evaluated. You can set the priority to any positive integer.
In the NetScaler operating system, policy priorities work in reverse order—the higher the number, the
lower the priority. For example, if you have three policies with priorities of 10, 100, and 1000, the
policy assigned a priority of 10 is performed first, then the policy assigned a priority of 100, and finally
the policy assigned an order of 1000. The responder feature implements only the first policy that a
request matches, not any additional policies that it might also match, so policy priority is important
for getting the results you intend.
You can leave yourself plenty of room to add other policies in any order, and still set them to evalu-
ate in the order you want, by setting priorities with intervals of 50 or 100 between each policy when
you globally bind it. You can then add additional policies at any time without having to reassign the
priority of an existing policy.
For additional information about binding policies on the NetScaler, see Policies and Expressions.
At the command prompt, type the following command to globally bind a responder policy and verify
the configuration:
Example:
7 Done
To bind responder policy to a specific virtual server by using the NetScaler command line:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The NetScaler appliance generates an undefined event (UNDEF event) when a request does not match
a responder policy, and then carries out the default action assigned to undefined events. By default,
that action is to forward the request to the next feature without changing it. This default behavior is
normally what you want; it ensures that requests that do not require special handling by a specific
responder action are sent to your Web servers and clients receive access to the content that they re-
quested.
If the Web site(s) your NetScaler appliance protects receive a significant number of invalid or malicious
requests, however, you may want to change the default action to either reset the client connection or
drop the request. In this type of configuration, you would write one or more responder policies that
would match any legitimate requests, and simply redirect those requests to their original destinations.
Your NetScaler appliance would then block any other requests as specified by the default action you
configured.
You can assign any one of the following actions to an undefined event:
• NOOP
The NOOP action aborts responder processing but does not alter the packet flow. This means
that the appliance continues to process requests that do not match any responder policy, and
eventually forwards them to the requested URL unless another feature intervenes and blocks
or redirects the request. This action is appropriate for normal requests to your Web servers and
is the default setting.
• RESET
If the undefined action is set to RESET, the appliance resets the client connection, informing the
client that it must re-establish its session with the Web server. This action is appropriate for
repeat requests for Web pages that do not exist, or for connections that might be attempts to
hack or probe your protected Web site(s).
• DROP
If the undefined action is set to DROP, the appliance silently drops the request without respond-
ing to the client in any way. This action is appropriate for requests that appear to be part of a
DDoS attack or other sustained attack on your servers.
Note: UNDEF events are triggered only for client requests. No UNDEF events are triggered for re-
sponses.
At the command prompt, type the following command to set the undefined action and verify the con-
figuration:
Example:
1. Navigate to AppExpert > Responder, and then under Settings, click the **Change Responder
Settings **link.
2. In the Set Responder Params dialog box, under Global Undefined-Result Action, select
NOOP, RESET, or DROP.
3. Click OK. A message appears in the status bar, stating that the Responder Parameters have been
configured.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Responder actions and policies are powerful and complex, but you can get started with relatively sim-
ple applications.
The following procedures block access to your protected Web site(s) by clients originating from the
CIDR 222.222.0.0/16. The responder sends an error message stating that the client is not authorized
to access the URL requested.
The following procedures redirect clients who access your protected Web site(s) from within the CIDR
222.222.0.0/16 to a specified URL.
At the command prompt, type the following commands to redirect clients and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The Responder feature now supports the Diameter protocol. You can configure Responder to respond
to Diameter requests as it does HTTP and TCP requests. For example, you could configure Responder
to respond to requests from a specific Diameter origin with a redirect to a web page enhanced for
mobile devices. A number of NetScaler expressions have been added that support examination of the
Diameter header and the attribute-value pairs (AVPs). These expressions support lookup of specific
AVPs by index, ID or name, examine the information in each AVP, and send an appropriate response.
For <actname>, substitute a name for your new action. The name can consist of from one to
127 characters in length, and can contain letters, numbers, and the hyphen (-) and underscore
(_) symbols. For aaa://host.example.com, substitute the URL of the diameter host to which you
want to redirect connections.
For <polname>, substitute a name for your new policy. As with <actname>, the name can consist
of from one to 127 characters in length, and can contain letters, numbers, and the hyphen (-) and
underscore (_) symbols. For host1.example.net, substitute the name of the originating host of
the requests that you want to redirect. For <actname>, substitute the name of the action that
you just created.
For <vservername>, substitute the name of the load balancing virtual server to which you want
to bind the policy. For <polname>, substitute the name of the policy you just created. For
<priority>, substitute a priority for the policy.
Example:
To create a Responder action and policy to respond to Diameter requests that originate from
“host1.example.net” with a redirect to “host.example.com”, you could add the following action and
policy, and bind the policy as shown.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The NetScaler expressions language contains expressions that can extract information from and ma-
nipulate RADIUS requests. These expressions enable you to use the Responder feature to respond
to RADIUS requests. Your responder policies and actions can use any expression that is appropriate
or relevant to a RADIUS request. The available expressions enable you to identify the RADIUS mes-
sage type, extract any attribute-value pair (AVP) from the connection, and send different responses
on the basis of that information. You can also create policy labels that invoke all responder policies
for RADIUS connections.
You can use RADIUS expressions to construct simple responses that do not require communication
with the RADIUS server to which the request was sent. When a responder policy matches a connection,
the NetScaler constructs and sends the appropriate RADIUS response without contacting the RADIUS
authentication server. For example, if the source IP address of a RADIUS request is from a subnet
that is specified in the responder policy, the NetScaler can reply to that request with an access-reject
message, or can simply drop the request.
You can also create policy labels to route specific types of RADIUS requests through a series of policies
that are appropriate to those requests.
Note: The current RADIUS expressions do not work with RADIUS IPv6 attributes.
The NetScaler documentation for expressions that support RADIUS assumes familiarity with the basic
structure and purpose of RADIUS communications. If you need more information about RADIUS, see
your RADIUS server documentation or search online for an introduction to the RADIUS protocol.
The following procedure uses the NetScaler command line to configure a responder action and policy,
and bind the policy to a RADIUS-specific global bind point.
In a responder configuration, you can use the following NetScaler expressions to refer to various por-
tions of a RADIUS request.
• RADIUS.IS_CLIENT
• RADIUS.IS_SERVER
Request Expressions:
• RADIUS.REQ.CODE
Returns the number that corresponds to the RADIUS request type. A derivative of the num_at
class. For example, a RADIUS access request would return 1 (one). A RADIUS accounting request
would return 4.
• RADIUS.REQ.LENGTH
Returns the length of the RADIUS request, including the header. A derivative of the
num_at class.
• RADIUS.REQ.IDENTIFIER
Returns the RADIUS request identifier, a number assigned to each request that allows the re-
quest to be matched to the corresponding response. A derivative of the
num_at class.
Returns the specified instance of the AVP as a string of type RAVP_t. A specific RADIUS AVP can
occur multiple times in a RADIUS message. INSTANCE (0) returns the first instance, INSTANCE
(1) returns second instance, and so on, up to sixteen instances.
Returns TRUE if the specified type of AVP exists in the message, or FALSE if it does not.
Response Expressions:
RADIUS response expressions are identical to RADIUS request expressions, except that RES replaces
REQ.
The ADC supports expressions to typecast RADIUS AVP values to the text, integer, unsigned integer,
long, unsigned long, ipv4 address, ipv6 address, ipv6 prefix and time data types. The syntax is the
same as for other NetScaler typecast expressions.
Example:
The ADC supports expressions to typecast RADIUS AVP values to the text, integer, unsigned integer,
long, unsigned long, ipv4 address, ipv6 address, ipv6 prefix and time data types. The syntax is the
same as for other NetScaler typecast expressions.
1 RADIUS.REQ.AVP(8).VALUE(0).typecast_ip_address_at
The NetScaler supports expressions to extract RADIUS AVP values by using the assigned integer codes
described in RFC2865 and RFC2866. You can also use text aliases to accomplish the same task. Some
examples follow.
The values of most commonly-used RADIUS AVPs can be extracted in the same manner.
Four global bind points are available for policies that contain RADIUS expressions.
• RADIUS_REQ_OVERRIDE
• RADIUS_REQ_DEFAULT
• RADIUS_RES_OVERRIDE
• RADIUS_RES_DEFAULT
• RADIUS_RESPONDWITH
Respond with the specified RADIUS response. The response is created with NetScaler expres-
sions, both RADIUS expressions and any others that are applicable.
• RADIUS.NEW_ANSWER
• RADIUS.NEW_ACCESSREJECT
• RADIUS.NEW_AVP
Use Cases
To configure the responder feature to block authentication requests from a specific network, begin
by creating a responder action that rejects requests. Use the action in a policy that selects requests
from the networks that you want to block. Bind the responder policy to a RADIUS-specific global bind
point, specifying:
• The priority
• END as the nextExpr value, to ensure that policy evaluation stops when this policy is matched
• RADIUS_REQ_OVERRIDE as the queue to which you assign the policy, so that it is evaluated be-
fore policies assigned to the default queue
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can configure the responder feature to respond to DNS requests as it does to HTTP and TCP re-
quests. For example, you could configure it to send DNS responses over UDP and ensure that the DNS
requests from the client are sent over TCP. A number of NetScaler expressions support examination
of the DNS header in the request. These expressions examine specific header fields and send an ap-
propriate response.
• DNS Expressions. In a responder configuration, you can use the following NetScaler expres-
sions to refer to various portions of a DNS request:
Expressions Descriptions
• DNS Bind Points. The following global bind points are available for policies that contain DNS
expressions.
In addition to the default bind points, you can create policy labels of type DNS and bind DNS
policies to them.
The following procedure uses the NetScaler command line to configure a responder action and policy
and bind the policy to a responder-specific global bind point.
For <actname>, substitute a name for your new action. The name can be 1 to 127 characters
in length, and can contain letters, numbers, hyphen (-), and underscore (_) symbols. For
<actType>, substitute a responder action type, respondWith.
For <polname>, substitute a name for your new policy. For <actname>, the name can be 1 to 127
characters in length, and can contain letters, numbers, hyphen (-), and underscore (_) symbols.
For <actname>, substitute the name of the action that you just created.
For <bindPoint>, specify one of the responder-specific global bind points. For <polName>, sub-
stitute the name of the policy that you just created. For <priority>, specify the priority of the
policy.
To enforce all the DNS requests over TCP, create a responder action that will set the TC bit and rcode
as NOERROR.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Troubleshooting
Contributed by:
C
If the responder feature does not work as expected after you have configured it, you can use some
common tools to access NetScaler resources and diagnose the problem.
For best results, use the following resources to troubleshoot an integrated cache issue on a NetScaler
appliance:
• Issue
The Responder feature is configured, but the responder action is not working.
Resolution
• Issue
Resolution
2. Configure a backup virtual server with a service bound to it. This ensures that the status
of the Web site is always displayed as UP.
3. Configure the primary virtual server to use the backup virtual server as a backup.
4. Create a responder action with an appropriate target. Following is an example for your
reference:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Rewrite
Contributed by:
C
Warning
Responder and Rewrite filters are deprecated and as an alternative, Citrix recommends you to
use filters using Advanced policy infrastructure.
Rewrite refers to the rewriting of some information in the requests or responses handled by the
NetScaler appliance. Rewriting can help in providing access to the requested content without
exposing unnecessary details about the Web site’s actual configuration. A few situations in which the
rewrite feature is useful are described below:
• <To improve security, the NetScaler can rewrite all the http://links to https:// in the re-
sponse body.
• <In the SSL offload deployment, the insecure links in the response have to be converted into
secure links. Using the rewrite option, you can rewrite all the http://links to https:// for
making sure that the outgoing responses from NetScaler to the client have the secured links.
• <If a Web site has to show an error page, you can show a custom error page instead of the default
404 Error page. For example, if you show the home page or site map of the Web site instead of
an error page, the visitor remains on the site instead of moving away from the Web site.
• <If you want to launch a new Web site, but use the old URL, you can use the Rewrite option.
• <When a topic in a site has a complicated URL, you can rewrite it with a simple, easy-to-
remember URL (also referred to as ‘cool URL’).
• <You can append the default page name to the URL of a Web site. For example, if the default
page of a company’s Web site is http://www.abc.com/index.php, when the user types
‘abc.com’ in the address bar of the browser, you can rewrite the URL to ‘abc.com/index.php’.
When you enable the rewrite feature, NetScaler can modify the headers and body of HTTP requests
and responses.
To rewrite HTTP requests and responses, you can use protocol-aware NetScaler policy expressions in
the rewrite policies you configure. The virtual servers that manage the HTTP requests and responses
must be of type
HTTP or
SSL. In HTTP traffic, you can take the following actions:
To rewrite TCP payloads, consider the payload as a raw stream of bytes. Each of the virtual servers
that managing the TCP connections must be of type TCP or SSL_TCP. The term TCP rewrite is used to
refer to the rewrite of TCP payloads that are not HTTP data. In TCP traffic, you can add, modify, or
delete any part of the TCP payload.
For examples to use the rewrite feature, see Rewrite Action and Policy Examples.
The main difference between the rewrite feature and the responder feature is as follows:
Responder cannot be used for response or server-based expressions. Responder can be used only for
the following scenarios depending on client parameters:
In case of a responder policy, the NetScaler examines the request from the client, takes action accord-
ing to the applicable policies, sends the response to the client, and closes the connection with the
client.
In case of a rewrite policy, the NetScaler examines the request from the client or response from the
server, takes action according to the applicable policies, and forwards the traffic to the client or the
server.
In general, it is recommended to use responder if you want the NetScaler to reset or drop a connec-
tion based on a client or request-based parameter. Use responder to redirect traffic, or respond with
custom messages. Use rewrite for manipulating data on HTTP requests and responses.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
March 6, 2019
Contributed by:
C
A rewrite policy consists of a rule and action. The rule determines the traffic on which rewrite is applied
and the action determines the action to be taken by the NetScaler. You can define multiple rewrite
policies. For each policy, specify the bind point and priority.
A bind point refers to a point in the traffic flow at which the NetScaler examines the traffic to verify
whether any rewrite policy can be applied to it. You can bind a policy to a specific load balancing or
content switching virtual server, or make the policy global if you want the policy to be applied to the
entire traffic handled by the NetScaler. These policies are referred to as global policies.
In addition to the user-defined policies, the NetScaler has some default policies. You cannot modify
or delete a default policy.
For evaluating the policies, NetScaler follows the order mentioned below:
• Global policies
• Policies bound to specific virtual servers
• Default policies
Note: NetScaler can apply a rewrite policy only when it is bound to a point.
• The NetScaler appliance checks for global policies and then checks for policies at individual
bind points.
• If multiple policies are bound to a bind point, the NetScaler evaluates the policies in the order of
their priority. The policy with the highest priority is evaluated first. After evaluating each policy,
if the policy is evaluated to TRUE (the traffic matches the rule), it adds the action associated with
the policy to a list of actions to be performed. A match occurs when the characteristics specified
in the policy rule match the characteristics of the request or response being evaluated.
• For any policy, in addition to the action, you can specify the policy that should be evaluated
after the current policy is evaluated. This policy is referred to as the ‘Go to Expression’. For any
policy, if a Go to Expression (gotoPriorityExpr) is specified, the NetScaler evaluates the Go to
Expression policy; it ignores policy with the next highest priority.
You can specify the priority of the policy to indicate the Go to Expression policy; you cannot
use the name of the policy. If you want the NetScaler to stop evaluating other policies after
evaluating a particular policy, you can set the Go to Expression to ‘END’.
• After all the policies are evaluated or when a policy has the Go to Expression set as END, the
NetScaler starts performing the actions according to the list of actions.
For more information about configuring rewrite policies, see “Configuring a Rewrite Policy” and about
binding rewrite policies, see “Binding a Rewrite Policy.”
The following figure illustrates how NetScaler processes a request or response when the rewrite fea-
ture is used.
Policy Evaluation
The policy with the highest priority is evaluated first. NetScaler does not stop the evaluation of rewrite
policies when it finds a match; it evaluates all the rewrite policies configured on the NetScaler.
The NetScaler starts the actual rewriting only after the evaluation is complete. It refers to the list of
actions identified by policies that are evaluated to TRUE, and starts the rewriting. After implementing
all the actions in the list, the NetScaler forwards the traffic as required.
Note:
Ensure that the policies do not specify conflicting or overlapping actions on the same part of the
HTTP header or body, or TCP payload. When such a conflict occurs, the NetScaler encounters an
undefined situation and aborts the rewrite.
Rewrite Actions
On the NetScaler appliance, specify the actions to be taken such as adding, replacing, or deleting
text within the body, or adding, modifying or deleting headers, or any changes in the TCP payload as
rewrite actions. For more information about rewrite actions, see Configuring a Rewrite Action.
The following table describes the steps the NetScaler can take when a policy evaluates to TRUE.
| Action | Result |
|—-|—|
| Insert | The rewrite action specified for the policy is carried out. |
| NOREWRITE | The request or response is not rewritten. NetScaler forwards the traffic without rewrit-
ing any part of the message. |
| RESET | The connection is aborted at the TCP level. |
| DROP | The message is dropped.|
Note: For any policy, you can configure the undefaction (action to be taken when the policy evaluates
to UNDEFINED) as NOREWRITE, RESET, or DROP.
To use the
Rewrite feature, take the following steps:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Enable the rewrite feature on the NetScaler appliance if you want to rewrite the HTTP or TCP requests
or responses. If the feature is enabled, NetScaler takes rewrite action according to the specified poli-
cies. For more information, see
How rewrite works.
At the command prompt, type the following commands to enable the rewrite feature and verify the
configuration:
Example:
1. <In the navigation pane, click System, and then click Settings.
2. <In the details pane, under Modes and Features, click Configure basic features.
3. <In the Configure Basic Features dialog box, select the Rewrite check box, and then click OK.
4. <In the Enable/Disable Feature(s) dialog box, click Yes. A message appears in the status bar,
stating that the selected feature was enabled.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
Warning
The Pattern function in a rewrite action is deprecated from NetScaler 12.0 build 56.20 onwards
and as an alternative, Citrix recommends you to use the Search rewrite action parameter.
After enabling the rewrite feature, you need to configure one or more actions unless a built-in rewrite
action is sufficient. All of the built-in actions have names beginning with the string ns_cvpn, followed
by a string of letters and underscore characters. Built-in actions perform useful and complex tasks
such as decoding parts of a clientless VPN request or response or modifying JavaScript or XML data.
The built-in actions can be viewed, enabled, and disabled, but cannot be modified or deleted.
Target expressions in actions for TCP rewrite must begin with one of the following expression prefixes:
You can use all types of existing string manipulation functions with these prefixes to identify the strings
that you want to rewrite. To configure a rewrite action, you assign it a name, specify an action type,
and add one or more arguments specifying additional data. The following table describes the action
types and the arguments you use with them.
Note: Action types that can be used only for HTTP rewrite are identified in the
Rewrite Action Type column.
At the command prompt, type the following commands to create a new rewrite action and verify the
configuration:
At the command prompt, type the following commands to modify an existing rewrite action and verify
the configuration:
•
• <show rewrite action <name>
Example:
At the command prompt, type the following commands to remove a rewrite action :
rm rewrite action <name>
Example:
1. In the Create Rewrite Action or Configure Rewrite Action dialog box, under the text area for the
type argument you want to enter, click Add.
2. In the Add Expression dialog box, in the first list box choose the first term for your expression.
• HTTP
The HTTP protocol. Choose this if you want to examine some aspect of the request that
pertains to the HTTP protocol.
• SYS
The protected Web site(s). Choose this if you want to examine some aspect of the request
that pertains to the recipient of the request.
• CLIENT
The computer that sent the request. Choose this if you want to examine some aspect of
the sender of the request.
When you make your choice, the rightmost list box lists appropriate terms for the next part of
your expression.
3. In the second list box, choose the second term for your expression. The choices depend upon
which choice you made in the previous step, and are appropriate to the context. After you
make your second choice, the Help window below the Construct Expression window (which
was blank) displays help describing the purpose and use of the term you just chose.
4. Continue choosing terms from the list boxes that appear to the right of the previous list box,
or typing strings or numbers in the text boxes that appear to prompt you to enter a value, until
your expression is finished.
For more information about the PI expressions language and creating expressions for responder
policies, see “Policies and Expressions.”
If you want to test the effect of a rewrite action when used on sample HTTP data, you can use
the Rewrite Expression Evaluator.
Note: The Rewrite Expression Evaluator is only available in the GUI. There is no NetScaler com-
mand line version.
To evaluate a rewrite action by using the Rewrite Action Evaluator dialog box
1. In the Rewrite Actions details pane, select the rewrite action that you want to evaluate, and then
click Evaluate.
2. In the Rewrite Expression Evaluator dialog box, specify values for the following parameters. (An
asterisk indicates a required parameter.)
• Rewrite Action*—If the rewrite action you want to evaluate is not already selected, select
it from the drop-down list. After you select a Rewrite action, the Details section displays
the details of the selected Rewrite action.
• New*—Select New to open the Create Rewrite Action dialog box and create a new rewrite
action.
• Modify*—Select Modify to open the Configure Rewrite Action dialog box and modify the
selected rewrite action.
• Flow Type*—Specifies whether to test the selected rewrite action with HTTP Request data
or HTTP Response data. The default is Request. If you want to test with Response data,
select Response.
• HTTP Request/Response Data*—Provides a space for you to provide the HTTP data that
the Rewrite Action Evaluator will use for testing. You can paste the data directly into the
window, or click Sample to insert some sample HTTP headers.
• Show end-of-line—Specifies whether to show UNIX-style end-of-line characters (\n) at the
end of each line of sample HTTP data.
• Sample—Inserts sample HTTP data into the HTTP Request/Response Data window. You
can choose either GET or POST data.
• Browse—Opens a local browse window so that you can choose a file containing sample
HTTP data from a local or network location.
• Clear—Clears the current sample HTTP data from the HTTP Request/Response Data win-
dow.
3. Click Evaluate. The Rewrite Action Evaluator evaluates the effect of the Rewrite action on the
sample data that you chose, and displays the results as modified by the selected Rewrite action
in the Results window. Additions and deletions are highlighted as indicated in the legend in the
lower left-hand corner of the dialog box.
4. Continue evaluating Rewrite actions until you have determined that all of your actions have the
effect that you wanted.
• You can modify the selected rewrite action and test the modified version by clicking Modify
to open the Configure Rewrite Action dialog box, making and saving your changes, and
5. Click Close to close the Rewrite Expression Evaluator and return to the Rewrite Actions pane.
To delete a rewrite action, select the rewrite action you want to delete, then click Remove and,
when prompted, confirm your choice by clicking OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you create any needed rewrite action(s), you must create at least one rewrite policy to select the
requests that you want the NetScaler appliance to rewrite.
A rewrite policy consists of a rule, which itself consists of one or more expressions, and an associated
action that is performed if a request or response matches the rule. Policy rules for evaluating HTTP
requests and responses can be based on almost any part of a request or response.
Even though you cannot use TCP rewrite actions to rewrite data other than the TCP payload, you can
base the policy rules for TCP rewrite policies on the information in the transport layer and the layers
below the transport layer.
If a configured rule matches a request or response, the corresponding policy is triggered and the ac-
tion associated with it is carried out.
Note: You can use either the command line interface or the GUI to create and configure rewrite poli-
cies. Users who are not thoroughly familiar with the command line interface and the NetScaler Policy
expression language will usually find using the GUI much easier.
At the command prompt, type the following commands to add a new rewrite policy and verify the
configuration:
At the command prompt, type the following commands to modify an existing rewrite policy and verify
the configuration:
Example:
At the command prompt, type the following command to remove a rewrite policy:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After creating a rewrite policy, you must bind it to put it into effect. You can bind your policy to Global
if you want to apply it to all traffic that passes through your NetScaler, or you can bind your policy to
a specific virtual server or bind point to direct only that virtual server or bind point’s incoming traffic
to that policy. If an incoming request matches a rewrite policy, the action associated with that policy
is carried out.
Rewrite policies for evaluating HTTP requests and responses can be bound to virtual servers of type
HTTP or SSL, or they can be bound to the
REQ_OVERRIDE,
REQ_DEFAULT,
RES_OVERRIDE, and
RES_DEFAULT bind points. Rewrite policies for TCP rewrite can be bound only to virtual servers of
type
TCP or
SSL_TCP, or to the
OTHERTCP_REQ_OVERRIDE,
OTHERTCP_REQ_DEFAULT,
OTHERTCP_RES_OVERRIDE, and
OTHERTCP_RES_DEFAULT bind points.
When you bind a policy, you assign it a priority. The priority determines the order in which the policies
you define are evaluated. You can set the priority to any positive integer.
In the NetScaler operating system, policy priorities work in reverse order - the higher the number, the
lower the priority. For example, if you have three policies with priorities of 10, 100, and 1000, the policy
assigned a priority of 10 is applied first, then the policy assigned a priority of 100, and finally the policy
assigned an order of 1000.
Unlike most other features in the NetScaler operating system, the rewrite feature continues to evalu-
ate and implement policies after a request matches a policy. However, the effect of a particular action
policy on a request or response will often be different depending on whether it is performed before
or after another action. Priority is important to get the results you intended.
You can leave yourself plenty of room to add other policies in any order, and still set them to evaluate in
the order you want, by setting priorities with intervals of 50 or 100 between each policy when you bind
it. If you do this, you can add additional policies at any time without having to reassign the priority of
an existing policy.
When binding a rewrite policy, you also have the option of assigning a goto expression (gotoPriori-
tyExpression) to the policy. A goto expression can be any positive integer that matches the priority
assigned to a different policy that has a higher priority than the policy that contains the goto expres-
sion. If you assign a goto expression to a policy, and a request or response matches the policy, the
NetScaler will immediately go to the policy whose priority matches the goto expression. It will skip
over any policies with priority numbers that are lower than that of the current policy, but higher than
the priority number of the goto expression, and not evaluate those policies.
At the command prompt, type the following commands to globally bind a rewrite policy and verify the
configuration:
Example:
To bind rewrite policy to a specific virtual server by using the command line interface
At the command prompt, type the following commands to bind rewrite policy to a specific virtual
server and verify the configuration:
Example:
2. In the details pane, select the rewrite policy you want to globally bind, and then click Policy
Manager.
3. In the Rewrite Policy Manager dialog box, in the Bind Points menu, do one of the following:
a) If you want to configure bindings for HTTP rewrite policies, click HTTP, and then click either
Request or Response, depending on whether you want to configure request-based rewrite
policies or response-based rewrite policies.
b) If you want to configure bindings for TCP rewrite policies, click TCP, and then click either
Client or Server, depending on whether you want to configure client-side TCP rewrite poli-
cies or server-side TCP rewrite policies.
4. Click the bind point to which you want to bind the rewrite policy. The Rewrite Policy Manager
dialog box displays all the rewrite policies that are bound to the selected bind point.
5. Click Insert Policy to insert a new row and display a drop-down list with all available, unbound
rewrite policies.
6. Click the policy you want to bind to the bind point. The policy is inserted into the list of rewrite
policies bound to the bind point.
7. In the Priority column, you can change the priority to any positive integer. For more information
about this parameter, see priority in “Parameters for binding a rewrite policy.”
8. If you want to skip over policies and go directly to a specific policy in the event that the current
policy is matched, change the value in the Goto Expression column to equal the priority of the
next policy to be applied.. For more information about this parameter, see gotoPriorityExpres-
sion in “Parameters for binding a rewrite policy.”
9. To modify a policy, click the policy, and then click Modify Policy.
10. To unbind a policy, click the policy, and then click Unbind Policy.
11. To modify an action, in the Action column, click the action you want to modify, and then click
Modify Action.
12. To modify an invoke label, in the Invoke column, click the invoke label you want to modify, and
then click Modify Invoke Label.
13. To regenerate the priorities of all the policies that are bound to the bind point you are currently
configuring, click Regenerate Priorities. The policies retain their existing priorities relative to
the other policies, but the priorities are renumbered in multiples of ten.
14. Click Apply Changes.
15. Click Close. A message appears in the status bar, stating that the Policy has been configured
successfully.
3. In the Configure Virtual Server (Load Balancing) dialog box, select the Policies tab. All policies
configured on your NetScaler appear on the list.
4. Select the check box next to the name of the policy you want to bind to this virtual server.
5. Click OK. A message appears in the status bar, stating that the Policy has been configured suc-
cessfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
If you want to build a more complex policy structure than is supported by single policies, you can
create policy labels and then bind them as you would policies. A policy label is a user-defined point
to which policies are bound. When a policy label is invoked, all the policies bound to it are evaluated
in the order of the priority you configured. A policy label can include one or multiple policies, each of
which can be assigned its own result. A match on one policy in the policy label can result in proceeding
to the next policy, invoking a different policy label or appropriate resource, or an immediate end to
policy evaluation and the return of control to the policy that invoked the policy label.
A rewrite policy label consists of a name, a transform name that describes the type of policy included
in the policy label, and a list of policies bound to the policy label. Each policy that is bound to the
policy label contains all of the elements described in Configuring a Rewrite Policy.
Note: You can use either the command line interface or the GUI to create and configure rewrite policy
labels. Users who are not thoroughly familiar with the command line interface and the NetScaler
Policy Infrastructure (PI) language will usually find using the GUI much easier.
To add a new rewrite policy label, at the command prompt, type the following command:
For example, to add a rewrite policy label named polLabelHTTPResponses to group all policies that
work on HTTP responses, you would type the following:
To modify an existing rewrite policy label, at the NetScaler command prompt, type the following com-
mand:
Note: The set rewrite policy command takes the same options as the add rewrite policy command.
To remove a rewrite policy label, at the NetScaler command prompt, type the following command:
rm rewrite policy<name>
For example, to remove a rewrite policy label named polLabelHTTPResponses, you would type the
following:
3. Add or remove policies from the list that is bound to the policy label.
• To add a policy to the list, click Insert Policy, and choose a policy from the drop-down list.
You can create a new policy and add it to the list by choosing New Policy in the list, and
following the instructions in “Configuring a Rewrite Policy.”
• To remove a policy from the list, select that policy, and then click Unbind Policy.
4. Modify the priority of each policy by editing the number in the Priority column.
To remove a policy label, select it, and then click Remove. To rename a policy label, select it and
then click Rename. Edit the name of the policy, and then click OK to save your changes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
An undefined event is triggered when the NetScaler cannot evaluate a policy, usually because it de-
tects a logical or other error in the policy or an error condition on the NetScaler. When the rewrite
policy evaluation results in an error, the specified undefined action is carried out. Undefined actions
configured at the rewrite policy level are carried out before a globally configured undefined action.
• undefAction NOREWRITE
Aborts rewrite processing, but does not alter the packet flow. This means that the NetScaler con-
tinues to process requests and responses that do not match any rewrite policy, and eventually
forwards them to the requested URL unless another feature intervenes and blocks or redirects
the request. This action is appropriate for normal requests to your Web servers, and is the de-
fault setting.
• undefAction RESET
Resets the client connection. This means that the NetScaler tells the client that it must re-
establish its session with the Web server. This action is appropriate for repeat requests for Web
pages that do not exist, or for connections that might be attempts to hack or probe your pro-
tected Web site(s).
• undefAction DROP
Silently drops the request without responding to the client in any way. This means that the
NetScaler simply discards the connection without responding to the client. This action is ap-
propriate for requests that appear to be part of a DDoS attack or another sustained attack on
your servers.
Note: Undefined events can be triggered for both request and response flow specific policies.
At the command prompt, type the following commands to configure the default action and verify the
configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
When you create a rewrite action, the NetScaler verifies that the expression you used to create the ac-
tion is safe. Expressions created by the NetScaler from run-time data, such as URLs contained in HTTP
requests, can cause unexpected errors. The NetScaler reports expressions that cause such errors as
unsafe expressions.
In some cases, the expressions may be safe. For example, the NetScaler cannot validate an expression
that contains a URL that does not resolve, even if the URL does not resolve because the Web server is
temporarily unavailable. You can manually bypass the Safety Check to allow these expressions.
At the command prompt, type the following commands to bypass the safety check and verify the con-
figuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The examples in this section demonstrate how to configure rewrite to perform various useful tasks.
The examples occur in the server room of Example Manufacturing Inc., a mid-sized manufacturing
company that uses its Web site to manage a considerable portion of its sales, deliveries, and customer
support.
Example Manufacturing has two domains: example.com for its Web site and email to customers, and
example.net for its intranet. Customers use the Example Web site to place orders, request quotes,
research products, and contact customer service and technical support.
As an important part of Example’s revenue stream, the Web site must respond quickly and keep cus-
tomer data confidential. Example therefore has several Web servers and uses NetScaler appliances to
balance the Web site load and manage traffic to and from its Web servers.
The Example system administrators use the rewrite features to perform the following tasks:
Example Inc. removes old X-Forwarded-For and Client-IP HTTP headers from incoming requests.
Example Inc. tags incoming requests with a header that indicates whether the connection is a secure
connection.
Example Inc. modifies the HTTP Server: header so that unauthorized users and malicious code cannot
use that header to determine the HTTP server software it uses.
Example Inc. hides information about the actual names of its Web servers and the configuration of its
server room from users, to make URLs on its Web site shorter and easier to remember and to improve
security on its site.
Example Inc. moved its Apache rewrite rules to a NetScaler appliance, translating the Apache PERL-
based script syntax to the NetScaler rewrite rule syntax.
The marketing department at Example Inc. sets up simplified URLs for certain predefined keyword
searches on the company’s Web site.
Example Inc. recently acquired a smaller competitor, and it now redirects requests to the acquired
company’s home page to a page on its own Web site.
Example Inc. encrypt HTTP predefined and user-defined header or body content by using PEM RSA
public key.
Each of these tasks requires that the system administrators create rewrite actions and policies and
bind them to a valid bind point on the NetScaler.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc. wants to remove old X-Forwarded-For and Client-IP HTTP headers from incoming re-
quests, so that the only X-Forwarded-For headers that appear are the ones added by the local server.
This configuration can be done through the NetScaler command line or the GUI. The Example Inc. sys-
tem administrator is an old-school networking engineer and prefers to use a CLI where possible, but
wants to be sure he understands the GUI interface so that he can show new system administrators on
the team how to use it.
The examples below demonstrate how to perform each configuration with both the CLI and the GUI.
The procedures are abbreviated on the assumption that users will already know the basics of creating
rewrite actions, creating rewrite policies, and binding policies.
• For more detailed information about creating rewrite actions, see Configuring a Rewrite Action.
• For more detailed information about creating rewrite policies, see Configuring a Rewrite Policy.
• For more detailed information about binding rewrite policies, see Binding a Rewrite Policy.
To delete old X-Forwarded and Client-IP headers from a request by using the command
line interface
At the command prompt, type the following commands in the order shown:
To delete old X-Forwarded and Client-IP headers from a request by using the GUI
In the Create Rewrite Action dialog box, create two rewrite actions with the following descriptions.
In the Create Rewrite Policy dialog box, create two rewrite policies with the following descriptions.
Bind both policies to global, assigning the priorities and goto expression values shown below.
All old X-Forwarded-For and Client-IP HTTP headers are now deleted from incoming requests.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc. wants to add a local Client-IP HTTP header to incoming requests. This example contains
two slightly different versions of the same basic task.
At the command prompt, type the following commands in the order shown:
In the Create Rewrite Action dialog box, create a rewrite action with the following description.
In the Create Rewrite Policy dialog box, create a rewrite policy with the following description.
Bind policy to global, assigning the priorities and goto expression values shown below.
|Name|Priority|Goto Expression|
|–|–|–|
|pol_ins_client|100|Next
A local Client-IP HTTP header is now added to incoming requests. You can also modify the configu-
ration above to append all IPs from X-Forwarded-For headers to the new Client-IP header, as shown
below.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Type of Rewrite
Action Name Action Header Name Value
Type of Rewrite
Action Name Action Header Name Value
You would then create a rewrite policy with the values shown in the following tables. These policies
check incoming requests to determine which requests are directed to port 80 and which are directed
to port 443. The policies then add the correct SSL header.
Finally, you would bind the rewrite policies to NetScaler, assigning the first policy a priority of 200,
and the second a priority of 300, and setting the goto expression of both policies to END.
Each incoming connection to port 80 now has an SSL:NO HTTP header added to it and each incoming
connection to port 443 has an SSL:YES HTTP header added to it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc. wants to modify the HTTP Server: header so that unauthorized users and malicious code
cannot use the header to identify the software that the HTTP server uses.
To modify the HTTP Server: header, you would create a rewrite action and a rewrite policy with the
values in the following tables.
Example commands:
You would then globally bind the rewrite policy, assigning a priority of 100 and setting the Goto Priority
Expression of the policy to END.
The HTTP Server: header is now modified to read “Web Server 1.0,” masking the actual HTTP server
software used by the Example Inc. Web site.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc. wants to hide its actual server room configuration from users to improve security on its
Web servers.
To do this, you would create a rewrite action with the values as shown in the following tables. For
request headers, the action in the table modifies www.example.com to web.hq.example.net. For
response headers, the action does the opposite, translating web.hq.example.net to www.example
.com.
Next, you would create rewrite policies using the values shown in the following tables. The first pol-
icy checks incoming requests to see if they are valid, and if they are, it performs the Action-Rewrite-
Request_Server_Replace action. The second policy checks responses to see if they originate at the
server web.hq.example.net. If they do, it performs the Action-Rewrite-Response_Server_Replace ac-
tion.
Examples of rewrite action and policy for redirect
add rewrite action Action-Rewrite-Request_Server_Replace REPLACE HTTP.REQ.
HOSTNAME.SERVER ’”Web.hq.example.net”
Finally, you would bind the rewrite policies, assigning each a priority of 500 because they are in differ-
ent policy banks and therefore will not conflict. You should set the goto expression to NEXT for both
bindings.
All instances of www.example.com in the request headers are now changed to web.hq.example.net,
and all instances of web.hq.example.net in response headers are now changed to www.example.com.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc., is currently using the Apache rewrite module to process search requests sent to its Web
servers and redirect those requests to the appropriate server on the basis of information in the request
URL. Example Inc. wants to simplify its setup by migrating these rules onto the NetScaler platform.
Several Apache rewrite rules that Example currently uses are shown below. These rules redirect search
requests to a special results page if they do not have a SiteID string or if they have a SiteID string equal
to zero (0), or to the standard results page if these conditions do not apply.
To implement these Apache rewrite rules on the NetScaler, you would create rewrite actions with the
values in the following tables.
You would then create rewrite policies with the values as shown in the tables below.
Finally, you would bind the rewrite policies, assigning the first a priority of 600 and the second a pri-
ority of 700, and then set the goto expression to NEXT for both bindings.
The NetScaler now handles these search requests exactly as the Web server did before the Apache
rewrite module rules were migrated.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
• Internal URL:
http://www.example.com/go/kwsearch.asp?keyword=\<marketingkeyword\>
To set up redirection for marketing keywords, you would create a rewrite action with the values in the
following table.
You would then create a rewrite policy with the values in the following table.
Finally, you would bind the rewrite policy, assigning it a priority of 800. Unlike the previous rewrite
policies, this policy should be the last to be applied to a request that matches its criteria. For this
reason, NetScaler administrator sets its Goto Priority Expression to END.
Any request using a marketing keyword is redirected to the keyword search CGI page, whereupon a
search is performed and all remaining policies are skipped.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
Example Inc. wants to redirect query requests to the appropriate server, as shown here.
To implement this redirection, you would first create a rewrite action with the values in the following
table.
You would then create a rewrite policy with the values in the following table.
Finally, you would bind the rewrite policy, assigning it a priority of 900. Because this policy should be
the last policy applied to a request that matches its criteria, you set the goto expression to END.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
New Company, Inc. recently acquired a smaller competitor, Purchased Company, and wants to redi-
rect the home page for Purchased Company to a new page on its own Web site, as shown here.
To redirect requests to the Purchased Company home page, you would create rewrite actions with the
values in the following table.
You would then create rewrite policies with the values in the following table.
Finally, you would bind the rewrite policies globally, assigning the first a priority of 100, the second
a priority of 200, and the third a priority of 300. These policies should be the last policies applied to
a request that matches the criteria. For this reason, set the goto expression to END for the first and
third policies, and to 300 for the second policy. This ensures that all remaining requests are processed
correctly.
Requests to the acquired company’s old Web site are now redirected to the correct page on the New
Company home page.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Complete the following tasks to configure policy-based RSA encryption by using the NetScaler com-
mand interface.
To add RSA public key as a policy expression by using the NetScaler command interface:
To add rewrite an action to encrypt an HTTP header request by using the NetScaler command
interface:
Subsequent execution of this curl command with the same data to encrypt shows that the encrypted
data is different each execution. This is because the padding inserts random bytes at the beginning
of the data to encrypt, causing the encrypted data to be different each time.
1. Sign into the NetScaler appliance and navigate to Configurations > AppExpert > Advanced Ex-
pressions.
2. In the details pane, click Add to define an RSA public key as an advanced policy expression.
3. In Create Expression page, set the following parameters:
a) Expression name. Name of the advanced expression.
b) Expression. Define RSA public key as an advanced expression using the Expression Editor.
c) Comments. A brief description of the expression.
4. Click Create.
To add rewrite an action to encrypt an HTTP header request by using the GUI:
1. Sign into the NetScaler appliance and navigate to Configurations > AppExpert > Rewrite > Ac-
tions.
2. In the details pane, click Add to add a rewrite action.
3. In the Create Rewrite Action screen, set the following parameters:
a) Name. Name of the rewrite action.
b) Type. Select action type as INSERT_HTTP_HEADER.
c) Use the action type to insert a header. Enter the name of the HTTP header that needs to
be rewritten.
d) Expression. Name of the advanced policy expression associated to the action.
e) Comments. A brief description of the rewrite action.
4. Click Create.
1. Sign into the NetScaler appliance and navigate to Configurations > AppExpert > Rewrite > Poli-
cies.
2. In the Rewrite Policies page, click Add to add a rewrite policy.
3. In the Create Rewrite Policy page, set the following parameters:
a) Name. Name of the rewrite policy.
b) Action. Name of the rewrite action to perform if the request or response matches this
rewrite policy.
c) Log Action. Name of message log action to use when a request matches this policy.
d) Undefined-Result Action. Action to perform if the result of policy evaluation is undefined.
e) Expression. Name of the advanced policy expression that triggers the action.
1. Sign into the NetScaler appliance and navigate to Configurations > AppExpert > Rewrite > Poli-
cies.
2. In the Rewrite Policies screen, select a rewrite policy that you want to bind and click Policy
Manager.
3. In the Rewrite Policy Manager page, in the Bind Points section, set the following parameters:
a) Bind Point. Select the binding point as Default Global.
b) Protocol. Select the protocol type as HTTP.
c) Connection Type. Select the connection type as Request.
d) Click Continue to view the Policy Binding section.
e) In the Policy Binding section, select the rewrite policy and set the bind parameters.
4. Click Bind.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
You can implement the feature by using a rewrite policy. To do this, you must complete the following
tasks:
Complete the following tasks to configure policy-based RSA encryption by using the Citrix ADC com-
mand interface.
To add RSA public key with no padding policy expression by using the Citrix ADC command in-
terface:
To add rewrite action for no padding policy expression by using the Citrix ADC command inter-
face:
add rewrite action rsa_encrypt_act insertHttpHeader encrypted ’HTTP.REQ.
HEADER(”plaintext”).PKEY_ENCRYPT_PEM_NO_PADDING(rsa_pub_key_4096)
1. Sign into the Citrix ADC appliance and navigate to Configurations > AppExpert > Rewrite >
Actions.
2. In the details pane, click Add to add a rewrite action.
3. In the Create Rewrite Action screen, set the following parameters:
a) Name. Name of the rewrite action.
b) Type. Select action type as INSERT_HTTP_HEADER.
c) Use the action type to insert a header. Enter the name of the HTTP header that needs to
be rewritten.
d) Expression. Name of the advanced policy expression associated to the action.
e) Comments. A brief description of the rewrite action.
4. Click Create.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
URL Transformation
Contributed by:
C
The URL transformation feature provides a method for modifying all URLs in designated requests from
an external version seen by outside users to an internal URL seen only by your Web servers and IT staff.
You can redirect user requests seamlessly, without exposing your network structure to users. You can
also modify complex internal URLs that users may find difficult to remember into simpler, more easily
remembered external URLs.
Note
Before you can use the URL transformation feature, you must enable the Rewrite feature. To
enable the Rewrite feature, see Enabling the Rewrite Feature.
URL transform feature rewrites URLs in HTML response body and is not applied to JavaScript and
other variables.
To begin configuring URL transformation, you create profiles, each describing a specific transforma-
tion. Within each profile, you create one or more actions that describe the transformation in detail.
Next, you create policies, each of which identifies a type of HTTP request to transform, and you as-
sociate each policy with an appropriate profile. Finally, you globally bind each policy to put it into
effect.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
A profile describes a specific URL transformation as a series of actions. The profile functions primarily
as a container for the actions, determining the order in which the actions are performed. Most trans-
formations transform an external hostname and optional path into a different, internal hostname and
path. Most useful transformations are simple and require only a single action, but you can use multi-
ple actions to perform complex transformations.
You cannot create actions and then add them to a profile. You must create the profile first, and then
add actions to it. In the CLI, creating an action and configuring the action are separate steps. Creating
a profile and configuring the profile are separate steps in both the CLI and the GUI.
At the NetScaler command prompt, type the following commands, in the order shown, to create a
URL transformation profile and verify the configuration. You can then repeat the second and third
commands to configure additional actions:
•
• show transform profile <name>
Example:
At the NetScaler command prompt, type the following commands to modify an existing URL transfor-
mation profile or action and verify the configuration:
Note: Use a set transform profile or set transform action command, respectively. The set transform
profile command takes the same arguments as does the add transform profile command, and set
transform action is the same command that was used for initial configuration.
Example:
To remove a URL transformation profile and actions by using the NetScaler command
line
First remove all actions associated with that profile by typing the following command once for each
action:
• rm transform action <name> After you have removed all actions associated with a profile, re-
move the profile as shown below.
• rm transform profile <name>
1. In the navigation pane, expand Rewrite, expand URL Transformation, and then click Profiles.
1. In the navigation pane, expand Rewrite, expand URL Transformation, and then click Profiles.
2. In the details pane, select the profile you want to configure, and then click Open.
3. In the Configure URL Transformation Profile dialog box, do one of the following.
• To create a new action, click Add.
• To modify an existing action, select the action, and then click Open.
4. Fill in the Create URL Transformation Action or Modify URL Transformation Action dialog box by
typing or selecting values for the parameters. The contents of the dialog box correspond to the
parameters described in “Parameters for configuring URL transformation profiles” as follows
(asterisk indicates a required parameter):
• Action Name*—name
• Comments—comment
• Priority*—priority
• Request URL from—reqUrlFrom
• Request URL into—reqUrlInto
• Response URL from—resUrlFrom
• Response URL into—resUrlInto
• Cookie Domain from—cookieDomainFrom
• Cookie Domain into—cookieDomainInto
• Enabled—state
5. Save your changes.
• If you are creating a new action, click Create, and then Close.
• If you are modifying an existing action, click OK.
A message appears in the status bar, stating that the Profile has been configured success-
fully.
6. Repeat step 3 through step 5 to create or modify any additional actions.
7. To delete an action, select the action, and then click Remove. When prompted, click OK to con-
firm the deletion.
8. Click OK to save your changes and close the Modify URL Transformation Profile dialog box.
9. To delete a profile, in the details pane select the profile, and then click Remove. When
prompted, click OK to confirm the deletion.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you create a URL transformation profile, you next create a URL transformation policy to select
the requests and responses that the NetScaler should transform by using the profile. URL transfor-
mation considers each request and the response to it as a single unit, so URL transformation policies
are evaluated only when a request is received. If a policy matches, the NetScaler transforms both the
request and the response.
Note: The URL transformation and rewrite features cannot both operate on the same HTTP header
during request processing. Because of this, if you want to apply a URL transformation to a request,
you must make sure that none of the HTTP headers it will modify are manipulated by any rewrite
action.
You must create a new policy. On the command line, an existing policy can only be removed. At the
NetScaler command prompt, type the following commands to configure a URL transformation policy
and verify the configuration:
Example:
4 1) Name: polsearch
5 Rule: HTTP.REQ.URL.SUFFIX.EQ(”Searching”)
6 Profile: prosearching
7 Priority: 0
8 Hits: 0
9 Done
At the NetScaler command prompt, type the following command to remove a URL transformation
policy:
Example:
1. In the navigation pane, expand Rewrite, expand URL Transformation, and then click Policies.
3. In the Create URL Transformation Policy or Configure URL Transformation Policy dialog box,
type or select values for the parameters. The contents of the dialog box correspond to the pa-
rameters described in “Parameters for configuring URL transformation policies” as follows (as-
terisk indicates a required parameter):
If you want help with creating an expression for a new policy, you can either hold down the
Control key and press the space bar while your cursor is in the Expression text box. To create
the expression, you can type it directly as described below, or you can use the Add Expression
dialog box.
• HTTP—The HTTP protocol. Choose this if you want to examine some aspect of the
request that pertains to the HTTP protocol.
• SYS—The protected Web site(s). Choose this if you want to examine some aspect of
the request that pertains to the recipient of the request.
• CLIENT—The computer that sent the request. Choose this if you want to examine
some aspect of the sender of the request.
• SERVER—The computer to which the request was sent. Choose this if you want to
examine some aspect of the recipient of the request.
• URL—The URL of the request. Choose this if you want to examine some aspect of the
URL to which the request was sent.
• TEXT—Any text string in the request. Choose this if you want to examine a text string
in the request.
• TARGET—The target of the request. Choose this if you want to examine some aspect
of the request target.
After you choose a prefix, the NetScaler displays a two-part prompt window that dis-
plays the possible next choices at the top, and a brief explanation of what the selected
choice means at the bottom. The choices depend on which prefix you chose.
If you chose HTTP as your prefix, your choices are REQ, which specifies HTTP requests, and
RES, which specifies HTTP responses. If you chose another prefix, your choices are more
varied. For help on a specific choice, click that choice once to display information about it
in the lower prompt window.
When you are certain which choice you want, double-click it to insert it into the Expression
window.
c) Type a period, and then continue selecting terms from the list boxes that appear to the
right of the previous list box. You type the appropriate text strings or numbers in the text
boxes that appear to prompt you to enter a value, until your expression is finished.
4. Click Create or OK, depending on whether you are creating a new policy or modifying an existing
policy.
5. Click Close. A message appears in the status bar, stating that the Policy has been configured
successfully.
1. In the Create Responder Action or Configure Responder Action dialog box, click Add.
2. In the Add Expression dialog box, in the first list box choose the first term for your expression.
• HTTP
The HTTP protocol. Choose this if you want to examine some aspect of the request that
pertains to the HTTP protocol.
• SYS
The protected Web site(s). Choose this if you want to examine some aspect of the request
that pertains to the recipient of the request.
• CLIENT
The computer that sent the request. Choose this if you want to examine some aspect of
the sender of the request.
• SERVER
The computer to which the request was sent. Choose this if you want to examine some
aspect of the recipient of the request.
• URL
The URL of the request. Choose this if you want to examine some aspect of the URL to
which the request was sent.
• TEXT
Any text string in the request. Choose this if you want to examine a text string in the re-
quest.
• TARGET
The target of the request. Choose this if you want to examine some aspect of the request
target.
When you make your choice, the rightmost list box lists appropriate terms for the next part
of your expression.
3. <In the second list box, choose the second term for your expression. The choices depend upon
which choice you made in the previous step, and are appropriate to the context. After you
make your second choice, the Help window below the Construct Expression window (which
was blank) displays help describing the purpose and use of the term you just chose.
4. <Continue choosing terms from the list boxes that appear to the right of the previous list box,
or typing strings or numbers in the text boxes that appear to prompt you to enter a value, until
your expression is finished.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you have configured your URL transformation policies, you bind them to Global or a bind point
to put them into effect. After binding, any a request or response that matches a URL transformation
policy is transformed by the profile associated with that policy.
When you bind a policy, you assign a priority to it. The priority determines the order in which the
policies you define are evaluated. You can set the priority to any positive integer. In the NetScaler OS,
policy priorities work in reverse order - the higher the number, the lower the priority.
Because the URL transformation feature implements only the first policy that a request matches, not
any additional policies that it might also match, policy priority is important for achieving the results
that you intend. If you give your first policy a low priority (such as 1000), you tell the NetScaler to per-
form it only if other policies with a higher priority do not match a request. If you give your first policy a
high priority (such as 1), you tell the NetScaler to perform it first, and skip any other policies that might
also match. You can leave yourself plenty of room to add other policies in any order, without having
to reassign priorities, by setting priorities with intervals of 50 or 100 between each policy when you
globally bind your policies.
At the NetScaler command prompt, type the following commands to globally bind a URL transforma-
tion policy and verify the configuration:
Example:
6
7 Done
1. In the navigation pane, expand Rewrite, then expand URL Transformation, and then click Poli-
cies.
2. In the details pane, click Policy Manager.
3. In the Transform Policy Manager dialog box, choose the bind point to which you want to bind
the policy. The choices are:
• Override Global. Policies that are bound to this bind point process all traffic from all in-
terfaces on the NetScaler appliance, and are applied before any other policies.
• LB Virtual Server. Policies that are bound to a load balancing virtual server are applied
only to traffic that is processed by that load balancing virtual server, and are applied be-
fore any Default Global policies. After selecting LB Virtual Server, you must also select the
specific load balancing virtual server to which you want to bind this policy.
• CS Virtual Server. Policies that are bound to a content switching virtual server are applied
only to traffic that is processed by that content switching virtual server, and are applied
before any Default Global policies. After selecting CS Virtual Server, you must also select
the specific content switching virtual server to which you want to bind this policy.
• Default Global. Policies that are bound to this bind point process all traffic from all inter-
faces on the NetScaler appliance.
• Policy Label. Policies that are bound to a policy label process traffic that the policy label
routes to them. The policy label controls the order in which policies are applied to this
traffic.
4. Select Insert Policy to insert a new row and display a drop-down list with all available, unbound
URL transformation policies.
5. Select the policy you want to bind, or select New Policy to create a new policy. The policy that
you selected or created is inserted into the list of globally bound URL transformation policies.
6. Make any additional adjustments to the binding.
• <To modify the policy priority, click the field to enable it, and then type a new priority. You
can also select Regenerate Priorities to renumber the priorities evenly.
• To modify the policy expression, double click that field to open the Configure Transform
Policy dialog box, where you can edit the policy expression.
• To set the Goto Expression, double click field in the Goto Expression column heading to
display the drop-down list, where you can choose an expression.
• To set the Invoke option, double click field in the Invoke column heading to display the
drop-down list, where you can choose an expression.
7. Repeat steps 3 through 6 to add any additional URL transformation policies you want to globally
bind.
8. Click OK to save your changes. A message appears in the status bar, stating that the Policy has
been configured successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
After you have configured your URL transformation policies, you bind them to Global or a bind point
to put them into effect. After binding, any a request or response that matches a URL transformation
policy is transformed by the profile associated with that policy.
When you bind a policy, you assign a priority to it. The priority determines the order in which the
policies you define are evaluated. You can set the priority to any positive integer. In the NetScaler OS,
policy priorities work in reverse order - the higher the number, the lower the priority.
Because the URL transformation feature implements only the first policy that a request matches, not
any additional policies that it might also match, policy priority is important for achieving the results
that you intend. If you give your first policy a low priority (such as 1000), you tell the NetScaler to per-
form it only if other policies with a higher priority do not match a request. If you give your first policy a
high priority (such as 1), you tell the NetScaler to perform it first, and skip any other policies that might
also match. You can leave yourself plenty of room to add other policies in any order, without having
to reassign priorities, by setting priorities with intervals of 50 or 100 between each policy when you
globally bind your policies.
At the NetScaler command prompt, type the following commands to globally bind a URL transforma-
tion policy and verify the configuration:
1. In the navigation pane, expand Rewrite, then expand URL Transformation, and then click Poli-
cies.
2. In the details pane, click Policy Manager.
3. In the Transform Policy Manager dialog box, choose the bind point to which you want to bind
the policy. The choices are:
• Override Global. Policies that are bound to this bind point process all traffic from all in-
terfaces on the NetScaler appliance, and are applied before any other policies.
• LB Virtual Server. Policies that are bound to a load balancing virtual server are applied
only to traffic that is processed by that load balancing virtual server, and are applied be-
fore any Default Global policies. After selecting LB Virtual Server, you must also select the
specific load balancing virtual server to which you want to bind this policy.
• CS Virtual Server. Policies that are bound to a content switching virtual server are applied
only to traffic that is processed by that content switching virtual server, and are applied
before any Default Global policies. After selecting CS Virtual Server, you must also select
the specific content switching virtual server to which you want to bind this policy.
• Default Global. Policies that are bound to this bind point process all traffic from all inter-
faces on the NetScaler appliance.
• Policy Label. Policies that are bound to a policy label process traffic that the policy label
routes to them. The policy label controls the order in which policies are applied to this
traffic.
4. Select Insert Policy to insert a new row and display a drop-down list with all available, unbound
URL transformation policies.
5. Select the policy you want to bind, or select New Policy to create a new policy. The policy that
you selected or created is inserted into the list of globally bound URL transformation policies.
6. Make any additional adjustments to the binding.
• <To modify the policy priority, click the field to enable it, and then type a new priority. You
can also select Regenerate Priorities to renumber the priorities evenly.
• To modify the policy expression, double click that field to open the Configure Transform
Policy dialog box, where you can edit the policy expression.
• To set the Goto Expression, double click field in the Goto Expression column heading to
display the drop-down list, where you can choose an expression.
• To set the Invoke option, double click field in the Invoke column heading to display the
drop-down list, where you can choose an expression.
7. Repeat steps 3 through 6 to add any additional URL transformation policies you want to globally
bind.
8. Click OK to save your changes. A message appears in the status bar, stating that the Policy has
been configured successfully.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The Rewrite feature now supports the Diameter protocol. You can configure Rewrite to modify Diam-
eter requests and response as you would HTTP or TCP requests and responses, allowing you to use
Rewrite to manage the flow of Diameter requests and make necessary modifications. For example, if
the “Origin-Host” value in a Diameter request is inappropriate, you can use Rewrite to replace it with
a value that is acceptable to the Diameter server.
To configure the Rewrite feature to replace the Origin-Host in a diameter request with a different value,
at the command prompt, type the following commands:
Example:
To create a Rewrite action and policy to modify all Diameter Host-Origins of “host.example.com” to
“NetScaler.example.net”, you could add the following action and policy, and bind the policy as shown.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
You can configure the rewrite feature to modify DNS requests and responses, as you would for HTTP
or TCP requests and responses. You can use rewrite to manage the flow of DNS requests, and make
necessary modifications in the header, or in the answer section. For example, if the DNS response does
not have the AA bit set in the header flag, you can use rewrite to set the AA bit in the DNS response
and send it to the client.
DNS Expressions
In a rewrite configuration, you can use the following NetScaler expressions to refer to various portions
of a DNS request or response:
The following global bind points are available for policies that contain DNS expressions.
In addition to the default bind points, you can create policy labels of type DNS_REQ or DNS_RES and
bind DNS policies to them.
• replace_dns_answer_section—This action replaces the DNS answers section with the defined
expression in the DNS policy.
• replace_dns_header_field—Checks the opcode type in the DNS request. Returns True or False,
indicating whether the opcode type in the DNS request matches the specified opcode type. This
action replaces the DNS header section with the defined expression in the DNS policy.
The following procedure uses the NetScaler command line to configure a rewrite action and policy
and bind the policy to a rewrite-specific global bind point.
Configure Rewrite action and policy, and bind the policy for DNS
For <actname>, substitute a name for your new action. The name can be 1 to 127 characters
in length, and can contain letters, numbers, hyphen (-), and underscore (_) symbols. For
<actType>, specify the rewrite action types provided for DNS expressions.
For <polname>, substitute a name for your new policy. For <actname>, the name can be 1 to 127
characters in length, and can contain letters, numbers, hyphen (-), and underscore (_) symbols.
For <actname>, substitute the name of the action that you just created.
For <polName>, substitute the name of the policy that you just created. For <priority>, specify
the priority of the policy. For <bindPoint>, substitute one of the rewrite -specific global bind
points.
Example:
The following commands configure the NetScaler appliance to act as an authoritative DNS server for
all the queries that it serves.
If the server responds with an NX domain, you can set the rewrite action to replace the response with
specified IP address. A NOPOLICY-REWRITE enables you to invoke an enternal bank without process-
ing an expression (a rule). This entry is a dummy policy that does not contain a rule but directs the
entry to a policy label or virtual server specific policy banks.
5 modify_nxdomain_res
6 add rewrite policylabel MODIFY_NODATA dns_res
7 bind rewrite policylabel MODIFY_NODATA modify_answer 10 END
8 bind rewrite policylabel MODIFY_NODATA set_res_aa 11 END
9 bind lb vserver v1 -policyName NOPOLICY-REWRITE -priority 11 -
gotoPriorityExpression END -type
10 RESPONSE -invoke policylabel MODIFY_NODATA
Limitations:
• Rewrite policies are evaluated only if the NetScaler appliance is configured as a DNS proxy server
and there is a cache miss.
• If the Recursion Available (RA) flag in the header is set to YES, the RA flag will not be modified in
the rewrites.
• If the RA flag in the header is set to YES, the CD flag in the header is modified regardless of any
rewrite action.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
String maps
January 6, 2019
Contributed by:
C
You can use string maps to perform pattern matching in all NetScaler features that use the default
policy syntax. A string map is a NetScaler entity that consists of key-value pairs. The keys and values
are strings in either ASCII or UTF-8 format. String comparison uses two new functions, MAP_STRING()
and IS_STRINGMAP_KEY().
A policy configuration that uses string maps performs better than one that does string matching
through policy expressions, and you need fewer policies to perform string matching with a large
number of key-value pairs. String maps are also intuitive, simple to configure, and result in a smaller
configuration.
String maps are similar in structure to pattern sets (a pattern set defines a mapping of index values
to strings; a string map defines a mapping of strings to strings) and the configuration commands
for string maps (commands such as add, bind, unbind, remove, and show) are syntactically similar
to configuration commands for pattern sets. Also, as with index values in a pattern set, each key
in a string map must be unique across the map. The following table illustrates a string map called
url_string_map, which contains URLs as keys and values.
Key Value
/url_1.html http://www.redirect_url_1.com/url_1
.html
/url_2.html http://www.redirect_url_2.com/url_2
.html
/url_3.html http://www.redirect_url_1.com/url_1
.html
The following table describes the two functions that have been introduced to enable string matching
with keys in a string map. String matching is always performed with the keys. Additionally, the follow-
ing functions perform a comparison between the keys in the string map and the complete string that
is returned by the expression prefix. The examples in the descriptions refer to the preceding example.
For completed information about the two functions introduced for enabling string matching with keys
in a string map, see String Map Function table pdf.
You first create a string map and then bind key-value pairs to it. You can create a string map from the
command line interface (CLI) or the GUI.
Example:
Create a string map and bind the key-value pair to the created entity.
Navigate to AppExpert > String Maps, click Add and specify the relevant details.
The following use case involves a responder policy with a redirect action. In the example below, the
first four commands create the string map url_string_map and bind the three key-value pairs used
in the earlier example. After creating the map and binding the key-value pairs, you create a respon-
der action (act_url_redirects) that redirects the client to the corresponding URL in the string map or
to www.default.com. You also configure a responder policy (pol_url_redirects) that checks whether
requested URLs match any of the keys in url_string_map and then performs the configured action.
Finally, you bind the responder policy to the content switching virtual server that receives the client
requests that are to be evaluated.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
URL Sets
Contributed by:
C
This feature enables you to blacklist one million URLs. The section includes the following topics:
• Getting Started
• Using Advanced Policy Expressions for URL Evaluation
• Configuring a URL Set
• URL Pattern Semantics
• Blacklisted URL Categories
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Getting Started
Contributed by:
C
To prevent access to restricted websites, a NetScaler appliance uses a specialized URL matching al-
gorithm. The algorithm uses a URL set that can contain a list of URLs up to one million (1,000,000)
blacklisted entries. Each entry can include metadata that defines URL categories and category groups
as indexed patterns. The appliance can also periodically download URLs of highly sensitive URL sets
managed by internet enforcement agencies (with government websites) or independent internet or-
ganizations such as the Internet Watch Foundation (IWF). Once the URL set is downloaded from a
website and imported into the appliance, the appliance encrypts the URL sets in the appliance (as
required by these agencies) and kept confidential so that the entries are not tampered.
The NetScaler appliance uses advanced policies to determine whether an incoming URL should be
blocked, allowed, or redirected. These policies use advanced expressions to evaluate incoming URLs
against blacklisted entries. An entry can include metadata. For entries that have no metadata, you
might want to use an expression that evaluates the URL on the basis of an exact string match. For
other URLs, you might want to use an expression that evaluates the URL’s metadata, in addition to an
expression that checks for an exact string match.
A URL set enables an Internet Service Provider (ISP) or a Telco customer to enforce government man-
dated safe internet access policies such as:
1. Block access to illegal internet sites (child abuse, drugs, and so on)
2. Safe browsing for children
A NetScaler appliance enables you to periodically download URL sets managed by internet enforce-
ment agencies or independent internet organizations such as IWF (Internet Watch Foundation). The
appliance periodically downloads the list and updates it securely. The list is stored as confidential URL
sets so that it is not tampered or human readable. The periodically downloaded URL set functions as
a blacklisted set for URL evaluation purposes.
If you have a private URL set and the contents of the list are kept confidential and the network ad-
ministrator does not know about the blacklisted URLs present in the list. To make sure if the policy is
configured correctly and the correct list is referenced to evaluate an incoming URL, you configure an
internal URL called Canary URL and add it to the URL set. Using the Canary URL, the administrator can
request through the appliance use the private URL set to ensure it is looked up for every URL request.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
Contributed by:
C
The following table describes the expressions you can use to evaluate incoming URLs with entries in
an URL set.
Expression Operation
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
• Download a URL set once from a specific URL using HTTP and HTTPS supported for the file down-
load.
• Downloading a URL set periodically, using a scheduler that periodically downloads or imports
URL sets for example, IWF URL set. The time interval is set in seconds for example, *http://
10.29.102.200/urls.txt -interval 3600*.
http://10.102.145.135/top10k
http://10.102.145.135/blacklists/audio-video/categorized_av
The imported URL set is further categorized into different categories and category groups in the
database. This is valid only if categories exist in the metadata of the URL set file.
Note: There can be a chance that you might have URL patterns without metadata.
Once you have downloaded the file, it is pushed into the appliance and at this point of interval, you
can update, delete or display file properties. After the file is pushed into the appliance, you can modify
the entries by adding further rows as it remains static.
The imported set is then stored in an encrypted file format on the NetScaler directory. The imported
list contains millions of URL entries. Otherwise, the appliance returns an error message saying that the
value exceeds the limit. If the imported URL set has blacklisted entries with metadata, the metadata
it is detected by the appliance when it is imported.
Once you import a URL set and add it into the appliance, the URL set is available for advanced policies
to identify the correct URL set during incoming URL evaluation. HTTP.REQ.HOSTNAME.APPEND(HTTP.REQ.URL).UR
URL set name>)
2.Updating a URL set on the NetScaler appliance. Once you have pushed the file into the appliance,
at this interval you can manually update a URL file by using command line interface.
3.Exporting a URL set. If you prefer a backup of the URL set, you can export the list of URL patterns
and save a copy of it to a destination URL. Before you export, check whether the URL set is marked as
private. If is marked private, the URL set cannot be exported.
4.Removing a URL set. If you want to delete a URL set of blacklisted entries, you can use the remove
command to delete the URL set from the NetScaler appliance.
5.Displaying a URL set. You can display the properties of a URL set by using the show command.
Example:
1 show urlset
2
3
4 Name: top100 PatternCount: 100 Delimiter:
RowSeparator: Interval: 0
5
6 Done
To import a URL set with meta by using the command line interface
Where,
rowSeparator is a CSV file row separator with default value set as 10.
Interval is the time interval in secs, rounded to the nearest 15 minutes at which the update of urlset
occurs.
CanaryURL is a URL used for testing when contents of the urlset is kept confidential.
Example
Navigate to AppExpert > URL Sets, click Import to download the URL set.
Navigate to AppExpert > URL Sets, click Add to create a URL set file for the downloaded URL set.
Navigate to AppExpert > URL Sets, select a URL set and click Edit to modify.
Navigate to AppExpert > URL Sets, select a URL set and click Update URL Set to update URL set with
the latest modifications made to the file.
Navigate to AppExpert > URL Sets, select a URL set and click Export URL Set to export the URL patterns
in a set to a destination URL and save it in that location.
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
January 6, 2019
Contributed by:
C
The following table shows the URL patterns used for specifying the list of pages you to want to filter.
For example, the pattern, www.example.com/bar will only match the single page www.example.
com/bar. To cover all the pages where the URL starts with www.example.com/bar, you must explic-
itly add a ‘*’ at the end.
For more information, seee Following is the semantics for a URL pattern to match the metadata map-
ping
1.
2. Citrix ADC
3. NetScaler 12.0
4. AppExpert
URL Categories
Contributed by:
C
1 Illegal Activities
2 Illegal Drugs
3 Medication
4 Marijuana
5 Terrorism/Extremists
6 Weapons
7 Hate/Slander
8 Violence/Suicide
9 Advocacy in general
10 Adult/Porn
11 Nudity
12 Sexual Services
13 Adult Search/Links
14 Hacking/Cracking
15 Malware
16 Remote Proxies
46 Side Business
47 Grotesque
48 Special Events
49 Popular Topics
50 Adult Magazine/News
51 Smoking
52 Drinking
53 Alcoholic Products
54 Fetish
55 Sexual Expression(text)
56 Costume Play/Enjoyment
57 Occult
58 Home & Family
59 Professional Sports
60 Sports in general
61 Life Events
62 Travel & Tourism
63 Public Agency Tourism
64 Public Transit
65 Accommodations
66 Music
67 Horoscope/Astrology/Fortune Telling
68 Entertainer/Celebrity
69 Dining/Gourmet
70 Entertainment/Venues/Activities
71 Traditional Religions
72 Religions
73 Politics
74 Advertisements/Banners
75 Sweepstakes/Prizes
76 SPAM
77 News
78 Automotive
79 Business & Commercial
80 Computing & Internet
81 Education
82 Government
83 Health
84 Internet Telephony
85 Military
86 Peer to Peer/Torrents
87 Recreation & Hobbies
88 Reference
89 Search Engines & Portals
90 Sex Education
91 SMS & Mobile Telephony Services
92 Mobile Apps & Publishers
93 Spyware
94 Content Delivery Networks & Infrastructure
95 Kids Sites
96 Swimsuits & Lingerie
97 Arts & Cultural Events
98 Hosting Sites
99 Philanthropy & Non-Profit Organizations
100 Photo Search & Photo Sharing Sites
101 Ringtones
102 Fashion & Beauty
103 Mobile App Stores
133 eLearning
134 Social Networks in General
135 Facebook
136 Facebook: Posting
137 Facebook: Commenting
138 Facebook: Friends
139 Facebook: Photo Upload
140 Facebook: Events
141 Facebook: Apps
142 Facebook: Chat
143 Facebook: Questions
144 Facebook: Video Upload
145 Facebook: Groups
146 Facebook: Games
147 LinkedIn
148 LinkedIn: Updates
149 LinkedIn: Mail
150 LinkedIn: Connections
151 LinkedIn: Jobs
152 Twitter
153 Twitter: Posting
154 Twitter: Mail
155 Twitter: Follow
156 YouTube
157 YouTube: Commenting
158 YouTube: Video Upload
159 YouTube: Sharing
160 Instagram
161 Instagram: Upload
1.
2. Citrix ADC
3. NetScaler 12.0
AppFlow
AppFlow use actions and policies to send records for a selected flow to specific set of collectors. An
AppFlow action specifies which set of collectors will receive the AppFlow records. Policies, which are
based on Advanced expressions can be configured to select flows for which flow records will be sent
to the collectors specified by the associated AppFlow action.
To limit the types of flows, you can enable AppFlow for a virtual server. AppFlow can also provide
statistics for the virtual server.
You can also enable AppFlow for a specific service, representing an application server, and monitor
the traffic to that application server.
Note
In the most common deployment scenario, inbound traffic flows to a Virtual IP address (VIP) on the
NetScaler appliance and is load balanced to a server. Outbound traffic flows from the server to a
mapped or subnet IP address on the NetScaler and from the VIP to the client. A flow is a unidirectional
collection of IP packets identified by the following five tuples: sourceIP, sourcePort, destIP, destPort,
and protocol.
As shown in the figure, the network flow identifiers for each leg of a transaction depend on the direc-
tion of the traffic.
To help the collector link all four flows in a transaction, AppFlow adds a custom transactionID element
to each flow. For application-level content switching, such as HTTP, it is possible for a single client
TCP connection to be load balanced to different backend TCP connections for each request. AppFlow
provides a set of records for each transaction.
• Flow Records
• Templates
Flow Records
AppFlow records contain standard NetFlow or IPFIX information, such as time stamps for the begin-
ning and end of a flow, packet count, and byte count. AppFlow records also contain application-level
information (such as HTTP URLs, HTTP request methods and response status codes, server response
time, and latency), web page performance data (such as page load time, page render time, and time
spent on the page), and database information (such as database protocol, database response status
and database response size). IPFIX flow records are based on templates that need to be sent before
sending flow records.
Templates
AppFlow defines a set of templates, one for each type of flow. Each template contains a set of stan-
dard Information Elements (IEs) and Enterprise-specific Information Elements (EIEs). IPFIX templates
define the order and sizes of the Information Elements (IE) in the flow record. The templates are sent
to the collectors at regular intervals, as described in RFC 5101.
• transactionID
An unsigned 32-bit number identifying an application-level transaction. For HTTP, this corre-
sponds to a request and response pair. All flow records that correspond to this request and
response pair have the same transaction ID. In the most common case, there are four uniflow
records that correspond to this transaction. If the NetScaler generates the response by itself
(served from the integrated cache or by a security policy), there may be only two flow records
for this transaction.
• connectionID
An unsigned 32-bit number identifying a layer-4 connection (TCP or UDP). The NetScaler flows
are usually bidirectional, with two separate flow records for each direction of the flow. This
information element can be used to link the two flows.
For the NetScaler, connectionID is an identifier for the connection data structure to track the
progress of a connection. In an HTTP transaction, for instance, a given connectionID may have
multiple transactionID elements corresponding to multiple requests that were made on that
connection.
• tcpRTT
The round trip time, in milliseconds, as measured on the TCP connection. This can be used as
a metric to determine the client or server latency on the network.
• httpRequestMethod
An 8-bit number indicating the HTTP method used in the transaction. An options template with
the number-to-method mapping is sent along with the template.
• httpRequestSize
• httpRequestURL
• httpUserAgent
• httpResponseStatus
• httpResponseSize
• httpResponseTimeToFirstByte
An unsigned 32-bit number indicating the time taken to receive the first byte of the response.
• httpResponseTimeToLastByte
An unsigned 32-bit number indicating the time taken to receive the last byte of the response.
• flowFlags
• clientInteractionStartTime
Time at which the browser receives the first byte of the response to load any objects of the page
such as images, scripts, and stylesheets.
• clientInteractionEndTime
Time at which the browser received the last byte of response to load all the objects of the page
such as images, scripts, and stylesheets.
• clientRenderStartTime
• clientRenderEndTime
Time at which browser finished rendering the entire page, including the embedded objects.
• dbProtocolName
An unsigned 8-bit number indicating the database protocol. Valid values are 1 for MS SQL and 2
for MySQL.
• dbReqType
An unsigned 8-bit number indicating the database request method used in the transaction. For
MS SQL, valid values are 1 is for QUERY, 2 is for TRANSACTION, and 3 is for RPC. For valid values
for MySQL, see the MySQL documentation.
• dbReqString
• dbRespStatus
An unsigned 64-bit number indicating the status of the database response received from the
web server.
• dbRespLength
• dbRespStatString
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You configure AppFlow in the same manner as most other policy-based features. First, you enable the
AppFlow feature. Then you specify the collectors to which the flow records are sent. After that, you
define actions, which are sets of configured collectors. Then you configure one or more policies and
associate an action to each policy. The policy tells the Citrix ADC appliance to select requests the flow
records of which are sent to the associated action. Finally, you bind each policy either globally or to
specific vservers to put it into effect.
You can further set AppFlow parameters to specify the template refresh interval and to enable the
exporting of httpURL, httpCookie, and httpReferer information. On each collector, you must specify
the Citrix ADC IP address as the address of the exporter.
Note: For information about configuring the Citrix ADC as an exporter on the collector, see the docu-
mentation for the specific collector.
The configuration utility provides tools that help users define the policies and actions that determine
exactly how the Citrix ADC appliance export records for a particular flow to a set of collectors(action.)
The command line interface provides a corresponding set of CLI-based commands for experienced
users who prefer a command line.
Enabling AppFlow
To be able to use the AppFlow feature, you must first enable it.
Navigate to System > Settings, click Configure Advanced Features and select the AppFlow option.
Specifying a Collector
A collector receives AppFlow records generated by the Citrix ADC appliance. To send the AppFlow
records, you must specify at least one collector. By default, the collector listens to IPFIX messages on
UDP port 4739. You can change the default port, when configuring the collector. Similarly, by default,
NSIP is used as the source IP for appflow traffic. You can change this default source IP to a SNIP or MIP
address when configuring a collector. You can also remove unused collectors.
At the command prompt, type the following commands to add a collector and verify the configuration:
Example
At the command prompt, type the following commands to add multiple collectors:
Navigate to System > AppFlow > Collectors, and create the AppFlow collector.
An AppFlow action is a set collectors, to which the flow records are sent if the associated AppFlow
policy matches.
At the command prompt, type the following commands to configure an Appflow action and verify the
configuration:
Example
Navigate to System > AppFlow > Actions, and create the AppFlow action.
After you configure an AppFlow action, you must next configure an AppFlow policy. An AppFlow policy
is based on a rule, which consists of one or more expressions.
Note: For creating and managing AppFlow policies, the configuration utility provides assistance that
is not available at the command line interface.
At the command prompt, type the following command to add an AppFlow policy and verify the con-
figuration:
Example
Navigate to System > AppFlow > Policies, and create the AppFlow policy.
1. In the Add Expression dialog box, in the first list box choose the first term for your expression.
• HTTP
The HTTP protocol. Choose this if you want to examine some aspect of the request that
pertains to the HTTP protocol.
• SSL
The protected Web site(s). Choose this if you want to examine some aspect of the request
that pertains to the recipient of the request.
• CLIENT
The computer that sent the request. Choose this if you want to examine some aspect of
the sender of the request.
When you make your choice, the rightmost list box lists appropriate terms for the next part
of your expression.
2. In the second list box, choose the second term for your expression. The choices depend upon
which choice you made in the previous step, and are appropriate to the context. After you
make your second choice, the Help window below the Construct Expression window (which
was blank) displays help describing the purpose and use of the term you just chose.
3. Continue choosing terms from the list boxes that appear to the right of the previous list box,
or typing strings or numbers in the text boxes that appear to prompt you to enter a value, until
your expression is finished.
To put a policy into effect, you must bind it either globally, so that it applies to all traffic that flows
through the Citrix ADC, or to a specific virtual server, so that the policy applies only to the traffic related
to that virtual server.
When you bind a policy, you assign it a priority. The priority determines the order in which the policies
you define are evaluated. You can set the priority to any positive integer.
In the Citrix ADC operating system, policy priorities work in reverse order—the higher the number, the
lower the priority. For example, if you have three policies with priorities of 10, 100, and 1000, the policy
assigned a priority of 10 is performed first, then the policy assigned a priority of 100, and finally the
policy assigned an order of 1000.
You can leave yourself plenty of room to add other policies in any order, and still set them to evaluate
in the order you want, by setting priorities with intervals of 50 or 100 between each policy when you
globally bind it. You can then add additional policies at any time without having to change the priority
of an existing policy.
At the command prompt, type the following command to globally bind an AppFlow policy and verify
the configuration:
Example
To bind an AppFlow policy to a specific virtual server by using the command line interface
At the command prompt, type the following command to bind an appflow policy to a specific virtual
server and verify the configuration:
Example
Navigate to System > AppFlow, click AppFlow policy Manager and select the relevant Bind Point (De-
fault Global) and Connection Type, and then bind the AppFlow policy.
To bind an AppFlow policy to a specific virtual server by using the configuration utility
Navigate to Traffic Management > Load Balancing > Virtual Servers, select the virtual server, and click
Policies, and bind the AppFlow policy.
If you want to monitor only the traffic through certain virtual servers, enable AppFlow specifically for
those virtual servers. You can enable AppFlow for load balancing, content switching, cache redirec-
tion, SSL VPN, GSLB, and authentication virtual servers.
To enable AppFlow for a virtual server by using the command line interface
Example
Navigate to Traffic Management > Content Switching > Virtual Servers, select the virtual server, and
enable AppFlow Logging option.
You can enable AppFlow for services that are to be bound to the load balancing virtual servers.
Example
Navigate to Traffic Management > Load Balancing > Services, select the service, and enable AppFlow
Logging option.
You can set AppFlow parameters to customize the exporting of data to the collectors.
At the command prompt, type the following commands to set the AppFlow parameters and verify the
settings:
Example
Navigate to System > AppFlow, click Change AppFlow Settings, and specify relevant AppFlow param-
eters.
The following example illustrates the procedure for configuring AppFlow for DataStream using the
command line interface.
When the Citrix ADC appliance receives a database request, the appliance evaluates the request
against a configured policy. If a match is found, the details are sent to the AppFlow collector
configured in the policy.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The EdgeSight Monitoring application provides web page monitoring data with which you can monitor
the performance of various Web applications served in a Citrix ADC environment. You can now export
this data to AppFlow collectors to get an in-depth analysis of the web page applications. AppFlow,
which is based on IPFIX standard, provides more specific information about web application perfor-
mance than does EdgeSight monitoring alone.
You can configure both load balancing and content switching virtual servers to export EdgeSight Mon-
itoring data to AppFlow collectors. Before configuring a virtual server for AppFlow export, associate
an Appflow action with the EdgeSight Monitoring responder policy.
• Page Load Time. Elapsed time, in milliseconds, from when the browser starts to receive the
first byte of a response until the user starts to interact with the page. At this stage, all the page
content might not be loaded.
• Page Render Time.Elapsed time, in milliseconds, from when the browser receives the first byte
of response until either all page content has been rendered or the page load action has timed
out.
• Time Spent on the Page. Time spent by users on a page. Represents the period of time from
one page request to the next one.
AppFlow transmits the performance data by using the Internet Protocol Flow Information eXport (IP-
FIX) format, which is an open Internet Engineering Task Force (IETF) standard defined in RFC 5101.
The AppFlow templates use the following enterprise-specific Information Elements (EIEs) to export
the information:
• Client Load End Time. Time at which the browser received the last byte of a response to load
all the objects of the page such as images, scripts, and stylesheets.
• Client Load Start Time.Time at which the browser receives the first byte of the response to load
any objects of the page such as images, scripts, and stylesheets.
• Client Render End Time. Time at which browser finished rendering the entire page, including
the embedded objects.
• Client Render Start Time. Time at which the browser started rendering the page.
Before associating the AppFlow action with the AppFlow policy, verify that the following prerequisites
have been met:
To export the web page performance data to the AppFlow collector, you must associate an AppFlow
action with the EdgeSight Monitoring responder policy. An AppFlow action specifies which set of col-
lectors receive the traffic.
To associate an AppFlow action with the EdgeSight Monitoring Responder policy by using the
command line interface
Example
To associate an AppFlow action with the EdgeSight Monitoring Responder policy by using the
configuration utility
To export EdgeSight statistics information from a virtual server to the AppFlow collector, you must
associate an AppFlow action with the virtual server.
To associate an AppFlow action with a Load Balancing or Content Switching virtual server by
using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers. You can also navigate to
Traffic Management > Content Switching > Virtual Servers.
2. In the details pane, select a virtual server, or multiple virtual servers, and then click Enable
EdgeSight Monitoring.
3. In the Enable EdgeSight Monitoring dialog box, select the Export EdgeSight statistics to
Appflow check box.
4. From the Appflow Action drop-down list, select the AppFlow action. The AppFlow action de-
fines the list of AppFlow collectors to which it exports EdgeSight Monitoring statistics. If you
have selected multiple load balancing virtual servers, the same AppFlow Action will be asso-
ciated with the responder policies bound to them. You can later change the AppFlow Action
configured for each of the selected Load Balancing virtual server individually, if required.
5. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
When a network disruption or a device failover occurs during an ICA session, session reconnection can
use one of two mechanisms: Session Reliability or Auto Client Reconnect.
Session Reliability, the preferred mode, is a seamless experience for the user. The disruption is barely
noticeable for brief network interruptions.
Auto Client Reconnect, the fallback option, involves restarting the client. This mechanism is disrup-
tive for the user and is not always supported.
Receivers can now reconnect their ICA sessions seamlessly using the ICA Session Reliability feature,
when HDX Insight is enabled.
This feature works both in standalone and in a NetScaler HA pair configuration and even when a
NetScaler failover happens.
Note
• NetScaler appliances should be running on software version 11.1 build 49.16 or later.
• You should not Enable or disable Session Reliability mode when the NetScaler appliances
have active connections.
• Enabling or Disabling the feature when connections are still active causes HDX Insight to
stop parsing those sessions after a failover occurs and result in loss of information about
the sessions.
• Session Reliability on a high availabilty setup is enabled by default for NetScaler software
version 11.1 49.16 or later. Session reliability is supported on a high availability setup only if
both the nodes of the setup run the same build (for example, release 11.1 build 53). In other
words, session reliability is not supported on a high availability setup if both the nodes run
different builds (for example, one node has release 11.1 build 53 whereas the other has re-
lease 11.1 build 56).
1. At the command line, use the default system administrator credentials to log on to the system.
2. To enable Session Reliability on HA failover, at the prompt, type: set ica parameter EnableSRon-
HAFailover YES
3. To disable Session Reliability on HA failover, at the prompt, type: set ica parameter EnableSRon-
HAFailover NO
1. In a web browser, type the IP address of the primary NetScaler instance in the HA pair (for ex-
ample, http://192.168.100.1).
2. In User Name and Password, enter the administrator credentials.
3. On the Configuration tab, navigate to System > Settings, and click Change ICA Parameters.
Limitations
• Enabling this feature will result in increased bandwidth consumption which is due to ICA com-
pression being turned off by the feature, and the extra traffic between the primary and sec-
ondary nodes to keep them in sync.
• This feature is supported in Active-Passive mode only. Active-Active mode is not currently sup-
ported.
• When HDX Insight is enabled, and Session Reliability on HA knob is set to NO, only ACR reconnect
mode is supported in NetScaler high availability failover scenario. The HA knob does not disable
Session Reliability if HDX Insight is disabled.
EnableSRonHAFailover Yes
Status (Default) EnableSRonHAFailover No
HDX Insight Enabled Session reconnect for ICA Session reconnect for ICA
Sessions works Sessions does not work
HDX Insight disabled Session reconnect for ICA Session reconnect for ICA
Sessions works Sessions works
Points to note
• Session Reliability for ICA sessions works out of the box with Gateway.
• Session Reliability for ICA sessions does not work ONLY when both the following conditions
are met:
– HDX Insight is enabled
– EnableSRonHAFailover is set to NO.
• Setting EnableSRonHAFailover knob to either YES or NO does not make any difference,
when HDX Insight is disabled.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Application Firewall
Contributed by:
C
The following topics cover installation and configuration of the Citrix Application Firewall feature.
Logs, Statistics, and Reports How to access and use the Web App Firewall
logs, the statistics, and the reports to assist in
configuring the Web App Firewall.
The Citrix Application Firewall offers easy to configure options to meet a wide range of application se-
curity requirements. Web App Firewall profiles, which consist of sets of security checks, can be used
to protect both the requests and the responses by providing deep packet-level inspections. Each pro-
file includes an option to select basic protections or advanced protections. Some protections might
require use of other files. For example, xml validation checks might require WSDL or schema files. The
profiles can also use other files, such as signatures or error objects. These files can be added locally,
or they can be imported ahead of time and saved on the appliance for future use. They can be shared
by multiple profiles.
Profiles work in conjunction with the Web App Firewall policies. Each policy identifies a type of traffic,
and that traffic is inspected for the security check violations specified in the profile that is associated
with the policy. The policies can have different bind points, which determine the scope of the policy.
For example, a policy that is bound to a specific virtual server is invoked and evaluated for only the
traffic flowing through that virtual server. The policies are evaluated in the order of their designated
priorities, and the first one that matches the request or response is applied.
• Quick Deployment of Web App Firewall Protection
You can use the following procedure for quick deployment of Web App Firewall security:
1. Add an appfw profile and select the appropriate type (html, xml, web2.0) for the security
requirements of the application.
2. Select the required level of security (basic or advanced).
3. Add or import the required files, such as signatures or WSDL.
4. Configure the profile to use the files, and make any other necessary changes to the default
settings.
5. Add an appfw policy for this profile.
6. Bind the policy to the target bind point and specify the priority.
• Web App Firewall entities
Following are brief overviews of the Web App Firewall entities. For details, see the Web App
Firewall Guide.
Profile—An Web App Firewall profile specifies what to look for and what to do. It inspects
both the request and the response to determine which potential security violations should be
checked and what actions should be taken when processing a transaction. A profile can pro-
tect an HTML, XML or HTML and XML payload. Depending on the security requirements of the
application, you can create either a basic or an advanced profile. A basic profile can protect
against known attacks. If higher security is required, you can deploy an advanced profile to al-
low controlled access to the application resources, blocking zero day attacks. However, a basic
profile can be modified to offer advanced protections, and vice versa. Multiple action choices
(for example, block, log, learn, and transform) are available. Advanced security checks might
use session cookies and hidden form tags for controlling and monitoring the client connections.
Web App Firewall profiles can learn the triggered violations and suggest the relaxation rules.
Basic Protections—A basic profile includes a preconfigured set of Start URL and Deny URL re-
laxation rules. These relaxation rules determine which requests should be allowed and which
should be denied. Incoming requests are matched against these lists and the configured actions
are applied. This allows the user to be able to secure applications with minimal configuration
for relaxation rules. The Start URL rules protect against forceful browsing. Known web server
vulnerabilities that are exploited by hackers can be detected and blocked by enabling a set of de-
fault Deny URL rules. Commonly launched attacks, such as Buffer Overflow, SQL, or Cross-site
scripting can also be easily detected.
Advanced Protections—As the name indicates, advanced protections are used for applications
that have higher security requirements. Relaxation rules are configured to allow access to only
specific data and block the rest. This positive security model mitigates unknown attacks, which
might not be detected by basic security checks. In addition to all the basic protections, an ad-
vanced profile keeps track of a user session by controlling the browsing, checking for cookies,
specifying input requirements for various form fields, and protecting against tampering of forms
or cross-site request forgery attacks. Learning, which observes the traffic and deploys the ap-
propriate relaxations, is enabled by default for many security checks. Although easy to use,
advanced protections require due consideration, because they offer tighter security but also
require more processing and do not allow use of caching, which can affect performance.
Import—Import functionality is useful when Web App Firewall profiles need to use external files,
that is, files hosted on an external or internal web server, or that have to be copied from a local
machine. Importing a file and storing it on the appliance is very useful, especially in situations
where you have to control access to external websites, or where compilation takes a long time,
large files have to be synced across HA deployments, or you can reuse a file by copying it across
multiple devices. For example:
– <WSDLs hosted on external web servers can be imported locally before blocking access to
external websites.
– <Large signature files generated by an external scan tool such as Cenzic can be imported
and precompiled, using schema on the Citrix appliance.
– <A customized HTML or XML error page can be imported from an external web server or
copied from a local file.
Signatures—Signatures are very powerful, because they use pattern matching to detect mali-
cious attacks and can be configured to check both the request and the response of a transaction.
They are a preferred option when a customizable security solution is needed. Multiple choices
(for example, block, log, learn, and transform) are available for the action to take when a signa-
ture match is detected. The Web App Firewall has a built-in default signature object consisting of
more than 1,300 signature rules, with an option to get the latest rules by using the auto-update
feature. Rules created by other scan tools can also be imported. The signature object can be
customized by adding new rules, which can work in conjunction with the other security checks
specified in the Web App Firewall profile. A signature rule can have multiple patterns and can
flag a violation only when all the patterns are matched, thereby avoiding false positives. Careful
selection of a literal fastmatch pattern for a rule can significantly optimize processing time.
Policies—Web App Firewall Policies are used to filter and separate the traffic into different types.
This provides the flexibility to implement different levels of security protections for the applica-
tion data. Access to highly sensitive data can be directed to advanced security-check inspec-
tions, while less sensitive data is protected by basic-level security inspections. Policies can also
be configured to bypass security-check inspection for harmless traffic. Higher security requires
more processing, so careful design of the policies can provide desired security along with opti-
mized performance. The priority of the policy determines the order in which it is evaluated, and
its bind point determines the scope of its application.
Highlights
1. <Ability to secure a wide range of applications by protecting different types of data, implement-
ing the right level of security for different resources, and still getting maximum performance.
2. Flexibility to add or modify a security configuration. You can tighten or relax security checks by
enabling or disabling basic and advanced protections.
3. Option to convert an HTML profile to an XML or Web2.0 (HTML+XML) profile and vice-versa, pro-
viding the flexibility to add security for different types of payload.
4. Easily deployed actions to block attacks, monitor them in logs, collect statistics, or even trans-
form some attack strings to render them harmless.
5. Ability to detect attacks by inspecting incoming requests, and to prevent leakage of sensitive
data by inspecting the responses sent by the servers.
6. Capability to learn from the traffic pattern to get recommendations for easily editable relaxation
rules that can be deployed to allow exceptions.
7. Hybrid security model that applies the power of customizable signatures to block attacks that
match specified patterns, and provides the flexibility to use the positive-security-model checks
for basic or advanced security protections.
8. Availability of comprehensive configuration reports, including information about PCI-DSS com-
pliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
March 8, 2019
Contributed by:
C
Q: Why is NetScaler App Firewall the preferred choice for securing applications?
**With the following features, the NetScaler App App Firewall offers a comprehensive security solu-
tion:
• Hybrid security model: NetScaler hybrid security model allows you to take advantage of both
a positive security model and a negative security model to come up with a configuration ideally
suited for your applications.
– Positive security model protects against Buffer Overflow, CGI-BIN Parameter Manipula-
tion, Form/Hidden Field Manipulation, Forceful Browsing, Cookie or Session Poisoning,
Broken ACLs, Cross-Site Scripting (XSS), Command Injection, SQL Injection, Error Trigger-
ing Sensitive Information Leak, Insecure Use of Cryptography, Server Misconfiguration,
Back Doors and Debug Options, Rate-Based Policy Enforcement, Well Known Platform Vul-
nerabilities, Zero-Day Exploits, Cross Site Request Forgery (CSRF), and leakage of Credit
Card and other sensitive data.
– Negative security model uses a rich set signatures to protect against L7 and HTTP applica-
tion vulnerabilities. The App Firewall is integrated with several third party scanning tools,
such as those offered by Cenzic, Qualys, Whitehat, and IBM. The built-in XSLT files allow
easy importation of rules, which can be used in conjunction with the native-format Snort
based rules. An auto-update feature gets the latest updates for new vulnerabilities.
The positive security model might be the preferred choice for protecting applications that have a high
need for security, because it gives you the option to fully control who can access what data. You allow
only what you want and block the rest. This model includes a built-in security check configuration,
which is deployable with few clicks. However, keep in mind that the tighter the security, the greater
the processing overhead.
The negative security model might be preferable for customized applications. The signatures allow
you to combine multiple conditions, and a match and the specified action are triggered only when
all the conditions are satisfied. You block only what you don’t want and allow the rest. A specific
fast-match pattern in a specified location can significantly reduce processing overhead to optimize
performance. The option to add your own signature rules, based on the specific security needs of
your applications, gives you the flexibility to design your own customized security solutions.
• Request as well as response side detection and protection: You can inspect the incoming
requests to detect any suspicious behavior and take appropriate actions, and you can check
the responses to detect and protect against leakage of sensitive data.
• Rich set of built-in protections for HTML, XML and JSON payloads: The App Firewall offers 19
different security checks. Six of them (such as Start URL and Deny URL) apply to both HTML and
XML data. Five checks (such as Field Consistency and Field Format) are specific to HTML, and
eight (such as XML Format and Web Service Interoperability) are specific to XML payloads. This
feature includes a rich set of actions and options. For example, URL Closure enables you to con-
trol and optimize the navigation through your website, to safeguard against forceful browsing
without having to configure relaxation rules to allow each and every legitimate URL. You have
the option to remove or x-out the sensitive data, such as credit-card numbers, in the response.
Be it SOAP Array attack protection, XML denial of Service (XDoS), WSDL scan prevention, Attach-
ment check, or any number of other XML attacks, you have the comfort of knowing that you have
an ironclad shield protecting your data when your applications are protected by the App Fire-
wall. The signatures allow you to configure rules using XPATH-Expressions to detect violations
in the body as well as the header of a JSON payload.
• GWT: Support for protecting Google Web Toolkit applications to safeguard against SQL, XSS and
Form Field Consistency check violations.
• Java-free, user friendly graphical user interface (GUI): An intuitive GUI and preconfigured
security checks make it easy to deploy security by clicking a few buttons. A wizard prompts and
guides you to create the required elements, such as profiles, policies, signatures, and bindings.
The HTML5 based GUI is free of any Java dependency. It’s performance is significantly better
than that of the older, Java based versions.
• Easy to Use and automatable CLI: Most of the configuration options that are available in GUI
are also available in the command line interface (CLI). The CLI commands can be executed by a
batch file and are easy to automate.
• Support for REST API: The NetScaler NITRO protocol supports a rich set of REST API’s to auto-
mate App Firewall configuration and collect pertinent statistics for ongoing monitoring of secu-
rity violations.
• Learning: The App Firewall’s ability to learn by monitoring traffic to fine tune security is very
user friendly. The learning engine recommends rules, which makes it easy to deploy relaxations
without proficiency in regular expressions.
• RegEx editor support: Regular expression offer an elegant solution to the dilemma of want-
ing to consolidate rules and yet optimize search. You can capitalize on the power of regular
expressions to configure URLs, field names, signature patterns, and so on. The rich built-in GUI
RegEx editor offers you a quick reference for the expressions and provides a convenient way to
validate and test your RegEx for accuracy.
• Customized error page: Blocked requests can be redirected to an error URL. You also have
the option to display a customized error object that uses supported variables and Citrix default
syntax (advanced PI expressions) to embed troubleshooting information for the client.
• PCI-DSS, stats, and other violation reports: The rich set of reports makes it easy to meet the
PCI-DSS compliance requirement, gather stats about traffic counters, and view violation reports
for all profiles or just one profile.
• Logging and click-to-rule from log: Detailed logging is supported for native as well as CEF for-
mat. The App Firewall offers you the ability to filter targeted log messages in the syslog viewer.
You can select a log message and deploy a corresponding relaxation rule by a simple click of a
button. You have the flexibility to customize log messages and also have support for generating
web logs. For additional details, see App Firewall Logstopic.
• Include violation logs in trace records: The ability to include log messages in the trace records
makes it very easy to debug unexpected behavior such as reset and block.
• Cloning: The useful Import/Export profile option allows you to clone the security configuration
from one NetScaler appliance to others. Export learned data options make it easy to export
the learned rules to an Excel file. You can then get them reviewed and approved by application
owner before applying them.
• Sessionless security checks: Deploying sessionless security checks can help you reduce the
memory footprint and expedite the processing.
• Interoperability with other NetScaler features: The App Firewall works seamlessly with other
NetScaler features, such as rewrite, URL transformation, integrated caching, CVPN, and rate lim-
iting.
• Support of PI expressions in policies: You can leverage the power of advanced PI expressions
to design policies to implement different levels of security for different parts of your application.
• Support for IPv6: The App Firewall supports both IPv4 and IPv6 protocols.
• Geolocation based security protection: You have the flexibility of using Citrix default syntax
(PI Expressions) for configuring location based policies, which can be used in conjunction with a
built-in location database to customize firewall protection. You can identify the locations from
which malicious requests originate, and enforce the desired level of security-check inspections
for requests that originate from a specific geographical location.
• Performance: Request-side streaming significantly improves performance. As soon as a field
is processed, the resulting data is forwarded to the back end while evaluation continues for the
remaining fields. The improvement in processing time is especially significant when handling
large posts.
• Other security features: The App Firewall has several other security knobs that can help ensure
the security of your data. For example, the Confidential Field lets you block leakage of sensitive
information in the log messages, and Strip HTML Comment allows you to remove the HTML
comments from the response before forwarding it to the client. Field Types can be used to
specify what inputs are allowed in the forms submitted to your application.
Do the following:
• Add an App Firewall profile and select the appropriate type (html, xml, web2.0) for the security
requirements of the application.
• Select the required level of security (basic or advanced).
• Add or import the required files, such as signatures or WSDL.
• Configure the profile to use the files, and make any other necessary changes to the default set-
tings.
• Add an App Firewall policy for this profile.
• Bind the policy to the target bind point and specify the priority.
The App Firewall profile offers protection for both HTML and XML payloads. Depending on the need
of your application, you can choose either a HTML profile or XML profile. If your application supports
both HTML and XML data, you can choose a Web2.0 profile.
Q: What is the difference between basic and advanced profiles? How do I decide which
one I need?
The decision to use a basic or an advance profile depends on the security need of your application. A
basic profile includes a preconfigured set of Start URL and Deny URL relaxation rules. These relaxation
rules determine which requests are allowed and which are denied. Incoming requests are matched
with the preconfigured rules, and the configured actions are applied. The user can secure applications
with minimal configuration of relaxation rules. The Start URL rules protect against forceful browsing.
Known web server vulnerabilities that are exploited by hackers can be detected and blocked by en-
abling a set of default Deny URL rules. Commonly launched attacks, such as Buffer Overflow, SQL, or
Cross-Site Scripting can also be easily detected.
As the name indicates, advanced protections are for applications that have higher security require-
ments. Relaxation rules are configured to allow access to only specific data and block the rest. This
positive security model mitigates unknown attacks, which might not be detected by basic security
checks. In addition to all the basic protections, an advanced profile keeps track of a user session by
controlling the browsing, checking for cookies, specifying input requirements for various form fields,
and protecting against tampering of forms or Cross-Site Request Forgery attacks. Learning, which
observes the traffic and recommends the appropriate relaxations, is enabled by default for many se-
curity checks. Although easy to use, advanced protections require due consideration, because they
offer tighter security but also require more processing. Some advance security checks do not allow
use of caching, which can affect performance.
Keep the following points in mind when deciding whether to use basic or advanced profiles:
• Basic and advanced profiles are just starting templates. You can always modify the basic profile
to deploy advanced security features, and vice versa.
• Advanced security checks require more processing and can affect performance. Unless your
application needs advanced security, you might want to start with a basic profile and tighten
the security as required for your application.
• You do not want to enable all security checks unless your application needs it.
Q: What is a policy? How do I select the bind point and set the priority?
App Firewall policies can help you sort your traffic into logical groups for configuring different levels
of security implementation. Carefully select the bind points for the policies to determine which traffic
is matched against which policy. For example, if you want every incoming request to be checked for
SQL/XSS attacks, you can create a generic policy and bind it globally. Or, if you want to apply more
stringent security checks to the traffic of a virtual server hosting applications that contain sensitive
data, you can bind a policy to that virtual server.
Careful assignment of priorities can enhance the traffic processing. You want to assign higher priori-
ties to more specific policies and lower priorities to generic policies. Note that the higher the number,
the lower the priority. A policy with a priority of 10 is evaluated before a policy that has a priority of
15.
You can apply different levels of security for different kinds of contents, e.g. requests for static objects
like images and text can be by-passed by using one policy and requests for other sensitive contents
can be subjected to a much stringent check by using a second policy.
The App Firewall makes it very easy to design the right level of security for your web-site. You can have
multiple App Firewall policies, bound to different App Firewall profiles, to implement different levels
of security-check inspections for your applications. You can initially monitor the logs to observe what
security threats are being detected and which violations are being triggered. You can either manually
add the relaxation rules or take advantage of the App Firewall’s recommended learned rules to deploy
the required relaxations to avoid false positives.
The NetScaler App Firewall offers visualizer support in GUI, which makes rule management very easy.
You can easily view all the data on one screen, and take action on several rules with one click. The
biggest advantage of the visualizer is that it recommends regular expressions to consolidate several
rules. You can select a subset of the rules, basing your selection on the delimiter and Action URL.
Visualizer support is available for viewing 1) learned rules and 2) relaxation rules.
1) The visualizer for learned rules offers the option to edit the rules and deploy them as relaxations.
You can also skip (ignore) rules.
2) The visualizer for deployed relaxations offers you the option to add a new rule or edit an existing
one. You can also enable or disable a group of rules by selecting a node and clicking the Enable or
Disable button in the relaxation visualizer.
A signature is an object that can have multiple rules. Each rule consists of one or more patterns that
can be associated with a specified set of actions. The App Firewall has a built-in default signature
object consisting of more than 1,300 signature rules, with an option to get the latest rules by using the
auto-update feature to get protection against new vulnerabilities. Rules created by other scan tools
can also be imported.
Signatures are very powerful because they use pattern matching to detect malicious attacks and can
be configured to check both the request and the response of a transaction. They are a preferred option
when a customizable security solution is needed. Multiple action choices (for example, block, log,
learn, and transform) are available for when a signature match is detected. The default signatures
cover rules to protect different types of applications, such as web-cgi, web-coldfusion, web-frontpage,
web-iis, web-php, web-client, web-activex, web-shell-shock, and web-struts. To match the needs of
your application, you can select and deploy the rules belonging to a specific category.
Signature-usage tips:
• You can just make a copy of the default signature object and modify it to enable the rules you
need and configure the actions you want.
• The signature object can be customized by adding new rules, which can work in conjunction
with other signature rules.
• The signature rules can also be configured to work in conjunction with the security checks spec-
ified in the App Firewall profile. If a match indicating a violation is detected by a signature as
well as a security check, the more restrictive action is the one that gets enforced.
• A signature rule can have multiple patterns and be configured to flag a violation only when all
the patterns are matched, thereby avoiding false positives.
• Careful selection of a literal fast-match pattern for a rule can significantly optimize processing
time.
The App Firewall is fully integrated into the NetScaler appliance and works seamlessly with other fea-
tures. You can configure maximum security for your application by using other NetScaler security
features in conjunction with the App Firewall. For example, AAA-TM can be used to authenticate the
user, check the user’s authorization to access the content, and log the accesses, including invalid login
attempts. Rewrite can be used to modify the URL or to add, modify or delete headers, and Respon-
der can be used to deliver customized content to different users. You can define the maximum load
for your website by using Rate Limiting to monitor the traffic and throttle the rate if it is too high.
HTTP Denial-of-Service (DoS) protection can help distinguish between real HTTP clients and mali-
cious DoS clients. You can narrow the scope of security-check inspection by binding the App Firewall
policies to virtual servers, while still optimizing the user experience by using the Load Balancing fea-
ture to manage heavily used applications. Requests for static objects such as images or text can bypass
security check inspection, taking advantage of integrated caching or compression to optimize the
bandwidth usage for such content.
Q: How is the payload processed by the App Firewall and the other NetScaler features?
A diagram showing details of the L7 packet flow in a NetScaler appliance is available in the Processing
Order of Features section at Getting Started topic.
Now that you know the advantages of using the state-of-the-art security protections of the NetScaler
App Firewall, you might want to collect additional information that can help you design the optimal
solution for your security needs. Citrix recommends that you do the following:
• Know your environment: Knowing your environment will help you to identify the best secu-
rity protection solution (signatures, security checks, or both) for your needs. Before you begin
configuration, you should gather the following information.
– OS: What kind of OS (MS Windows, Linux, BSD, Unix, others) do you have?
– Web Sever: What web server (IIS, Apache or NetScaler Enterprise Server) are you running?
– Application: What type of applications are running on your application server (for exam-
ple, ASP.NET, PHP, Cold Fusion, ActiveX, FrontPage, Struts, CGI, Apache Tomcat, Domino,
and WebLogic)?
– Do you have customized applications or off-the-shelf (for example, Oracle, SAP) applica-
tions? What version you are using?
– SSL: Do you require SSL? If so, what key size (512, 1024, 2048, 4096) is used for signing
certificates?
– Traffic Volume: What is the average traffic rate through your applications? Do you have
seasonal or time-specific spikes in the traffic?
– Server Farm: How many servers do you have? Do you need to use load balancing?
– Database: What type of database (MS-SQL, MySQL, Oracle, Postgres, SQLite, nosql,
Sybase, Informix etc.) do you use?
– DB Connectivity: What kind of data base connectivity do you have (DSN, per-file connec-
tion string, single file connection string) and what drivers are used?
• Identify your security needs: You might want to evaluate which applications or specific data
need maximum security protection, which ones are less vulnerable, and the ones for which se-
curity inspection can safely be bypassed. This will help you in coming up with an optimal config-
uration, and in designing appropriate policies and bind points to segregate the traffic. For exam-
ple, you might want to configure a policy to bypass security inspection of requests for static web
content, such as images, MP3 files, and movies, and configure another policy to apply advanced
security checks to requests for dynamic content. You can use multiple policies and profiles to
protect different contents of the same application.
• License requirement: Citrix offers a unified solution to optimize the performance of your appli-
cation by taking advantage of a rich set of features such as load balancing, content switching,
caching, compression, responder, rewrite, and content filtering, to name a few. Identifying the
features that you want can help you decide which license you need.
• Install and baseline a NetScaler appliance: Create a virtual server and run test traffic through
it to get an idea of the rate and amount of traffic flowing through your system. This information
will help you to identify your capacity requirement and select the right appliance (VPX, MPX, or
SDX).
• Deploy the App Firewall: Use the App Firewall wizard to proceed with a simple security config-
uration. The wizard walks you through several screens and prompts you to add a profile, policy,
signature, and security checks.
– Profile: Select a meaningful name and the appropriate type (HTML, XML or WEB 2.0) for
your profile. The policy and signatures will be auto-generated using the same name.
– Policy: The auto-generated policy has the default Expression (true), which selects all traf-
fic and is bound globally. This is a good starting point unless you have in mind a specific
policy that you want to use.
– Protections: The wizard helps you take advantage of the hybrid security model, in which
you can use the default signatures offering a rich set of rules to protect different types
of applications. Simple edit mode allows you to view the various categories (CGI, Cold
Fusion, PHP, etc.). You can select one or more categories to identify a specific set of rules
applicable to your application. Use the Action option to enable all the signature rules in
the selected categories. Make sure that blocking is disabled, so that you can monitor the
traffic before tightening the security. Click Continue. In the Specify Deep protections
pane, you can make changes as needed to deploy the security check protections. In most
cases, basic protections are sufficient for initial security configuration. Run the traffic for
a while to collect a representative sample of the security-inspection data.
– Tightening the security: After deploying App Firewall and observing the traffic for a while,
you can start tightening the security of your applications by deploying relaxations and then
enabling blocking. Learning, Visualizer, and Click to deploy rules are useful features
that make it very easy to tweak your configuration to come up with just the right level
of relaxation. At this point, you can also change the policy expression and/or configure
additional policies and profiles to implement desired levels of security for different types
of content.
– Debugging: If you see unexpected behavior of your application, the App Firewall offers
various options for easy debugging:
* Log. If legitimate requests are getting blocked, your first step is to check the ns.log file
to see if any unexpected security-check violation is being triggered.
* Disable feature. If you do not see any violations but are still seeing unexpected be-
havior, such as an application resetting or sending partial responses, you can disable
the App Firewall feature for debugging. If the issue persists, it rules out the App Fire-
wall as a suspect.
* Trace records with log messages. If the issue appears to be App Firewall related and
needs closer inspection, you have the option to include security violation messages in
an nstrace. You can use “Follow TCP stream” in the trace to view the details of the indi-
vidual transaction, including headers, payload, and the corresponding log message,
together on the same screen. Details of how to use this functionality are available at
Appendixes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Introduction
Contributed by:
C
The NetScaler App App Firewall prevents security breaches, data loss, and possible unauthorized mod-
ifications to web sites that access sensitive business or customer information. It does so by filtering
both requests and responses, examining them for evidence of malicious activity, and blocking those
that exhibit such activity. Your site is protected not only from common types of attacks, but also from
new, as yet unknown attacks. In addition to protecting web servers and web sites from unauthorized
access and misuse by hackers and malicious programs, the App Firewall provides protection against
security vulnerabilities in legacy CGI code or scripts, other web frameworks, web server software, and
the underlying operating systems.
The NetScaler App Firewall is available as a stand-alone appliance, or as a feature on a NetScaler vir-
tual appliance (VPX). In the App Firewall documentation, the term NetScaler refers to the platform on
which the App Firewall is running, regardless of whether that platform is a dedicated firewall appli-
ance, a NetScaler on which other features have also been configured, or a NetScaler VPX.
To use the App Firewall, you must create at least one security configuration to block connections that
violate the rules that you set for your protected web sites. The number of security configurations
that you might want to create depends on the complexity of your web site. In some cases, a single
configuration is sufficient. In other cases, particularly those that include interactive web sites, web
sites that access database servers, online stores with shopping carts, you might need several different
configurations to best protect sensitive data without wasting significant effort on content that is not
vulnerable to certain types of attacks. You can often leave the defaults for the global settings, which
affect all security configurations, unchanged. However, you can change the global settings if they
conflict with other parts of your configuration or you prefer to customize them.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Web application security is network security for computers and programs that communicate by using
the HTTP and HTTPS protocols. This is an extremely broad area in which security flaws and weak-
nesses abound. Operating systems on both servers and clients have security issues and are vulnerable
to attack. Web server software and web site enabling technologies such as CGI, Java, JavaScript, PERL
and PHP have underlying vulnerabilities. Browsers and other client applications that communicate
with web-enabled applications also have vulnerabilities. Web sites that use any technology but the
simplest of HTML, including any site that allows interaction with visitors, often have vulnerabilities of
their own.
In the past, a breach in security was often just an annoyance, but today that is seldom the case. For
example, attacks in which a hacker gained access to a web server and made unauthorized modifica-
tions to (defaced) a web site used to be common. They were usually launched by hackers who had
no motivation beyond demonstrating their skills to fellow hackers or embarrassing the targeted per-
son or company. Most current security breaches, however, are motivated by a desire for money. The
majority attempt to accomplish one or both of the following goals: to obtain sensitive and potentially
valuable private information, or to obtain unauthorized access to and control of a web site or web
server.
Certain forms of web attacks focus on obtaining private information. These attacks are often possible
even against web sites that are secure enough to prevent an attacker from taking full control. The in-
formation that an attacker can obtain from a web site can include customer names, addresses, phone
numbers, social security numbers, credit card numbers, medical records, and other private informa-
tion. The attacker can then use this information or sell it to others. Much of the information obtained
by such attacks is protected by law, and all of it by custom and expectation. A breach of this type
can have extremely serious consequences for customers whose private information is compromised.
At best, these customers will have to exercise vigilance to prevent others from abusing their credit
cards, opening unauthorized credit accounts in their name, or appropriating their identities outright
(identity theft). At worst, the customers may face ruined credit ratings or even be blamed for criminal
activities in which they had no part.
Other web attacks are aimed at obtaining control of (or compromising) a web site or the server on
which it operates, or both. A hacker who gains control of a web site or server can use it to host unau-
thorized content, act as a proxy for content hosted on another web server, provide SMTP services to
send unsolicited bulk email, or provide DNS services to support such activities on other compromised
web servers. Most web sites that are hosted on compromised web servers promote questionable or
outright fraudulent businesses. For example, the majority of phishing web sites and child exploitation
web sites are hosted on compromised web servers.
Protecting your web sites and web services against these attacks requires a multilayered defense capa-
ble of both blocking known attacks with identifiable characteristics and protecting against unknown
attacks, which can often be detected because they look different from the normal traffic to your web
sites and web services.
The first line of defense for your web sites is protection against the large number of attacks that are
known to exist and have been observed and analyzed by web security experts. Common types of
attacks against HTML-based web sites include:
• Buffer overflow attacks. Sending an extremely long URL, extremely long cookie, or other ex-
tremely long bit of information to a web server in hopes of causing it or the underlying operating
system to hang, crash, or provide the attacker with access to the underlying operating system. A
buffer overflow attack can be used to gain access to unauthorized information, to compromise
a web server, or both.
• Cookie security attacks. Sending a modified cookie to a web server, usually in hopes of ob-
taining access to unauthorized content by using falsified credentials.
• Forceful browsing. Accessing URLs on a web site directly, without navigating to the URLs by
means of hyperlinks on the home page or other common start URLs on the web site. Individual
instances of forceful browsing may simply indicate a user who bookmarked a page on your web
site, but repeated attempts to access nonexistent content, or content that users should never
access directly, often represent an attack on web site security. Forceful browsing is normally
used to gain access to unauthorized information, but can also be combined with a buffer over-
flow attack in an attempt to compromise your server.
• Web form security attacks. Sending inappropriate content to your web site in a web form. In-
appropriate content can include modified hidden fields, HTML or code in a field intended for
alphanumeric data only, an overly long string in a field that accepts only a short string, an al-
phanumeric string in a field that accepts only an integer, and a wide variety of other data that
your web site does not expect to receive in that web form. A web form security attack can be
used either to obtain unauthorized information from your web site or to compromise the web
site outright, usually when combined with a buffer overflow attack.
Two specialized types of attacks on web form security deserve special mention:
• SQL injection attacks. Sending an active SQL command or commands in a web form or as part
of a URL, with the goal of causing an SQL database to execute the command or commands. SQL
injection attacks are normally used to obtain unauthorized information.
• Cross-site scripting attacks. Using a URL or a script on a web page to violate the same-origin
policy, which forbids any script from obtaining properties from or modifying any content on
a different web site. Since scripts can obtain information and modify files on your web site,
allowing a script access to content on a different web site can provide an attacker the means to
obtain unauthorized information, to compromise a web server, or both.
Attacks against XML-based web services normally fall into at least one of the following two categories:
attempts to send inappropriate content to a web service, or attempts to breach security on a web
service. Common types of attacks against XML-based web services include:
• Malicious code or objects. XML requests that contain code or objects that can either directly
obtain sensitive information or can give an attacker control of the web service or underlying
server.
• Badly-formed XML requests. XML requests that do not conform to the W3C XML specification,
and that can therefore breach security on an insecure web service
• Denial of service (DoS) attacks. XML requests that are sent repeatedly and in high volume,
with the intent of overwhelming the targeted web service and denying legitimate users access
to the web service.
In addition to standard XML-based attacks, XML web services and Web 2.0 sites are also vulnerable to
SQL injection and cross-site scripting attacks, as described below:
• SQL injection attacks. Sending an active SQL command or commands in an XML-based re-
quest, with the goal of causing an SQL database to execute that command or commands. As
with HTML SQL injection attacks, XML SQL injection attacks are normally used to obtain unau-
thorized information.
• Cross-site scripting attacks. Using a script included in an XML based application to violate
the same-origin policy, which does not allow any script to obtain properties from or modify any
content on a different application. Since scripts can obtain information and modify files by using
your XML application, allowing a script access to content belonging to a different application can
give an attacker the means to obtain unauthorized information, to compromise the application,
or both
Known web attacks can usually be stopped by filtering web site traffic for specific characteristics (sig-
natures) that always appear for a specific attack and should never appear in legitimate traffic. This
approach has the advantages of requiring relatively few resources and posing relatively little risk of
false positives. It is therefore a valuable tool in fighting attacks on web sites and web services, and
configuring basic signature protections that intercept most known web attacks is easy to do.
The greatest threat against web sites and applications does not come from known attacks, but from
unknown attacks. Most unknown attacks fall into one of two categories: newly-launched attacks for
which security firms have not yet developed an effective defense (zero-day attacks), and carefully-
targeted attacks on a specific web site or web service rather than many web sites or web services
(spear attacks). These attacks, like known attacks, are usually intended to obtain sensitive private
information, compromise the web site or web service and allow it to be used for further attacks, or
both of those goals.
Zero-day attacks are a major threat to all users. These attacks are usually of the same types as known
attacks; zero-day attacks often involve injected SQL, a cross-site script, a cross-site request forgery, or
another type of attack similar to known attacks. In most cases, they target vulnerabilities that the de-
velopers of the targeted software, web site, or web service either are unaware of or have just learned
about. Security firms have therefore usually not developed defenses against these attacks, and even
if they have, users have usually not obtained and installed the patches or performed the workarounds
necessary to protect against these attacks. The time between discovery of a zero-day attack and avail-
ability of a defense (the vulnerability window) is shrinking, but perpetrators can still count on hours
or even days in which many web sites and web services lack any specific protection against the attack.
Spear attacks are a major threat, but to a more select group of users. A common type of spear attack,
a spear phish, is usually targeted at customers of a specific bank or financial institution, or (less com-
monly) at employees of a specific company or organization. Unlike other phishes, which are often
crudely written forgeries that a user with any familiarity with the actual communications of that bank
or financial institution can recognize, spear phishes are letter perfect and extremely convincing. They
can contain information specific to the individual that, at first look, no stranger should know or be able
to obtain. The spear phisher is therefore able to convince his or her target to provide the requested in-
formation, which the phisher can then use to loot accounts, to process illegitimately obtained money
from other sources, or to gain access to other, even more sensitive information.
Both of these types of attack have certain characteristics that can usually be detected, although not
by using static patterns that look for specific characteristics, as do standard signatures. Detecting
these types of attacks requires more sophisticated and more resource-intensive approaches, such as
heuristic filtering and positive security model systems. Heuristic filtering looks, not for specific pat-
terns, but for patterns of behaviors. Positive security model systems model the normal behavior of
the web site or web service that they are protecting, and then block connections that do not fit within
that model of normal use. URL based and web-form based security checks profile normal use of your
web sites, and then control how users interact with your web sites, using both heuristics and posi-
tive security to block anomalous or unexpected traffic. Both heuristic and positive security, properly
designed and deployed, can catch most attacks that signatures miss. However, they require consid-
erably more resources than do signatures, and you must spend some time configuring them properly
to avoid false positives. They are therefore usually used, not as the primary line of defense, but as
backups to signatures or other less resource-intensive approaches.
By configuring these advanced protections in addition to signatures, you create a hybrid security
model, which enables the App Firewall to provide comprehensive protection against both known and
unknown attacks.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
January 6, 2019
Contributed by:
C
When you install the App Firewall, you create an initial security configuration, which consists of a pol-
icy, a profile, and a signatures object. The policy is a rule that identifies the traffic to be filtered, and
the profile identifies the patterns and types of behavior to allow or block when the traffic is filtered.
The simplest patterns, which are called signatures, are not specified within the profile, but in a signa-
tures object that is associated with the profile.
A signature is a string or pattern that matches a known type of attack. The App Firewall contains over a
thousand signatures in seven categories, each directed at attacks on specific types of web servers and
web content. Citrix updates the list with new signatures as new threats are identified. During configu-
ration, you specify the signature categories that are appropriate for the web servers and content that
you need to protect. Signatures provide good basic protection with low processing overhead. If your
applications have special vulnerabilities or you detect an attack against them for which no signature
exists, you can add your own signatures.
The more advanced protections are called security checks. A security check is a more rigorous, algo-
rithmic inspection of a request for specific patterns or types of behavior that might indicate an attack
or constitute a threat to your protected web sites and web services. It can, for example, identify a re-
quest that attempts to perform a certain type of operation that might breach security, or a response
that includes sensitive private information such as a social security number or credit card number.
During configuration, you specify the security checks that are appropriate for the web servers and con-
tent that you need to protect. The security checks are restrictive. Many of them can block legitimate
requests and responses if you do not add the appropriate exceptions (relaxations) when configuring
them. Identifying the needed exceptions is not difficult if you use the adaptive learning feature, which
observes normal use of your web site and creates recommended exceptions.
The App Firewall can be installed as either a Layer 3 network device or a Layer 2 network bridge be-
tween your servers and your users, usually behind your company’s router or firewall. It must be in-
stalled in a location where it can intercept traffic between the web servers that you want to protect
and the hub or switch through which users access those web servers. You then configure the network
to send requests to the App Firewall instead of directly to your web servers, and responses to the App
Firewall instead of directly to your users. The App Firewall filters that traffic before forwarding it to
its final destination, using both its internal rule set and your additions and modifications. It blocks
or renders harmless any activity that it detects as harmful, and then forwards the remaining traffic to
the web server. The following figure provides an overview of the filtering process.
Note:
The figure omits the application of a policy to incoming traffic. It illustrates a security configura-
tion in which the policy is to process all requests. Also, in this configuration, a signatures object
has been configured and associated with the profile, and security checks have been configured
in the profile.
As the figure shows, when a user requests a URL on a protected web site, the App Firewall first exam-
ines the request to ensure that it does not match a signature. If the request matches a signature, the
App Firewall either displays the error object (a web page that is located on the App Firewall appliance
and which you can configure by using the imports feature) or forwards the request to the designated
error URL (the error page). Signatures do not require as many resources as do security checks, so
detecting and stopping attacks that are detected by a signature before running any of the security
checks reduces the load on the server.
If a request passes signature inspection, the App Firewall applies the request security checks that have
been enabled. The request security checks verify that the request is appropriate for your web site or
web service and does not contain material that might pose a threat. For example, security checks
examine the request for signs indicating that it might be of an unexpected type, request unexpected
content, or contain unexpected and possibly malicious web form data, SQL commands, or scripts.
If the request fails a security check, the App Firewall either sanitizes the request and then sends it
back to the NetScaler appliance (or NetScaler virtual appliance), or displays the error object. If the
request passes the security checks, it is sent back to the NetScaler appliance, which completes any
other processing and forwards the request to the protected web server.
When the web site or web service sends a response to the user, the App Firewall applies the response
security checks that have been enabled. The response security checks examine the response for leaks
of sensitive private information, signs of web site defacement, or other content that should not be
present. If the response fails a security check, the App Firewall either removes the content that should
not be present or blocks the response. If the response passes the security checks, it is sent back to
the NetScaler appliance, which forwards it to the user.
The basic App Firewall features are policies, profiles, and signatures, which provide a hybrid security
model as described in “Known Web Attacks,” “Unknown Web Attacks,” and “How the App Firewall
Works.” Of special note is the learning feature, which observes traffic to your protected applications
and recommends appropriate configuration settings for certain security checks.
The imports feature manages files that you upload to the App Firewall. These files are then used by the
App Firewall in various security checks, or when responding to a connection that matches a security
check.
You can use the logs, statistics, and reports features to evaluate the performance of the App Firewall
and identify possible needs for additional protections.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
January 6, 2019
Contributed by:
C
All hardware and virtual versions of the NetScaler can be configured and managed from the NetScaler
command line interface or the web-based GUI. All features of most NetScaler features can be con-
figured using either of these tools. The NetScaler App Firewall is an exception: not all App Firewall
configuration tasks can be performed at the command line. Inexperienced users also find the GUI eas-
ier to use. In particular, the App Firewall wizard considerably reduces the complexity of configuring
the App Firewall. Unlike most NetScaler wizards, the App Firewall wizard can serve as your primary
interface to the App Firewall.
The command line interface is a modified UNIX shell based on the FreeBSD bash shell. To configure the
App Firewall from the command line interface, you type commands at the prompt and press the Enter
key, just as you do with any other Unix shell. For instructions for using the command line interface,
see [Command Reference](https://developer-docs.citrix.com/projects/netscaler-
command-reference/en/12.0/appfw/application-firewall-commands/).
The GUI is a web-based GUI interface to the appliance. The App Firewall configuration section is found
under Security > App Firewall. Figure 1 shows the navigation pane expanded to display the App Fire-
wall screens, and in the detail pane the main ![App Firewall screen].
(/en-us/netscaler/media/cu-screenshot-labeled.png)
The GUI has two main areas on all screens. The panel on the left, called the navigation pane, contains
a navigation tree, with which you navigate to the screens on which you configure the features that are
installed on your appliance. The screens to which you navigate appear to the right of the navigation
pane, in the details pane.
When you access the GUI, the details pane displays the System Overview screen. If, in the navigation
pane, you click plus sign next to the App Firewall folder, the App Firewall node expands to include the
main App Firewall elements that you can configure. If you click the first element, Profiles, the details
pane displays the configured profiles, if any profiles have been configured. At the bottom of the details
pane, you can click Add to configure a new profile. Other buttons at the bottom of the details pane are
grayed out until you select an existing profile. Screens for the other elements work in the same way.
If, instead of expanding the App Firewall node, you click the node itself, the details pane displays dif-
ferent options, one of which is the App Firewall wizard, as shown in Figure 1. Citrix recommends that
you use the wizard for initial configuration, and many users use it almost exclusively. It includes most
of the functionality that is available elsewhere in the GUI.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can configure the NetScaler App Firewall by using any of the following methods:
• App Firewall Wizard. A dialog box consisting of a series of screens that step you through the
configuration process.
• NetScaler App Interface AppExpert Template. A NetScaler AppExpert template (a set of con-
figuration settings) that are designed to provide appropriate protection for web sites. This App-
Expert template contains appropriate App Firewall configuration settings for protecting many
web sites.
• NetScaler GUI. The NetScaler web-based configuration interface.
• NetScaler Command Line Interface. The NetScaler command line configuration interface.
Citrix recommends that you use the App Firewall Wizard. Most users will find it the easiest method to
configure the App Firewall, and it is designed to prevent mistakes. If you have a new NetScaler or VPX
that you will use primarily to protect web sites, you may find the Web Interface AppExpert template a
better option because it provides a good default configuration, not just for the App Firewall, but for the
entire appliance. Both the GUI and the command line interface are intended for experienced users,
primarily to modify an existing configuration or use advanced options.
The App Firewall wizard is a dialog box that consists of several screens that prompt you to configure
each part of a simple configuration. The App Firewall then creates the appropriate configuration ele-
ments from the information that you give it. This is the simplest and, for most purposes, the best way
to configure the App Firewall.
To use the wizard, connect to the GUI with the browser of your choice. When the connection is estab-
lished, verify that the App Firewall is enabled, and then run the App Firewall wizard, which prompts
you for configuration information. You do not have to provide all of the requested information the first
time you use the wizard. Instead, you can accept default settings, perform a few relatively straight-
forward configuration tasks to enable important features, and then allow the App Firewall to collect
important information to help you complete the configuration.
For example, when the wizard prompts you to specify a rule for selecting the traffic to be processed,
you can accept the default, which selects all traffic. When it presents you with a list of signatures, you
can enable the appropriate categories of signatures and turn on the collection of statistics for those
signatures. For this initial configuration, you can skip the advanced protections (security checks). The
wizard automatically creates the appropriate policy, signatures object, and profile (collectively, the
security configuration), and binds the policy to global. The App Firewall then begins filtering connec-
tions to your protected websites, logging any connections that match one or more of the signatures
that you enabled and collecting statistics about the connections that each signature matches. After
the App Firewall processes some traffic, you can run the wizard again and examine the logs and statis-
tics to see if any of the signatures that you have enabled are matching legitimate traffic. After deter-
mining which signatures are identifying the traffic that you want to block, you can enable blocking
for those signatures. If your website or web service is not complex, does not use SQL, and does not
have access to sensitive private information, this basic security configuration will probably provide
adequate protection.
You may need additional protection if, for example, your website is dynamic. Content that uses scripts
may need protection against cross-site scripting attacks. Web content that uses SQL—such as shop-
ping carts, many blogs, and most content management systems—may need protection against SQL
injection attacks. Websites and web services that collect sensitive private information such as social
security numbers or credit card numbers may require protection against unintentional exposure of
that information. Certain types of web-server or XML-server software may require protection from
types of attacks tailored to that software. Another consideration is that specific elements of your web-
sites or web services may require different protection than do other elements. Examining the App
Firewall logs and statistics can help you identify the additional protections that you might need.
After deciding which advanced protections are needed for your websites and web services, you can
run the wizard again to configure those protections. Certain security checks require that you enter ex-
ceptions (relaxations) to prevent the check from blocking legitimate traffic. You can do so manually,
but it is usually easier to enable the adaptive learning feature and allow it to recommend the neces-
sary relaxation. You can use the wizard as many times as necessary to enhance your basic security
configuration and/or create additional security configurations.
The wizard automates some tasks that you would have to perform manually if you did not use the
wizard. It automatically creates a policy, a signatures object, and a profile, and assigns them the name
that you provided when you were prompted for the name of your configuration. The wizard also adds
your advanced-protection settings to the profile, binds the signatures object to the profile, associates
the profile with the policy, and puts the policy into effect by binding it to Global.
A few tasks cannot be performed in the wizard. You cannot use the wizard to bind a policy to a bind
point other than Global. If you want the profile to apply to only a specific part of your configuration,
you must manually configure the binding. You cannot configure the engine settings or certain other
global configuration options in the wizard. While you can configure any of the advanced protection
settings in the wizard, if you want to modify a specific setting in a single security check, it may be
easier to do so on the manual configuration screens in the GUI.
For more information on using the App Firewall Wizard, see “The App Firewall Wizard.”
AppExpert templates are a different and simpler approach to configuring and managing complex en-
terprise applications. The AppExpert display in the GUI consists of a table. Applications are listed
in the left-most column, with the NetScaler features that are applicable to that application appearing
each in its own column to the right. (In the AppExpert interface, those features that are associated with
an application are called application units.) In the AppExpert interface, you configure the interesting
traffic for each application, and turn on rules for compression, caching, rewrite, filtering, responder
and the App Firewall, instead of having to configure each feature individually.
The Web interface AppExpert template contains rules for the following App Firewall signatures and
security checks:
• “Deny URL check.” Detects connections to content that is known to pose a security risk, or to
any other URLs that you designate.
• “Buffer Overflow check.” Detects attempts to cause a buffer overflow on a protected web
server.
• “Cookie Consistency check.” Detects malicious modifications to cookies set by a protected
web site.
• “Form Field Consistency check.” Detects modifications to the structure of a web form on a
protected web site.
• “CSRF Form Tagging check.” Detects cross-site request forgery attacks.
• “Field Formats check.” Detects inappropriate information uploaded in web forms on a pro-
tected web site.
• “HTML SQL Injection check.” Detects attempts to inject unauthorized SQL code.
• “HTML Cross-Site Scripting check.” Detects cross-site scripting attacks.
For information on installing and using an AppExpert Template, see “AppExpert Applications and Tem-
plates.”
The GUI is a web-based interface that provides access to all configuration options for the App Firewall
feature, including advanced configuration and management options that are not available from any
other configuration tool or interface. Specifically, many advanced Signatures options can be config-
ured only in the GUI. You can review recommendations generated by the learning feature only in the
GUI. You can bind policies to a bind point other than Global only in the GUI.
For a description of the GUI, see “The App Firewall Configuration Interfaces.” For more information on
using the GUI to configure the App Firewall, see “Manual Configuration By Using the GUI.”
For instructions on configuring the App Firewall by using the GUI, see “Manual Configuration By Using
the GUI.” For information on the NetScaler GUI, see “The App Firewall Configuration Interfaces.”
The NetScaler command line interface is a modified UNIX shell based on the FreeBSD bash shell. To
configure the App Firewall from the command line interface, you type commands at the prompt and
press the Enter key, just as you do with any other Unix shell. You can configure most parameters and
options for the App Firewall by using the NetScaler command line. Exceptions are the signatures fea-
ture, many of whose options can be configured only by using the GUI or the App Firewall wizard, and
the learning feature, whose recommendations can only be reviewed in the GUI.
For instructions on configuring the App Firewall by using the NetScaler command line, see “Manual
Configuration By Using the Command Line Interface.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Before you can create an App Firewall security configuration, you must make sure that the App Firewall
feature is enabled.
• If you are configuring a dedicated NetScaler App Firewall appliance or are upgrading an exist-
ing NetScaler or VPX, the feature is already enabled. You do not have to perform either of the
procedures described here.
• If you have a new NetScaler or VPX, you need to enable the App Firewall feature before you
configure it.
• If you are upgrading a NetScaler or VPX from a previous version of the NetScaler operating sys-
tem to the current version, you might need to enable the App Firewall feature before you con-
figure it.
Note:
If you are upgrading a NetScaler or VPX from a previous version, you might also need to update
the licenses on your ADC or VPX before you can enable the App Firewall. Check with your Citrix
representative or reseller to obtain the correct license.
You can enable the App Firewall by using the command line or the GUI.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Unlike most wizards, the NetScaler App App Firewall Wizard is designed not just to simplify the initial
configuration process, but also to modify previously created configurations and to maintain your App
Firewall setup. A typical user runs the wizard multiple times, skipping some of the screens each time.
The App Firewall Wizard automatically creates profiles, policies, and signatures.
To run the App Firewall Wizard, open the GUI and follow these steps:
For more information about the GUI, see The App Firewall Configuration Interfaces.
The App Firewall wizard displays the following screens on a tabular page:
1. Specify Name: on this screen, when creating a new security configuration, specify a meaningful
name and the appropriate type (HTML, XML or WEB 2.0) for your profile. The default policy and signa-
tures are auto-generated by using the same name.
Profile Name
The name can begin with a letter, number, or the underscore symbol, and can consist of from 1 to 31
letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=), colon (:), and
underscore (_) symbols. Choose a name that makes it easy for others to tell what content your new
security configuration protects.
Note:
Because the wizard uses this name for both the policy and the profile, it is limited to 31 characters.
Manually created policies can have names up to 127 characters in length.
When modifying an existing configuration, you select Modify Existing Configuration and then, in the
Name drop-down list, select the name of the existing configuration that you want to modify.
Note:
Only policies that are bound to global or to a bind point appear in this list; you cannot modify
an unbound policy by using the Application Firewall wizard. You must either manually bind it to
Global or a bind point, or modify it manually. (For manual modification, in the GUI Application
Firewall > Policies > Firewall pane, select the policy and click Open).
Profile Type
You also select a profile type on this screen. The profile type determines the types of advanced pro-
tection (security checks) that can be configured. Because certain kinds of content are not vulnerable
to certain types of security threats, restricting the list of available checks saves time during configura-
tion. The types of App Firewall profiles are:
• Web Application (HTML). Any HTML-based Web site that does not use XML or Web 2.0 technolo-
gies.
• XML Application (XML, SOAP). Any XML-based Web service.
• Web 2.0 Application (HTML, XML, REST). Any Web 2.0 site that combines HTML and XML-based
content, such as an ATOM-based site, a blog, an RSS feed, or a wiki.
Note: If you are unsure which type of content is used on your website, you can choose Web 2.0 Appli-
cation to ensure that you protect all types of web application content.
2. Specify Rule: on this screen, you specify the policy rule (expression) that defines the traffic the
current configuration examines. If you create an initial configuration to protect your websites and
web services, you can accept the default value, true, which selects all web traffic .
If you want this security configuration to examine, not all HTTP traffic that is routed through the appli-
ance, but specific traffic, you can write a policy rule specifying the traffic that you want it to examine.
Rules are written in NetScaler expressions language, which is a fully functional object-oriented pro-
gramming language. For more information, see Configure a Custom Policy Expression.
Note: In addition to the default expressions syntax, for backward compatibility the NetScaler oper-
ating system supports the NetScaler classic expressions syntax on NetScaler Classic and nCore ap-
pliances and virtual appliances. Classic expressions are not supported on NetScaler Cluster appli-
ances and virtual appliances. Current users who want to migrate their existing configurations to the
NetScaler cluster must migrate any policies that contain classic expressions to the default expressions
syntax.
• For a simple description of using the NetScaler expressions syntax to create App Firewall rules,
and a list of useful rules, see “Firewall Policies.”
• For a detailed explanation of how to create policy rules in NetScaler expressions syntax, see
“Policies and Expressions.”
4. Select Signatures: on this screen, you select the categories of signatures that you want to use to
protect your web sites and web services.
This is not a mandatory step, and you can skip it if you want to and go to the Specify Deep Protections
screen. If the Select Signatures screen is skipped, only a profile and associated policies are created,
and the signatures are not created.
If you are creating a new security configuration, the signature categories that you select are enabled,
and by default they are recorded in a new signatures object. The new signatures object is assigned the
same name that you entered on the Specify name screen as the name of the security configuration.
If you have previously configured signatures objects and want to use one of them as the signatures ob-
ject associated with the security configuration that you are creating, click Select Existing Signature
and select a signatures object from the Signatures list.
If you are modifying an existing security configuration, you can click Select Existing Signature and
assign a different signatures object to the security configuration.
If you click Create New Signature, you can choose the edit mode as Simple or Advanced.
The simple mode allows for easy configuration of the signature, with a preset list of protection defini-
tions for common applications such as IIS (Internet Information Server), PHP and ActiveX. The default
categories in Simple mode are:
• CGI. Protection against attacks on web sites that use CGI scripts in any language, including PERL
scripts, Unix shell scripts, and Python scripts.
• Cold Fusion. Protection against attacks on web sites that use the Adobe Systems® ColdFusion®
Web development platform.
• FrontPage. Protection against attacks on web sites that use the Microsoft® FrontPage® Web de-
velopment platform.
• PHP. Protection against attacks on web sites that use the PHP open-source Web development
scripting language.
• Client side. Protection against attacks on client-side tools used to access your protected web
sites, such as Microsoft Internet Explorer, Mozilla Firefox, the Opera browser, and the Adobe
Acrobat Reader.
• Microsoft IIS. Protection against attacks on Web sites that run the Microsoft Internet Information
Server (IIS)
• Miscellaneous. Protection against attacks on other server-side tools, such as Web servers and
database servers.
On this screen, you select the actions associated with the signature categories that you selected on
the Select Signatures screen. The actions that you can configure are:
• Block
• Log
• Stats
By default the Log and Stats actions are enabled but not the Block action. To configure actions, click
Settings. You can change the action settings of all the selected categories by using the Action drop-
down menu.
The advanced mode allows for more granular control over the signature definitions and provides sig-
nificantly more information. Use the advanced mode if you want complete control over signature
definition.
The contents of this screen are the same as the contents of the Modify Signatures Object dialog box, as
described in “Configuring or Modifying a Signatures Object.” In this screen, you can configure actions
either by clicking the Actions drop-down menu or the actions menu, which appears as a cirle with
three dots.
7. Specify Deep Protections: on this screen, you choose the advanced protections (also called secu-
rity checks or simply checks) that you want to use to protect your web sites and web services. Which
checks are available depends on the profile type that you chose on the Specify Name screen. All
checks are available for Web 2.0 Application profiles.
For more information, see Overview of Security Checks and see “Advanced Form Protections Checks.”
You configure the actions for the advanced protections that you have enabled.The actions that you
can configure are:
To configure actions, select the protection by clicking the check box, and then click Action Settings to
select the required actions. Select other parameters, if required, and then click OK to close the Action
Settings window.
To view all logs for a specific check, select that check, and then click Logs to display the Syslog Viewer,
as described in “App Firewall Logs.” If a security check is blocking legitimate access to your protected
web site or web service, you can create and implement a relaxation for that security check by selecting
a log that shows the unwanted blocking, and then clicking Deploy.
After you completing specifying Action Settings, click Finish to complete the wizard.
Following are four procedures that show how to perform specific types of configuration by using the
App Firewall wizard.
Follow these steps to create a new firewall configuration and signature objects, by using the Appli-
caiton Firewall wizard.
2. In the details pane, under Getting Started, click Application Firewall Wizard.**The wizard
opens.
6. In the Select Signatures screen, select Create New Signature and Simple as the edit mode,
and then click Next.
7. In the Specify Signature Protections screen, configure the required settings. For more infor-
mation about which signatures to consider for blocking and how to determine when you can
safely enable blocking for a signature, see “Signatures.”
8. In the Specify Deep Protections screen configure the required actions and parameters in Ac-
tion Settings.
9. When you complete, click Finish to close the Application Firewall wizard.
Follow these steps to modify an existing configuration and existing signature categories.
4. In the Specify Rule screen, click Next to keep the default value “true.” If you want to modify the
rule, follow the steps described in “Configure a Custom Policy Expresssion.”
5. In the Select Signatures screen, click Select Existing Signature. From the Existing Signature
drop-down menu, select the appropriate option, and then click Next. The advanced signature
protection screen appears.
Note: If you select an existing signature, the default edit mode for signature protected is ad-
vanced.
6. In the Specify Signature Protections screen, configure the required settings and click Next. For
more information about which signatures to consider for blocking and how to determine when
you can safely enable blocking for a signature, see “Signatures.”
7. In the Specify Deep Protections screen, configure the settings and click Next.
8. After you complete, click Finish to close the App Firewall Wizard.
Follow these steps to use the Application Firewall Wizard to skip the Select Signatures screen and
create a new configuration with just the profile and the associated policies but without any signatures.
Follow these steps to use the Application Firewall Wizard to create a specialized security configura-
tion to protect only specific content. In this case, you create a new security configuration instead of
modifying the initial configuration. This type of security configuration requires a custom rule, so that
the policy applies the configuration to only the selected Web traffic.
4. On the Specify Rule screen, enter a rule that matches only that content that you want this web
application to protect. Use the Frequently Used Expressions drop-down list and the Expres-
sion Editor to create a custom expression. When you complete, click Next.
5. In the Select Signatures screen, select the edit mode, and then click Next.
6. In the Specify Signature Protections screen, configure the required settings.
7. In the Specify Deep Protections screen configure the required actions and parameters in Ac-
tion Settings.
8. When you complete, click Finish to close the Application Firewall Wizard.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Manual configuration
Contributed by:
C
If you want to bind a profile to a bind point other than Global, you must manually configure the bind-
ing. Also, certain security checks require that you either manually enter the necessary exceptions or
enable the learning feature to generate the exceptions that your Web sites and Web services need.
Some of these tasks cannot be performed by using the App Firewall wizard.
If you are familiar with how the App Firewall works and prefer manual configuration, you can manually
configure a signatures object and a profile, associate the signatures object with the profile, create a
policy with a rule that matches the web traffic that you want to configure, and associate the policy
with the profile. You then bind the policy to Global, or to a bind point, to put it into effect, and you
have created a complete security configuration.
For manual configuration, you can use the GUI (a graphical interface) or the command line. Citrix
recommends that you use the GUI. Not all configuration tasks can be performed at the command line.
Certain tasks, such as enabling signatures and reviewing learned data, must be done in the GUI. Most
other tasks are easier to perform in the GUI.
Replicating configuration
When you use the GUI (GUI) or the command line interface (CLI) to manually configure the App Fire-
wall, the configuration is saved in the /nsconfig/ns.conf file. You can use the commands in that file to
replicate the configuration on another appliance. You can cut and paste the commands into the CLI
one by one, or you can save multiple commands in a text file in the /var/tmp folder and run them as
a batch file. Following is an example of running a batch file containing commands copied from the
/nsconfig/ns.conf file of a different appliance:
> batch -f /var/tmp/appfw_add.txt
Warning
Import commands are not saved in the ns.conf file. Before running commands from the ns.conf
file to replicate the configuration on another appliance, you must import all the objects used
in the configuration (for example, signatures, error page, WSDL, and Schema) to the appliance
on which you will replicate the configuration. The add command to add an App Firewall profile
saved in an ns.conf file might include the name of an imported object, but such a command
might fail when executed on another appliance if the referenced object does not exist on that
appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
December 7, 2018
Contributed by:
C
If you need to configure the App Firewall feature manually, Citrix recommends that you use the GUI.
Before you can configure the signatures, you must create a new signatures object from the appropriate
default signatures object template. Assign the copy a new name, and then configure the copy. You
cannot configure or modify the default signatures objects directly. The following procedure provides
basic instructions for configuring a signatures object. For more detailed instructions, see “Manually
Configuring the Signatures Feature.”
1. Navigate to Security > application firewall > Signatures.
2. In the details pane, select the signatures object that you want to use as a template, and then
click Add.
• *Default Signatures. Contains the signatures rules, the SQL injection rules, and the cross-
site scripting rules.
• *XPath Injection. Contains all of the items in the *Default Signatures, and in addition, con-
tains the XPath injection rules.
3. In the **Add Signatures Object **dialog box, type a name for your new signatures object, click
OK, and then click Close. The name can begin with a letter, number, or the underscore symbol,
and can consist of from one to 31 letters, numbers, and the hyphen (-), period (.) pound (#),
space ( ), at (@), equals (=), and underscore (_) symbols.
4. Select the signatures object that you created, and then click Open.
5. In the Modify Signatures Object dialog box, set the Display Filter Criteria options at the left
to display the filter items that you want to configure.
As you modify these options, the results that you specify are displayed in the Filtered Results
window at the right. For more information about the categories of signatures, see “Signatures.”
6. In the Filtered Results area, configure the settings for a signature by selecting and clearing the
appropriate checkboxes.
Creating an App Firewall profile requires that you specify only a few configuration details.
3. In the Create App Firewall Profile dialog box, type a name for your profile.
The name can begin with a letter, number, or the underscore symbol, and can consist of from
one to 31 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
colon (:), and underscore (_) symbols.
2. In the details pane, select the profile that you want to configure, and then click Edit.
3. In the Configure App Firewall Profile dialog box, on the Security Checks tab, configure the
security checks.
• To enable or disable an action for a check, in the list, select or clear the checkbox for that
action.
• To configure other parameters for those checks that have them, in the list, click the blue
chevron to the far right of that check. In the dialog box that appears, configure the param-
eters. These vary from check to check.
You can also select a check and, at the bottom of the dialog box, click Open to display the
Configure Relaxation dialog box or Configure Rule dialog box for that check. These dialog
boxes also vary from check to check. Most of them include a Checks tab and a General
tab. If the check supports relaxations or user-defined rules, the Checks tab includes an
Add button, which opens yet another dialog box, in which you can specify a relaxation or
rule for the check. (A relaxation is a rule for exempting specified traffic from the check.) If
relaxations have already been configured, you can select one and click Open to modify it.
• To review learned exceptions or rules for a check, select the check, and then click Learned
Violations. In the Manage Learned Rules dialog box, select each learned exception or rule
in turn.
– To edit the exception or rule, and then add it to the list, click Edit & Deploy.
– To accept the exception or rule without modification, click Deploy.
– To remove the exception or rule from the list, click Skip.
• To open the Learning Visualizer and use it to review learned rules, click Visualizer.
• To review the log entries for connections that matched a check, select the check, and then
click Logs. You can use this information to determine which checks are matching attacks
so that you can enable blocking for those checks. You can also use this information to
determine which checks are matching legitimate traffic, so that you can configure an ap-
propriate exemption to allow those legitimate connections. For more information about
the logs, see “Logs, Statistics, and Reports.”
• To completely disable a check, in the list, clear all of the checkboxes to the right of that
check.
• To associate the profile with the set of signatures that you previously created and config-
ured, under Common Settings, choose that set of signatures in the Signatures drop-down
list.
Note:
You may need to use the scroll bar on the right of the dialog box to scroll down to
display the Common Settings section.
• To configure an HTML or XML Error Object, select the object from the appropriate drop-
down list.
Note:
You must first upload the error object that you want to use in the Import pane.
• To configure the default XML Content Type, type the content type string directly into the
Default Request and Default Response text boxes, or click Manage Allowed Content Types
to manage the list of allowed content types.
5. If you want to use the learning feature, click Learning, and configure the learning settings for
the profile. For more information, see Configure and Learning feature..
You configure two different types of information in this dialog box, depending upon which security
check you are configuring. In the majority of cases, you configure an exception (or relaxation) to the
security check. If you are configuring the Deny URL check or the Field Formats check, you configure
an addition (or rule). The process for either of these is the same.
2. In the Profiles pane, select the profile you want to configure, and then click Edit.
3. In the Configure App Firewall Profile dialog box, click the Security Checks tab. The Secu-
rity Checks tab contains the complete list of App Firewall security checks, also called advanced
protections in some places.
4. In the Security Checks tab, click the check that you want to configure, and then click Open. The
Modify Check dialog box for the check that you chose is displayed, with the Checks tab selected.
The Checks tab contains a list of existing relaxations or rules for this check. The list might be
empty if you have not either manually added any relaxations or approved any relaxations that
were recommended by the learning engine. Beneath the list is a row of buttons that allow you
to add, modify, delete, enable, or disable the relaxations on the list.
The Add Check Relaxation or Modify Check Relaxation dialog box for the selected check is
displayed. Except for the title, these dialog boxes are identical.
6. Fill in the dialog box as described below. The dialog boxes for each check are different; the list
below covers all elements that might appear in any dialog box.
• Enabled check box—Select to place this relaxation or rule in active use; clear to deactivate
it.
• Action URL—In the text area, enter a PCRE-format regular expression that defines the URL
to which data entered into the web form is delivered.
• Cookie—In the text area, enter a PCRE-format regular expression that defines the cookie.
• Field Name—A web form field name element may be labeled Field Name, Form Field, or
another similar name. In the text area, enter a PCRE-format regular expression that defines
the name of the form field.
• Form Origin URL—In the text area, enter a PCRE-format regular expression that defines
the URL that hosts the web form.
• Form Action URL—In the text area, enter a PCRE-format regular expression that defines
the URL to which data entered into the web form is delivered.
• Name—An XML element or attribute name. In the text area, enter a PCRE-format regular
expression that defines the name of the element or attribute.
• URL—A URL element may be labeled Action URL, Deny URL, Form Action URL, Form Origin
URL, Start URL, or simply URL. In the text area, enter a PCRE-format regular expression that
defines the URL.
• Format—The format section contains multiple settings that include list boxes and text
boxes. Any of the following can appear:
– Type—Select a field type in the Type drop-down list. To add a new field type defini-
tion, click Manage—
– Minimum Length—Type a positive integer that represents the minimum length in
characters if you want to force users to fill in this field. Default: 0 (Allows field to be
left blank.)
– Maximum length—To limit the length of data in this field, type a positive integer that
represents the maximum length in characters. Default: 65535
• Location—Choose the element of the request that your relaxation will apply to from the
drop-down list. For HTML security checks, the choices are:
– ELEMENT—XML element.
– ATTRIBUE—XML attribute.
• Maximum Attachment Size—The maximum size in bytes allowed for an XML attachment.
Note: For any element that requires a regular expression, you can type the regular expression,
use the
Regex Tokens menu to insert regular expression elements and symbols directly into the text box,
or click Regex Editor to open the Add Regular Expression dialog box, and use it to construct
the expression.
10. To configure the settings and relationships of all existing relaxations in an integrated interactive
graphic display, click Visualizer, and use the display tools.
Note:
The Visualizer button does not appear on all check relaxation dialog boxes.
11. To review learned rules for this check, click Learning and perform the steps in To configure and
use the Learning feature
2. In the Profiles pane, select the profile, and then click Edit.
3. Click the Learning tab. At the top of the Learning tab is list of the security checks that are avail-
able in the current profile and that support the learning feature.
4. To configure the learning thresholds, select a security check, and then type the appropriate
values in the following text boxes:
• Minimum number threshold. Depending on which security check’s learning settings you
are configuring, the minimum number threshold might refer to the minimum number of
total user sessions that must be observed, the minimum number of requests that must be
observed, or the minimum number of times a specific form field must be observed, before
a learned relaxation is generated. Default: 1
5. To remove all learned data and reset the learning feature, so that it must start its observations
again from the beginning, click Remove All Learned Data.
Note:
This button removes only learned recommendations that have not been reviewed and ei-
ther approved or skipped. It does not remove learned relaxations that have been accepted
and deployed.
6. To restrict the learning engine to traffic from a specific set of IPs, click Trusted Learning Clients,
and add the IP addresses that you want to use to the list.
a) To add an IP address or IP address range to the Trusted Learning Clients list, click Add.
b) In the Add Trusted Learning Clients dialog box, Trusted Clients IP list box, type the IP
address or an IP address range in CIDR format.
c) In the Comments text area, type a comment that describes this IP address or range.
d) Click Create to add your new IP address or range to the list.
e) To modify an existing IP address or range, click the IP address or range, and then click
Open. Except for the name, the dialog box that appears is identical to the Add Trusted
Learning Clients dialog box.
f) To disable or enable an IP address or range, but leave it on the list, click the IP address or
range, and then click Disable or Enable, as appropriate.
g) To remove an IP address or range completely, click the IP address or range, and then click
Remove.
7. Click Close to return to the Configure application firewall Profile dialog box.
8. Click Close to close the Configure application firewall Profile dialog box, and return to the
application firewall Profile screen.
• To create a new firewall policy, click Add. The Create App Firewall Policy is displayed.
• To edit an existing firewall policy, select the policy, and then click Edit.
The Create App Firewall Policy or Configure App Firewall Policy is displayed.
3. If you are creating a new firewall policy, in the Create App Firewall Policy dialog box, Policy
Name text box, type a name for your new policy.
The name can begin with a letter, number, or the underscore symbol, and can consist of from
one to 128 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
colon (:), and underscore (_) symbols.
If you are configuring an existing firewall policy, this field is read-only. You cannot modify it.
4. Select the profile that you want to associate with this policy from the Profile drop-down list.
You can create a new profile to associate with your policy by clicking New, and you can modify
an existing profile by clicking Modify.
The policy rule, also called the expression, defines the web traffic that the App Firewall filters by using
the profile associated with the policy. Like other NetScaler policy rules (or expressions), App Firewall
rules use NetScaler expressions syntax. This syntax is powerful, flexible, and extensible. It is too com-
plex to describe completely in this set of instructions. You can use the following procedure to create
a simple firewall policy rule, or you can read it as an overview of the policy creation process.
1. If you have not already done so, navigate to the appropriate location in the App Firewall wizard
or the NetScaler GUI to create your policy rule:
• If you are configuring a policy in the App Firewall wizard, in the navigation pane, click ap-
plication firewall, then in the details pane click application firewall Wizard, and then
navigate to the Specify Rule screen.
• If you are configuring a policy manually, in the navigation pane, expand application fire-
wall, Policies, and then Firewall. In the details pane, to create a new policy, click Add. To
modify an existing policy, select the policy, and then click Open.
2. On the Specify Rule screen, the Create application firewall Profile dialog box, or the Configure
Application Firewall Profile dialog box, click Prefix, and then choose the prefix for your expres-
sion from the drop-down list. Your choices are:
• HTTP. The HTTP protocol. Choose this if you want to examine some aspect of the request
that pertains to the HTTP protocol.
• SYS. The protected Web site(s). Choose this if you want to examine some aspect of the
request that pertains to the recipient of the request.
• CLIENT. The computer that sent the request. Choose this if you want to examine some
aspect of the sender of the request.
• SERVER. The computer to which the request was sent. Choose this if you want to examine
some aspect of the recipient of the request.
After you choose a prefix, the App Firewall displays a two-part prompt window that displays the
possible next choices at the top, and a brief explanation of what the selected choice means at
the bottom.
3. Choose your next term.
If you chose HTTP as your prefix, your only choice is REQ, which specifies the Request/Response
pair. (The App Firewall operates on the request and response as a unit instead of on each sepa-
rately.) If you chose another prefix, your choices are more varied. For help on a specific choice,
click that choice once to display information about it in the lower prompt window.
When you have decided which term you want, double-click it to insert it into the Expression
window.
4. Type a period after the term you just chose. You are then prompted to choose your next term, as
described in the previous step. When a term requires that you type a value, fill in the appropriate
value. For example, if you choose HTTP.REQ.HEADER(“”), type the header name between the
quotation marks.
5. Continue choosing terms from the prompts and filling in any values that are needed, until your
expression is finished.
Following are some examples of expressions for specific purposes.
• Specific web host. To match traffic from a particular web host:
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
For shopping.example.com, substitute the name of the web host that you want to match.
• Specific web folder or directory. To match traffic from a particular folder or directory on
a Web host:
1 HTTP.REQ.URL.STARTSWITH(”https//www.example.com/folder”)
For www.example.com, substitute the name of the web host. For folder, substitute the
folder or path to the content that you want to match. For example, if your shopping cart is
in a folder called /solutions/orders, you substitute that string for folder.
• Specific type of content: GIF images. To match GIF format images:
1 HTTP.REQ.URL.ENDSWITH(”.gif”)
1 HTTP.REQ.URL.STARTSWITH(”https//www.example.com/CGI-BIN”)
1 HTTP.REQ.URL.ENDSWITH(”.js”)
For more information about creating policy expressions, see “Policies and Expressions.”
Note:
If you use the command line to configure a policy, remember to escape any double quota-
tion marks within NetScaler expressions. For example, the following expression is correct
if entered in the GUI:
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
If entered at the command line, however, you must type this instead:
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
To add a firewall rule (expression) by using the Add Expression dialog box
The Add Expression dialog box (also referred to as the Expression Editor) helps users who are not
familiar with the NetScaler expressions language to construct a policy that matches the traffic that
they want to filter.
1. If you have not already done so, navigate to the appropriate location in the App Firewall wizard
or the NetScaler GUI:
• If you are configuring a policy in the App Firewall wizard, in the navigation pane, click
App Firewall, then in the details pane click App Firewall Wizard, and then navigate to the
Specify Rule screen.
• If you are configuring a policy manually, in the navigation pane, expand App Firewall,
then Policies, and then Firewall. In the details pane, to create a new policy, click Add. To
modify an existing policy, select the policy, and then click Open.
2. On the Specify Rule screen, in the Create App Firewall Profile dialog box, or in the Configure
App Firewall Profile dialog box, click Add.
3. In the Add Expression dialog box, in the Construct Expression area, in the first list box, choose
one of the following prefixes:
• HTTP. The HTTP protocol. Choose this if you want to examine some aspect of the request
that pertains to the HTTP protocol. The default choice.
• SYS. The protected Web site(s). Choose this if you want to examine some aspect of the
request that pertains to the recipient of the request.
• CLIENT. The computer that sent the request. Choose this if you want to examine some
aspect of the sender of the request.
• SERVER. The computer to which the request was sent. Choose this if you want to examine
some aspect of the recipient of the request.
4. In the second list box, choose your next term. The available terms differ depending on the choice
you made in the previous step, because the dialog box automatically adjusts the list to contain
only those terms that are valid for the context. For example, if you selected HTTP in the previ-
ous list box, the only choice is REQ, for requests. Because the App Firewall treats requests and
associated responses as a single unit and filters both, you do not need to specific responses
separately. After you choose your second term, a third list box appears to the right of the sec-
ond. The Help window displays a description of the second term, and the Preview Expression
window displays your expression.
5. In the third list box, choose the next term. A new list box appears to the right, and the Help win-
dow changes to display a description of the new term. The Preview Expression window updates
to display the expression as you have specified it to that point.
6. Continue choosing terms, and when prompted filling in arguments, until your expression is com-
plete. If you make a mistake or want to change your expression after you have already selected
a term, you can simply choose another term. The expression is modified, and any arguments or
additional terms that you added after the term that you modified are cleared.
7. When you have finished constructing your expression, click OK to close the Add Expression dia-
log box. Your expression is inserted into the Expression text area.
• Navigate to Security > App Firewall, and in the details pane, click application firewall
policy manager.
• Navigate to Security > application firewall > Policies > Firewall Policies, and in the de-
tails pane, click Policy Manager.
2. In the Application Firewall Manager dialog, choose the bind point to which you want to bind
the policy from the drop-down list. The choices are:
• Override Global. Policies that are bound to this bind point process all traffic from all in-
terfaces on the NetScaler appliance, and are applied before any other policies.
• LB Virtual Server. Policies that are bound to a load balancing virtual server are applied
only to traffic that is processed by that load balancing virtual server, and are applied be-
fore any Default Global policies. After selecting LB Virtual Server, you must also select the
specific load balancing virtual server to which you want to bind this policy.
• CS Virtual Server. Policies that are bound to a content switching virtual server are applied
only to traffic that is processed by that content switching virtual server, and are applied
before any Default Global policies. After selecting CS Virtual Server, you must also select
the specific content switching virtual server to which you want to bind this policy.
• Default Global. Policies that are bound to this bind point process all traffic from all inter-
faces on the NetScaler appliance.
• Policy Label. Policies that are bound to a policy label process traffic that the policy label
routes to them. The policy label controls the order in which policies are applied to this
traffic.
• None. Do not bind the policy to any bind point.
3. Click Continue. A list of existing App Firewall policies appears.
4. Select the policy you want to bind by clicking it.
5. Make any additional adjustments to the binding.
• To modify the policy priority, click the field to enable it, and then type a new priority. You
can also select Regenerate Priorities to renumber the priorities evenly.
• To modify the policy expression, double click that field to open the Configure App Fire-
wall Policy dialog box, where you can edit the policy expression.
• To set the Goto Expression, double click field in the Goto Expression column heading to
display the drop-down list, where you can choose an expression.
• To set the Invoke option, double click field in the Invoke column heading to display the
drop-down list, where you can choose an expression.
6. Repeat steps 3 through 6 to add any additional App Firewall policies you want to globally bind.
7. Click OK. A message appears in the status bar, stating that the policy has been successfully
bound.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can configure many App Firewall features from the NetScaler command line. There are important
exceptions, however. You cannot enable signatures from the command line. There are over 1,000
default signatures in seven categories; the task is simply too complex for the command line interface.
You can configure the check actions and parameters for security checks from the command line, but
cannot enter manual relaxations. While you can configure the adaptive learning feature and enable
learning from the command line, you cannot review learned relaxations or learned rules and approve
or skip them. The command line interface is intended for advanced users who are thoroughly familiar
with the NetScaler appliance and the App Firewall feature.
To manually configure the App Firewall by using the NetScaler command line, use a telnet or secure
shell client of your choice to log on to the NetScaler command line.
Example
The following example adds a profile named pr-basic, with basic defaults, and assigns a profile type
of HTML. This is the appropriate initial configuration for a profile to protect an HTML Web site.
• set appfw profile <name> <arg1> [<arg2> ...] where <arg1> represents a param-
eter and <arg2> represents either another parameter or the value to assign to the parameter
represented by <arg1>. For descriptions of the parameters to use when configuring specific
security checks, see Advanced Protections and its subtopics. For descriptions of the other pa-
rameters, see “Parameters for Creating a Profile.”
• save ns config
Example
The following example shows how to configure an HTML profile created with basic defaults to begin
protecting a simple HTML-based Web site. This example turns on logging and maintenance of statis-
tics for most security checks, but enables blocking only for those checks that have extremely low false
positive rates and require no special configuration. It also turns on transformation of unsafe HTML and
unsafe SQL, which prevents attacks but does not block requests to your Web sites. With logging and
statistics enabled, you can later review the logs to determine whether to enable blocking for a specific
security check.
Example
The following example adds a policy named pl-blog, with a rule that intercepts all traffic to or from
the host blog.example.com, and associates that policy with the profile pr-blog. This is an appropriate
policy to protect a blog hosted on a specific hostname.
Example
The following example binds the policy named pl-blog and assigns it a priority of 10.
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Signatures
Contributed by:
C
The App Firewall signatures function provides specific, configurable rules to simplify the task of pro-
tecting your web sites against known attacks. A signature represents a pattern that is a component
of a known attack on an operating system, web server, website, XML-based web service, or other re-
source. A rich set of preconfigured App Firewall built-in or Native rules offers an easy to use security
solution, leveraging the power of pattern matching to detect attacks and protect against application
vulnerabilities.
You can create your own signatures or use the signatures in the built-in templates. The App Firewall
has two built-in templates:
• Default Signatures: This template contains a preconfigured list of over 1,300 signatures, in ad-
dition to a complete list of SQL injection keywords, SQL special strings, SQL transform rules, and
SQL wildchar characters. It also contains denied patterns for cross-site scripting, and allowed
attributes and tags for cross-site scripting. This is a read-only template. You can view the con-
tents, but you cannot add, edit, or delete anything in this template. To use it, you must make
a copy. In your own copy, you can enable the signature rules that you want to apply to your
traffic, and specify the actions to be taken when the signature rules match the traffic.
The App Firewall signatures are derived from the rules published by Snort, which is an open source
intrusion prevention system capable of performing real-time traffic analysis to detect a variety of at-
tacks and probes.
• *Xpath Injection Patterns: This template contains a preconfigured set of literal and PCRE key-
words and special strings that are used to detect XPath (XML Path Language) injection attacks.
Blank Signatures: In addition to making a copy of the built-in *Default Signatures template, you can
use a blank signatures template to create a new signature object. The signature object that you create
with the blank signatures option does not have any native signature rules, but, just like the *Default
template, it has all the SQL/XSS built-in entities.
External-Format Signatures: The App Firewall also supports the use of external format signatures.
You can import the scan files of the third party scan tools by using the XSLT files that are supported
by the NetScaler App Firewall. A set of built-in XSLT files are available for the following scan tools to
translate these external format files to the Native format:
• Cenzic
• Deep Security for Web Apps
• IBM AppScan Enterprise
• IBM AppScan Standard.
• Qualys
• Whitehat
• Hewlett Packard Enterprise WebInspect
Tighter security increases processing overhead. Signatures provide the following deployment options
to help you to optimize the protection of your applications:
• Negative Security Model: With the negative security model, you use a rich set of preconfigured
signature rules to leverage the power of pattern matching to detect attacks and protect against
application vulnerabilities. You block only what you don’t want and allow the rest. You can add
your own signature rules, based on the specific security needs of your applications, to design
your own customized security solutions.
• Hybrid security Model: In addition to using signatures, you can use positive security checks
to create a configuration ideally suited for your applications. Use signatures to block what you
don’t want, and use positive security checks to enforce what is allowed.
To protect your application by using signatures, you must configure one or more profiles to use your
signatures object. In a hybrid security configuration, the SQL injection and Cross-Site scripting pat-
terns, and the SQL transformation rules, in your signatures object are used not only by the signature
rules, but also by the positive security checks configured in the App Firewall profile that is using the
signatures object.
The App Firewall examines the traffic to your protected web sites and web services to detect traffic
that matches a signature. A match is triggered only when every pattern in the rule matches the traffic.
When a match occurs, the specified actions for the rule are invoked. You can display an error page or
error object when a request is blocked. Log messages can help you to identify attacks being launched
against your application. If you enable statistics, the App Firewall maintains data about requests that
match an App Firewall signature or security check.
If the traffic matches both a signature and a positive security check, the more restrictive of the two
actions is enforced. For example, if a request matches a signature rule for which the block action is
disabled, but the request also matches an SQL Injection positive security check for which the action is
block, the request is blocked. In this case, the signature violation might be logged as <not blocked
>, although the request is blocked by the SQL injection check.
Customization: If necessary, you can add your own rules to a signatures object. You can also cus-
tomize the SQL/XSS patterns. The option to add your own signature rules, based on the specific se-
curity needs of your applications, gives you the flexibility to design your own customized security
solutions. You block only what you don’t want and allow the rest. A specific fast-match pattern in
a specified location can significantly reduce processing overhead to optimize performance. You can
add, modify, or remove SQL injection and cross-site scripting patterns. Built-in RegEx and expression
editors help you configure your patterns and verify their accuracy.
Auto-update: You can manually update the signature object to get the latest signature rules, or you
can leverage the auto-update feature so that the App Firewall can automatically update the signatures
from the cloud-based App Firewall updates service.
Note
If new signature rules are added during auto-update, they are disabled by default. You should
periodically review the updated signatures and enable the newly added rules that are pertinent
for protecting your applications.
Getting started
Using Citrix signatures to protect your application is quite easy and can be accomplished in a few
simple steps:
• You can use the Wizard that prompts you to create the entire App Firewall configuration, includ-
ing adding the profile and policy, selecting and enabling signatures, and specifying actions for
signatures and positive security checks. The signatures object is created automatically.
• You can create a copy of the signatures object from the *Default Signatures template, use a blank
template to create a new signature with your own customized rules, or add an external format
signature. Enable the rules and configure the actions that you want to apply.
2. Configure the target App Firewall profile to use this signatures object.
Highlights
• The *Default signatures object is a template. It cannot be edited or deleted. To use it, you must
create a copy. In your own copy, you can enable the rules and the desired action for each rule as
required for your application. To protect the application, you must configure the target profile
to use this signature.
• Processing signature patterns has overhead. Try to enable only those signatures that are appli-
cable for protecting your application, rather than enabling all signature rules.
• Every pattern in the rule must match to trigger a signature match.
• You can add your own customized rules to inspect incoming requests to detect various types of
attacks, such as SQL injection or cross-site scripting attacks. You can also add rules to inspect
the responses to detect and block leakage of sensitive information such as credit card numbers.
• You can make a copy of an existing signatures object and tweak it, by adding or editing rules
and SQL/XSS patterns, to protect another application.
• You can use auto-update to download the latest version of the App Firewall default rules without
need for ongoing monitoring to check for the availability of the new update.
• A signature object can be used by more than one profile. Even after you have configured one
or more profile(s) to use a signature object, you can still enable or disable signatures or change
the action settings. You can manually create and modify your own custom signature rules. The
changes will apply to all the profiles that are currently configured to use this signature object.
• You can configure signatures to detect violations in various types of payloads, such as HTML,
XML, JSON, and GWT.
• You can export a configured signatures object and import it to another NetScaler appliance for
easy replication of your customized signature rules.
Signatures are patterns that are associated with a known vulnerability. You can use signature protec-
tion to identify the traffic that attempts to exploit these vulnerabilities, and take specific actions.
Signatures are organized into categories. You can optimize the performance and reduce the process-
ing overhead by enabling only the rules in the categories that are appropriate for protecting your ap-
plication.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
To use signatures to protect your web sites, you must review the rules, and enable and configure the
ones that you want to apply. The rules are disabled by default. Citrix recommends that you enable all
rules that are applicable to the type of content that your web site uses.
To manually configure the signatures feature, use a browser to connect to the GUI. Then, create a
signatures object from a built-in template, an existing signatures object, or by importing a file. Next,
configure the new signatures object as explained in Configuring or Modifying a Signatures Object.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can add a new signatures object to the App Firewall by:
You must use the GUI to copy a template or existing signatures object. You can use either the GUI or
the command line to import a signatures object. You can also use either the GUI or the command line
to remove a signatures object.
2. In the details pane, select the signatures object that you want to use as a template.
• Default Signatures. Contains the signatures rules, the SQL injection rules, and the cross-
site scripting rules.
• XPath Injection. Contains the XPath injection patterns.
• Any existing signatures object.
Attention:
If you do not choose a signatures type to use as a template, the App Firewall will prompt
you to create signatures from scratch.
3. Click Add.
4. In the Add Signatures Object dialog box, type a name for your new signatures object, and then
click OK. The name can begin with a letter, number, or the underscore symbol, and can consist
of from one to 31 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@),
equals (=), and underscore (_) symbols.
5. Click Close.
Example #1
The following example creates a new signatures object from a file named signatures.xml and assigns
it the name MySignatures.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You configure a signatures object after creating it, or modify an existing signatures object, to enable
or disable signature categories or specific signatures, and configure how the App Firewall responds
when a signature matches a connection.
2. In the details pane, select the signatures object that you want to configure, and then click Open.
3. In the Modify Signatures Object dialog box, set the Display Filter Criteria options at the left
to display the filter items that you want to configure.
As you modify these options, the results that you requested are displayed in the Filtered Results win-
dow at the right.
16 | --------- |
--------------------------------------------------------------------------
|
17 | Enabled | The signature is enabled. The App Firewall checks
only for signatures that are enabled when it processes traffic.
|
18 | Block | Connections that match this signature are blocked.
|
19 | Log | A log entry is produced for any connection that
matches this signature.
|
20 | Stats | The App Firewall includes any connection that matches
this signature in the statistics that it generates for that
check. |
21 - To display only signatures that contain a specific string, type the
string into the text box under the filter criteria, and then click
Search.
22 - To reset all display filter criteria to the default settings and
display all signatures, click Show All.
1. For information about a specific signature, select the signature, and then click the blue double
arrow in the More field. The Signature Rule Vulnerability Detail message box appears. It con-
tains information about the purpose of the signature and provides links to external web-based
information about the vulnerability or vulnerabilities that this signature addresses. To access
an external link, click the blue double arrow to the left of the description of that link.
2. Configure the settings for a signature by selecting the appropriate check boxes.
3. If you want to add a local signature rule to the signatures object, or modify an existing local
signature rule, see “The Signatures Editor.”
4. If you have no need for SQL injection, cross-site scripting, or Xpath injection patterns, click OK,
and then click Close. Otherwise, in the lower left-hand corner of the details pane, click Manage
SQL/XSS Patterns.
5. In the Manage SQL/XSS Patterns dialog box, Filtered Results window, navigate to the pattern
category and pattern that you want to configure. For information about the SQL injection pat-
terns, see “HTML SQL Injection Check.” For information about the cross-site scripting patterns,
see “HTML Cross-Site Scripting Check.
a) Select the branch to which you want to add the new pattern.
b) Click the Add button directly below the lower section of the Filtered Results window.
c) In the Create Signature Item dialog box, fill in the Element text box with the pattern that
you want to add. If you are adding a transformation pattern to the transform rules branch,
under Elements, fill in the From text box with the pattern that you want to change and the
To text box with the pattern to which you want to change the previous pattern.
d) Click OK.
a) In the Filtered Results window, select the branch that contains the pattern that you want
to modify.
b) In the detail window beneath the Filtered Results window, select the pattern that you
want to modify.
c) Click Modify.
d) In the Modify Signature Item dialog box, Element text box, modify the pattern. If you
are modifying a transformation pattern, you can modify either or both patterns under Ele-
ments, in the From and the To text boxes.
e) Click OK.
8. To remove a pattern, select the pattern that you want to remove, then click the Remove button
below the details pane beneath the Filtered Results window. When prompted, confirm your
choice by clicking Close.
a) Select the branch to which you want to add the patterns category.
b) Click the Add button directly below the Filtered Results window.
Note: Currently you can add only one category, named patterns, to the XSS branch, so after
you click Add,you must accept the default choice, which is patterns.
3. Click OK.
10. To remove a branch, select that branch, and then click the Remove button directly below the
Filtered Results window. When prompted, confirm your choice by clicking OK.
Note: If you remove a default branch, you remove all of the patterns in that branch. Doing
so can disable the security checks that use that information.
11. When you are finished modifying the SQL injection, cross-site scripting, and XPath injection pat-
terns, click OK, and then click Close to return to the Modify Signatures Object dialog box.
12. Click OK at any point to save your changes, and when you are finished configuring the signatures
object, click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
JavaScript Object Notation (JSON) is a text-based open standard derived from the JavaScript scripting
language. JSON is preferred for human readable representation of simple data structures and associa-
tive arrays, called objects. It serves as an alternative to XML and is primarily used to transmit serialized
data structures for communicating with web applications. The JSON files are typically saved with a
.json extension.
The JSON payload is typically sent with the MIME type specified as application/json. The other “stan-
dard” content types for JSON are:
• application/x-javascript
• text/javascript
• text/x-javascript
• text/x-json
To allow JSON requests, the appliance is preconfigured with the JSON content type as shown in the
following show-command output:
The NetScaler App Firewall processes the post body for the following content-types only:
• application/x-www-form-urlencoded
• multipart/form-data
• text/x-gwt-rpc
The requests that are received with other content-type headers including application/json (or any
other allowed content type) are forwarded to the backend after header inspection. The post body in
such requests is not inspected for security check violations even when the profile’s security checks
such as SQL or XSS are enabled.
In order to protect JSON applications and detect violations, App Firewall signatures can be used. All
requests that contain the allowed content-type header are processed by the App Firewall for signature
match. You can add your own customized signature rules to process JSON payload to perform various
security check inspections (for example, XSS, SQL, and Field Consistency), to detect violations in the
headers as well as the post body, and take specified actions.
Tip
Unlike the other built-in defaults, the preconfigured JSON content type can be edited or removed
by using the CLI or the GUI (GUI). If legitimate requests for JSON applications are getting blocked
and triggering content-type violations, check to make sure that the content type value is con-
figured accurately. For additional details regarding how App Firewall processes content-type
header, see Content type protection
Navigate to Security > App Firewall and, in the Settings section, select Manage JSON Content
Types.
In the Configure App Firewall JSON Content Type panel, add, edit, or delete JSON content types to
suit the needs of your applications.
In addition to a valid JSON content type, you need to configure signatures to specify the pattern(s)
that, when detected in a JSON request, indicate a security breach. The specified actions, such as
block and log, are taken when an incoming request triggers a match for all the target patterns in the
signature rule.
To add a customized signature rule, Citrix recommends that you use the GUI. Navigate to System >
Security > App Firewall > Signatures. Double click the target signature object to access the Edit App
Firewall Signatures panel. Click on the Add button to configure the actions, category, log string, rule
patterns and so on. Although App Firewall inspects all allowed content-type payload for signature
match, you can optimize the processing by specifying the JSON expression in the rule. When you
Add a new rule pattern, select Expression in the drop-down options for Match and provide the target
match expression from your JSON payload to identify the specific requests that need to be inspected.
An expression must begin with a TEXT. prefix. You can add other rule patterns to specify additional
match patterns to identify the attack.
The following example shows a signature rule. If any cross-site script tag is detected in the POST body
of the JSON payload that matches the specified XPATH_JSON expression, a signature match is trig-
gered.
32
33 </PatternList>
34
35 <LogString>Cross-site scripting violation detected in json payload</
LogString>
36
37 <Comment/>
38
39 </SignatureRule>
The following payload triggers the signature match, because it includes the cross-site scripting tag
<Gotcha!!>.
1 {
2 ”glossary”: {
3 ”title”: ”example glossary”,”GlossDiv”: {
4 ”title”: ”S”,”GlossList”: {
5 ”GlossEntry”: {
6 ”ID”: ”SGML”,”SortAs”: ”SGML”,”GlossTerm”: ”Standard Generalized
Markup Language”,”Acronym”: ”SGML”,”Abbrev”: ”ISO 8879:1986”,”
GlossDef”: {
7 ”para”: ”A meta-markup language, used to create markup languages **<
Gotcha!!>** such as DocBook.”,”GlossSeeAlso”: [”GML”, ”XML”] }
8 ,”GlossSee”: ”markup” }
9 }
10 }
11 }
12 }
Note
If you send the same payload after removing the cross-site script tag (<Gotcha!!>), the signature
rule match is not triggered.
Highlights
• To protect JSON payload, use App Firewall signatures to detect XSS, SQL and other violations.
• Verify that the JSON content type is configured on the appliance as the allowed content type.
• Make sure that the content type in the payload matches the configured JSON content type.
• Make sure that all the patterns configured in the signature rule match for the signature violation
to be triggered.
• When you add a signature rule, it MUST have at least one Rule pattern to match the Expression
in the JSON payload. All the PI expressions in signature rules must start with the prefix TEXT.
and must be Boolean.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You should update your signatures objects frequently to ensure that your App Firewall is providing pro-
tection against current threats. You should regularly update both the default App Firewall signatures
and any signatures that you import from a supported vulnerability scanning tool.
Citrix regularly updates the default signatures for the App Firewall. You can update the default signa-
tures manually or automatically. In either case, ask your Citrix representative or Citrix reseller for the
URL to access the updates. You can enable automatic updates of the Citrix native format signatures
in the “Engine Settings” and “Signature Auto Update Settings” dialog boxes.
Most makers of vulnerability scanning tools regularly update the tools. Most web sites also change
frequently. You should update your tool and rescan your web sites regularly, exporting the resulting
signatures to a file and importing them into your App Firewall configuration.
Tip
When you update the App Firewall signatures from the NetScaler command line, you must first
update the default signatures, and then issue additional update commands to update each cus-
tom signatures file that is based on the default signatures. If you do not update the default sig-
natures first, a version mismatch error prevents updating of the custom signatures files.
Note
The following applies to merging a third-party signature object with a user-defined signature
object with Native rules and user-added rules:
When a version 0 signatures is merged with a new imported file, the resultant signatures will
remain as version 0.
This means all native (or built-in) rules in the imported file will be ignored after the merge. This
is to ensure that the version 0 signatures are maintained as is after a merge.
In order to include the native rules in the imported file for merge, you should update the existing
signatures from version 0 first before the merge. This means you need to abandon the version
0 nature of the existing signatures.
To update the App Firewall signatures from the source by using the command line
Example
The following example updates the signatures object named MySignatures from the default signa-
tures object, merging new signatures in the default signatures object with the existing signatures.
This command does not overwrite any user-created signatures or signatures imported from another
source, such as an approved vulnerability scanning tool.
Citrix regularly updates the signatures for the App Firewall. You should regularly update the signatures
on your App Firewall to ensure that your App Firewall is using the most current list. Ask your Citrix
representative or Citrix reseller for the URL to access the updates.
To update a signatures object from a Citrix format file by using the command line
To update a signatures object from a Citrix format file by using the GUI
Note: Before you update a signatures object from a file, you must create the file by exporting
signatures from the vulnerability scanning tool.
• Use Built-in XSLT File—Choose this option if you want to use a built-in XSLT files.
• Use Local XSLT File—Choose this option to use an XSLT file on your local computer.
• Reference XSLT from URL—Choose this option to import an XSLT file from a web URL.
6. If you chose Use Built-in XSLT File, in the Built-In XSLT drop-down list select the file that you want
to use from the following options:
• Cenzic.
• Deep_Security_for_Web_Apps.
• Hewlett_Packard_Enterprise_WebInspect.
• IBM-AppScan-Enterprise.
• IBM-AppScan-Standard.
• Qualys.
• Whitehat.
7. Click Update. The update file is imported, and the Update Signatures dialog box changes to a
format nearly identical to that of the Modify Signatures Object dialog box, which is described
in “Configuring or Modifying a Signatures Object.” The Update Signatures Object dialog box
displays all branches with new or modified signature rules, SQL injection or cross-site scripting
patterns, and XPath injection patterns if there are any.
8. Review and configure the new and modified signatures.
9. When you are finished, click OK, and then click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You export a signatures object to a file so that you can import it to another NetScaler.
4. In the Export Signatures Object dialog box, Local File text box, type the path and name of the
file to which you want to export the signatures object, or use the Browse dialog to designate a
path and name.
5. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can use the signatures editor, which is available in the GUI, to add a new user-defined (local) sig-
nature rule to an existing signatures object, or to modify a previously configured local signature rule.
Except that it is defined by the user (you), a local signature rule has the same attributes as a default
signature rule from Citrix, and it functions in the same way. You enable or disable it, and configure
the signature actions for it, just as you do for a default signature.
Add a local rule if you need to protect your web sites and services from a known attack that the existing
signatures do not match. For example, you might discover a new type of attack and determine its
characteristics by examining the logs on your web server, or you might obtain third-party information
about a new type of attack.
At the heart of a signature rule are the rule patterns, which collectively describe the characteristics
of the attack that the rule is designed to match. Each pattern can consist of a simple string, a PCRE-
format regular expression, or the built-in SQL injection or cross-site scripting patterns.
You might want to modify a signature rule by adding a new pattern or modifying an existing pattern to
match an attack. For example, you might find out about changes to an attack, or you might determine
a better pattern by examining the logs on your web server, or from third-party information.
2. In the details pane, select the signatures object that you want to edit, and then click Open.
3. In the Modify Signatures Object dialog box, in the middle of the screen beneath the Filtered
Results window, do one of the following:
4. In the Add Local Signature Rule or the Modify Local Signature Rule dialog box, configure the
actions for a signature by selecting the appropriate check boxes.
• Enabled. Enables the new signature rule. If you do not select this, this new signature rule
is added to your configuration, but is inactive.
• Block. Blocks connections that violate this signature rule.
• Log. Logs violations of this signature rule to the NetScaler log.
• Stat. Includes violations of this signature rule in the statistics.
• Remove. Strips information that matches the signature rule from the response. (Applies
only to response rules.)
• X-Out. Masks information that matches the signature rule with the letter X. (Applies only
to response rules.)
• Allow Duplicates. Allows duplicates of this signature rule in this signatures object.
5. Choose a category for the new signature rule from the Category drop-down list.
You can also create a new category by clicking the icon to the right of the list and using the Add
Signature Rule Category dialog box to add a new category to the list, The rule you are modify-
ing is automatically added to the new category. For instructions, see “To add a signature rule
category.”
6. In the LogString text box, type a brief description of the signature rule to be used in the logs.
a) To strip HTML comments before applying this signature rule, in the Strip Comments drop-
down list choose All or Exclude Script Tag.
b) To set CSRF Referer Header checking, in the CSRF Referer Header checking radio button
array, select either the If Present or Always radio button.
c) To manually modify the Rule ID assigned to this local signature rule, modify the number in
the Rule ID text box. The ID must be a positive integer between 1000000 and 1999999 that
has not already been assigned to a local signature rule.
d) To assign a version number to the new signature rule, modify the number in the Version
Number text box.
e) To assign a Source ID, modify the string in the Source ID text box.
f) To specify the source, choose Local or Snort from the Source drop-down list, or click the
Add icon to the right of the list and add a new source.
g) To assign a harm score to violations of this local signature rule, type a number between 1
and 10 in the Harm Score text box.
h) To assign a severity rating to this local signature rule, in the Severity drop-down list choose
High, Medium, or Low, or click the Add icon to the right of the list and add a new severity
rating.
i) To assign a violation type to this local signature rule, in the Type drop-down list choose
Vulnerable or Warning, or click the Add icon to the right of the list and add a new violation
type.
• To add a pattern, click Add. In the Create New Signature Rule Pattern dialog box, add
one or more patterns for your signature rule, and then click OK.
• To edit a pattern, select the pattern, and then click Open. In the Edit Signature Rule Pat-
tern dialog box, modify the pattern, and then click OK.
For more information about adding or editing patterns, see “Signature Rule Patterns.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Putting signature rules into a category enables you to configure the actions for a group of signatures
instead of for each individual signature. You might want to do so for the following reasons:
• Ease of selection. For example, assume that all of signature rules in a particular group protect
against attacks on a specific type of web server software or technology. If your protected web
sites use that software or technology, you want to enable them all. If they do not, you do not
want to enable any of them.
• Ease of initial configuration. It is easiest to set defaults for a group of signatures as a category,
instead of one-by-one. You can then make any changes to individual signatures as needed.
• Ease of ongoing configuration. It is easier to configure signatures if you can display only those
that meet specific criteria, such as belonging to a specific category.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can add a new pattern to a signature rule or modify an existing pattern of a signature rule to spec-
ify a string or expression that characterizes an aspect of the attack that the signature matches. To
determine which patterns an attack exhibits, you can examine the logs on your web server, use a tool
to observe connection data in real time, or obtain the string or expression from a third-party report
about the attack.
Caution:
Each pattern can consist of a simple string, a PCRE-format regular expression, or the built-in SQL in-
jection or cross-site scripting pattern. Before you attempt to add a pattern that is based on a regular
expression, you should make sure that you understand PCRE-format regular expressions. PCRE ex-
pressions are complex and powerful; if you do not understand how they work, you can unintentionally
create a pattern that matches something that you did not want (a false positive) or that fails to match
something that you did want (a false negative).
If you are not already familiar with PCRE-format regular expressions, you can use the following re-
sources to learn the basics, or for help with some specific issue:
• “Mastering Regular Expressions”, Third Edition. Copyright (c) 2006 by Jeffrey Friedl. O’Reilly
Media, ISBN: 9780596528126.
• “Regular Expressions Cookbook”. Copyright (c) 2009 by Jan Goyvaerts and Steven Levithan.
O’Reilly Media, ISBN: 9780596520687
• PCRE Man page/Specification (text/official): http://www.pcre.org/pcre.txt
• PCRE Man Page/Specification (html/gammon.edu.au): http://www.gammon.com.au/pcre
/index.html
• Wikipedia PCRE entry: “http://en.wikipedia.org/wiki/PCRE”
• PCRE Mailing List (run by exim.org): http://lists.exim.org/mailman/listinfo/pcre
-dev
If you need to encode non-ASCII characters in a PCRE-format regular expression, the NetScaler plat-
form supports encoding of hexadecimal UTF-8 codes. For more information, see “PCRE Character
Encoding Format.”
2. In the details pane, select that signatures object that you want to configure, and then click Open.
3. In the Modify Signatures Object dialog box, in the middle of the screen beneath the Filtered
Results window, either click Add to create a signature rule, or select an existing signature rule
and click Open.
Note:
You can modify only signature rules that you added. You cannot modify the default signa-
ture rules.
Depending on your action, either the Add Local Signature Rule or the Modify Local Signature
Rule dialog box appears. Both dialog boxes have the same contents.
4. Under the Patterns window in the dialog box, either click Add to add a new pattern, or select an
existing pattern from the list beneath the Add button and click Open. Depending on your action,
either the Create New Signature Rule Pattern or the Edit Signature Rule Pattern dialog box
appears. Both dialog boxes have the same contents.
5. In the Pattern Type drop-down list, choose the type of connection that the pattern is intended
to match.
• If the pattern is intended to match request elements or features, such as injected SQL code,
attacks on web forms, cross-site scripts, or inappropriate URLs, choose Request.
• If the pattern is intended to match response elements or features, such as credit card num-
bers or safe objects, choose Response.
6. In the Location area, define the elements to examine with this pattern.
The Location area describes what elements of the HTTP request or response to examine for this
pattern. The choices that appear in the Location area depend upon the chosen pattern type.
If you chose Request as the pattern type, items relevant to HTTP requests appear; if you chose
Response, items relevant to HTTP responses appear.
In addition, as you choose a value from the Area drop-down list, the remaining parts of the Lo-
cation area change interactively. Following are all configuration items that might appear in this
section.
• Area Drop-down list of elements that describe a particular portion of the HTTP connection.
The choices are as follows:
– HTTP_ANY. All parts of the HTTP connection.
– HTTP_COOKIE. All cookies in the HTTP request headers after any cookie transforma-
tions are performed.
Note: Does not search HTTP response “Set-Cookie:” headers.
– HTTP_FORM_FIELD. Form fields and their contents, after URL decoding, percent de-
coding, and removal of excess whitespace. You can use the <Location> tag to further
restrict the list of form field names to be searched.
– HTTP_HEADER. The value portions of the HTTP header after any cross-site scripting
or URL decoding transformations.
– HTTP_METHOD. The HTTP request method.
– HTTP_ORIGIN_URL. The origin URL of a web form.
– HTTP_POST_BODY. The HTTP post body and the web form data that it contains.
– HTTP_RAW_COOKIE. All HTTP request cookie, including the “Cookie:” name portion.
Note: Does not search HTTP response “Set-Cookie:” headers.
– HTTP_RAW_HEADER. The entire HTTP header, with individual headers separated by
linefeed characters (\n) or carriage return/line-feed strings (\r\n).
– HTTP_RAW_RESP_HEADER. The entire response header, including the name and
value parts of the response header after URL transformation has been done, and
the complete response status. As with HTTP_RAW_HEADER, individual headers are
separated by linefeed characters (\n) or carriage return/line-feed strings (\r\n).
– HTTP_RAW_SET_COOKIE. The entire Set-Cookie header after any URL transforma-
tions have been performed
Note: URL transformation can change both the domain and path parts of the Set-
Cookie header.
– HTTP_RAW_URL. The entire request URL before any URL transformations are per-
formed, including any query or fragment parts.
– HTTP_RESP_HEADER. The value part of the complete response headers after any URL
transformations have been performed.
– HTTP_RESP_BODY. The HTTP response body
– HTTP_SET_COOKIE. All “Set-Cookie” headers in the HTTP response headers.
– HTTP_STATUS_CODE. The HTTP status code.
– HTTP_STATUS_MESSAGE. The HTTP status message.
– HTTP_URL. The value portion of the URL in the HTTP headers, excluding any query or
fragment ports, after conversion to the UTF-* character set, URL decoding, stripping
of whitespace, and conversion of relative URLs to absolute. Does not include HTML
entity decoding.
• URL
Examines any URLs found in the elements specified by the
Area setting. Select one of the following settingss.
– Any. Checks all URLs.
– Literal. Checks URLs that contain a literal string. After you select Literal, a text box is
displayed. Type the literal string that you want in the text box.
– PCRE. Checks URLs that match a PCRE-format regular expression. After you select
this choice, the regular expression window is displayed. Type the regular expression
in the window. You can use the Regex Tokens to insert common regular expression
elements at the cursor, or you can click Regex Editor to display the Regular Expression
Editor dialog box, which provides more assistance in constructing the regular expres-
sion that you want.
– Expression. Checks URLs that match a NetScaler default expression.
• Field Name
Examines any form field names found in the elements specified by the
Area selection.
– Any. Checks all URLs.
– Literal. Checks URLs that contain a literal string. After you select Literal, a text box is
displayed. Type the literal string that you want in the text box.
– PCRE. Checks URLs that match a PCRE-format regular expression. After you select
this choice, the regular expression window is displayed. Type the regular expression
in the window. You can use the Regex Tokens to insert common regular expression
elements at the cursor, or you can click Regex Editor to display the Regular Expression
Editor dialog box, which provides more assistance in constructing the regular expres-
sion that you want.
– Expression. Checks URLs that match a NetScaler default expression.
7. In the Pattern area, define the pattern. A pattern is a literal string or PCRE-format regular expres-
sion that defines the pattern that you want to match. The Pattern area contains the following
elements:
• Match
A drop-down list of search methods that you can use for the signature. This list differs
depending on whether the pattern type is Request or Response.
• Injection. Directs the App Firewall to look for injected SQL in the specified location. The Pattern
window disappears, because the App Firewall already has the patterns for SQL injection.
• CrossSiteScripting. Directs the App Firewall to look for cross-site scripts in the specified loca-
tion. The Pattern window disappears, because the App Firewall already has the patterns for
cross-site scripts.
• Expression. An expression in the NetScaler default expressions language. This is the same
expressions language that is used to create App Firewall policies and other policies on the
NetScaler appliance. Although the NetScaler expressions language was originally developed
for policy rules, it is a highly flexible general purpose language that can also be used to define
a signature pattern.
When you choose Expression, the NetScaler Expression Editor appears beneath Pattern window. For
more information about the Expression Editor and instructions on how to use it, see “To add a firewall
rule (expression) by using the Add Expression dialog box
NOTE:
When you choose PCRE, the regular expression tools beneath the Pattern window are enabled.
These tools are not useful for most other types of patterns.
• Credit Card. A built-in pattern to match one of the six supported types of credit card number.
Note: The Expression match type is not available for Response-side signatures.
In this window, type the pattern that you want to match, and fill in any additional data.
1 - Literal. Type the string you want to search for in the text area.
2 - PCRE. Type the regular expression in the text area. Use the **Regex
Editor** for more assistance in constructing the regular expression
that you want, or the Regex Tokens to insert common regular
1. Click OK.
3. When finished adding or modifying patterns, click OK to save your changes and return to the
Signatures pane.
Caution:
Until you click OK in the Add Local Signature Rule or Modify Local Signature Rule dialog
box, your changes are not saved. Do not close either of these dialog boxes without clicking
OK unless you want to discard your changes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can use the signature editor to import and merge rules through the Citrix ADC GUI. You can see all
the new, updated, duplicate, and invalid rules.
1. New Rules
2. Updated Rules
3. Duplicate Rules
4. Invalid Rules
The output of New Rules Only and Updated Rules Only filters appears in the Category filter pane of
the Edit window in signature editor.
You must import files through the GUI to see the corresponding links for new, duplicate, invalid, and
updated rules.
For example, you can use the Citrix ADC GUI to import the following signature files:
<http://1.1.1.1/testsite/signatures/sig-3100000.xml>.
1. In the NetScaler web GUI, go to Configuration > Security > Application Firewall > Signatures.
In the Signatures window, click Add. Then select File Format > Native, Import From >
URL and in the URL field, add the above link. For example; <http://1.1.1.1/testsite/
signatures/sig-3100000.xml>.
2. After you click Open, the signature file will open and you can see links for New Rule and Invalid
Rules.
3. If you import a 3<sup>rd</sup> party signature rule from the following site, for example;
<http://1.1.1.1/FFC/sig_validation/trendmicro_sample2.xml> as shown below,
you can see 90 new Rules and nine duplicate Rules in the imported .xml file.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The signature update occurs on the primary node. While the signatures are updated on the primary
node, in parallel the updated files are simultaneously synchronized with the secondary node.
The *Default signature is always updated first and then the rest of the user-defined signatures are
updated.
The default route NSIP is used to connect to the Amazon AWS. If there is a specific use case scenario
where SNIP is used, and if there are multiple SNIPs, the first one to receive the ARP response from the
hosting site will hold the route.
In case of an upgrade, if the NS has an older base version for the signatures, *Default signature is
automatically updated if a newer signature version is available.
If the schema has changed, the schema version of all the signature objects gets updated when the
version is upgraded.
However, for the base version of the user-defined signatures, the behavior is different in release 10.5
versus release 11.0.
In release 10.5, only the default signature was updated and the base version of the rest of the signa-
tures remained unchanged after the build upgrade.
In release 11.0, this behavior has changed. When the appliance is upgraded to install a new build, not
only the *Default signature object but all the other user-defined signatures that currently exist in the
appliance are also updated and will have the same version after the build upgrade.
In both 10.5 and 11.0 release builds, if auto-update is configured, the *Default Signatures as well as all
non-zero version signatures get auto-updated to the latest released signature version and will have
the same base version.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The App Firewall advanced protections (security checks) are a set of filters designed to catch complex
or unknown attacks on your protected web sites and web services. The security checks use heuris-
tics, positive security, and other techniques to detect attacks that may not be detected by signatures
alone. You configure the security checks by creating and configuring an App Firewall profile, which is
a collection of user-defined settings that tell the App Firewall which security checks to use and how
to handle a request or response that fails a security check. A profile is associated with a signatures
object and with a policy to create a security configuration.
The App Firewall provides twenty security checks, which differ widely in the types of attacks that they
target and how complex they are to configure. The security checks are organized into the following
categories:
• Common security checks. Checks that apply to any aspect of web security that either does not
involve content or is equally applicable to all types of content.
• HTML security checks. Checks that examine HTML requests and responses. These checks ap-
ply to HTML-based web sites and to the HTML portions of Web 2.0 sites, which contain mixed
HTML and XML content.
• XML security checks. Checks that examine XML requests and responses. These checks apply
to XML-based web services and to the XML portions of Web 2.0 sites.
The security checks protect against a wide range of types of attack, including attacks on operation
system and web server software vulnerabilities, SQL database vulnerabilities, errors in the design and
coding of web sites and web services, and failures to secure sites that host or can access sensitive
information.
All security checks have a set of configuration options, the check actions, which control how the App
Firewall handles a connection that matches a check. Three check actions are available for all security
checks. They are:
A fourth check action, Learn, is available for more than half of the check actions. It observes traffic to
a protected Web site or web service and uses connections that repeatedly violate the security check to
generate recommended exceptions (relaxations) to the check, or new rules for the check. In addition
to the check actions, certain security checks have parameters that control the rules that the check
uses to determine which connections violate that check, or that configure the App Firewall’s response
to connections that violate the check. These parameters are different for each check, and they are
described in the documentation for each check.
To configure security checks, you can use the App Firewall wizard, as described in “The App Firewall
Wizard,” or you can configure the security checks manually, as described in “Manual Configuration By
Using the GUI.” Some tasks, such as manually entering relaxations or rules or reviewing learned data,
can be done only by using the GUI, not the command line. Using the wizard is usually best configura-
tion method, but in some cases manual configuration might be easier if you are thoroughly familiar
with it and simply want to adjust the configuration for a single security check.
Regardless of which method you use to configure the security checks, each security check requires
that certain tasks be performed. Many checks require that you specify exceptions (relaxations) to pre-
vent blocking of legitimate traffic before you enable blocking for that security check. You can do this
manually, by observing the log entries after a certain amount of traffic has been filtered and then cre-
ating the necessary exceptions. However, it is usually much easier to enable the learning feature and
let it observe the traffic and recommend the necessary exceptions.
App Firewall uses packet engines (PE) during processing the transactions. Each packet engine has a
limit of 100K sessions which is sufficient for most deployment scenarios. However, when App Fire-
wall is processing heavy traffic and the session timeout is configured at a higher value, the sessions
might get accumulated. If the number of alive App Firewall sessions exceed the 100K per PE limit,
the App Firewall security check violations might not be sent to the Security Insight appliance. Low-
ering the session timeout to a smaller value, or using sessionless mode for the security checks with
sessionless URL closure or sessionless field consistency might help in preventing the sessions getting
accumulated. If this is not a viable option in scenarios where transactions might require longer ses-
sions, upgrading to a higher-end platform with more packet engine is recommended.
Support for cached AppFirewall is added, and the max session setting through the CLI per core is set
to 50K sessions.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Four of the App Firewall protections are especially effective against common types of Web attacks,
and are therefore more commonly used than any of the others. They are:
• HTML Cross-Site Scripting. Examines requests and responses for scripts that attempt to access
or modify content on a different Web site than the one on which the script is located. When this
check finds such a script, it either renders the script harmless before forwarding the request or
response to its destination, or it blocks the connection.
• HTML SQL Injection. Examines requests that contain form field data for attempts to inject SQL
commands into an SQL database. When this check detects injected SQL code, it either blocks
the request or renders the injected SQL code harmless before forwarding the request to the Web
server.
Note: If both of the following conditions apply to your configuration, you should make certain
that your App Firewall is correctly configured:
– If you enable the HTML Cross-Site Scripting check or the HTML SQL Injection check (or
both), and
– Your protected Web sites accept file uploads or contain Web forms that can contain large
POST body data.
For more information about configuring the App Firewall to handle this case, see “Configuring
the Application Firewall.”
• Buffer Overflow. Examines requests to detect attempts to cause a buffer overflow on the Web
server.
• Cookie Consistency. Examines cookies returned with user requests to verify that they match
the cookies your Web server set for that user. If a modified cookie is found, it is stripped from
the request before the request is forwarded to the Web server.
The Buffer Overflow check is simple; you can usually enable blocking for it immediately. The other
three top-level checks are considerably more complex and require configuration before you can safely
use them to block traffic. Citrix strongly recommends that, rather than attempting to configure these
checks manually, you enable the learning feature and allow it to generate the necessary exceptions.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The HTML Cross-Site Scripting (XSS) check examines both the headers and the POST bodies of user
requests for possible cross-site scripting attacks. If it finds a cross-site script, it either modifies (trans-
forms) the request to render the attack harmless, or blocks the request.
To prevent misuse of the scripts on your protected web sites to breach security on your web sites,
the HTML Cross-Site Scripting check blocks scripts that violate the same origin rule, which states that
scripts should not access or modify content on any server but the server on which they are located.
Any script that violates the same origin rule is called a cross-site script, and the practice of using scripts
to access or modify content on another server is called cross-site scripting. The reason cross-site
scripting is a security issue is that a web server that allows cross-site scripting can be attacked with a
script that is not on that web server, but on a different web server, such as one owned and controlled
by the attacker.
Unfortunately, many companies have a large installed base of JavaScript-enhanced web content that
violates the same origin rule. If you enable the HTML Cross-Site Scripting check on such a site, you
have to generate the appropriate exceptions so that the check does not block legitimate activity.
The App Firewall offers various action options for implementing HTML Cross-Site Scripting protection.
In addition to the Block, Log, Stats and Learn actions, you also have the option to Transform cross-
site scripts to render an attack harmless by entity encoding the script tags in the submitted request.
You can configure Check complete URL’s for cross-site scripting parameter to specify if you want to
inspect not just the query parameters but the entire URL to detect XSS attack.
You can deploy relaxations to avoid false positives. The App Firewall learning engine can provide rec-
ommendations for configuring relaxation rules.
Following options are available for configuring an optimized HTML Cross-Site Scripting protection for
your application:
• Block—If you enable block, the block action is triggered if the XSS tags are detected in the re-
quest.
• Log—If you enable the log feature, the HTML Cross-Site Scripting check generates log messages
indicating the actions that it takes. If block is disabled, a separate log message is generated for
each header or form field in which the XSS violation was detected. However, only one message
is generated when the request is blocked. Similarly, one log message per request is generated
for the transform operation, even when XSS tags are transformed in multiple fields. You can
monitor the logs to determine whether responses to legitimate requests are getting blocked. A
large increase in the number of log messages can indicate attempts to launch an attack.
• Stats—If enabled, the stats feature gathers statistics about violations and logs. An unexpected
surge in the stats counter might indicate that your application is under attack. If legitimate re-
quests are getting blocked, you might have to revisit the configuration to see if you need to
configure new relaxation rules or modify the existing ones.
• Learn—If you are not sure which relaxation rules might be ideally suited for your application,
you can use the learn feature to generate HTML Cross-Site Scripting rule recommendations
based on the learned data. The App Firewall learning engine monitors the traffic and provides
learning recommendations based on the observed values. To get optimal benefit without com-
promising performance, you might want to enable the learn option for a short time to get a
representative sample of the rules, and then deploy the rules and disable learning.
• Transform cross-site scripts—If enabled, the App Firewall makes the following changes to re-
quests that match the HTML Cross-Site Scripting check:
– Left angle bracket (<) to HTML character entity equivalent (<)
– Right angle bracket (>) to HTML character entity equivalent (>)
This ensures that browsers do not interpret unsafe html tags, such as <script>, and thereby execute
malicious code. If you enable both request-header checking and transformation, any special charac-
ters found in request headers are also modified as described above. If scripts on your protected web
site contain cross-site scripting features, but your web site does not rely upon those scripts to operate
correctly, you can safely disable blocking and enable transformation. This configuration ensures that
no legitimate web traffic is blocked, while stopping any potential cross-site scripting attacks.
• Check complete URLs for cross-site scripting—If checking of complete URLs is enabled, the
App Firewall examines entire URLs for HTML cross-site scripting attacks instead of checking just
the query portions of URLs.
• Check Request headers—If Request header checking is enabled, the App Firewall examines the
headers of requests for HTML cross-site scripting attacks, instead of just URLs. If you use the GUI,
you can enable this parameter in the Settings tab of the App Firewall profile.
Important
As part of the streaming changes, the App Firewall processing of the Cross-site Scripting tags
has changed. This change is applicable to 11.0 builds onwards. This change is also pertinent
for the enhancement builds of 10.5.e that support request side streaming. In earlier releases,
presence of either open bracket (<), or close bracket (>), or both open and close brackets (<>)
was flagged as Cross-site Scripting Violation. The behavior has changed in the builds that include
support for request side streaming. Only the close bracket character (>) is no longer considered
as an attack. Requests are blocked even when an open bracket character (<) is present, and is
considered as an attack. The Cross-site scripting attack gets flagged.
The App Firewall gives you an option to exempt a specific form field, header, or Cookie from cross-site
scripting inspection check. You can completely bypass the inspection for one or more of these fields
by configuring relaxation rules.
The App Firewall allows you to implement tighter security by fine tuning the relaxation rules. An ap-
plication might require the flexibility to allow specific patterns, but configuring a relaxation rule to
bypass the security inspection might make the application vulnerable to attacks, because the target
field is exempted from inspection for any cross-site scripting attack patterns. Cross-site scripting fine
grained relaxation provides the option to allow specific attributes, tags, and patterns. The rest of
the attributes, tags and patterns are blocked. For example, the App Firewall currently has a default
set of more than 125 denied patterns. Because hackers can use these patterns in Cross-site script at-
tacks, the App Firewall flags them as potential threats. You can relax one or more pattern(s) that are
considered safe for the specific location. The rest of the potentially dangerous XSS patterns are still
checked for the target location and continue to trigger the security check violations. You now have
much tighter control.
The commands used in relaxations have optional parameters for Value Type and Value Expression.
The value type can be left blank or you have an option to select Tag or Attribute or Pattern. If you
leave the value type blank, the configured field of the specified URL is exempted from the Cross-Site
Scripting check inspection. If you select a value type, you must provide a value expression. You
can specify whether the value expression is a regular expression or a literal string. When the input
is matched against the allowed and denied list, only the specified expressions configured in the relax-
ation rules are exempted.
1. XSS Allowed Attributes: There are 52 default allowed attributes, such as, abbr, accesskey,
align, alt, axis, bgcolor, border, cellpadding, cellspacing, char, charoff, charset etc.
2. XSS Allowed Tags: There are 47 default allowed tags, such as, address, basefont, bgsound,
big, blockquote, bg, br, caption, center, cite, dd, del etc.
3. XSS Denied Patterns: There are 129 default denied patterns, such as, FSCommand, javascript:,
onAbort, onActivate etc.
Warning
App Firewall action URL’s are regular expressions. When configuring HTML cross-site scripting
relaxation rules, you can specify Name, and Value Expression to be literal or RegEx. Regular
expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format regular
expressions, double-check any regular expressions you write. Make sure that they define exactly
the rule that you want to add as an exception, and nothing else. Careless use of wildcards, and
especially of the dot-asterisk ( .*) metacharacter/wildcard combination, can have results that you
do not want, such as blocking access to web content that you did not intend to block or allowing
an attack that the HTML Cross-Site Scripting check would otherwise have blocked.
Points to Consider:
• Value expression is an optional argument. A field name might not have any value expression.
• A field name can be bound to multiple value expressions.
• Value expressions should be assigned a value type. The XSS value type can be: 1) Tag, 2) At-
tribute, or 3) Pattern.
• You can have multiple relaxation rules per field name/URL combination
• The form field names and the action URL’s are not case sensitive.
Using the Command Line to Configure the HTML Cross-Site Scripting check
To configure HTML Cross-Site Scripting check actions and other parameters by using the command
line
If you use the command-line interface, you can enter the following commands to configure the HTML
Cross-Site Scripting Check:
To configure a HTML Cross-Site Scripting check relaxation rule by using the command line
In the GUI, you can configure the HTML Cross-Site Scripting check in the pane for the profile associated
with your application.
To configure or modify the HTML Cross-Site Scripting check by using the GUI
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security checks.
You have 2 options for configuration:
a. If you just want to enable or disable Block, Log, Stats, and Learn actions for the HTML Cross-Site
Scripting, you can select or clear check boxes in the table, click OK, and then click Save and Close to
close the Security Check pane.
b. If you want to configure additional options for this security check, double click HTML Cross-Site
Scripting, or select the row and click Action Settings, to display the following options:
Check complete URLs for Cross-site scripting—Instead of checking just the query part of the URL,
check the complete URL for cross-site script violations.
After changing any of the above settings, click OK to save the changes and return to the Security
Checks table. You can proceed to configure other security checks if needed. Click OK to save all the
changes you have made in the Security Checks section, and then click Save and Close to close the
Security Check pane.
To enable or disable the Check request Header setting, in the Advanced Settings pane, click Profile
Settings. In Common Settings, Select or clear the Check Request Headers check box. Click OK. You
can either use the X icon at the top right hand side of the Profile Settings pane to close this section
or, if you have finished configuring this profile, you can click Done to return to the Application Fire-
wall > Profile
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Relaxation Rules.
3. In the Relaxation Rules table, double-click the HTML Cross-Site Scripting entry, or select it and
click Edit.
4. In the HTML Cross-Site Scripting Relaxation Rules dialogue box, perform Add, Edit, Delete,
Enable, or Disable operations for relaxation rules.
Note
When you add a new rule, the Value Expression field is not displayed unless you select Tag or
Attribute or Pattern option in the Value Type Field.
For a consolidated view of all the relaxation rules, you can highlight the HTML Cross-Site Scripting
row in the Relaxation Rules table, and click Visualizer. The visualizer for deployed relaxations offers
you the option to Add a new rule or Edit an existing one. You can also Enable or Disable a group of
rules by selecting a node and clicking the corresponding buttons in the relaxation visualizer.
You can use the GUI to view or customize the default list of XSS allowed attributes or allowed tags. You
can also view or customize the default list of XSS denied Patterns.
The default lists are specified in Application Firewall > Signatures > Default Signatures. If you do
not bind any signature object to your profile, the default XSS allowed and denied list specified in the
Default Signatures object will be used by the profile for the Cross-Site Scripting security check process-
ing. The Tags, Attributes, and Patterns, specified in the default signatures object, are read-only. You
cannot edit or modify them. If you want to modify or change these, make a copy of the Default Signa-
tures object to create a User-Defined signature object. Make changes in the allowed or denied lists in
the new User-defined signature object and use this signature object in your profile that is processing
the traffic for which you want to use these customized allowed and denied lists.
a. Navigate to Application Firewall > Signatures, select *Default Signatures, and click Edit. Then
click Manage SQL/XSS Patterns.
The Manage SQL/XSS Paths table shows following three rows pertaining to XSS :
xss/allowed/attribute
xss/allowed/tag
xss/denied/pattern
b. Select a row and click Manage Elements to display the corresponding XSS Elements (Tag, Attribute,
Pattern) used by the App Firewall Cross-Site Scripting check.
1. To customize XSS Elements: You can edit the User-Defined signature object to customize the
allowed Tag, allowed Attributes and denied Patterns. You can add new entries or remove the
existing ones.
a. Navigate to Application Firewall > Signatures, highlight the target User-defined signature, and
click Edit. Click Manage SQL/XSS Patterns to display the Manage SQL/XSS paths table.
i. Click Manage Elements, to Add, Edit or Remove the corresponding XSS element.
You must be very careful before you remove or modify any default XSS element, or delete the XSS
path to remove the entire row. The signature rules as well as the Cross-Site Scripting security
check rely on these elements for detecting attacks to protect your applications. Customizing the
XSS Elements can make your application vulnerable to Cross-Site Scripting attacks if the required
pattern is removed during editing.
Using the Learn Feature with the HTML Cross-Site Scripting Check
When the learn action is enabled, the App Firewall learning engine monitors the traffic and learns the
triggered violations. You can periodically inspect these learned rules. After due consideration, you
can deploy the learned rule as a HTML Cross-Site Scripting relaxation rule.
HTML Cross-Site Scripting Learning enhancement—An App Firewall learning enhancement was in-
troduced in release 11.0 of the NetScaler software. To deploy fine grained HTML Cross-Site Scripting
relaxation, the App Firewall offers fine grained HTML Cross-Site Scripting learning. The learning en-
gine makes recommendations regarding the observed Value Type (Tag, Attribute, Pattern) and the
corresponding Value expression observed in the input fields. In addition to checking the blocked re-
quests to determine whether the current rule is too restrictive and needs to be relaxed, you can review
the rules generated by the learning engine to determine which value type and value expressions are
triggering violations and need to be addressed in relaxation rules.
Note
The App Firewall’s learning engine can distinguish only the first 128 bytes of the name. If a form
has multiple fields with names that match for the first 128 bytes, the learning engine might not
be able to distinguish between them. Similarly, the deployed relaxation rule might inadvertently
relax all such fields from HTML Cross-Site Scripting inspection.
Tip
XSS tags which are longer than 12 characters are not learned or logged correctly.
If you need a larger taglength for learning, you can add a large non-appearing tag in
the AS_XSS_ALLOWED_TAGS_LIST for length ‘x’.
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Learned Rules. You can select the HTML Cross-Site
Scripting entry in the Learned Rules table and double-click it to access the learned rules. The
table displays the Field Name, Action URL, Value Type, Value and Hits columns. You can
deploy the learned rules or edit a rule before deploying it as a relaxation rule. To discard a rule,
you can select it and click the Skip button. You can edit only one rule at a time, but you can
select multiple rules to deploy or skip.
You also have the option to show a summarized view of the learned relaxations by selecting the HTML
Cross-Site Scripting entry in the Learned Rules table and clicking Visualizer to get a consolidated
view of all the learned violations. The visualizer makes it very easy to manage the learned rules. It
presents a comprehensive view of the data on one screen and facilitates taking action on a group of
rules with one click. The biggest advantage of the visualizer is that it recommends regular expressions
to consolidate multiple rules. You can select a subset of these rules, based on the delimiter and Action
URL. You can display 25, 50, or 75 rules in the visualizer, by selecting the number from a drop-down
list. The visualizer for learned rules offers the option to edit the rules and deploy them as relaxations.
Or you can skip the rules to ignore them.
Using the Log Feature with the HTML Cross-Site Scripting Check
When the log action is enabled, the HTML Cross-Site Scripting security check violations are logged in
the audit log as APPFW_XSS violations. The App Firewall supports both Native and CEF log formats.
You can also send the logs to a remote syslog server.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the HTML Cross-Site Scripting violations:
Shell
tail -f /var/log/ns.log | grep APPFW_XSS
Example of a Cross-Site Scripting security check violation log message in CEF log format
Example of a Cross-Site Scripting security check violation log message in Native log format showing
transform action
for the App Firewall security check violations. The log messages must be in CEF log format for this
operation. Click to deploy functionality is available only for log messages that are generated by the
block (or not block) action. You cannot deploy a relaxation rule for a log message about the transform
operation.
To deploy a relaxation rule from the Syslog Viewer, select the log message. A check box appears in the
upper right corner of the Syslog Viewer box of the selected row. Select the check box, and then select
an option from the Action list to deploy the relaxation rule. Edit & Deploy, Deploy, and Deploy All
are available as Action options.
The HTML Cross-Site Scripting rules that are deployed by using the Click to Deploy option do not
include the fine grain relaxation recommendations.
When the stats action is enabled, the counter for the HTML Cross-Site Scripting check is incremented
when the App Firewall takes any action for this security check. The statistics are collected for Rate and
Total count for Traffic, Violations, and Logs. The size of an increment of the log counter can vary de-
pending on the configured settings. For example, if the block action is enabled, the request for a page
that contains 3 HTML Cross-Site Scripting violations increments the stats counter by one, because the
page is blocked as soon as the first violation is detected. However, if block is disabled, processing
the same request increments the statistics counter for violations and the logs by three, because each
violation generates a separate log message.
To display HTML Cross-Site Scripting check statistics by using the command line
3. Use the scroll bar to view the statistics about HTML Cross-Site Scripting violations and logs. The
statistics table provides real-time data and is updated every 7 seconds.
Highlights
Note the following points about the HTML Cross-Site Scripting check:
• Built-in Support for HTML Cross-Site Scripting attack Protection—The NetScaler App App
Firewall protects against Cross-Site Scripting attacks by monitoring a combination of allowed
attributes and tags, as well as denied patterns in the received payload. All the built-in default
allowed tags, allowed attributes and denied patterns used by the XSS check are specified in the
/netscaler/default_custom_settings.xml file.
• Customization—You can change the default list of tags, attributes, and patterns to customize
the Cross-Site Scripting security check inspection for the specific needs of your application.
Make a copy of the default signature object, modify existing entries, or add new ones. Bind
this signature object to your profile to make use of the customized configuration.
• Hybrid Security Model—Both signatures and deep security protections use the SQL/XSS pat-
terns specified in the signature object that is bound to the profile. If no signature object is bound
to the profile, the SQL/XSS patterns present in the default signature object are used.
• Transform—Note the following about the transform operation:
The transform operation works independently of the other Cross-Site Scripting action settings. If
transform is enabled and block, log, stats, and learn are all disabled, XSS tags will be transformed.
If the block action is enabled, it takes precedence over the transform action.
• Fine Grained Relaxation and Learning—Fine tune the relaxation rule to relax a subset of XSS
elements from security check inspection but detect the rest. The learning engine recommends
a specific value type and value expressions based on the observed data.
• Click to Deploy—Select one, or multiple XSS violation log messages in the syslog viewer and
deploy them as relaxation rules.
• Charset—The default charset for the profile should be set based on the need of the applica-
tion. By default, the profile charset is set to English US (ISO-8859-1). If a request is received
without the specified charset, the App Firewall processes the request as if it is ISO-8859-1. The
open bracket character (<) or the close bracket character (>) will not get interpreted as XSS tags
if these characters are encoded in other charsets. For example, if a request contains a UTF-8
character string “%uff1cscript%uff1e” but the charset is not specified on the request page, the
XSS violation might not get triggered unless the default charset for the profile is specified as
Unicode.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Many web applications have web forms that use SQL to communicate with relational database
servers. Malicious code or a hacker can use an insecure web form to send SQL commands to the
web server. The App Firewall HTML SQL Injection check provides special defenses against injection
of unauthorized SQL code that might break security. If the App Firewall detects unauthorized SQL
code in a user request, it either transforms the request, to render the SQL code inactive, or blocks the
request. The App Firewall examines the request payload for injected SQL code in three locations: 1)
POST body, 2) headers, and 3) cookies.
A default set of keywords and special characters provides known keywords and special characters
that are commonly used to launch SQL attacks. You can add new patterns, and you can edit the de-
fault set to customize the SQL check inspection. The App Firewall offers various action options for
implementing SQL Injection protection. In addition to the Block, Log, Stats and Learn actions, the
App Firewall profile also offers the option to transform SQL special characters to render an attack
harmless.
In addition to actions, there are several parameters that can be configured for SQL injection process-
ing. You can check for SQL wildcard characters. You can change the SQL Injection type and select one
of the 4 options (SQLKeyword, SQLSplChar, SQLSplCharANDKeyword, SQLSplCharORKeyword)
to indicate how to evaluate the SQL keywords and SQL special characters when processing the pay-
load. The SQL Comments Handling parameter gives you an option to specify the type of comments
that need to be inspected or exempted during SQL Injection detection.
You can deploy relaxations to avoid false positives. The App Firewall learning engine can provide rec-
ommendations for configuring relaxation rules.
Following options are available for configuring an optimized SQL Injection protection for your appli-
cation:
Block—If you enable block, the block action is triggered only if the input matches the SQL injection
type specification. For example, if SQLSplCharANDKeyword is configured as the SQL injection type,
a request is not blocked if it contains no key words, even if SQL special characters are detected in
the input. Such a request is blocked if the SQL injection type is set to either SQLSplChar, or SQL-
SplCharORKeyword.
Log—If you enable the log feature, the SQL Injection check generates log messages indicating the
actions that it takes. If block is disabled, a separate log message is generated for each input field in
which the SQL violation was detected. However, only one message is generated when the request
is blocked. Similarly, one log message per request is generated for the transform operation, even
when SQL special characters are transformed in multiple fields. You can monitor the logs to determine
whether responses to legitimate requests are getting blocked. A large increase in the number of log
messages can indicate attempts to launch an attack.
Stats—If enabled, the stats feature gathers statistics about violations and logs. An unexpected surge in
the stats counter might indicate that your application is under attack. If legitimate requests are getting
blocked, you might have to revisit the configuration to see if you need to configure new relaxation rules
or modify the existing ones.
Learn—If you are not sure which SQL relaxation rules might be ideally suited for your application, you
can use the learn feature to generate recommendations based on the learned data. The App Firewall
learning engine monitors the traffic and provides SQL learning recommendations based on the ob-
served values. To get optimal benefit without compromising performance, you might want to enable
the learn option for a short time to get a representative sample of the rules, and then deploy the rules
and disable learning.
Transform SQL special characters—The App Firewall considers three characters, Single straight
quote (‘), Backslash (), and Semicolon (;) as special characters for SQL security check processing. The
SQL Transformation feature modifies the SQL Injection code in an HTML request to ensure that the
request is rendered harmless. The modified HTML request is then sent to the server. All default
transformation rules are specified in the /netscaler/default_custom_settings.xml file.
The transform operation renders the SQL code inactive by making the following changes to the re-
quest:
These three characters (special strings) are necessary to issue commands to an SQL server. Unless
an SQL command is prefaced with a special string, most SQL servers ignore that command. There-
fore, the changes that the App Firewall performs when transformation is enabled prevent an attacker
from injecting active SQL. After these changes are made, the request can safely be forwarded to your
protected web site. When web forms on your protected web site can legitimately contain SQL special
strings, but the web forms do not rely on the special strings to operate correctly, you can disable block-
ing and enable transformation to prevent blocking of legitimate web form data without reducing the
protection that the App Firewall provides to your protected web sites.
The transform operation works independently of the SQL Injection Type setting. If transform is en-
abled and the SQL Injection type is specified as SQL keyword, SQL special characters are transformed
Tip
You normally enable either transformation or blocking, but not both. If the block action is en-
abled, it takes precedence over the transform action. If you have blocking enabled, enabling
transformation is redundant.
Check for SQL Wildcard Characters—Wild card characters can be used to broaden the selections
of a structured query language (SQL-SELECT) statement. These wild card operators can be used in
conjunction with LIKE and NOT LIKE operators to compare a value to similar values. The percent (%),
and underscore (_) characters are frequently used as wild cards. The percent sign is analogous to the
asterisk (*) wildcard character used with MS-DOS and to match zero, one, or multiple characters in a
field. The underscore is similar to the MS-DOS question mark (?) wildcard character. It matches a
single number or character in an expression.
For example, you can use the following query to do a string search to find all customers whose names
contain the D character.
The following example combines the operators to find any salary values that have 0 in the second and
third place.
Different DBMS vendors have extended the wildcard characters by adding extra operators. The
NetScaler App App Firewall can protect against attacks that are launched by injecting these wildcard
characters. The 5 default Wildcard characters are percent (%), underscore (_), caret (ˆ), opening
square bracket ([), and closing square bracket (]). This protection applies to both HTML and XML
profiles.
The default wildcard chars are a list of literals specified in the *Default Signatures:
• <wildchar type=”LITERAL”>%</wildchar>
• <wildchar type=”LITERAL”>_</wildchar>
• <wildchar type=”LITERAL”>^</wildchar>
• <wildchar type=”LITERAL”>[</wildchar>
• <wildchar type=”LITERAL”>]</wildchar>
Wildcard characters in an attack can be PCRE, like [ˆA-F]. The App Firewall also supports PCRE wild-
cards, but the literal wildcard chars above are sufficient to block most attacks.
Note
The SQL wildcard character check is different from the SQL special character check. This option
must be used with caution to avoid false positives.
Check Request Containing SQL Injection Type—The App Firewall provides 4 options to implement
the desired level of strictness for SQL Injection inspection, based on the individual need of the applica-
tion. The request is checked against the injection type specification for detecting SQL violations. The
4 SQL injection type options are:
• SQL Special Character and Keyword—Both an SQL keyword and an SQL special character must
be present in the input to trigger SQL violation. This least restrictive setting is also the default
setting.
• SQL Special Character—At least one of the special characters must be present in the input to
trigger SQL violation.
• SQL key word—At least one of the specified SQL keywords must be present in the input to trig-
ger an SQL violation. Do not select this option without due consideration. To avoid false posi-
tives, make sure that none of the keywords are expected in the inputs.
• SQL Special Character or Keyword—Either the key word or the special character string must
be present in the input to trigger the security check violation.
Tip
If you configure the App Firewall to check for inputs that contain an SQL special character, the App
Firewall skips web form fields that do not contain any special characters. Since most SQL servers
do not process SQL commands that are not preceded by a special character, enabling this option
can significantly reduce the load on the App Firewall and speed up processing without placing
your protected web sites at risk.
SQL comments handling—By default, the App Firewall checks all SQL comments for injected SQL
commands. Many SQL servers ignore anything in a comment, however, even if preceded by an SQL
special character. For faster processing, if your SQL server ignores comments, you can configure the
App Firewall to skip comments when examining requests for injected SQL. The SQL comments han-
dling options are:
• ANSI—Skip ANSI-format SQL comments, which are normally used by UNIX-based SQL
databases. For example:
– – (Two Hypens) - This is a comment that begins with two hyphens and ends with end of
line.
– {} - Braces (Braces enclose the comment. The { precedes the comment, and the } follows it.
Braces can delimit single- or multiple-line comments, but comments cannot be nested)
– /* */ : C style comments (Does not allow nested comments). Please
note **/*!** <comment that begin with slash followed by asterisk
and exclamation mark is not a comment > ***/**
– MySQL Server supports some variants of C-style comments. These enable you to write
code that includes MySQL extensions, but is still portable, by using comments of the fol-
lowing form: /! MySQL-specific code /
– . # : Mysql comments : This is a comment that begins with # character and ends with end
of the line
• Nested—Skip nested SQL comments, which are normally used by Microsoft SQL Server. For
example; – (Two Hypens), and /* */ (Allows nested comments)
• ANSI/Nested—Skip comments that adhere to both the ANSI and nested SQL comment stan-
dards. Comments that match only the ANSI standard, or only the nested standard, are still
checked for injected SQL.
• Check all Comments—Check the entire request for injected SQL without skipping anything.
This is the default setting.
Tip
In most cases, you should not choose the Nested or the ANSI/Nested option unless your back-
end database runs on Microsoft SQL Server. Most other types of SQL server software do not rec-
ognize nested comments. If nested comments appear in a request directed to another type of
SQL server, they might indicate an attempt to breach security on that server.
Check Request headers—Enable this option if, in addition to examining the input in the form fields,
you want to examine the request headers for HTML SQL Injection attacks. If you use the GUI, you can
enable this parameter in the Advanced Settings -> Profile Settings pane of the App Firewall profile.
Note
If you enable the Check Request header flag, you might have to configure relaxation rule for the
User-Agent header. Presence of the SQL keyword like and SQL special character semi-colon (;)
might trigger false positive and block requests that contain this header.
Warning
If you enable both request header checking and transformation, any SQL special characters
found in headers are also transformed. The Accept, Accept-Charset, Accept-Encoding, Accept-
Language, Expect, and User-Agent headers normally contain semicolons (;). Enabling both
Request header checking and transformation simultaneously might cause errors.
The App Firewall gives you an option to exempt a specific form field, header, or Cookie from SQL In-
jection inspection check. You can completely bypass the inspection for one or more of these fields by
configuring relaxation rules for the SQL Injection check.
The App Firewall allows you to implement tighter security by fine tuning the relaxation rules. An ap-
plication might require the flexibility to allow specific patterns, but configuring a relaxation rule to
bypass the security inspection might make the application vulnerable to attacks, because the target
field is exempted from inspection for any SQL attack patterns. SQL fine grained relaxation provides
the option to allow specific patterns and block the rest. For example, the App Firewall currently has
a default set of more than 100 SQL keywords. Because hackers can use these keywords in SQL Injec-
tion attacks, the App Firewall flags them as potential threats. You can relax one or more keyword(s)
that are considered safe for the specific location. The rest of the potentially dangerous SQL keywords
are still checked for the target location and continue to trigger the security check violations. You now
have much tighter control.
The commands used in relaxations have optional parameters for Value Type and Value Expression.
You can specify whether the value expression is a regular expression or a literal string. The value type
can be left blank or you have an option to select Keyword or SpecialString or WildChar.
Warning
Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format
regular expressions, double-check any regular expressions you write. Make sure that they define
exactly the URL that you want to add as an exception, and nothing else. Careless use of wildcards,
and especially of the dot-asterisk ( .*) metacharacter/wildcard combination, can have results that
you do not want, such as blocking access to web content that you did not intend to block or
allowing an attack that the HTML SQL Injection check would otherwise have blocked.
Points to Consider:
• Value expression is an optional argument. A field name might not have any value expression.
• A field name can be bound to multiple value expressions.
• Value expressions should be assigned a value type. The SQL value type can be: 1) Keyword, 2)
SpecialString, or 3) WildChar.
• You can have multiple relaxation rules per field name/URL combination.
To configure SQL Injection actions and other parameters by using the command line:
In the command line interface, you can use either the set appfw profile command or the add appfw
profile command to configure the SQL Injection protections. You can enable the block, learn, log,
stats action(s) and specify whether you want to transform the special characters used in SQL Injec-
tion attack strings to disable the attack. Select the type of SQL attack pattern (key words, wildcard
characters, special strings) you want to detect in the payloads, and indicate whether you want the
App Firewall to also inspect the request Headers for SQL Injection violations. Use the unset appfw
profile command to revert the configured settings back to their defaults. Each of the following com-
mands sets only one parameter, but you can include multiple parameters in a single command:
Note
You can find the list of SQL keywords from default signature file contents by viewing the view
signature object, which has list of sql key words and sql special characters.
In the GUI, you can configure the SQL Injection security check in the pane for the profile associated
with your application.
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security checks.
You have 2 options for configuration:
a. If you just want to enable or disable Block, Log, Stats, and Learn actions for HTML SQL Injection,
you can select or clear check boxes in the table, click OK, and then click Save and Close to close the
Security Check pane.
b. If you want to configure additional options for this security check, double click HTML SQL Injection,
or select the row and click Action Settings, to display the following options:
Transform SQL Special character—Transform any SQL Special characters in the request.
Check for SQL Wildcard Characters—Consider SQL Wildcard characters in the payload to be attack
patterns.
Check Request Containing—Type of SQL injection (SQLKeyword, SQLSplChar, SQLSplCharANDKey-
word, or SQLSplCharORKeyword) to check.
SQL Comments Handling—Type of comments (Check All Comments, ANSI, Nested, or ANSI/Nested)
to check.
After changing any of the above settings, click OK to save the changes and return to the Security
Checks table. You can proceed to configure other security checks if needed. Click OK to save all the
changes you have made in the Security Checks section, and then click Save and Close to close the
Security Check pane.
1. To enable or disable the Check request Header setting, in the Advanced Settings pane, click
Profile Settings. In Common Settings, Select or clear the Check Request Headers check box.
Click OK. You can either use the X icon at the top right hand side of the Profile Settings pane to
close this section or, if you have finished configuring this profile, you can click Done to return to
the App Firewall > Profile.
To configure an SQL Injection relaxation rule by using the GUI
• Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
• In the Advanced Settings pane, click Relaxation Rules.
• In the Relaxation Rules table, double-click the HTML SQL Injection entry, or select it and click
Edit.
• In the HTML SQL Injection Relaxation Rules dialogue box, perform Add, Edit, Delete, Enable,
or Disable operations for relaxation rules.
Note
When you add a new rule, the Value Expression field is not displayed unless you select Keyword
or SpecialString or WildChar option in the Value Type Field.
The default SQL patterns are specified in Application Firewall> Signatures > Default Signatures.
If you do not bind any signature object to your profile, the default SQL patterns specified in the De-
fault Signatures object will be used by the profile for the SQL Injection security check processing. The
rules and patterns, specified in the default signatures object, are read-only. You cannot edit or modify
them. If you want to modify or change these patterns, make a copy of the Default Signatures object
to create a User-Defined signature object. Make changes in the SQL patterns in the new User-defined
signature object and use this signature object in your profile that is processing the traffic for which
you want to use these customized SQL patterns.
a. Navigate to Application Firewall > Signatures, select *Default Signatures, and click Edit.
The Manage SQL/XSS paths table shows following four rows pertaining to SQL Injection:
b. Select a row and click Manage Elements to display the corresponding SQL patterns (keywords,
special strings, transformation rules or the wildcard characters) used by the App Firewall SQL injection
check.
2. noTo customize SQL patterns: You can edit the User-Defined signature object to customize the SQL
key words, special strings, and wildcard characters. You can add new entries or remove the existing
ones. You can modify the transformation rules for the SQL special strings.
a. Navigate to Application Firewall > Signatures, highlight the target User-defined signature, and
click Edit. Click Manage SQL/XSS patterns to display the Manage SQL/XSS paths table.
i. Click Manage Elements, to Add, Edit or Remove the corresponding SQL element.
You must be very careful before you remove or modify any default SQL element, or delete the SQL
path to remove the entire row. The signature rules as well as the SQL Inject security check rely
on these elements for detecting SQL Injection attacks to protect your applications. Customizing
the SQL patterns can make your application vulnerable to SQL attacks if the required pattern is
When the learn action is enabled, the App Firewall learning engine monitors the traffic and learns the
triggered violations. You can periodically inspect these learned rules. After due consideration, you
can deploy the learned rule as an SQL Injection relaxation rule.
SQL Injection Learning enhancement—An App Firewall learning enhancement was introduced in re-
lease 11.0 of the NetScaler software. To deploy fine grained SQL Injection relaxation, the App Firewall
offers fine grained SQL Injection learning. The learning engine makes recommendations regarding
the observed Value Type (keyword, SpecialString, Wildchar) and the corresponding Value expression
observed in the input fields. In addition to checking the blocked requests to determine whether the
current rule is too restrictive and needs to be relaxed, you can review the rules generated by the learn-
ing engine to determine which value type and value expressions are triggering violations and need to
be addressed in relaxation rules.
Important
The App Firewall’s learning engine can distinguish only the first 128 bytes of the name. If a form
has multiple fields with names that match for the first 128 bytes, the learning engine might not
be able to distinguish between them. Similarly, the deployed relaxation rule might inadvertently
relax all such fields from SQL Injection inspection.
Note To bypass SQL check in User-Agent header, use the following relaxation rule:
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Learned Rules. You can select the HTML SQL Injection
entry in the Learned Rules table and double-click it to access the learned rules. You can deploy
the learned rules or edit a rule before deploying it as a relaxation rule. To discard a rule, you
can select it and click the Skip button. You can edit only one rule at a time, but you can select
multiple rules to deploy or skip.
You also have the option to show a summarized view of the learned relaxations by selecting the HTML
SQL Injection entry in the Learned Rules table and clicking Visualizer to get a consolidated view of
all the learned violations. The visualizer makes it very easy to manage the learned rules. It presents a
comprehensive view of the data on one screen and facilitates taking action on a group of rules with one
click. The biggest advantage of the visualizer is that it recommends regular expressions to consolidate
multiple rules. You can select a subset of these rules, based on the delimiter and Action URL. You
can display 25, 50, or 75 rules in the visualizer, by selecting the number from a drop-down list. The
visualizer for learned rules offers the option to edit the rules and deploy them as relaxations. Or you
can skip the rules to ignore them.
When the log action is enabled, the HTML SQL Injection security check violations are logged in the
audit log as APPFW_SQL violations. The App Firewall supports both Native and CEF log formats. You
can also send the logs to a remote syslog server.
To access the log messages by using the command line
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the SQL Injection violations:
> Shell
Example of a HTML SQL Injection log message when the request is transformed
Example of a HTML SQL Injection log message when the post request is blocked
Note
As part of the streaming changes in 10.5.e build (enhancement builds) as well as 11.0 build on-
wards, we now process the input data in blocks. RegEx pattern matching is now restricted to
4K for contiguous character string matching. With this change, the SQL violation log messages
might include different information compared to the earlier builds. The keyword and special
character in the input could be separated by a large number of bytes. We now keep track of the
SQL keywords and special strings when processing the data, instead of buffering the entire input
value. In addition to the field name, the log message now includes the SQL keyword, or the SQL
special character, or both the SQL keyword and the SQL special character, as determined by the
configured setting. The rest of the input is no longer included in the log message, as shown in
the following example:
Example:
In 10.5, when the App Firewall detects the SQL violation, the entire input string might be included
in the log message, as shown below:
SQL Keyword check failed for field text=\”select a name from testbed1
;(;)\”.*<blocked>
In enhancement builds of 10.5.e that support request side streaming as well as 11.0 build on-
wards, we log only the field name, keyword and special character (if applicable) in the log mes-
sage, as shown below:
The NetScaler GUI includes a useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• Navigate to the Application Firewall > Profiles, select the target profile, and click Security
Checks. Highlight the HTML SQL Injection row and click Logs. When you access the logs di-
rectly from the HTML SQL Injection check of the profile, the GUI filters out the log messages and
displays only the logs pertaining to these security check violations.
• You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In the
Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which dis-
plays all log messages, including other security check violation logs. This is useful for debugging
when multiple security check violations might be triggered during request processing.
• Navigate to Application Firewall > policies > Auditing. In the Audit Messages section, click the
Syslog messages link to display the Syslog Viewer, which displays all log messages, including
other security check violation logs.
The HTML based Syslog Viewer provides various filter options for selecting only the log messages that
are of interest to you. To select log messages for the HTML SQL Injection check, filter by selecting
APPFW in the dropdown options for Module. The Event Type list offers a rich set of options to further
refine your selection. For example, if you select the APPFW_SQL check box and click the Apply but-
ton, only log messages pertaining to the SQL Injection security check violations appear in the Syslog
Viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Module, Event
Type, Event ID, Client IP etc. appear below the log message. You can select any of these options to
highlight the corresponding information in the log message.
Click to Deploy functionality is available only in the GUI. You can use the Syslog Viewer to not only
view the logs but also to deploy HTML SQL Injection relaxation rules based on the log messages for the
App Firewall security check violations. The log messages must be in CEF log format for this operation.
Click to deploy functionality is available only for log messages that are generated by the block (or not
block) action. You cannot deploy a relaxation rule for a log message about the transform operation.
To deploy a relaxation rule from the Syslog Viewer, select the log message. A check box appears in the
upper right corner of the Syslog Viewer box of the selected row. Select the check box, and then select
an option from the Action list to deploy the relaxation rule. Edit & Deploy, Deploy, and Deploy All
are available as Action options.
The SQL Injection rules that are deployed by using the Click to Deploy option do not include the fine
grain relaxation recommendations.
When the stats action is enabled, the counter for the SQL Injection check is incremented when the App
Firewall takes any action for this security check. The statistics are collected for Rate and Total count
for Traffic, Violations, and Logs. The size of an increment of the log counter can vary depending on the
configured settings. For example, if the block action is enabled, the request for a page that contains 3
SQL Injection violations increments the stats counter by one, because the page is blocked as soon as
the first violation is detected. However, if block is disabled, processing the same request increments
the statistics counter for violations and the logs by three, because each violation generates a separate
log message.
sh appfw stats
Highlights
• Built-in Support for SQL Injection Protection—The NetScaler App App Firewall protects
against SQL Injection by monitoring a combination of SQL keywords and special characters in
the form parameters. All SQL keywords, special characters, wildcard characters, and default
transformation rules are specified in the /netscaler/default_custom_settings.xml file.
• Customization—You can change the default key words, special characters, wildcard characters
and transformation rules to customize the SQL security check inspection for the specific needs
of your application. Make a copy of the default signature object, modify existing entries, or add
new ones. Bind this signature object to your profile to make use of the customized configura-
tion.
• Hybrid Security Model—Both signatures and deep security protections use the SQL/XSS pat-
terns specified in the signature object that is bound to the profile. If no signature object is bound
to the profile, the SQL/XSS patterns present in the default signature object are used.
• Transform—Note the following about the transform operation:
– The transform operation works independently of the other SQL Injection action settings.
If transform is enabled and block, log, stats, and learn are all disabled, SQL special charac-
ters will be transformed.
– When SQL Transformation is enabled, user requests are sent to the backend servers after
the SQL special characters are transformed in non-block mode. If the block action is en-
abled, it takes precedence over the transform action. If the injection type is specified as
SQL special character and block is enabled, the request is blocked despite the transform
action.
• Fine Grained Relaxation and Learning—Fine tune the relaxation rule to relax a subset of SQL
elements from security check inspection but detect the rest. The learning engine recommends
a specific value type and value expressions based on the observed data.
• Click to Deploy—Select one, or multiple SQL violation log messages in the syslog viewer and
deploy them as relaxation rules.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Buffer Overflow check detects attempts to cause a buffer overflow on the web server. If the App
Firewall detects that the URL, cookies, or header are longer than the specified maximum length in a
request, it blocks that request because it might be an attempt to cause a buffer overflow.
The Buffer Overflow check prevents attacks against insecure operating-system or web-server software
that can crash or behave unpredictably when it receives a data string that is larger than it can handle.
Proper programming techniques prevent buffer overflows by checking incoming data and either re-
jecting or truncating overlong strings. Many programs, however, do not check all incoming data and
are therefore vulnerable to buffer overflows. This issue especially affects older versions of web-server
software and operating systems, many of which are still in use.
The Buffer Overflow security check allows you to configure the Block, Log, and Stats actions. In addi-
tion, you can also configure the following parameters:
• Maximum URL Length. The maximum length the App Firewall allows in a requested URL. Re-
quests with longer URLs are blocked. Possible Values: 0-65535. Default: 1024
• Maximum Cookie Length. The maximum length the App Firewall allows for all cookies in a re-
quest. Requests with longer cookies trigger the violations. Possible Values: 0-65535. Default:
4096
• Maximum Header Length. The maximum length the App Firewall allows for HTTP headers.
Requests with longer headers are blocked. Possible Values: 0-65535. Default: 4096
Using the command line to configure the Buffer Overflow security check
To configure Buffer Overflow security check actions and other parameters by using the command line
If you use the command-line interface, you can add the following Buffer Overflow Check arguments
to the set appfw profile <profileName> command:
• -bufferOverflowAction [[ block] [ log] [stats]] | [none]
• -bufferOverflowMaxURLLength <positiveInteger>
• -bufferOverflowMaxCookieLength <positiveInteger>
• -bufferOverflowMaxHeaderLength <positiveInteger>
In the GUI, you can configure the Buffer Overflow security check in the pane for the profile associated
with your application.
To configure or modify the Buffer Overflow security check by using the GUI
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security checks.
You have 2 options for configuration:
a. If you just want to enable or disable Block, Log, and Stats actions for Buffer Overflow, you can
select or clear check boxes in the table, click OK, and then click Save and Close to close the Security
Check pane.
b. If you want to configure additional options for this security check, double click Buffer Overflow,
or select the row and click Action Settings, to display the following options:
Maximum URL Length.
Maximum Cookie Length.
Maximum Header Length.
After changing any of the above settings, click OK to save the changes and return to the Security
Checks table. You can proceed to configure other security checks if needed. Click OK to save all the
changes you have made in the Security Checks section, and then click Save and Close to close the
Security Check pane.
Using the Log Feature with the Buffer Overflow Security Check
When the log action is enabled, the Buffer Overflow security check violations are logged in
the audit log as APPFW_BUFFEROVERFLOW_URL, APPFW_BUFFEROVERFLOW_COOKIE, and
APPFW_BUFFEROVERFLOW_HDR violations. The App Firewall supports both Native and CEF log
formats. You can also send the logs to a remote syslog server.
If you use the GUI to review the logs, you can use the click-to-deploy feature to apply relaxations indi-
cated by the logs.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the Buffer overflow violations:
1 > **Shell**
2 > **tail -f /var/log/ns.log | grep APPFW_BUFFEROVERFLOW**
The NetScaler GUI includes a useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• Navigate to the Application Firewall > Profiles, select the target profile, and click Security
Checks. Highlight the Buffer Overflow row and click Logs. When you access the logs directly
from the Buffer Overflow Security Check of the profile, the GUI filters out the log messages and
displays only the logs pertaining to these security check violations.
• You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In the
Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which dis-
plays all log messages, including other security check violation logs. This is useful for debugging
when multiple security check violations might be triggered during request processing.
• Navigate to Application Firewall > policies > Auditing. In the Audit Messages section, click the
Syslog messages link to display the Syslog Viewer, which displays all log messages, including
other security check violation logs.
The XML based Syslog Viewer provides various filter options for selecting only the log mes-
sages that are of interest to you. To select log messages for the Buffer Overflow check,
filter by selecting APPFW in the dropdown options for Module. The Event Type list offers
three options, APPFW_BUFFEROVERFLOW_URL, APPFW_BUFFEROVERFLOW_COOKIE, and
APPFW_BUFFEROVERFLOW_HDR, to view all the log messages pertaining to buffer overflow se-
curity check. You can select one or more options to further refine your selection. For example, if
you select the APPFW_BUFFEROVERFLOW_COOKIE check box and click the Apply button, only log
messages pertaining to the Buffer Overflow security check violations for the Cookie header appear
in the Syslog Viewer. If you place the cursor in the row for a specific log message, multiple options,
such as Module, Event Type, Event ID, and Client IP, appear below the log message. You can select
any of these options to highlight the corresponding information in the log message.
Click-to-Deploy: The GUI provides click-to-deploy functionality, which is currently supported only
for the buffer overflow log messages pertaining to the URL Length violations. You can use the Syslog
Viewer to not only view the triggered violations, but also execute informed decisions based on the
observed lengths of the blocked messages. If the current value is too restrictive and is triggering false
positives, you can select a message and deploy it to replace the current value with the URL length
value seen in the message. The log messages must be in CEF log format for this operation. If the
relaxation can be deployed for a log message, a check box appears at the right edge of the Syslog
Viewer box in the row. Select the check box, and then select an option from the Action list to deploy
the relaxation. Edit & Deploy, Deploy, and Deploy All are available as Action options. You can use the
APPFW_BUFFEROVERFLOW_URL filter to isolate all the log messages pertaining to the configured
URL length violations.
If you select an individual log message, all three action options Edit & Deploy, Deploy, and Deploy
All are available. If you select Edit & Deploy, the Buffer Overflow settings dialogue is displayed.
The new URL length that was observed in the request is inserted into the Maximum URL length input
field. If you click Close without any edits, the current configured values remain unchanged. If you
click the OK button, the new value of the Maximum URL length replaces the previous value.
Note
The block, log and stats action check boxes are unchecked in the displayed Buffer Overflow
settings dialogue, and need to be reconfigured if you select the Edit & Deploy option. Make sure
to enable these check boxes before clicking OK, otherwise the new URL length will get configured
but the actions will be set to none.
If you select the check boxes for multiple log messages, you can use the Deploy or Deploy All op-
tion. If the deployed log messages have different URL lengths, the configured value gets replaced
by the highest URL Length value observed in the selected messages. Deploying the rule results only
in changing the bufferOverflowMaxURLLength value. Configured actions are retained and remain
unchanged.
When the stats action is enabled, the counter for the Buffer Overflow Security Check is incremented
when the App Firewall takes any action for this security check. The statistics are collected for Rate
and Total count for Traffic, Violations, and Logs. The size of an increment of the log counter can vary
depending on the configured settings. For example, if the block action is enabled, a request for a page
that contains three Buffer Overflow violations increments the stats counter by one, because the page
is blocked as soon as the first violation is detected. However, if block is disabled, processing the same
request increments the statistics counter for violations and the logs by three, because each violation
generates a separate log message.
To display Buffer Overflow Security Check statistics by using the command line
Highlights
• The buffer overflow security check allows you to configure limits to enforce the maximum length
of allowed URLs, Cookies and Headers.
• Block, Log and Stats actions enable you to monitor the traffic and configure optimal protection
for your application.
• Syslog viewer enables you to filter and view all the log messages pertaining to buffer overflow
violations.
• The App Firewall now evaluates individual cookies when inspecting the incoming request. If
length of any one cookie received in the Cookie header exceeds the configured BufferOver-
flowMaxCookieLength, the Buffer Overflow violation is triggered.
Important
In release 10.5.e (in a few interim enhancement builds prior to 59.13xx.e build) as well as in the
11.0 release (in builds prior to 65.x), App Firewall processing of the Cookie header was changed.
In those releases, every cookie is evaluated individually, and if the length of any one cookie re-
ceived in the Cookie header exceeds the configured BufferOverflowMaxCookieLength, the Buffer
Overflow violation is triggered. As a result of this change, requests that were blocked in 10.5 and
earlier release builds might be allowed, because the length of the entire cookie header is not cal-
culated for determining the cookie length. ** In some situations, the total cookie size forwarded
to the server might be larger than the accepted value, and the server might respond with “400
Bad Request”.
Note that this change has been reverted. The behavior in the 10.5.e ->59.13xx.e and subsequent
10.5.e enhancement builds as well as in the 11.0 release 65.x and subsequent builds is now simi-
lar to that of the non-enhancement builds of release 10.5. The entire raw Cookie header is now
considered when calculating the length of the cookie. Surrounding spaces and the semicolon (;)
characters separating the name-value pairs are also included in determining the cookie length.**
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Cookie Consistency check examines cookies returned by users, to verify that they match the cook-
ies that your web site set for that user. If a modified cookie is found, it is stripped from the request
before the request is forwarded to the web server. You can also configure the Cookie Consistency
check to transform all of the server cookies that it processes, by encrypting the cookies, proxying the
cookies, or adding flags to the cookies. This check applies to requests and responses.
An attacker would normally modify a cookie to gain access to sensitive private information by posing
as a previously authenticated user, or to cause a buffer overflow. The Buffer Overflow check protects
against attempts to cause a buffer overflow by using a very long cookie. The Cookie Consistency check
focuses on the first scenario.
• Block
• Log
• Learn
• Statistics
• Transform. If enabled, the Transform action modifies all cookies as specified in the following
settings:
– Encrypt Server Cookies. Encrypt cookies set by your web server, except for any listed in
the Cookie Consistency check relaxation list, before forwarding the response to the client.
Encrypted cookies are decrypted when the client sends a subsequent request, and the
decrypted cookies are reinserted into the request before it is forwarded to the protected
web server. Specify one of the following types of encryption:
* None. Do not encrypt or decrypt cookies. The default.
* Decrypt only. Decrypt encrypted cookies only. Do not encrypt cookies.
* Encrypt session only. Encrypt session cookies only. Do not encrypt persistent cook-
ies. Decrypt any encrypted cookies.
* Encrypt all. Encrypt both session and persistent cookies. Decrypt any encrypted
cookies.
Note: When encrypting cookies, the App Firewall adds the
HttpOnly flag to the cookie. This flag prevents scripts from accessing and parsing the
cookie. The flag therefore prevents a script-based virus or trojan from accessing a de-
crypted cookie and using that information to breach security. This is done regardless
of the
Flags to Add in Cookies parameter settings, which are handled independently of the
Encrypt Server Cookies parameter settings.
• Proxy Server Cookies. Proxy all non-persistent (session) cookies set by your web server, ex-
cept for any listed in the Cookie Consistency check relaxation list. Cookies are proxied by using
the existing App Firewall session cookie. The App Firewall strips session cookies set by the pro-
tected web server and saves them locally before forwarding the response to the client. When
the client sends a subsequent request, the App Firewall reinserts the session cookies into the
request before forwarding it to the protected web server. Specify one of the following settings:
– None. Do not proxy cookies. The default.
– Session only. Proxy session cookies only. Do not proxy persistent cookies
Note: If you disable cookie proxying after having enabled it (set this value to
None after it was set to
Session only), cookie proxying is maintained for sessions that were established before you
disabled it. You can therefore safely disable this feature while the App Firewall is process-
ing user sessions.
• Flags to Add in Cookies. Add flags to cookies during transformation. Specify one of the follow-
ing settings:
– None. Do not add flags to cookies. The default.
– HTTP only. Add the HttpOnly flag to all cookies. Browsers that support the HttpOnly flag
do not allow scripts to access cookies that have this flag set.
– Secure. Add the Secure flag to cookies that are to be sent only over an SSL connection.
Browsers that support the Secure flag do not send the flagged cookies over an insecure
connection.
– All. Add the HttpOnly flag to all cookies, and the Secure flag to cookies that are to be sent
only over an SSL connection.
If you use the command-line interface, you can enter the following commands to configure the Cookie
Consistency Check:
To specify relaxations for the Cookie Consistency check, you must use the GUI. On the Checks tab
of the Modify Cookie Consistency Check dialog box, click Add to open the Add Cookie Consistency
Check Relaxation dialog box, or select an existing relaxation and click Open to open the Modify Cookie
Consistency Check Relaxation dialog box. Either dialog box provides the same options for configuring
a relaxation.
• Logon Fields. The following expression exempts all cookie names beginning with the string
logon_ followed by a string of letters or numbers that is at least two characters long and no
more than fifteen characters long:
1 ^logon_[0-9A-Za-z]{
2 2,15 }
3 $
• Logon Fields (special characters). The following expression exempts all cookie names begin-
ning with the string türkçe-logon_ followed by a string of letters or numbers that is at least two
characters long and no more than fifteen characters long:
1 ^txC3xBCrkxC3xA7e-logon_[0-9A-Za-z]{
2 2,15 }
3 $
• Arbitrary strings. Allow cookies that contain the string sc-item_, followed by the ID of an item
that the user has added to his shopping cart ([0-9A-Za-z]+), a second underscore (_), and finally
the number of these items he wants ([1-9][0-9]?), to be user-modifiable:
1 ^sc-item_[0-9A-Za-z]+_[1-9][0-9]?$
Caution: Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-
format regular expressions, double-check any regular expressions you write. Make sure that they de-
fine exactly the URL you want to add as an exception, and nothing else. Careless use of wildcards, and
especially of the dot-asterisk (
.*) metacharacter/wildcard combination, can have results you do not want or expect, such as blocking
access to web content that you did not intend to block or allowing an attack that the Cookie Consis-
tency check would otherwise have blocked.
Important
In release 10.5.e (in a few interim enhancement builds prior to 59.13xx.e build) as well as in the
11.0 release (in builds prior to 65.x), App Firewall processing of the Cookie header was changed.
In those releases, every cookie is evaluated individually, and if the length of any one cookie re-
ceived in the Cookie header exceeds the configured BufferOverflowMaxCookieLength, the Buffer
Overflow violation is triggered. As a result of this change, requests that were blocked in 10.5 and
earlier release builds might be allowed, because the length of the entire cookie header is not cal-
culated for determining the cookie length. In some situations, the total cookie size forwarded to
the server might be larger than the accepted value, and the server might respond with “400 Bad
Request”.
Note that this change has been reverted. The behavior in the 10.5.e ->59.13xx.e and subsequent
10.5.e enhancement builds as well as in the 11.0 release 65.x and subsequent builds is now simi-
lar to that of the non-enhancement builds of release 10.5. The entire raw Cookie header is now
considered when calculating the length of the cookie. Surrounding spaces and the semicolon (;)
characters separating the name-value pairs are also included in determining the cookie length.**
Note
Sessionless Cookie Consistency: The cookie consistency behavior has changed in release 11.0.
In earlier releases, the cookie consistency check invokes sessionization. The cookies are stored
in the session and signed. A “wlt_” suffix is appended to transient cookies and a “wlf_” suffix is
appended to the persistent cookies before they are forwarded to the client. Even if the client does
not return these signed wlf/wlt cookies, the App Firewall uses the cookies stored in the session
to perform the cookie consistency check.
In release 11.0, the cookie consistency check is sessionless. The App Firewall now adds a cookie
that is a hash of all the cookies tracked by the App Firewall. If this hash cookie or any other
tracked cookie is missing or tampered with, the App Firewall strips the cookies before forwarding
the request to the back end server and triggers a cookie-consistency violation. The server treats
the request as a new request and sends new Set-Cookie header(s).
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Web servers following Google Web Toolkit (GWT) Remote Procedure Call (RPC) mechanisms can be
secured by the NetScaler App App Firewall without a need for any specific configuration to enable the
GWT support.
What is GWT
The GWT is used for building and optimizing complex high-performance web applications by people
who do not have expertise in XMLHttpRequest, and JavaScript. This open source, free development
toolkit is used extensively for developing small and large scale applications and is quite frequently
used for displaying browser based data such as search results for flights, hotels, and so on. The GWT
provides a core set of Java APIs and widgets for writing optimized JavaScript scripts that can run on
most browsers and mobile devices. The GWT RPC framework makes it easy for the client and server
components of the web application to exchange Java objects over HTTP. GWT RPC services are not the
same as web services based on SOAP or REST. They are simply a lightweight method for transferring
data between the server and the GWT application on the client. GWT handles serialization of the Java
objects exchanging the arguments in the method calls and the return value.
https://www.quora.com/What-web-applications-use-Google-Web-Toolkit-%28GWT%29
The GWT RPC request is pipe delimited and has variable number of arguments. It is carried as a pay-
load of HTTP POST and has the following values:
1 5|0|8|http://localhost:8080/test/|16878339F02B83818D264AE430C20468| com
.test.client.TestService|testMethod|java.lang.String|java.lang.
Integer| myInput1|java.lang.Integer/3438268394|1|2|3|4|2|5|6|7|8|1|
b) String Table:
http://localhost:8080/test/|16878339F02B83818D264AE430C20468| com.test.
client.TestService|testMethod|java.lang.String|java.lang.Integer|myInput1|
java.lang.Integer/3438268394|
The members of the above pipe delimited string table contain the user-provided inputs. These inputs
are parsed for the App Firewall checks and are identified as follows:
• 1st : http://localhost:8080/test/
This is the Request URL. It should not contain the query part, because the GET method is not
allowed.
• 2nd : 16878339F02B83818D264AE430C20468
Unique HEX identifier. A request is considered malformed if this string has non-hex characters.
• rd : com.test.client.TestService
• 4th : testMethod
<container>.<sub-cntnr>.name/<integer><identifier>
The payload consists of references to the elements in the string table. These integer values cannot be
larger than the number of elements in the string table.
The App Firewall understands and interprets GWT RPC requests, inspects the payload for security
check violations, and takes specified actions.
The App Firewall headers and cookies checks for GWT requests are similar to those for other request
formats. After appropriate URL decoding and charset conversion, all the parameters in the string table
are inspected. The GWT request body does not contain field names, just the field values. The input
values can be validated against the specified format by using the App Firewall Field Format check,
which can also be used to control the length of the input. The Cross-site Scripting and SQL Injection
attacks in the inputs can be easily detected and thwarted by the App Firewall.
Learning and relaxation rules: Learning and deployment of relaxation rules are supported for GWT
requests. App Firewall rules are in the form of <actionURL> <fieldName> mapping. The GWT re-
quest format does not have the field names and thus requires special handling. The App Firewall
inserts dummy field names in the learned rules that can be deployed as relaxation rules. The -isRegex
flag works as it does for non-GWT rules.
• Action URL:
Multiple services responding to an RPC can be configured on the same web server. The HTTP
request has the URL of the web server, not of the actual service handling the RPC. Therefore,
relaxation is not applied on the basis of the HTTP request URL, because that would relax all the
services on that URL for the target field. For GWT requests, the App Firewall uses the URL of the
actual service found in the GWT payload, in the fourth field in the string table.
• Field name:
Since the GWT request body contains only field values, the App Firewall inserts dummy field
names such as 1, 2, and so on when recommending learned rules.
Log Messages: The App Firewall generates log messages for the security check violations that are
detected in the GWT requests. A log message generated by a malformed GWT request contains the
string “GWT” for easy identification.
The same payload can trigger different App Firewall security check violations for different Content-
types. Consider the following example:
5|0|8|http://localhost:8080/acdtest/|16878339F02Baf83818D264AE430C20468|com
.test.client.TestService|testMethod|java.lang.String%3b|java.lang.Integer|
select|
Content-type: application/x-www-form-urlencoded:
A request sent with this content type results in a SQL violation if the SQL Injection Type is configured
to use any of the four available options: SQLSplCharANDKeyword, SQLSplCharORKeyword, SQLKey-
word, or SQLSplChar. The App Firewall considers ‘&’ to be the field separator and ‘=’ to be the name-
value separator when processing the above payload. Since neither of these characters appears any-
where in the post body, the entire content is treated as a single field name. The field name in this
request contains both an SQL special character (;) and an SQL Keyword (select). Therefore violations
are caught for all four SQL Injection type options.
Content-type: text/x-gwt-rpc:
A request sent with this content type triggers ’ to be the field separator for the above payload
an SQL violation only if the SQL injection type in the GWT request. Therefore, the post body is
is set to one of the following three divided into various form-field values, and
options:SQLSplCharORKeyword,SQLKeyword, form-field names are added (in accordance
or SQLSplChar. No violation is triggered if the with the convention described earlier).
SQL injection type is set to Because of this splitting, the SQL special
SQLSplCharANDKeyword, which is the default character and SQL keyword become parts of
option. The App Firewall considers the vertical separate form fields.
bar ‘
As a result, when SQL Injection Type is set to SQLSplChar, field 8 indicates the SQL violation. For
SQLKeyword, field 10 indicates the violation. Either of these two fields can indicate a violation if the
SQL Inject type is configured with the SQLSplCharORKeyword option, which looks for the presence
of either a keyword or a special character. No violation is caught for the default SQLSplCharAND-
Keyword option, because there is no single field that has a value that contains both SQLSplChar and
SQLKeyword together.
Tips:
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The data-leak-prevention checks filter responses to prevent leaks of sensitive information, such as
credit card numbers and social security numbers, to unauthorized recipients.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
If you have an application that accepts credit cards, or your websites have access to database servers
that store credit card numbers, you must use Data Leak Prevention (DLP) measures and configure
protection for each type of credit card that you accept.
The NetScaler App App Firewall Credit Card check prevents attackers from exploiting Data Leak Pre-
vention flaws to obtain credit card numbers of your customers. By following simple configuration
steps, you can enforce protection of one or more of the following credit cards: 1) Visa, 2) Master Card,
3) Discover, 4) American Express (Amex), 5) JCB, and 6) Diners Club.
The Credit Card security check examines server responses to identify instances of the target credit card
numbers, and applies a specified action when such a number is found. The action can be to transform
the response by X’ing out all but the last group of digits in the credit card number, or to block the
response if it contains more than a specified number of credit card numbers. If you specify both, the
block action takes precedence. The Maximum credit cards allowed per page setting determines when
the block action is invoked. The default setting, 0 (no credit card numbers allowed on the page), is
the safest, but you can allow up to 255. Depending on where the violation is detected in the response
and the block action gets triggered, you might get fewer than the maximum allowed number of credit
cards in the response.
To avoid false positives, you can apply relaxations to exempt specific numbers from the Credit Card
check. For example, a social security number, purchase order number, or Google account number
might be similar to a credit card number. You can specify individual numbers or use a regular expres-
sion to indicate the string of digits to be bypassed when processing the response URL for credit card
inspection.
If you’re not sure which credit card numbers to exempt, you can use the learn feature to generate
recommendations based on the learned data. To get optimal benefit without compromising perfor-
mance, you might want to enable this option for a short time to get a representative sample of the
rules, and then deploy the relaxations and disable learning.
If you enable the log feature, the Credit Card check generates log messages indicating the actions
that it takes. You can monitor the logs to determine whether responses to legitimate requests are
getting blocked. A large increase in the number of log messages can indicate thwarted attempts to
gain access. By default, the doSecureCreditCardLogging parameter is ON, so the credit card number
is not included in the log message generated by the safe commerce (Credit Card) violation.
The stats feature gathers statistics about violations and logs. An unexpected surge in the stats counter
might indicate that your application is under attack.
To configure the Credit Card security check for protecting your application, configure the profile that
governs inspecting the traffic to and from this application.
Note:
A website that does not access a SQL database usually does not have access to sensitive private
information such as credit card numbers.
In the command line interface, you can use either the set appfw profile command or the add appfw
profile command to activate credit-card checking and specify which actions to perform. You can use
the unset appfw profile command to revert back to the default settings. To specify relaxations, use
the bind appfw command to bind credit card numbers to the profile.
Use either the set appfw profile command or the add appfw profile command, as follows:
In the GUI, you configure the credit card security check in the pane for the profile associated with your
application.
To add or modify the Credit Card security check by using the GUI
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security
checks. You have 2 options for configuration:
a) If you just want to enable or disable Block, Log, Stats, and Learn actions for Credit Card,
you can select or clear check boxes in the table, click OK, and then click Save and Close to
close the Security Check pane.
b) If you want to configure additional options for this security check, double click Credit Card,
or select the row and click Action Settings to display additional options as follows:
• Out—Mask any credit card number detected in a response by replacing each digit,
except the digits in the final group, with the letter “X.
• Maximum credit cards allowed per page—Specify the number of credit cards that can
be forwarded to the client without triggering a block action.
• Protected Credit Cards. Select or clear a check box to enable or disable protection for
each type of credit card.
• You can also edit the Block, Log, Stats and Learn actions in the Credit Card Settings
pane.
After making any of the above changes, click OK to save the changes and return to the
Security Checks table. You can proceed to configure other security checks if needed.
Click OK to save all the changes you have made in the Security Checks section and
then click Save and Close to close the Security Check pane.
3. In the Advanced Settings pane, click Profile settings. To enable or disable secure logging of
credit card Numbers, select or clear the Secure Credit Card Logging check box. (By default, it
is selected).
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Relaxation Rules. The Relaxation Rules table has
a Credit Card entry. You can double click, or select this row and click Edit to access the
Credit Card Relaxation Rules dialogue. You can perform Add, Edit, Delete, Enable, or
Disable operations for relaxation rules.
When the learn action is enabled, the App Firewall learning engine monitors the traffic and learns the
triggered violations. You can periodically inspect these learned rules. After due consideration, if you
want to exempt a specific string of digits from the Credit Card security check, you can by deploy the
learned rule as a relaxation rule.
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Learned Rules. You can select the Credit Card entry
in the Learned Rules table and double-click it to access the learned rules. You can deploy
the learned rules or edit a rule before deploying it as a relaxation rule. To discard a rule,
you can select it and click the Skip button. You can edit only one rule at a time, but you
can select multiple rules to deploy or skip.
You also have the option to show a summarized view of the learned relaxations by selecting
the Credit Card entry in the Learned Rules table and clicking Visualizer to get a consolidated
view of all the learned violations. The visualizer makes it very easy to manage the learned rules.
It presents a comprehensive view of the data on one screen and facilitates taking action on a
group of rules with one click. The biggest advantage of the visualizer is that it recommends
regular expressions to consolidate multiple rules. You can select a subset of these rules, based
on the delimiter and Action URL. You can display 25, 50, or 75 rules in the visualizer, by selecting
the number from a drop-down list. The visualizer for learned rules offers the option to edit the
rules and deploy them as relaxations. Or you can skip the rules to ignore them.
When the log action is enabled, the Credit Card security check violations are logged in the audit log as
APPFW_SAFECOMMERCE or APPFW_SAFECOMMERCE_XFORM violations. The App Firewall supports
both Native and CEF log formats. You can also send the logs to a remote syslog server.
The default setting for doSecureCreditCardLogging is ON. If you change it to OFF, both credit card
number and type are included in the log message.
Depending on the settings configured for the Credit Card checks, the application-firewall generated
log messages might include the following information:
• Credit card numbers were transformed (X’d out). A separate log message is generated for each
transformed credit card number, so multiple log messages might be generated during process-
ing of a single response.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertain-
ing to the Credit Card violations:
– Shell
1. The NetScaler GUI includes a very useful tool (Syslog Viewer) for analyzing the log mes-
sages. You have a couple of options for accessing the Syslog Viewer: Navigate to the tar-
get profile > Security Checks. Highlight the Credit Card row and click Logs. When you
access the logs directly from the Credit Card security check of the profile, it filters out the
log messages and displays only the logs pertaining to these security check violations.
2. You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In
the Audit Messages section, click the Syslog messages link to display the Syslog Viewer,
which displays all log messages, including other security check violation logs. This is use-
ful for debugging when multiple security check violations might be triggered during re-
quest processing.
The HTML based Syslog Viewer provides various filter options for selecting only the log
messages that are of interest to you. To access Credit Card security check violation log
messages, filter by selecting APPFW in the dropdown options for Module. The Event Type
displays a rich set of options to further refine your selection. For example, if you select the
APPFW_SAFECOMMERCE and APPFW_SAFECOMMERCE_XFORM check boxes and click the
Apply button, only log messages pertaining to the Credit Card security check violations
appear in the Syslog Viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Mod-
ule and EventType, appear below the log message. You can select any of these options to
highlight the corresponding information in the logs.
Example of a Native format log message when the response is not blocked
Example of a CEF format log message when the response is blocked. The credit card number and type
can be seen in the log, because the doSecureCreditCardLogging parameter is disabled.
When the stats action is enabled, the corresponding counter for the Credit Card check is incremented
when the App Firewall takes any action for this security check. The statistics are collected for Rate and
Total count for Traffic, Violations, and Logs. The increment of the log counter can vary depending on
the configured settings. For example, if the block action is enabled and the Max Allowed credit card
setting is 0, the request for a page that contains 20 credit card numbers increments the stats counter
by one when the page is blocked as soon as the first credit card number is detected. However, if block
is disabled and transform is enabled, processing the same request increments the statistics counter
for logs by 20, because each credit card transformation generates a separate log message.
sh appfw stats
Highlights
Note the following points about the Credit Card security check:
• The App Firewall enables you to protect credit card information and detect any attempts to ac-
cess this sensitive data.
• To use the Credit Card protection check, you must specify at least one type of credit card and
an action. The check is then applied to HTML, XML, and Web 2.0 profiles.
You can pipe the output of sh appfw profile grep CreditCard displays the configured
command and grep for CreditCard to see all settings of various parameters as well as the
the Credit Card specific configuration. For relaxation rules pertaining to the Credit Card
example, sh appfw profile my_profile check for the App Firewall profile named
my_profile.
• You can exclude specific numbers from Credit Card inspection without bypassing the security
check inspection for the rest of the credit card numbers.
• Relaxation is available for all App Firewall protected credit card patterns. In the GUI, you can
use the visualizer to specify Add, Edit, Delete, Enable, or Disable operations on relaxation rules.
• The App Firewall learning engine can monitor the outgoing traffic to recommend rules based
on observed violations. Visualizer support is also available for managing the learned credit card
rules in the GUI. You can edit and deploy the learned rules, or skip them after careful inspection.
• The setting for number of allowed credit cards applies to each response. It does not pertain to
the cumulative total of credit card numbers observed during the entire user session.
• The number of X’d out digits depends on the length of the credit card numbers. Ten digits are
X’d out for credit cards that have 13 through 15 digits. Twelve digits are X’d out for credit cards
that have 16 digits. If your application does not require sending the entire credit card number
in the response, Citrix recommends that you enable this action to mask the digits in the credit
card numbers.
• The X-out operation transforms all the credit cards and works independently of the configured
settings for the maximum number of allowed credit cards. For example, if there are 4 credit
cards in the response and the creditCardMaxAllowed parameter is set to 10, all 4 credit cards
are X’d-out, but they are not blocked. If the credit card numbers are spread out in the docu-
ment, a partial response with X’d-out numbers might be sent to the client before the response
is blocked.
• Do not disable the doSecureCreditCardLogging parameter before due consideration. When this
parameter is turned off, the credit card numbers are displayed and are accessible in the log
messages. These numbers are not masked in the logs, even if the X-out action is enabled. If
you are sending logs to a remote syslog server, and the logs are compromised, the credit card
numbers can be exposed.
• When the response page is blocked because of a Credit Card violation, the App Firewall does
not redirect to the error page.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Safe Object check provides user-configurable protection for sensitive business information, such
as customer numbers, order numbers, and country-specific or region-specific telephone numbers or
postal codes. A user-defined regular expression or custom plug-in tells the App Firewall the format of
this information and defines the rules to be used to protect it. If a string in a user request matches a
safe object definition, the App Firewall either blocks the response, masks the protected information,
or removes the protected information from the response before sending it to the user, depending on
how you configured that particular safe object rule.
The Safe Object check prevents attackers from exploiting a security flaw in your web server software
or on your web site to obtain sensitive private information, such as company credit card numbers or
social security numbers. If your web sites do not have access to these types of information, you do
not need to configure this check. If you have a shopping cart or other application that can access such
information, or your web sites have access to database servers that contain such information, you
should configure protection for each type of sensitive private information that you handle and store.
Note:
A web site that does not access an SQL database usually does not have access to sensitive private
information.
The Safe Object Check dialog box is unlike that for any other check. Each safe object expression that
you create is the equivalent of a separate security check, similar to the Credit Card check, for that
type of information. If you use the wizard or the GUI, you add a new expression by clicking Add and
configuring the expression in the Add Safe Object dialog box. You modify an existing expression by
selecting it, then clicking Open, and then configuring the expression in the Modify Safe Object dialog
box.
In the Safe Object dialog box for each safe object expression, you can configure the following:
• Safe Object Name. A name for your new safe object. The name can begin with a letter, number,
or the underscore symbol, and can consist of from one to 255 letters, numbers, and the hyphen
(-), period (.) pound (#), space ( ), at sign (@), equals (=), colon (:), and underscore (_) symbols.
– X-Out. Mask any information that matches the safe object expression with the letter “X”.
– Remove. Remove any information that matches the safe object expression.
• Regular Expression. Enter a PCRE-compatible regular expression that defines the safe object.
You can create the regular expression in one of three ways: by typing the regular expression
directly into the text box, by using the Regex Tokens menu to enter regular expression elements
and symbols directly into the text box, or by opening the Regular Expressions Editor and using
it to construct the expression. The regular expression must consist of ASCII characters only. Do
not cut and paste characters that are not part of the basic 128-character ASCII set. If you want to
include non-ASCII characters, you must manually type those characters in PCRE hexadecimal
character encoding format.
Note: Do not use start anchors (ˆ) at the beginning of Safe Object expressions, or end anchors
($) at the end of Safe Object expressions. These PCRE entities are not supported in Safe Object
expressions, and if used, will cause your expression not to match what it was intended to match.
• Maximum Match Length. Enter a positive integer that represents the maximum length of the
string that you want to match. For example, if you want to match U.S. social security numbers,
enter the number eleven (11) in this field. That allows your regular expression to match a string
with nine numerals and two hyphens. If you want to match California driver’s license numbers,
enter the number eight (8).
Caution:
If you do not enter a maximum match length in this field, the App Firewall uses a default
value of one (1) when filtering for strings that match your safe object expressions. As a
result, most safe object expressions fail to match their target strings.
You cannot use the command-line interface to configure the Safe Object check. You must configure it
by using either the App Firewall wizard or the GUI.
• Look for strings that appear to be U.S. social security numbers, which consist of three numerals
(the first of which must not be zero), followed by a hyphen, followed by two more numerals,
followed by a second hyphen, and ending with a string of four more numerals:
1 [1-9][0-9]{
2 2,2 }
3 -[0-9]{
4 2,2 }
5 -[0-9]{
6 4,4 }
• Look for strings that appear to be California driver’s license IDs, which start with a letter and are
followed by a string of exactly seven numerals:
1 [A-Za-z][0-9]{
2 7,7 }
• Look for strings that appear to be Example Manufacturing customer IDs which, consist of a string
of five hexadecimal characters (all the numerals and the letters A through F), followed by a hy-
phen, followed by a three-letter code, followed by a second hyphen, and ending with a string of
ten numerals:
1 [0-9A-Fa-f]{
2 5,5 }
3 -[A-Za-z]{
4 3,3 }
5 -[0-9]{
6 10,10 }
Caution: Regular expressions are powerful. Especially if you are not thoroughly familiar with
PCRE-format regular expressions, double-check any regular expressions you write to ensure that
they define exactly the type of string you want to add as a safe object definition, and nothing
else. Careless use of wildcards, and especially of the dot-asterisk (.*) metacharacter/wildcard
combination, can have results you did not want or expect, such as blocking access to web content
that you did not intend to block.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The advanced Form Protection checks examine web form data to prevent attackers from compromis-
ing your system by modifying the web forms on your web sites or sending unexpected types and quan-
tities of data to your web site in a form.
Note
SQL, XSS, FFC, and FieldFormat protection checks are applied if the Exclude Upload Files From
Security Checks is unset.
A file upload is also a form element that has control-name name field that is submitted as part of form
submission.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
January 6, 2019
Contributed by:
C
The Field Formats check verifies the data that users send to your web sites in web forms. It examines
both the length and type of data to ensure that it is appropriate for the form field in which it appears.
If the App Firewall detects inappropriate web form data in a user request, it blocks the request.
By preventing an attacker from sending inappropriate web form data to your web site, the Field For-
mats check prevents certain types of attacks on your web site and database servers. For example, if
a particular field expects the user to enter a phone number, the Field Formats check examines the
user-submitted input to ensure that the data matches the format of a phone number. If a particular
field expects a first name, the Field Formats check ensures that the data in that field is of a type and
length appropriate for a first name. It does the same thing for each form field that you configure it to
protect.
This check applies to HTML requests only. It does not apply to XML requests. You can configure Field
Format Checks in HTML profiles or Web 2.0 profiles to inspect HTML payload for protecting your appli-
cations. The App Firewall also supports Field Format Check protection for Google Web Toolkit (GWT)
applications.
The Field Formats check requires that you enable one or more actions. The App Firewall examines the
submitted inputs and applies the specified actions.
Note
Field format rules are tightening rules. Adding them to relaxation list from learned data acts as
a blocking rule.
To relax field format rules, please remove particular “fieldname” from the fieldformat relaxations
list.
You have the option to set the default field formats to specify Field Type and the minimum and max-
imum length of data expected in each form field on each web form that you want to protect. You
can deploy relaxation rules to configure a Field Format for an individual field of a specific form. Mul-
tiple rules can be added to specify the field name, the action URL, and Field Formats. Specify Field
Formats to accept different types of inputs in different form fields. The learning feature can provide
recommendations for the relaxation rules.
Field Format Actions—You can enable Block, Log, Stats, and Learn actions. At least one of these
actions must be enabled to engage the Field Format Check protection.
• Block. If you enable block, the block action is triggered if the input does not conform to the
specified Field Format. If a rule was configured for the target field, the input is checked against
the specified rule. Otherwise, it is checked against the default field format specification. Any
mismatch in the Field Type or min/max length specification results in blocking the request.
• Log. If you enable the log feature, the Field Format check generates log messages indicating
the actions that it takes. You can monitor the logs to determine whether responses to legiti-
mate requests are getting blocked. A large increase in the number of log messages can indicate
malicious attempts to launch an attack.
• Stats. If enabled, the stats feature gathers statistics about violations and logs. An unexpected
surge in the stats counter might indicate that your application is under attack, or you might have
to revisit the configuration to see if the specified field format is too restrictive.
• Learn. If you are not sure which Field Types or minimum and maximum length values might be
ideally suited for your application, you can use the learn feature to generate recommendations
based on the learned data. The App Firewall learning engine monitors the traffic and provides
field format recommendations based on the observed values. To get optimal benefit without
compromising performance, you might want to enable the learn option for a short time to get
a representative sample of the rules, and then deploy the rules and disable learning.
Note: The App Firewall’s learning engine can distinguish only the first 128 bytes of the name.
If a form has multiple fields with names that match for the first 128 bytes, the learning engine
might not be able to distinguish between them. Similarly, the deployed relaxation rule might
inadvertently relax all such fields.
Default Field Format—In addition to configuring the actions, you can configure the default Field For-
mat to specify the type of data expected in all the form fields for your application. A Field Type can be
selected as the Field Format type. Minimum length and Maximum length parameters can be used to
specify the length of the allowed inputs. As an alternative to Field Types, you can use Character Maps
to specify what’s allowed in a field (except in cluster deployments).
• Field Type—Field Types are named expression to which you assign assigned priority values.
Field Type expressions specify the allowed inputs and are matched against the submitted data
to determine whether the received values are consistent with the allowed values. The Field
Types are checked in the order of their priority numbers. A lower number indicates a higher
priority. The App Firewall gives you the option to add your own Field Types and assign them the
priorities you want. The priority value can range from 0 through 64000. The following built-in
Field Types are provided to help simplify the configuration process:
Note: The built-in Field Types are IMMUTABLE. They cannot be modified or removed. Any
Field Types that you add are MODIFIABLE. You can edit them or remove them.
Configuring a Field Type as a default Field Format might be useful when you have a PCRE expres-
sion that can identify the valid inputs in all or most of the form fields for your application and
exclude the invalid inputs. For example, if all the inputs in your application forms are expected
to contain only numbers and letters, you might want to use the built-in Field Type alphanum as
the default Field Type. Any non-alphanumeric character such as a backslash () or semicolon (;)
in the input will trigger a violation. You can also add your own customized Field Types and use
them to configure default Field Formats. For example, if you want to make the lowercase “x”,
“y”, and “z” the only allowed alpha characters, you can configure a customized Field Type with
regular expression “ˆ[x-z]+$”. You could assign it a higher priority (lower priority number) then
the built-in Field Types and use it as the default Field Type.
• Minimum Length — The default minimum data length assigned to form fields in web forms that
do not have an explicit setting. This parameter is set to 0 by default, which allows the user to
leave the field blank. Any higher setting forces users to fill in the field.
Caution: If the minimum length value is 0 but the Field Type is integer, alpha, or alphanum,
a request is blocked if any input field is left empty, despite the minimum length setting. That
is because the regEx for these Field Types contains a + character, which means one or more
characters. Distinguishing an integer from an alpha character requires at least one character.
• Maximum Length—The default maximum data length assigned to form fields in web forms that
do not have an explicit setting. This parameter is set to 65535 by default.
Note: Characters vs bytes. The minimum and the maximum lengths for the field formats
represent the number of bytes, not the number of characters. Languages that have greater
than one-byte character representation can cause the limit to be exceeded with fewer char-
acters than the number configured for the maximum value. For example, with double-byte
character representation, the maximum value of 9 allows no more than 4 characters.
Tip: The GUI allows you to cut and paste UTF-8 characters directly into the GUI without
having to convert them to hex.
• Character Maps: In addition to recommending the Field Types, the App Firewall learning en-
gine offers you an additional option, Use Character Maps, to deploy the Format Check rules. A
Character Map is a set of all the characters allowed in a particular form field. You can fine tune
the Field format specification to allow or disallow specific characters by using Character Maps.
A separate Character Map is generated for each form field. The alpha and numeric characters
are treated differently in Character Maps. If any alpha character is seen in the input, all alpha
characters [A-Za-z] will be allowed by the recommended PCRE expression in the Character Map.
Similarly, if any digit is included, all digits [0-9] will be allowed. Non-printable characters are
specified by using the x construct. Only single Byte characters with values between 0-255 are
considered for Character Map recommendations.
A Character Map can be more specific than the corresponding Field Type recommendation. In
some situations, Character Maps might be a better option, because they give you tighter control
over the set of characters allowed as inputs. The deployed character maps are displayed as
strings that start with prefix “CM” followed by digits. The priority for the Character Maps starts at
10000. As with user-added Field Types, you can add, edit or remove a Character Map. Character
Maps that are currently used in deployed rules cannot be modified or removed.
When you add a field formats rule with any built-in Field Type and use character map instead of
Field Type and save it, the changes do not get saved and rule still shows with Field Type.
When the character map matches one of the built-in type, the field type is reused instead of cre-
ating a new character map.
In the command line interface, you can use the add appfw fieldtype command to add a new Field Type.
You can use either the set appfw profile command or the add appfw profile command to configure
the Field Format check and specify which actions to perform. You can use the unset appfw profile
command to revert the configured settings back to their defaults. To specify a Field Format rule, use
the bind appfw command to bind a Field Type to a form Field and the action URL, along with the
minimum and maximum length specifications.
Use the add command to add a Field Type. You must specify the Name, Regular expression and Priority
when adding a new Field Type. You also have the option to add a Comment. You can use the show
command to display the configured Field Types. You can also delete a Field Type by using the remove
command, which requires only the Name of the Field Type.
<priority> is a positive_integer
Example:
Note: As shown above, use of “appfw” in the command is optional. For example, “Add Field-
Type” or “Add appfw fieldType” are both valid options. The names of the Field Types are case
insensitive due to normalization. As shown in the above examples, Cust_Zipcode, cust_zipcode,
and cUsT_ziPcode refer to the same Field Type.
Use either the set appfw profile command or the add appfw profile command, as follows:
Example:
In the GUI, you can manage the Field Types. You can also configure the Field Formats security check
in the pane for the profile associated with your application.
To add, modify or remove a Field Type using the GUI
1. Navigate to Application Firewall node. In the Settings, click Manage Field Types to display the
Configure Application Firewall Field Type dialogue box.
2. Click Add to add a new Field Type. Follow the instructions in this pane and click Create. You can
also edit or delete any user-added Field Type if it is currently not being used by a deployed rule.
To add or modify the Field Formats security check by using the GUI
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security
checks. You have 2 options for configuration:
a) If you just want to enable or disable Block, Log, Stats, and Learn actions for Field Formats,
you can select or clear check boxes in the table, click OK, and then click Save and Close
to close the Security Check pane.
b) If you want to configure additional options for this security check, double click Field For-
mats, or select the row and click Action Settings, to display the following options for De-
fault Field Format:
• Field Type—Select the Field Type that you want to configure as the default Field Type.
You can select the built-in and user-defined Field Types. The deployed Character Maps
are also included in the list and can be selected.
• Minimum Length—Specify the minimum number of characters that must be in each
field. Possible values: 0-65535.
• Maximum Length— Specify the maximum number of characters that must be in each
field. Possible values: 1-65535.
You can also edit the Block, Log, Stats and Learn actions in the Field Formats Settings
pane.
After making any of the above changes, click OK to save the changes and return to the Security
Checks table. You can proceed to configure other security checks if needed. Click OK ** to save
all the changes you have made in the Security Checks section, and then click **Save and
Close to close the Security Check pane.
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Relaxation Rules. The Relaxation Rules table has a
Field Formats entry. You can double click, or select this row and click the Edit button, to
access the Field Formats Relaxation Rules dialogue. You can perform Add, Edit, Delete,
Enable, or Disable operations for relaxation rules.
For a consolidated view of all the relaxation rules, you can highlight the Field Formats row
and click Visualizer. The visualizer for deployed relaxations offers you the option to Add a
new rule or Edit an existing one. You can also Enable or Disable a group of rules by selecting
a node and clicking the corresponding buttons in the relaxation visualizer.
When the learn action is enabled, the App Firewall learning engine monitors the traffic and learns the
triggered violations. You can periodically inspect these learned rules. After due consideration, you
can deploy the learned rule as a Field Format relaxation rule.
Field formats learning enhancement—An App Firewall learning enhancement was introduced in re-
lease 11.0. In the previous releases, once the learned field format recommendation is deployed, the
App Firewall learning engine stops monitoring the valid requests for the purpose of recommending
new rules on the basis of the new data points. This limits the configured security protection, because
the learning database does not include any representations of the new data seen in the valid requests
processed by the security check.
Violations are no longer coupled with learning. The learning engine learns and makes recommenda-
tions for the field formats regardless of the violations. In addition to checking the blocked requests
to determine whether the current field format is too restrictive and needs to be relaxed, the learn-
ing engine also monitors the allowed requests to determine whether the current field format is too
permissive, and allows elevating the security by deploying a more restrictive rule.
No Field format is bound—The behavior remains unchanged in this scenario. All learn data is sent to
the aslearn engine. The learning engine suggests a field format rule based on the data set.
Field format is bound: In the previous releases, observed data is sent to the aslearn engine only in
the case of a violation. The learning engine suggests a field format rule based on the data set. In the
11.0 release, all data is sent to aslearn engine even if no violation is triggered. The learning engine
suggests a field format rule based on the entire data set of all received inputs.
If the initial field format learned rules are based on a small sample of data, a few non typical values
might result in a recommendation that is too lenient for the target field. The ongoing learning allows
the App Firewall to observe data points from every request to collect a representative sample for the
learned recommendations. This is helpful in further tightening the security to deploy the optimal
input format with an adequate range value.
The field format learning makes use of the priority of the Field Types as well as the configured settings
of the following learning thresholds:
The field format rule recommendations are based on the following criteria:
• Field Type recommendations—The Field Type recommendations are determined by the as-
signed priorities of the existing Field Types and the specified Field Format thresholds. The pri-
orities determine the order in which the Field Types are matched against the inputs. A lower
number specifies a higher priority. For example, Field Type integer has the higher priority (30)
and is therefore evaluated before Field Type alphanum (50). The thresholds determine the num-
ber of inputs evaluated to collect a representative sample for the data point. Assigning the right
priority to the configured Field Types, and configuring an appropriate learningsetting value
for the fieldFormatPercentThreshold and fieldFormatMinThreshold parameters, is essential
for getting the correct Field Format recommendation. The Field Type with the highest priority,
based on the configured thresholds, is matched first against the inputs. If there is a match, this
Field Type is suggested without considering the other Field Types. For example, three default
Field Types, integer, alphanum, and any will match if all the inputs contain only numbers. How-
ever, integer will be recommended since it has the highest priority.
• Minimum and Maximum length recommendations—Calculations for the minimum and max-
imum lengths for the Field Format are done independently of the determination for the Field
Type. The field format length calculations are based on the average length of all the observed
inputs. Half of this calculated average is suggested as the min value, and twice the value of this
average is suggested as the max value. The range for the Minimum Length is 0-65535 and the
range for the Maximum Length is 1-65535. The configured value for the minimum length cannot
exceed the maximum length.
• Handling of space character—The Field Format check counts every space character when
checking for the Field Formats length. Leading or trailing spaces are not stripped, and multiple
consecutive spaces in the middle of the input string are no longer consolidated to a single
space during input processing.
1. Navigate to Application Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Learned Rules. You can select the Field Formats entry
in the Learned Rules table and double-click it to access the learned rules. You can deploy the
learned rules or edit a rule before deploying it as a relaxation rule. To discard a rule, you can se-
lect it and click the Skip button. You can edit only one rule at a time, but you can select multiple
rules to deploy or skip.
You also have the option to show a summarized view of the learned relaxations by selecting
the Field Formats entry in the Learned Rules table and clicking Visualizer to get a consolidated
view of all the learned violations. The visualizer makes it very easy to manage the learned rules.
It presents a comprehensive view of the data on one screen and facilitates taking action on a
group of rules with one click. The biggest advantage of the visualizer is that it recommends
regular expressions to consolidate multiple rules. You can select a subset of these rules, based
on the delimiter and Action URL. You can display 25, 50, or 75 rules in the visualizer, by selecting
the number from a drop-down list. The visualizer for learned rules offers the option to edit the
rules and deploy them as relaxations. Or you can skip the rules to ignore them.
When the log action is enabled, the Field Formats security check violations are logged in the audit log
as APPFW_FIELDFORMAT violations. The App Firewall supports both Native and CEF log formats. You
can also send the logs to a remote syslog server.
To access the log messages by using the command line
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining
to the Field Formats violations:
• Shell
• tail -f /var/log/ns.log | grep APPFW_FIELDFORMAT
To access the log messages by using the GUI
The NetScaler GUI includes a very useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• Navigate to the Application Firewall > Profiles, select the target profile, and click Security
Checks. Highlight the Field Formats row and click Logs. When you access the logs directly from
the Field Formats security check of the profile, it filters out the log messages and displays only
the logs pertaining to these security check violations.
• You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In the
Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which
displays all log messages, including other security check violation logs. This is useful for debug-
ging when multiple security check violations might be triggered during request processing.
• Navigate to Application Firewall > policies > Auditing. In the Audit Messages section, click the
Syslog messages link to display the Syslog Viewer, which displays all log messages, including
other security check violation logs.
The HTML based Syslog Viewer provides various filter options for selecting only the log mes-
sages that are of interest to you. To access Field Formats security check violation log messages,
filter by selecting APPFW in the dropdown options for Module. The Event Type displays a rich set
of options to further refine your selection. For example, if you select the APPFW_FIELDFORMAT
check box and click the Apply button, only log messages pertaining to the Field Formats secu-
rity check violations appear in the Syslog Viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Module and
EventType, appear below the log message. You can select any of these options to highlight the corre-
sponding information in the logs.
Example of a Native format log message when the request is not blocked
When the stats action is enabled, the corresponding counter for the Field Formats check is incre-
mented when the App Firewall takes any action for this security check. The statistics are collected
for Rate and Total count for Traffic, Violations, and Logs. The increment of the log counter can vary
depending on the configured settings. For example, if the block action is enabled, the request for a
page that contains 3 Field Format violations increments the stats counter by one, because the page is
blocked as soon as the first Field Formats violation is detected. However, if block is disabled, process-
ing the same request increments the statistics counter for violations and the logs by 3, because each
Field Formats violation generates a separate log message.
To display Field Formats statistics by using command line
At the command prompt, type:
sh appfw stats
Deployment tip
• After running a representative sample of the traffic to your application, review the learned rec-
ommendations.
• If a Field Type is recommended by most of the learned rules, configure that Field Type as the
Default Field Type. For minimum and maximum lengths, use the widest range suggested by
these rules.
• Deploy rules for other fields for which different Field Types or different minimum/maximum
lengths are better suited.
• Enable blocking and disable learning.
• Monitor stats and logs. If a significant number of violations are still being triggered, you might
want to review the log messages to confirm that the violations represent malicious requests
that should have been blocked. If valid requests are being flagged as violations, you can either
edit the configured Field Format rule to further relax it or enable learning again to get recom-
mendations based on the new data points.
Note: You can fine tune your configuration by getting new learning recommendations.
Highlights
Note the following points about the Field Format security check:
• Protection—By configuring optimal field format rules, you can protect against many attacks.
For example, if you specify that a field can only have integers, hackers will not be able to launch
SQL Injection or XSS attacks by using this field, because the inputs required to launch such at-
tacks will not meet the configured field format requirement.
• Performance—You can limit the minimum and the maximum allowed length for the inputs in
the field format rules. This can prevent a malicious user from entering excessively large input
strings in an attempt to add processing overhead to the server, or worse, cause the server to
dump core because of stack overflow. By limiting the input size, you can shorten the time re-
quired for processing legitimate requests.
• Configuring Field Formats—You must enable one of the actions (block, log, stats, learn) to en-
gage the field Format protection. You can also specify the Field format rules to identify the al-
lowed inputs in your form fields.
• Selecting Character Maps vs. Field Types—Both Character Maps and Field Types use regular
expressions. However, a Character Map provides a more specific expression by narrowing down
the list of allowed characters. For example, for an input such as [email protected], the learn-
ing engine might recommend the Field Type nohtml but the Character Map [.@-Za-z] might be
more specific, because it narrows down the allowed set of non-alpha characters. The Charac-
ter Map option allows, in addition to alpha characters, only two non-alpha characters: period
(.) and at (@).
• Ongoing Learning—The App Firewall monitors and takes into account all the incoming data
(violations as well as allowed inputs) to build a learning table for recommending rules. The rules
are revised and updated as new incoming data arrives. New field format rules are suggested for
a field even if it already has a bound field format rule. If the configured Field Formats are too
restrictive and are blocking the valid requests, you can deploy a more relaxed Field Format.
Similarly, if the current Field Formats are too generic, you can further refine and tighten the
security by deploying a more restrictive Field Format.
• Overwriting Rules—If a rule has already been deployed for a field/URL combination, the GUI
allows the user to update the field format. A dialog box asks for confirmation to replace the
existing rule. If you are using the command line interface, you have to explicitly unbind the
previous binding and then bind the new rule.
• Multiple match—If multiple field formats match a given field name and its action URL, the App
Firewall arbitrarily selects one of them to apply.
• Buffer boundary—If a field value extends across multiple streaming buffers, and the format for
these two parts of the field value is different, a field format corresponding to “any” is sent to the
learn database.
• Field Format vs. Field Consistency Check—Both the Field Format check and the Field Con-
sistency check are form-based protection checks. The Field Formats check provides a different
type of protection than does the Form Field Consistency check. The Form Field Consistency
check verifies that the structure of the web forms returned by users is intact, that data format
restrictions configured in the HTML are respected, and that data in hidden fields has not been
modified. It can do this without any specific knowledge about your web forms other than what
it derives from the web form itself. The Field Formats check verifies that the data in each form
field matches the specific formatting restrictions that you configured manually, or that the learn-
ing feature generated and you approved. In other words, the Form Field Consistency check en-
forces general web form security, while the Field Formats check enforces the specific rules for
the allowed inputs for your web forms.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Form Field Consistency check examines the web forms returned by users of your web site, and
verifies that web forms were not modified inappropriately by the client. This check applies only to
HTML requests that contain a web form, with or without data. It does not apply to XML requests.
The Form Field Consistency check prevents clients from making unauthorized changes to the struc-
ture of the web forms on your web site when they fill out and submit a form. It also ensures that the
data a user submits meets the HTML restrictions for length and type, and that data in hidden fields is
not modified. This prevents an attacker from tampering with a web form and using the modified form
to gain unauthorized access to web site, redirect the output of a contact form that uses an insecure
script and thereby send unsolicited bulk email, or exploit a vulnerability in your web server software
to gain control of the web server or the underlying operating system. Web forms are a weak link on
many web sites and attract a wide range of attacks.
• If a field is sent to the user, the check ensures that it is returned by the user.
Note: The Form Field Consistency check enforces HTML restrictions on data type and
length but does not otherwise validate the data in web forms. You can use the Field
Formats check to set up rules that validate data returned in specific form fields on your
web forms.
• If your web server does not send a field to the user, the check does not allow the user to add
that field and return data in it.
• If a field is a read-only or hidden field, the check verifies that the data has not changed.
• If a field is a list box or radio button field, the check verifies that the data in the response corre-
sponds to one of the values in that field.
If a web form returned by a user violates one or more of the Form Field consistency checks, and you
have not configured the App Firewall to allow that web form to violate the Form Field Consistency
checks, the request is blocked.
If you use the wizard or the GUI, in the Modify Form Field Consistency Check dialog box, on the General
tab you can enable or disable the Block, Log, Learn, and Statistics actions.
You also configure Sessionless Field Consistency in the General tab. If Sessionless Field Consistency
is enabled, the App Firewall checks only the web form structure, dispensing with those parts of the
Form Field Consistency check that depend upon maintaining session information. This can speed the
Form Field Consistency check with little security penalty for web sites that use many forms. To use
Sessionless Field Consistency on all web forms, select On. To use it only for forms submitted with the
HTTP POST method, select postOnly
If you use the command-line interface, you can enter the following command to configure the Form
Field Consistency Check:
To specify relaxations for the Form Field Consistency check, you must use the GUI. On the Checks tab
of the Modify Form Field Consistency Check dialog box, click Add to open the Add Form Field Consis-
tency Check Relaxation dialog box, or select an existing relaxation and click Open to open the Modify
Form Field Consistency Check Relaxation dialog box. Either dialog box provides the same options for
configuring a relaxation, as described in “Manual Configuration By Using the GUI.”
1 ^UserType$
• Choose form fields with names that begin with UserType_ and are followed by a string that be-
gins with a letter or number and consists of from one to twenty-one letters, numbers, or the
apostrophe or hyphen symbol:
1 ^UserType_[0-9A-Za-z][0-9A-Za-z’-]{
2 0,20 }
3 $
• Choose form fields with names that begin with Turkish-UserType_ and are otherwise the same
as the previous expression, except that they can contain Turkish special characters throughout:
1 ^T\xC3\xBCrk\xC3\xA7e-UserType_([0-9A-Za-z]|\\x[0-9A-Fa-f][0-9A-
Fa-f])+$
Note: See “PCRE Character Encoding Format” for a complete description of supported spe-
cial characters and how to encode them properly.
• Choose form field names that begin with a letter or number, consist of a combination of letters
and/or numbers only, and that contain the string Num anywhere in the string:
1 ^[0-9A-Za-z]*Num[0-9A-Za-z]*$
1 ^http://www[.]example[.]com/search[.]pl?[^?]*$
• Choose URLs that begin with http://www.example-español.com and have paths and filenames
that consist of upper-case and lower-case letters, numbers, non-ASCII special characters, and
selected symbols in the path. The ñ character and any other special characters are represented
as encoded UTF-8 strings containing the hexadecimal code assigned to each special character
in the UTF-8 charset:
1 ^http://www[.]example-espa\xC3\xB1ol[.]com/(([0-9A-Za-z]|\\x[0-9A-
Fa-f][0-9A-Fa-f])([0-9A-Za-z_-]|\\x[0-9A-Fa-f][0-9A-Fa-f])*/)
*([0-9A-Za-z]|\\x[0-9A-Fa-f][0-9A-Fa-f])([0-9A-Za-z_-]|\\x[0-9A
-Fa-f][0-9A-Fa-f])*[.](asp|htp|php|s?html?)$
1 ^[^?<>]*/search[.]cgi\?[^?<>]*$
Caution: Regular expressions are powerful. Especially if you are not thoroughly familiar with
PCRE-format regular expressions, double-check any regular expressions you write. Make sure
that they define exactly the URL you want to add as an exception, and nothing else. Careless use
of wildcards, and especially of the dot-asterisk (
.*) metacharacter/wildcard combination, can have results you do not want or expect, such as
blocking access to web content that you did not intend to block or allowing an attack that the
Cookie Consistency check would otherwise have blocked.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Cross Site Request Forgery (CSRF) Form Tagging check tags each web form sent by a protected
web site to users with a unique and unpredictable FormID, and then examines the web forms returned
by users to ensure that the supplied FormID is correct. This check protects against cross-site request
forgery attacks. This check applies only to HTML requests that contain a web form, with or without
data. It does not apply to XML requests.
The CSRF Form Tagging check prevents attackers from using their own web forms to send high vol-
ume form responses with data to your protected web sites. This check requires relatively little CPU
processing capacity compared to certain other security checks that analyze web forms in depth. It
is therefore able to handle high volume attacks without seriously degrading the performance of the
protected web site or the App Firewall itself.
Before you enable the CSRF Form Tagging check, you should be aware of the following:
• You need to enable form tagging. The CSRF check depends on form tagging and does not work
without it.
• You should disable the NetScaler Integrated Caching feature for all web pages containing forms
that are protected by that profile. The Integrated Caching feature and CSRF form tagging are
not compatible.
• You should consider enabling Referer checking. Referer checking is part of the Start URL check,
but it prevents cross-site request forgeries, not Start URL violations. Referer checking also puts
less load on the CPU than does the CSRF Form Tagging check. If a request violates Referer check-
ing, it is immediately blocked, so the CSRF Form Tagging check is not invoked.
• The CSRF Form Tagging check does not work with web forms that use different domains in the
form-origin URL and form-action URL. For example, CSRF Form Tagging cannot protect a web
form with a form-origin URL of http://www.example.com and a form action URL of http
://www.example.org/form.pl, because example.com and example.org are different do-
mains.
If you use the wizard or the GUI, in the Modify CSRF Form Tagging Check dialog box, on the General
tab you can enable or disable the Block, Log, Learn and Statistics actions.
If you use the command-line interface, you can enter the following command to configure the CSRF
Form Tagging Check:
• set appfw profile <name> -fieldConsistencyAction [block] [log] [learn]
[stats] [none]
To specify relaxations for the CSRF Form Tagging check, you must use the GUI. On the Checks tab of the
Modify CSRF Form Tagging Check dialog box, click Add to open the Add CSRF Form Tagging Check
Relaxation dialog box, or select an existing relaxation and click Open to open the Modify CSRF Form
Tagging Check Relaxation dialog box. Either dialog box provides the same options for configuring a
relaxation.
An alert is generated when you set the NetScaler Appfirewall session limit to a value of 0 or lower,
because such a setting affects advanced protection check functionality that requires a properly func-
tioning App Firewall session.
Following are examples of CSRF Form Tagging check relaxations:
Note: The following expressions are URL expressions that can be used in both the Form Origin URL
and Form Action URL roles.
1 ^http://www[.]example[.]com/search
2 [.]pl?[^?]*$
• Choose URLs that begin with http://www.example-español.com and have paths and file-
names that consist of upper-case and lower-case letters, numbers, non-ASCII special charac-
ters, and selected symbols in the path. The ñ character and any other special characters are
represented as encoded UTF-8 strings containing the hexadecimal code assigned to each spe-
cial character in the UTF-8 charset:
1 http://www[.]example-espa\xC3\xB1ol[.]com/(([0-9A-Za-z]|\\x[0-9A-Fa-f
][0-9A-Fa-f])
2 ([0-9A-Za-z_-]|\\x[0-9A-Fa-f][0-9A-Fa-f])*/)*([0-9A-Za-z]|\\x[0-9A-Fa-f
][0-9A-Fa-f])([0-9A-Za-z_-]|\\x[0-9A-Fa-f][0-9A-Fa-f])*[.](asp|htp|
php|s?html?)$
1 ^[^?<>]*/search[.]cgi\?[^?<>]*$
Important
Regular expressions are powerful. If you are not thoroughly familiar with PCRE-format regular
expressions, double-check any regular expressions you write. Make sure that they define exactly
the URL that you want to add as an exception, and nothing else. Careless use of wildcards, and
especially of the dot-asterisk (.*) metacharacter/wildcard combination, can have results you do
not want, such as blocking access to web content that you did not intend to block or allowing an
attack that the check would otherwise have blocked.
Tip
When enableValidate referrer header is enabled under the Start URL Action, ensure that the Re-
ferrer Header URL is added to StartURL as well.
Note
When NetScaler reaches the appfw_session_limit and CSRF checks are enabled, the web
application freezes.
To prevent web application freeze, decrease the session timeout and increase the session limit
by using the following commands:
Logging and generating SNMP alarms when appfw_session_limit is reached assists you in trou-
bleshooting and debugging issues.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You configure an exception (or relaxation) to the CSRF Form Tagging security check in the Add Cross-
Site Request Forgery Tagging Check Relaxation dialog box or the Modify Cross-Site Request Forgery
Tagging Check Relaxation dialog box.
2. In the Profiles pane, select the profile you want to configure, and then click Open.
3. In the Configure App Firewall Profile dialog box, click the Security Checks tab. The Security
Checks tab contains the list of App Firewall security checks.
The Add Cross-Site Request Forgery Tagging Check Relaxation or Modify Cross-Site Request
Forgery Tagging Check Relaxation dialog box is displayed. Except for the title, these dialog
boxes are identical.
• Enabled check box—Select to place this relaxation or rule in active use; clear to deactivate
it.
• Form Origin URL—In the text area, enter a PCRE-format regular expression that defines
the URL that hosts the form.
• Form Action URL—In the text area, enter a PCRE-format regular expression that defines
the URL to which data entered into the form is delivered.
Note: For any element that requires a regular expression, you can type the regular expres-
sion, use the Regex Tokens menu to insert regular expression elements and symbols di-
rectly into the text box, or click Regex Editor to open the Add Regular Expression dialog
box, and use it to construct the expression.
6. Click OK. The Add Cross-Site Request Forgery Tagging Check Relaxation or Modify Cross-
Site Request Forgery Tagging Check Relaxation dialog box closes and you return to the Mod-
ify Cross-Site Request Forgery Tagging Check dialog box.
10. To configure the settings and relationships of all existing relaxations in an integrated interactive
graphic display, click Visualizer, and use the display tools.
11. To review and configure learned rules for the CSRF check, click Learningand perform the steps
in “To configure and use the Learning feature.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The URL Protection checks examine request URLs to prevent attackers from aggressively attempting
to access multiple URLs (forceful browsing) or using a URL to trigger a known security vulnerability in
web server software or web site scripts.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Start URL check examines the URLs in incoming requests and blocks the connection attempt if
the URL does not meet the specified criteria. To meet the criteria, the URL must match an entry in the
Start URL list, unless the Enforce URL Closure parameter is enabled. If you enable this parameter, a
user who clicks a link on your Web site is connected to the target of that link.
The primary purpose of the Start URL check is to prevent repeated attempts to access random URLs on
a Web site, (forceful browsing) through bookmarks, external links, or jumping to pages by manually
typing in the URLs to skip the pages required to reach that part of the website. Forceful browsing can
be used to trigger a buffer overflow, find content that users were not intended to access directly, or
find a back door into secure areas of your Web server. The App Firewall enforces a website’s given
traversal or logic path by allowing access to only the URL’s that are configured as start URLs.
If you use the wizard or the GUI, in the Modify Start URL Check dialog box, on the
General tab you can enable or disable Block, Log, Statistics, Learn actions, and the following parame-
ters:
• Enforce URL Closure. Allow users to access any web page on your web site by clicking a hyper-
link on any other page on your web site. Users can navigate to any page on your web site that
can be reached from the home page or any designated start page by clicking hyperlinks.
Note: The URL closure feature allows any query string to be appended to and sent with the ac-
tion URL of a web form submitted by using the HTTP GET method. If your protected web sites
use forms to access an SQL database, make sure that you have the SQL injection check enabled
and properly configured.
• Sessionless URL Closure. From the client’s point of view, this type of URL closure functions
in exactly the same way as standard, session-aware URL Closure, but uses a token embedded
in the URL instead of a cookie to track the user’s activity, which consumes considerably fewer
resources. When sessionless URL closure is enabled, the App Firewall appends a “as_url_id” tag
to all the URL’s that are in URL closure.
Note: When enabling sessionless (Sessionless URL Closure), you must also enable regular URL
closure (Enforce URL Closure) or sessionless URL closure does not work.
• Validate Referer Header. Verify that the Referer header in a request that contains web form
data from your protected web site instead of another web site. This action verifies that your
web site, not an outside attacker, is the source of the web form. Doing so protects against cross-
site request forgeries (CSRF) without requiring form tagging, which is more CPU-intensive than
header checks. The App Firewall can handle the HTTP Referer header in one of the following
four ways, depending on which option you select in the drop-down list:
– Off—Do not validate the Referer header.
– If-Present—Validate the Referer header if a Referer header exists. If an invalid Referer
header is found, the request generates a referer-header violation. If no Referer header ex-
ists, the request does not generate a referer-header violation. This option enables the App
Firewall to perform Referer header validation on requests that contain a Referer header,
but not block requests from users whose browsers do not set the Referer header or who
use web proxies or filters that remove that header.
– Always Except Start URLs—Always validate the Referer header. If there is no Referer
header and the requested URL is not exempted by the startURL relaxation rule, the
request generates a referer-header violation. If the Referer header is present but it is
invalid, the request generates a referer-header violation.
– Always Except First Request—Always validate the referer header. If there is no referer
header, only the URL that is accessed first is allowed. All other URL’s are blocked without a
valid referer header. If the Referer header is present but it is invalid, the request generates
a referer-header violation.
One Start URL setting, Exempt Closure URLs from Security Checks, is not configured in the Modify
Start URL Check dialog box, but is configured in the Settings tab of the Profile. If enabled, this setting
directs the App Firewall not to run further form based checks (such as Cross-Site Scripting and SQL
Injection inspection) on URLs that meet the URL Closure criteria.
Note
Although the referer header check and Start URL security check share the same action settings,
it is possible to violate the referer header check without violating the Start URL check. The dif-
ference is visible in the logs, which log referer header check violations separately from Start URL
check violations.
OFF:
If-Present:
AlwaysExceptStartURLs:
• Request has no referer header and the request URL is a start URL -> Request is allowed.
• Request has no referer header and the request URL is not a start URL ->Request is blocked.
• Request has referer header and the referer URL is in URL closure -> Request is allowed.
• Request has referer header and the referer URL is not in URL closure -> Request is blocked.
AlwaysExceptFirstRequest:
• Request has no referer header and is the first request URL of the session -> Request is allowed.
• Request has no referer header and is not the first request URL of the session -> Request is
blocked.
• Request has referer header and is either the first request URL of the session or is in URL closure
-> Request is allowed.
• Request has referer header and is neither the first request URL of the session nor is in URL closure
-> Request is blocked.
If you use the command-line interface, you can enter the following commands to configure the Start
URL Check:
To specify relaxations for the Start URL check, you must use the GUI. On the Checks tab of the Modify
Start URL Check dialog box, click Add to open the Add Start URL Check Relaxation dialog box, or select
an existing relaxation and click Open to open the Modify Start URL Check Relaxation dialog box. Either
dialog box provides the same options for configuring a relaxation.
1 ^http://www[.]example[.]com$
• Allow users to access all static HTML (.htm and .html), server-parsed HTML (.htp and .shtml),
PHP (.php), and Microsoft ASP (.asp) format web pages at www.example.com:
1 ^http://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_-]*/)*
2 [0-9A-Za-z][0-9A-Za-z_.-]*[.](asp|htp|php|s?html?)$
• Allow users to access web pages with pathnames or file names that contain non-ASCII characters
at www.example-español.com:
1 ^http://www[.]example-espaxC3xB1ol[.]com/(([0-9A-Za-z]|x[0-9A-Fa-f
][0-9A-Fa-f])([0-9A-Za-z_-]|x[0-9A-Fa-f][0-9A-Fa-f])*/)*
2 ([0-9A-Za-z]|x[0-9A-Fa-f][0-9A-Fa-f])([0-9A-Za-z_-]|x[0-9A-Fa-f
][0-9A-Fa-f])*[.](asp|htp|php|s?html?)$
• Allow users to access all GIF (.gif), JPEG (.jpg and .jpeg), and PNG (.png) format graphics at
www.example.com:
1 ^http://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_-]*/)*
2 [0-9A-Za-z][0-9A-Za-z_.-]*[.](gif|jpe?g|png)$
• Allow users to access CGI (.cgi) and PERL (.pl) scripts, but only in the CGI-BIN directory:
1 ^http://www[.]example[.]com/CGI-BIN/[0-9A-Za-z][0-9A-Za-z_.-]*[.](
cgi|pl)$
• Allow users to access Microsoft Office and other document files in the docsarchive directory:
1 ^http://www[.]example[.]com/docsarchive/[0-9A-Za-z][0-9A-Za-z_
-.]*[.](doc|xls|pdf|ppt)$
Note
Caution: Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-
format regular expressions, double-check any regular expressions that you write. Make sure that they
define exactly the URL you want to add as an exception, and nothing else. Careless use of wildcards,
and especially of the dot-asterisk (.*) metacharacter/wildcard combination, can have results you do
not want, such as blocking access to web content that you did not intend to block or allowing an
attack that the Start URL check would otherwise have blocked.
Tip
You can add the -and- to the allowed list of SQL keywords for URL naming scheme. For exam-
ple, example https://FQDN/bread-and-butter.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Deny URL check examines and blocks connections to URLs that are commonly accessed by hack-
ers and malicious code. This check contains a list of URLs that are common targets of hackers or
malicious code and that rarely if ever appear in legitimate requests. You can also add URLs or URL
patterns to the list. The Deny URL check prevents attacks against various security weaknesses known
to exist in web server software or on many web sites.
The Deny URL check takes priority over the Start URL check, and thus denies malicious connection
attempts even when a Start URL relaxation would normally allow a request to proceed.
In the Modify Deny URL Check dialog box, on the General tab you can enable or disable the Block, Log,
and Statistics actions.
If you use the command-line interface, you can enter the following command to configure the Deny
URL Check:
To create and configure your own deny URLs, you must use the GUI. On the Checks tab of the Modify
Deny URL Check dialog box, click Add to open the Add Deny URL dialog box, or select an existing user-
defined deny URL and click Open to open the Modify Deny URLdialog box. Either dialog box provides
the same options for creating and configuring a deny URL.
1 ^http://images[.]example[.]com$
• Do not allow users to access CGI (.cgi) or PERL (.pl) scripts directly:
1 ^http://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_-]*/)*
2 [0-9A-Za-z][0-9A-Za-z_.-]*[.](cgi|pl)$
1 ^http://www[.]example[.]com/(([0-9A-Za-z]|x[0-9A-Fa-f][0-9A-Fa-f])
2 ([0-9A-Za-z_-]|x[0-9A-Fa-f][0-9A-Fa-f])*/)*([0-9A-Za-z]|x[0-9A-Fa-f
][0-9A-Fa-f])
3 ([0-9A-Za-z_-]|x[0-9A-Fa-f][0-9A-Fa-f])*[.](cgi|pl)$
Caution:
Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format
regular expressions, double-check any regular expressions you write. Make sure that they define
exactly the URL or pattern that you want to block, and nothing else. Careless use of wildcards,
and especially of the dot-asterisk (
.*) metacharacter/wildcard combination, can have results that you do not want, such as blocking
access to web content that you did not intend to block.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML Protection checks examine requests for XML-based attacks of all types.
Caution: The XML security checks apply only to content that is sent with an HTTP content-type
header of text/xml. If the content-type header is missing, or is set to a different value, all XML
security checks are bypassed. If you plan to protect XML or Web 2.0 web applications, the web-
masters of each web server that hosts those applications should ensure that the proper HTTP
Contributed by:
C
The XML Format check examines the XML format of incoming requests and blocks those requests that
are not well formed or that do not meet the criteria in the XML specification for properly-formed XML
documents. Some of those criteria are:
• An XML document must contain only properly-encoded Unicode characters that match the Uni-
code specification.
• No special XML syntax characters—such as < , > and &—can be included in the document except
when used in XML markup.
• All begin, end, and empty-element tags must be correctly nested, with none missing or overlap-
ping.
• XML element tags are case-sensitive. All beginning and end tags must match exactly.
• A single root element must contain all the other elements in the XML document.
A document that does not meet the criteria for well-formed XML does not meet the definition of an
XML document. Strictly speaking, it is not XML. However, not all XML applications and web services
enforce the XML well-formed standard, and not all handle poorly-formed or invalid XML correctly. In-
appropriate handling of a poorly-formed XML document can cause security breaches. The purpose
of the XML Format check is to prevent a malicious user from using a poorly-formed XML request to
breach security on your XML application or web service.
If you use the wizard or the GUI, in the Modify XML Format Check dialog box, on the General tab you
can enable or disable the Block, Log, and Statistics actions.
If you use the command-line interface, you can enter the following command to configure the XML
Format Check:
You cannot configure exceptions to the XML Format check. You can only enable or disable it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML Denial of Service (XML DoS or XDoS) check examines incoming XML requests to determine
whether they match the characteristics of a denial-of-service (DoS) attack, and blocks those requests
that do. The purpose of the XML DoS check is to prevent an attacker from using XML requests to launch
a denial-of-service attack on your web server or web site.
If you use the wizard or the GUI, in the Modify XML Denial-of-Service Check dialog box, on the General
tab you can enable or disable the Block, Log, Statistics, and Learn actions:
If you use the command-line interface, you can enter the following command to configure the XML
Denial-of-Service check:
To configure individual XML Denial-of-Service rules, you must use the GUI. On the Checks tab of the
Modify XML Denial-of-Service Check dialog box, select a rule and click Open to open the Modify XML
Denial-of-Service dialog box for that rule. The individual dialog boxes differ for the different rules but
are extremely simple. Some only allow you to enable or disable the rule; others allow you to modify
a number by typing a new value in a text box.
Restrict the maximum number of nested levels in each individual element to 256. If this rule
is enabled, and the App Firewall detects an XML request with an element that has more than
the maximum number of allowed levels, it blocks the request. You can modify the maximum
number of levels to any value from one (1) to 65,535.
Restrict the maximum length of each element name to 128 characters. This includes the name
within the expanded namespace, which includes the XML path and element name in the follow-
ing format:
1 {
2 http://prefix.example.com/path/ }
3 target_page.xml
1 The user can modify the maximum name length to any value between one
(1) character and 65,535.
• Maximum # Elements
Restrict the maximum number of any one type of element per XML document to 65,535. You
can modify the maximum number of elements to any value between one (1) and 65,535.
Restrict the maximum number of children (including other elements, character information,
and comments) each individual element is allowed to have to 65,535. You can modify the maxi-
mum number of element children to any value between one (1) and 65,535.
• Maximum # Attributes
Restrict the maximum number of attributes each individual element is allowed to have to 256.
You can modify the maximum number of attributes to any value between one (1) and 256.
Restrict the maximum length of each attribute name to 128 characters. You can modify the max-
imum attribute name length to any value between one (1) and 2,048.
Restrict the maximum length of each attribute value to 2048 characters. You can modify the
maximum attribute name length to any value between one (1) and 2,048.
Restrict the maximum character data length for each element to 65,535. You can modify the
length to any value between one (1) and 65,535.
Restrict the size of each file to 20 MB. You can modify the maximum file size to any value.
Require that each file be at least 9 bytes in length. You can modify the minimum file size to any
positive integer representing a number of bytes.
Limit the number of entity expansions allowed to the specified number. Default: 1024.
Restrict the maximum number of nested entity expansions to no more than the specified num-
ber. Default: 32.
• Maximum # Namespaces
Limit the number of namespace declarations in an XML document to no more than the specified
number. Default: 16.
Limit the URL length of each namespace declaration to no more than the specified number of
characters. Default: 256.
Block any special processing instructions included in the request. This rule has no user-
modifiable values.
• Block DTD
Block any document type definitions (DTD) included with the request. This rule has no user-
modifiable values.
Block all references to external entities in the request. This rule has no user-modifiable values.
– Maximum SOAP Array Size. The maximum total size of all SOAP arrays in an XML request
before the connection is blocked. You can modify this value. Default: 20000000.
– Maximum SOAP Array Rank. The maximum rank or dimensions of any single SOAP array
in an XML request before the connection is blocked. You can modify this value. Default:
16.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML Cross-Site Scripting check examines the user requests for possible cross-site scripting attacks
in the XML payload. If it finds a possible cross-site scripting attack, it blocks the request.
To prevent misuse of the scripts on your protected web services to breach security on your web ser-
vices, the XML Cross-Site Scripting check blocks scripts that violate the same origin rule, which states
that scripts should not access or modify content on any server but the server on which they are lo-
cated. Any script that violates the same origin rule is called a cross-site script, and the practice of
using scripts to access or modify content on another server is called cross-site scripting. The reason
cross-site scripting is a security issue is that a web server that allows cross-site scripting can be at-
tacked with a script that is not on that web server, but on a different web server, such as one owned
and controlled by the attacker.
The App Firewall offers various action options for implementing XML Cross-Site Scripting protection.
You have the option to configure Block, Log, and Stats actions.
The App Firewall XML XSS check is performed on the payload of the incoming requests and attack
strings are identified even if they are spread over multiple lines. The check looks for XSS attack strings
in the element and the attribute values. You can apply relaxations to bypass security check inspec-
tion under specified conditions. The logs and statistics can help you identify needed relaxations.
The CDATA section of the XML payload might be an attractive area of focus for the hackers because the
scripts are not executable outside the CDATA section. A CDATA section is used for content that is to be
treated entirely as character data. HTML mark up tag delimiters “<”, “>”, and “/>” will not cause the
parser to interpret the code as HTML elements. The following example shows a CDATA Section with
XSS attack string:
1 <![CDATA[rn
2 <script language=”Javascript” type=”text/javascript”>alert (”Got
you”)</script>rn
3 ]]>
Action Options
An action is applied when the XML Cross-Site Scripting check detects an XSS attack in the request. The
following options are available for optimizing XML Cross-Site Scripting protection for your application:
• Block—Block action is triggered if the XSS tags are detected in the request.
• Log—Generate log messages indicating the actions taken by the XML Cross-Site Scripting
check. If block is disabled, a separate log message is generated for each location (ELEMENT,
ATTRIBUTE) in which the XSS violation is detected. However, only one message is generated
when the request is blocked. You can monitor the logs to determine whether responses to
legitimate requests are getting blocked. A large increase in the number of log messages can
indicate attempts to launch an attack.
• Stats—Gather statistics about violations and logs. An unexpected surge in the stats counter
might indicate that your application is under attack. If legitimate requests are getting blocked,
you might have to revisit the configuration to see if you need to configure new relaxation rules
or modify the existing ones.
Relaxation Rules
If your application requires you to bypass the Cross-Site Scripting check for a specific ELEMENT or AT-
TRIBUTE in the XML payload, you can configure a relaxation rule. The XML Cross-Site Scripting check
relaxation rules have the following parameters:
• Name—You can use literal strings or regular expressions to configure the name of the ELEMENT
or the Attribute. The following expression exempts all ELEMENTS beginning with the string
name_ followed by a string of uppercase or lowercase letters, or numbers, that is at least two
and no more than fifteen characters long:
^name_[0-9A-Za-z]{ 2,15 } $
Note
The names are case sensitive. Duplicate entries are not allowed, but you can use capitalization of
the names and differences in location to create similar entries. For example, each of the following
relaxation rules is unique:
• Location—You can specify the Location of the Cross-site Scripting Check exception in your XML
payload. The option ELEMENT is selected by default. You can change it to ATTRIBUTE.
• Comment—This is an optional field. You can use up to a 255 character string to describe the
purpose of this relaxation Rule.
Warning
Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format
regular expressions, double-check any regular expressions you write. Make sure that they define
exactly the name that you want to add as an exception, and nothing else. Careless use of Regular
Expressions can have results that you do not want, such as blocking access to web content that
you did not intend to block or allowing an attack that the XML Cross-Site Scripting check would
otherwise have blocked.
Using the command line to configure the XML cross-site scripting check
To configure XML Cross-Site Scripting check actions and other parameters by using the command line
If you use the command-line interface, you can enter the following commands to configure the XML
Cross-Site Scripting Check:
To configure a XML Cross-Site Scripting check relaxation rule by using the command line
You can add relaxation rules to bypass inspection of XSS script attack inspection in a specific location.
Use the bind or unbind command to add or delete the relaxation rule binding, as follows:
> bind appfw profile <name> -XMLXSS <string> [isRegex (REGEX | NOTREGEX)]
[-location ( ELEMENT | ATTRIBUTE )] ‒comment <string> [-state ( ENABLED |
DISABLED )]
Example:
After executing the above command, the following relaxation rule is configured. The rule is enabled,
the name is treated as a literal (NOTREGEX), and ELEMENT is selected as the default location:
10
11 Done
In the GUI, you can configure the XML Cross-Site scripting check in the pane for the profile associated
with your application.
To configure or modify the XML Cross-Site Scripting check by using the GUI
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security checks.
You have 2 options for configuration:
a) If you just want to enable or disable Block, Log, and Stats actions for the XML Cross-Site Scripting
check, you can select or clear check boxes in the table, click OK, and then click Save and Close to close
the Security Check pane.
b) You can double click XML Cross-Site Scripting, or select the row and click Action Settings, to dis-
play the action options. After changing any of the action settings, click OK to save the changes and
return to the Security Checks table.
You can proceed to configure other security checks if needed. Click OK to save all the changes you
have made in the Security Checks section, and then click Save and Close to close the Security Check
pane.
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Relaxation Rules.
3. In the Relaxation Rules table, double-click the XML Cross-Site Scripting entry, or select it and
click Edit.
4. In the XML Cross-Site Scripting Relaxation Rules dialogue box, perform Add, Edit, Delete,
Enable, or Disable operations for relaxation rules.
For a consolidated view of all the relaxation rules, you can highlight the XML Cross-Site Scripting row
in the Relaxation Rules table, and click Visualizer. The visualizer for deployed relaxations offers you
the option to Add a new rule or Edit an existing one. You can also Enable or Disable a group of rules
by selecting a node and clicking the corresponding buttons in the relaxation visualizer.
You can use the GUI to view or customize the default list of XSS allowed attributes or allowed tags. You
can also view or customize the default list of XSS denied Patterns.
The default lists are specified in App Firewall > Signatures > Default Signatures. If you do not bind
any signature object to your profile, the default XSS Allowed and Denied list specified in the Default
Signatures object will be used by the profile for the Cross-Site Scripting security check processing. The
Tags, Attributes, and Patterns, specified in the default signatures object, are read-only. You cannot
edit or modify them. If you want to modify or change these, make a copy of the Default Signatures
object to create a User-Defined signature object. Make changes in the Allowed or Denied lists in the
new user-defined signature object and use this signature object in the profile that is processing the
traffic for which you want to use these customized allowed and denied lists.
1. Navigate to App Firewall > Signatures, select *Default Signatures, and click Edit. Then click
Manage SQL/XSS Patterns.
The Manage SQL/XSS Paths table shows following three rows pertaining to XSS :
1 xss/allowed/attribute
2
3 xss/allowed/tag
4
5 xss/denied/pattern
Select a row and click Manage Elements to display the corresponding XSS Elements (Tag, Attribute,
Pattern) used by the App Firewall Cross-Site Scripting check.
To customize XSS Elements: You can edit the user-defined signature object to customize the allowed
Tag, allowed Attributes and denied Patterns. You can add new entries or remove the existing ones.
1. Navigate to App Firewall > Signatures, highlight the target user-defined signature, and click
Edit. Click Manage SQL/XSS Patterns to display the Manage SQL/XSS paths table.
2. Select the target XSS row.
a) Click Manage Elements, to Add, Edit or Remove the corresponding XSS element.
Warning
Be very careful when you remove or modify any default XSS element, or delete the XSS path
to remove the entire row. The signatures, HTML Cross-Site Scripting security check, and XML
Cross-Site Scripting security check rely on these Elements for detecting attacks to protect your
applications. Customizing the XSS Elements can make your application vulnerable to Cross-Site
Using the log feature with the XML cross-site scripting check
When the log action is enabled, the XML Cross-Site Scripting security check violations are logged in the
audit log as APPFW_XML_XSS violations. The App Firewall supports both Native and CEF log formats.
You can also send the logs to a remote syslog server.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the XML Cross-Site Scripting violations:
1 > Shell
2
3 > **tail -f /var/log/ns.log | grep APPFW_XML_XSS**
Example of a XML Cross-Site Scripting security check violation log message in Native log format
showing <blocked> action
Example of a XML Cross-Site Scripting security check violation log message in CEF log format showing
<not blocked> action
The NetScaler GUI includes a useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• Navigate to the App Firewall > Profiles, select the target profile, and click Security Checks.
Highlight the XML Cross-Site Scripting row and click Logs. When you access the logs directly
from the XML Cross-Site Scripting check of the profile, the GUI filters out the log messages and
displays only the logs pertaining to these security check violations.
• You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In the
Audit Messages section, click the Syslog messages link to display the Syslog Viewer, which dis-
plays all log messages, including other security check violation logs. This is useful for debugging
when multiple security check violations might be triggered during request processing.
• Navigate to App Firewall > policies > Auditing. In the Audit Messages section, click the Syslog
messages link to display the Syslog Viewer, which displays all log messages, including other
security check violation logs.
The XML based Syslog Viewer provides various filter options for selecting only the log messages that
are of interest to you. To select log messages for the XML Cross-Site Scripting check, filter by select-
ing APPFW in the dropdown options for Module. The Event Type list offers a rich set of options to
further refine your selection. For example, if you select the APPFW_XML_XSS check box and click the
Apply button, only log messages pertaining to the XML Cross-Site Scripting security check violations
appear in the Syslog Viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Module, Event
Type, Event ID, Client IP etc. appear below the log message. You can select any of these options to
highlight the corresponding information in the log message.
When the stats action is enabled, the counter for the XML Cross-Site Scripting check is incremented
when the App Firewall takes any action for this security check. The statistics are collected for Rate
and Total count for Traffic, Violations, and Logs. The size of an increment of the log counter can vary
depending on the configured settings. For example, if the block action is enabled, a request for a page
that contains three XML Cross-Site Scripting violations increments the stats counter by one, because
the page is blocked as soon as the first violation is detected. However, if block is disabled, processing
the same request increments the statistics counter for violations and the logs by three, because each
violation generates a separate log message.
To display XML Cross-Site Scripting check statistics by using the command line
3. Use the scroll bar to view the statistics about XML Cross-Site Scripting violations and logs. The
statistics table provides real-time data and is updated every 7 seconds.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML SQL injection check examines the user requests for possible XML SQL Injection attacks. If it
finds injected SQL in XML payloads, it blocks the requests.
A XML SQL attack can inject source code into a web application such that it can be interpreted and
executed as a valid SQL query to perform a database operation with malicious intent. For example,
XML SQL attacks can be launched to gain unauthorized access to the contents of a database or to
manipulate the stored data. XML SQL Injection attacks are not only common, but can also be very
harmful and costly.
Compartmentalizing the privileges of the database users can assist in protecting the database to some
extent. All database users should be given only the required privileges to complete their intended
tasks, so that they cannot execute SQL queries to perform other tasks. For example, a read-only user
should not be allowed to write or manipulate data tables. The App Firewall XML SQL Injection check
inspects all XML requests to provide special defenses against injection of unauthorized SQL code that
might break security. If the App Firewall detects unauthorized SQL code in any XML request of any
user, it can block the request.
The NetScaler App App Firewall inspects the presence of SQL keywords and special characters to iden-
tify the XML SQL Injection attack. A default set of keywords and special characters provides known
keywords and special characters that are commonly used to launch XML SQL attacks. The App Fire-
wall considers three characters, single straight quote (‘), backslash (), and semicolon (;) as special
characters for SQL security check processing. You can add new patterns, and you can edit the default
set to customize the XML SQL check inspection.
The App Firewall offers various action options for implementing XML SQL Injection protection. You
can Block the request, Log a message in the ns.log file with details regarding the observed violations,
and collect Stats to keep track of the number of observed attacks.
In addition to actions, there are several parameters that can be configured for XML SQL injection
processing. You can check for SQL wildcard characters. You can change the XML SQL Injection
type and select one of the 4 options (SQLKeyword, SQLSplChar, SQLSplCharANDKeyword, SQL-
SplCharORKeyword) to indicate how to evaluate the SQL keywords and SQL special characters when
processing the XML payload. The XML SQL Comments Handling parameter gives you an option to
specify the type of comments that need to be inspected or exempted during XML SQL Injection detec-
tion.
You can deploy relaxations to avoid false positives. The App Firewall XML SQL check is performed on
the payload of the incoming requests, and attack strings are identified even if they are spread over
multiple lines. The check looks for SQL Injection strings in the element and the attribute values. You
can apply relaxations to bypass security check inspection under specified conditions. The logs and
statistics can help you identify needed relaxations.
Action options
An action is applied when the XML SQL Injection check detects an SQL Injection attack string in the
request. The following actions are available for configuring an optimized XML SQL Injection protection
for your application:
Block—If you enable block, the block action is triggered only if the input matches the XML SQL in-
jection type specification. For example, if SQLSplCharANDKeyword is configured as the XML SQL
injection type, a request is not blocked if it does not contain any key words, even if SQL special char-
acters are detected in the payload. Such a request is blocked if the XML SQL injection type is set to
either SQLSplChar, or SQLSplCharORKeyword.
Log—If you enable the log feature, the XML SQL Injection check generates log messages indicating
the actions that it takes. If block is disabled, a separate log message is generated for each location
(ELEMENT, ATTRIBUTE) in which the XML SQL violation was detected. However, only one message is
generated when the request is blocked. You can monitor the logs to determine whether responses to
legitimate requests are getting blocked. A large increase in the number of log messages can indicate
attempts to launch an attack.
Stats—If enabled, the stats feature gathers statistics about violations and logs. An unexpected surge in
the stats counter might indicate that your application is under attack. If legitimate requests are getting
blocked, you might have to revisit the configuration to see if you need to configure new relaxation rules
or modify the existing ones.
In addition to the block, log and stats actions, you can configure the following parameters for XML SQL
Injection check:
Check for XML SQL wildcard Characters—Wild card characters can be used to broaden the selections
of a structured query language (SQL-SELECT) statement. These wild card operators can be used in
conjunction with LIKE and NOT LIKE operators to compare a value to similar values. The percent (%),
and underscore (_) characters are frequently used as wild cards. The percent sign is analogous to the
asterisk (*) wildcard character used with MS-DOS and to match zero, one, or multiple characters in a
field. The underscore is similar to the MS-DOS question mark (?) wildcard character. It matches a
single number or character in an expression.
For example, you can use the following query to do a string search to find all customers whose names
contain the D character.
The following example combines the operators to find any salary values that have 0 as the second and
third character.
Different DBMS vendors have extended the wildcard characters by adding extra operators. The
NetScaler App App Firewall can protect against attacks that are launched by injecting these wildcard
characters. The 5 default Wildcard characters are percent (%), underscore (_), caret (ˆ), opening
square bracket ([), and closing square bracket (]). This protection applies to both HTML and XML
profiles.
The default wildcard chars are a list of literals specified in the *Default Signatures:
Wildcard characters in an attack can be PCRE, like [ˆA-F]. The App Firewall also supports PCRE wild-
cards, but the literal wildcard chars above are sufficient to block most attacks.
Note
The XML SQL wildcard character check is different from the XML SQL special character check.
This option must be used with caution to avoid false positives.
Check Request Containing SQL Injection Type—The App Firewall provides 4 options to implement
the desired level of strictness for SQL Injection inspection, based on the individual need of the applica-
tion. The request is checked against the injection type specification for detecting SQL violations. The
4 SQL injection type options are:
• SQL Special Character and Keyword—Both an SQL keyword and an SQL special character must
be present in the inspected location to trigger SQL violation. This least restrictive setting is also
Tip
If you select the SQL Special Character option, the App Firewall skips strings that do not contain
any special characters. Since most SQL servers do not process SQL commands that are not pre-
ceded by a special character, enabling this option can significantly reduce the load on the App
Firewall and speed up processing without placing your protected web sites at risk.
SQL comments handling—By default, the App Firewall parses and checks all comments in XML data
for injected SQL commands. Many SQL servers ignore anything in a comment, even if preceded by
an SQL special character. For faster processing, if your XML SQL server ignores comments, you can
configure the App Firewall to skip comments when examining requests for injected SQL. The XML SQL
comments handling options are:
• ANSI—Skip ANSI-format SQL comments, which are normally used by UNIX-based SQL
databases.
• Nested—Skip nested SQL comments, which are normally used by Microsoft SQL Server.
• ANSI/Nested—Skip comments that adhere to both the ANSI and nested SQL comment stan-
dards. Comments that match only the ANSI standard, or only the nested standard, are still
checked for injected SQL.
• Check all Comments—Check the entire request for injected SQL, without skipping anything.
This is the default setting.
Tip
In most cases, you should not choose the Nested or the ANSI/Nested option unless your back-
end database runs on Microsoft SQL Server. Most other types of SQL server software do not rec-
ognize nested comments. If nested comments appear in a request directed to another type of
SQL server, they might indicate an attempt to breach security on that server.
Relaxation rules
If your application requires you to bypass the XML SQL Injection inspection for a specific ELEMENT or
ATTRIBUTE in the XML payload, you can configure a relaxation rule. The XML SQL Injection inspection
relaxation rules have the following parameters:
• Name: You can use literal strings or regular expressions to configure the name of the ELEMENT
or the ATTRIBUTE. The following expression exempts all ELEMENTS beginning with the string
PurchaseOrder_ followed by a string of numbers that is at least two and no more than ten char-
acters long:
Note: The names are case sensitive. Duplicate entries are not allowed, but you can use capitalization
of the names and differences in location to create similar entries. For example, each of the following
relaxation rules is unique:
• Location: You can specify the Location of the XML SQL Inspection exception in your XML pay-
load. The option ELEMENT is selected by default. You can change it to ATTRIBUTE.
• Comment: This is an optional field. You can use up to a 255 character string to describe the
purpose of this relaxation Rule.
Warning
Regular expressions are powerful. Especially if you are not thoroughly familiar with PCRE-format
regular expressions, double-check any regular expressions you write. Make sure that they define
exactly the name that you want to add as an exception, and nothing else. Careless use of Regular
Expressions can have results that you do not want, such as blocking access to web content that
you did not intend to block or allowing an attack that the XML SQL Injection inspection would
otherwise have blocked.
Using the command line to configure the XML SQL Injection Check
To configure XML SQL Injection actions and other parameters by using the command line:
In the command line interface, you can use either the set appfw profile command or the add appfw
profile command to configure the XML SQL Injection protections. You can enable the block, log, and
stats action(s). Select the type of SQL attack pattern (key words, wildcard characters, special strings)
you want to detect in the payloads. Use the unset appfw profile command to revert the configured
settings back to their defaults. Each of the following commands sets only one parameter, but you can
include multiple parameters in a single command:
Use the bind or unbind command to add or delete relaxation rules, as follows:
Example:
In the GUI, you can configure the XML SQL Injection security check in the pane for the profile associated
with your application.
To configure or modify the XML SQL Injection check by using the GUI
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Security Checks.
The security check table displays the currently configured action settings for all the security checks.
You have 2 options for configuration:
a. If you just want to enable or disable Block, Log, and Stats actions for XML SQL Injection, you can
select or clear check boxes in the table, click OK, and then click Save and Close to close the Security
Check pane.
b. If you want to configure additional options for this security check, double click XML SQL Injection,
or select the row and click Action Settings, to display the following options:
Check for SQL Wildcard Characters—Consider SQL Wildcard characters in the payload to be attack
patterns.
SQL Comments Handling—Type of comments (Check All Comments, ANSI, Nested, or ANSI/Nested) to
check.
After changing any of the above settings, click OK to save the changes and return to the Security
Checks table. You can proceed to configure other security checks if needed. Click OK to save all the
changes you have made in the Security Checks section, and then click Save and Close to close the
Security Check pane.
1. Navigate to App Firewall > Profiles, highlight the target profile, and click Edit.
2. In the Advanced Settings pane, click Relaxation Rules.
3. In the Relaxation Rules table, double-click the XML SQL Injection entry, or select it and click
Edit.
4. In the XML SQL Injection Relaxation Rules dialogue box, perform Add, Edit, Delete, Enable,
or Disable operations for relaxation rules.
For a consolidated view of all the relaxation rules, you can highlight the XML SQL Injection row in
the Relaxation Rules table, and click Visualizer. The visualizer for deployed relaxations offers you the
option to Add a new rule or Edit an existing one. You can also Enable or Disable a group of rules by
selecting a node and clicking the corresponding buttons in the relaxation visualizer.
You can use the GUI to view or customize the SQL patterns.
The default SQL patterns are specified in App Firewall > Signatures > *Default Signatures. If you
do not bind any signature object to your profile, the default SQL patterns specified in the Default Sig-
natures object will be used by the profile for XML SQL Injection security check processing. The rules
and patterns in the Default Signatures object are read-only. You cannot edit or modify them. If you
want to modify or change these patterns, create a user-defined signature object by making a copy of
the Default Signatures object and changing the SQL patterns. Use the user-defined signature object
in the profile that processes the traffic for which you want to use these customized SQL patterns.
a. Navigate to App Firewall > Signatures, select *Default Signatures, and click Edit. Then click
Manage SQL/XSS Patterns.
The Manage SQL/XSS Paths table shows following four rows pertaining to SQL Injection:
b. Select a row and click Manage Elements to display the corresponding SQL patterns (keywords,
special strings, transformation rules or the wildcard characters) used by the App Firewall SQL injection
check.
To customize SQL Patterns: You can edit a user-defined signature object to customize the SQL key
words, special strings, and wildcard characters. You can add new entries or remove the existing ones.
You can modify the transformation rules for the SQL special strings.
a. Navigate to App Firewall > Signatures, highlight the target user-defined signature, and click Edit.
Click Manage SQL/XSS Patterns to display the Manage SQL/XSS paths table.
i. Click Manage Elements, to Add, Edit or Remove the corresponding SQL element.
Warning
You must be very careful when removing or modifying any default SQL element, or deleting the
SQL path to remove the entire row. The signature rules as well as the XML SQL Injection security
check rely on these elements for detecting SQL Injection attacks to protect your applications.
Customizing the SQL patterns can make your application vulnerable to XML SQL attacks if the
required pattern is removed during editing.
Using the log feature with the XML SQL injection check
When the log action is enabled, the XML SQL Injection security check violations are logged in the audit
log as APPFW_XML_SQL violations. The App Firewall supports both Native and CEF log formats. You
can also send the logs to a remote syslog server.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the XML Cross-Site Scripting violations:
1 > Shell
2
3 > tail -f /var/log/ns.log | grep APPFW_XML_SQL
The NetScaler GUI includes a useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• Navigate to App Firewall > Profiles, select the target profile, and click Security Checks. High-
light the XML SQL Injection row and click Logs. When you access the logs directly from the
XML SQL Injection check of the profile, the GUI filters out the log messages and displays only
the logs pertaining to these security check violations.
• You can also access the Syslog Viewer by navigating to System > Auditing. In the Audit Mes-
sages section, click the Syslog messages link to display the Syslog Viewer, which displays all
log messages, including other security check violation logs. This is useful for debugging when
multiple security check violations might be triggered during request processing.
• Navigate to App Firewall > Policies > Auditing. In the Audit Messages section, click the Syslog
messages link to display the Syslog Viewer, which displays all log messages, including other
security check violation logs.
The XML based Syslog Viewer provides various filter options for selecting only the log messages that
are of interest to you. To select log messages for the XML SQL Injection check, filter by selecting
APPFW in the dropdown options for Module. The Event Type list offers a rich set of options to further
refine your selection. For example, if you select the APPFW_XML_SQL check box and click the Apply
button, only log messages pertaining to the XML SQL Injection security check violations appear in
the Syslog Viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Module, Event
Type, Event ID, and Client IP appear below the log message. You can select any of these options to
highlight the corresponding information in the log message.
When the stats action is enabled, the counter for the XML SQL Injection check is incremented when
the App Firewall takes any action for this security check. The statistics are collected for Rate and Total
count for Traffic, Violations, and Logs. The size of an increment of the log counter can vary depend-
ing on the configured settings. For example, if the block action is enabled, a request for a page that
contains three XML SQL Injection violations increments the stats counter by one, because the page
is blocked as soon as the first violation is detected. However, if block is disabled, processing the same
request increments the statistics counter for violations and the logs by three, because each violation
generates a separate log message.
To display XML SQL Injection check statistics by using the command line
At the command prompt, type:
> sh appfw stats
Contributed by:
C
The XML Attachment check examines incoming requests for malicious attachments, and it blocks
those requests that contain attachments that might breach applications security. The purpose of the
XML Attachment check is to prevent an attacker from using an XML attachment to breach security on
your server.
If you use the wizard or the GUI, in the Modify XML Attachment Check dialog box, on the General tab
you can enable or disable the Block, Learn, Log, Statistics, and Learn actions:
If you use the command-line interface, you can enter the following command to configure the XML
Attachment Check:
You must configure the other XML Attachment check settings in the GUI. In the
Modify XML Attachment Check dialog box, on the
Checks tab, you can configure the following settings:
• Maximum Attachment Size. Allow attachments that are no larger than the maximum attach-
ment size you specify. To enable this option, first select the Enabled check box, and then type
the maximum attachment size in bytes in the Size text box.
• Attachment Content Type. Allow attachments of the specified content type. To enable this
option, first select the Enabled check box, and then enter a regular expression that matches the
Content-Type attribute of the attachments that you want to allow.
– You can type the URL expression directly in the text window. If you do so, you can use
the Regex Tokens menu to enter a number of useful regular expressions at the cursor
instead of typing them manually.
– You can click Regex Editor to open the Add Regular Expression dialog box and use it
to construct the URL expression.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The Web Services Interoperability (WS-I) check examines both requests and responses for adherence
to the WS-I standard, and blocks those requests and responses that do not adhere to this standard.
The purpose of the WS-I check is to block requests that might not interact with other XML appropri-
ately. An attacker can use inconsistencies in interoperability to launch an attack on your XML applica-
tion.
If you use the wizard or the GUI, in the Modify Web Services Interoperability Check dialog box, on the
General tab you can enable or disable the Block, Log, Statistics, and Learn actions.
If you use the command-line interface, you can enter the following command to configure the Web
Services Interoperability check:
To configure individual Web Services Interoperability rules, you must use the GUI. On the Checks tab
of the Modify Web Services Interoperability Check dialog box, select a rule and click Enable or Disable
to enable or disable the rule. You can also click Open to open the Web Services Interoperability Detail
message box for that rule. The message box displays read-only information about the rule. You cannot
modify or make other configuration changes to any of these rules.
The WS-I check uses the rules listed in WS-I Basic Profile 1.0. WS-I delivers best practices for develop-
ing interoperable Web Services solutions. WS-I checks are performed only on SOAP Messages.
Rule Description
Rule Description
Rule Description
Rule Description
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML Message Validation check examines requests that contain XML messages to ensure that they
are valid. If a request contains an invalid XML message, the App Firewall blocks the request. The
purpose of the XML Validation check is to prevent an attacker from using specially constructed invalid
XML messages to breach the security of your application.
If you use the wizard or the GUI, in the Modify XML Message Validation Check dialog box, on the General
tab you can enable or disable the Block, Log, and Statistics actions.
If you use the command-line interface, you can enter the following command to configure the XML
Message Validation Check:
You must use the GUI to configure the other XML Validation check settings. In the
Modify XML Message Validation Check dialog box, on the
Checks tab, you can configure the following settings:
• XML Message Validation. Use one of the following options to validate the XML message:
– SOAP Envelope. Validate only the SOAP envelope of XML messages.
– WSDL. Validate XML messages by using an XML SOAP WSDL. If you choose WSDL validation,
in the WSDL Object drop-down list you must choose a WSDL. If you want to validate against
a WSDL that has not already been imported to the App Firewall, you can click the Import
button to open the Manage WSDL Imports dialog box and import your WSDL. See “WSDL
topic” for more information.
* If you want to validate the entire URL, leave the Absolute radio button in the End Point
Check button array selected. If you want to validate only the portion of the URL after
the host, select the Relative radio button.
* If you want the App Firewall to enforce the WSDL strictly, and not allow any additional
XML headers not defined in the WSDL, you must clear the Allow additional headers not
defined in the WSDL check box.
Caution: If you uncheck the
Allow Additional Headers not defined in the WSDL check box, and your WSDL does
not define all XML headers that your protected XML application or Web 2.0 applica-
tion expects or that a client sends, you may block legitimate access to your protected
service.
– XML Schema. Validate XML messages by using an XML schema. If you choose XML schema
validation, in the XML Schema Object drop-down list you must choose an XML schema. If
you want to validate against an XML schema that has not already been imported to the App
Firewall, you can click the Import button to open the Manage XML Schema Imports dialog
box and import your WSDL. See WSDL for more information.
• Response Validation. By default, the App Firewall does not attempt to validate responses. If
you want to validate responses from your protected application or Web 2.0 site, select the Vali-
date Response check box. When you do, the Reuse the XML Schema specified in request valida-
tion check box and the XML Schema Object drop-down list are activated.
– Check the Reuse XML Schema check box to use the schema you specified for request vali-
dation to do response validation as well.
Note: If you check this check box, the
XML Schema Object drop-down list is grayed out.
– If you want to use a different XML schema for response validation, use the XML Schema
Object drop-down list to select or upload that XML schema.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The XML SOAP fault filtering check examines responses from your protected web services and filters
out XML SOAP faults. This prevents leaking of sensitive information to attackers.
If you use the wizard or the GUI, in the Modify XML SOAP Fault Filtering Check dialog box, on the Gen-
eral tab you can enable or disable the Block, Log, and Statistics actions, and the Remove action, which
removes SOAP faults before forwarding the response to the user.
If you use the command-line interface, you can enter the following command to configure the XML
SOAP Fault Filtering Check:
You cannot configure exceptions to the XML SOAP Fault Filtering check. You can only enable or disable
it.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
October 4, 2018
Contributed by:
C
Web servers usually add a Content-Type header that contains a MIME/type definition for the type of
content in each file that the web server serves to users. Web servers serve many different types of
content. For example, standard HTML is assigned the “text/html” MIME type. JPG images are assigned
the “image/jpeg” or “image/jpg” content type. A normal web server can serve dozens or hundreds of
different types of content, all defined in the Content Type header by an assigned MIME/type.
Many App Firewall filtering rules are designed to filter specific types of content. Because filtering rules
that apply to one type of content (such as HTML) are often inappropriate when filtering a different type
of content (such as images), the App Firewall attempts to determine the content type of requests and
responses before it filters them. When a web server or browser does not add a Content-Type header
to a request or response, the App Firewall applies a default content type to the connection and filters
the content accordingly.
The default content type is normally “application/octet-stream”, the most generic MIME/type defini-
tion.This MIME/type is appropriate for any type of content that a web server is likely to serve, but also
does not provide much information to the App Firewall to allow it to choose appropriate filtering. If a
protected web server on your network is configure to add accurate content type headers to the con-
tent it serves, or serves only one type of content, you can create a profile for that web server and assign
a different default content type to it to improve both the speed and the accuracy of filtering.
You can also configure a list of allowed request content types for a specific profile. When this feature is
configured, if the App Firewall filters a request that does not match one of the allowed content types,
it blocks the request. After upgrade from release 10.5 to 11.0, unknown content-types which are not
in the default allowed content-type list do not bind. You can add other content-types which you want
to be allowed to the relaxed rules.
Note
To set the default request content type by using the command line interface
Example
The following example sets the “text/html” content type as the default for the specified profile:
To remove the user-defined default request content type by using the command line
interface
Example
The following example unsets the default content type of “text/html” for the specified profile, allowing
the type to revert to “application/octet-stream”:
Note
Always use last content-type header for processing and remove remaining content-type headers
if any that ensures that the backend server receives a request with only one content-type.
To block requests that can be bypassed, add an App Firewall policy with rule as HTTP.REQ.HEADER
(“content-type”).COUNT.GT(1)’ and profile as appfw_block.
To set the default response content type by using the command line interface
Example
The following example sets the “text/html” content type as the default for the specified profile:
To remove the user-defined default response content type by using the command line
interface
Example
The following example unsets the default content type of “text/html” for the specified profile, allowing
the type to revert to “application/octet-stream”:
To add a content type to the allowed content types list by using the command line
interface
Example
The following example adds the “text/shtml” content type to the allowed content types list for the
specified profile:
To remove a content type from the allowed content types list by using the command
line interface
Example
The following example removes the “text/shtml” content type from the allowed content types list for
the specified profile:
To manage the default and allowed content types by using the GUI
6. To manage the allowed content types, click Manage Allowed Content Types.
7. To add a new content type or modify an existing content type, click Add or Open, and in the Add
Allowed Content Type or Modify Allowed Content Type dialog box, do the following steps.
a) Select/clear the Enabled check box to include the content type in, or exclude it from, the
list of allowed content types.
b) In the Content Type text box, type a regular expression that describes the content type that
you want to add, or change the existing content type regular expression.
Content types are formatted exactly as MIME type descriptions are.
Note: You can include any valid MIME type on the allowed contents type list. Since
many types of document can contain active content and therefore could potentially
contain malicious content, you should exercise caution when adding MIME types to
this list.
c) In the Comments text box, add an optional comment that describes the reason for adding
this particular MIME type to the allowed contents type list.
d) Click Create or OK to save your changes.
8. Click Close to close the Manage Allowed Content Types dialog box and return to the Settings
tab.
9. Click OK to save your changes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Profiles
Contributed by:
C
A profile is a collection of security settings that are used to protect specific types of web content or
specific parts of your web site. In a profile, you determine how the App Firewall applies each of its
filters (or checks) to requests to your web sites, and responses from them. The App Firewall supports
two types of profile: four built-in (default) profiles that do not require further configuration, and user-
defined profiles that do require further configuration.
Built-in profiles
The four App Firewall built-in profiles provide simple protection for applications and web sites that
either do not require protection, or that should not be directly accessed by users at all. These profile
types are:
• APPFW_BYPASS. Skips all App Firewall filtering and sends the unmodified traffic to the pro-
tected application or web site, or to the client.
• APPFW_RESET. Resets the connection, requiring that the client re-establish his or her session
by visiting a designated start page.
• APPFW_DROP. Drops all traffic to or from the protected application or web site, and sends no
response of any kind to the client.
• APPFW_BLOCK. Blocks traffic to or from the protected application or web site.
You use the built-in profiles exactly as you do user-defined profiles, by configuring a policy that selects
the traffic to which you want to apply the profile and then associating the profile with your policy.
Since you do not have to configure a built-in policy, it provides a quick way to allow or block specified
types of traffic or traffic that is sent to specific applications or web sites.
User-defined profiles
User-defined profiles are profiles that are build and configured by users. Unlike the default profiles,
you must configure a user-defined profile before it will be of use filtering traffic to and from your pro-
tected applications.
There are three types of user-defined profile:
• HTML. Protects HTML-based web pages.
• XML. Protects XML-based web services and web sites.
• Web 2.0. Protects Web 2.0 content that combines HTML and XML content, such as ATOM feeds,
blogs, and RSS feeds.
The App Firewall has a number of security checks, all of which can be enabled or disabled, and con-
figured in a number of ways in each profile. Each profile also has a number of settings that control
how it handles different types of content. Finally, rather than manually configuring all of the secu-
rity checks, you can enable and configure the learning feature. This feature observes normal traffic
to your protected web sites for a period of time, and uses those observations to provide you with a
tailored list of recommended exceptions (relaxations) to some security checks, and additional rules
for other security checks.
During initial configuration, whether by using the App Firewall Wizard or manually, you normally cre-
ate one general purpose profile to protect all content on your web sites that is not covered by a more
specific profile. After that, you can create as many specific profiles as you want to protect more spe-
cialized content.
The Profiles pane consists of a table that contains the following elements:
Name. Displays all the App Firewall profiles configured in the appliance.
Bound signature. Displays the signatures object that is bound to the profile in the previous column,
if any.
Policies. Displays the App Firewall policy that invokes the profile in the leftmost column of that row,
if any.
Comments. Displays the comment associated with the profile in the leftmost column of that row, if
any.
Profile Type. Displays the type of profile. Types are Built-In, HTML, XML, and Web 2.0.
Above the table is a row of buttons and a drop-down list that allow you to create, configure, delete,
and view information about your profiles:
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can create an App Firewall profile in one of two ways: by using the command line, and by using the
GUI. Creating a profile by using the command line requires that you specify options on the command
line. The process is similar to that of configuring an existing profile, and with a few exceptions the two
commands take the same parameters.
Creating a profile by using the GUI requires that you specify only two options. You specify basic or
advanced defaults, the default configuration for the various security checks and settings that are part
of a profile, and choose the profile type to match the type of content that the profile is intended to
protect. You can also, optionally, add a comment. After you create the profile, you must then configure
it by selecting it in the data pane, and then clicking Edit.
If you plan to use the learning feature or to enable and configure a large number of advanced protec-
tions, you should choose advanced defaults. In particular, if you plan to configure either of the SQL
injection checks, either of the cross-site scripting checks, any check that provides protection against
Web form attacks, or the cookie consistency check, you should plan to use the learning feature. Unless
you include the proper exceptions for your protected Web sites when configuring these checks, they
can block legitimate traffic. Anticipating all of the necessary exceptions without creating any that are
too broad is difficult. The learning feature makes this task much easier. Otherwise, basic defaults are
quick and should provide the protection that your web applications need.
There are also a few restrictions on the name that you can give to a profile. A profile name cannot
be the same as the name assigned to any other profile or action in any feature on the NetScaler ap-
pliance. Certain action or profile names are assigned to built-in actions or profiles, and can never
be used for user profiles. A complete list of disallowed names can be found in the App Firewall Pro-
fileSupplemental Information. If you attempt to create a profile with a name that has already been
used for an action or a profile, an error message is displayed and the profile is not created.
Example
The following example adds a profile named pr-basic, with basic defaults, and assigns a profile type
of HTML. This is the appropriate initial configuration for a profile to protect an HTML Web site.
1 add appfw profile pr-basic -defaults basic -comment ”Simple profile for
web sites.”
2 set appfw profile pr-basic -type HTML
3 save ns config
Creating an App Firewall profile requires that you specify only a few configuration details.
3. In the Create App Firewall Profile dialog box, type a name for your profile.
The name can begin with a letter, number, or the underscore symbol, and can consist of from
one to 31 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
colon (:), and underscore (_) symbols.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
To configure a user-defined App Firewall profile, first configure the security checks, which are called
deep protections or advanced protections in the App Firewall wizard. Certain checks require configura-
tion if you are to use them at all. Others have default configurations that are safe but limited in scope;
your web sites might need or benefit from a different configuration that takes advantage of additional
features of certain security checks.
After you have configured the security checks, you can also configure a number of other settings that
control the behavior, not of a single security check, but the App Firewall feature. The default configu-
ration is sufficient to protect most web sites, but you should review them to make sure that they are
right for your protected web sites.
For more information about the App Firewall security checks, see “Advanced Protections.”
where:
For descriptions of the parameters to use when configuring specific security checks, see “Ad-
vanced Protections.”
• save ns config
Example
The following example shows how to enable blocking for the HTML SQL Injection and HTML Cross-Site
Scripting checks in a profile named
pr-basic. This command enables blocking for those actions while making no other changes to the
profile.
Add button, which opens yet another dialog box, in which you can specify a relaxation or
rule for the check. (A relaxation is a rule for exempting specified traffic from the check.) If
relaxations have already been configured, you can select one and click Open to modify it.
• To review learned exceptions or rules for a check, select the check, and then click Learned
Violations. In the Manage Learned Rules dialog box, select each learned exception or
rule in turn.
– To edit the exception or rule, and then add it to the list, click Edit & Deploy.
– To accept the exception or rule without modification, click Deploy.
– To remove the exception or rule from the list, click Skip.
• To refresh the list of exceptions or rules to be reviewed, click Refresh.
• open the Learning Visualizer and use it to review learned rules, click Visualizer.
• review the log entries for connections that matched a check, select the check, and then
click Logs. You can use this information to determine which checks are matching attacks,
so that you can enable blocking for those checks. You can also use this information to
determine which checks are matching legitimate traffic, so that you can configure an ap-
propriate exemption to allow those legitimate connections. For more information about
the logs, see “Logs, Statistics, and Reports.”
• To completely disable a check, in the list, clear all of the check boxes to the right of that
check.
4. On the Settings tab, configure the profile settings.
• To associate the profile with the set of signatures that you previously created and config-
ured, under Common Settings, choose that set of signatures in the Signatures drop-down
list.
Note: You may need to use the scroll bar on the right of the dialog box to scroll down
to display the Common Settings section.
• To configure an HTML or XML Error Object, select the object from the appropriate drop-
down list.
Note: You must first upload the error object that you want to use in the Imports pane.
For more information about importing error objects, see Imports
• To configure the default XML Content Type, type the content type string directly into the
Default Request and Default Response text boxes, or click Manage Allowed Content Types
to manage the list of allowed content types. “»More….”
5. If you want to use the learning feature, click Learning, and configure the learning settings for
the profile, as described in “Configuring and Using the Learning Feature”.
6. Click OK to save your changes and return to the Profiles pane.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
If you chose the wrong profile type for an App Firewall profile, or the type of content on the protected
web site has changed, you can change the profile type.
Note: When you change the profile type, you lose all configuration settings and learned relax-
ations or rules for the features that the new profile type does not support. For example, if you
change the profile type from Web 2.0 to XML, you lose any configuration options for Start URL,
Form Field Consistency Check, and the other HTML-specific security checks. The configuration
for any options that is supported by both the old and the new profile types remains unchanged.
To change an App Firewall profile type by using the command line interface
Example
The following example changes the type of a profile named pr-basic, from HTML to HTML XML, which
is equivalent to the Web 2.0 type in the GUI.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can replicate the entire configuration of an App Firewall profile (including all bound objects, such
as HTML error object, XML error object, WSDL or XML schema, signatures, and so on) across multiple
appliances. You can select a target profile and export the configuration to save it in your computer’s lo-
cal file system, or you can transfer the archived configuration to store it on a server. Similarly, you can
browse your computer’s local file system or import the archive from the server to select a previously
exported profile and import it into your NetScaler appliance.
The option to export the entire profile configuration and then import it into another appliance can
be useful in various use cases. For example, you might want to configure an App Firewall profile in
a test bed set-up to test and validate that it is working as expected. Once you are satisfied, you can
export the profile and import the profile configuration to your production NetScaler appliances. This
functionality is also useful for backing up your configuration. You can export the profile before making
changes, so that you can easily roll back the configuration to a known state if necessary.
Note
App Firewall profiles that are exported and archived from one build cannot be restored to a sys-
tem running a different build, because changes introduced in the newer releases can lead to
compatibility issues. If you attempt to restore an archived profile to a different build than the
one from which it was exported, an error message is logged in ns.log.
The export and import profile functionality is available in both the GUI (GUI) and the command line
interface (CLI). The GUI is recommended, because it offers easy to use Action options. With a click of
a button you can Export or Import the entire configuration of a profile.
If you use CLI to export a profile, you must archive the configuration and then export it. To import
a profile, you must import the archive into the NetScaler appliance and then execute the restore
command to extract the configuration. The following set of CLI commands can be used for exporting,
importing and managing the profile configurations.
Exporting a profile from one appliance and importing it to another requires five steps in CLI. The first
3 steps are performed on the source appliance on which profile configuration is originally created,
and the next 2 steps are performed on the target appliance on which the profile configuration is to be
replicated.
Step 3: Use a file transfer utility such as scp to transfer the exported archive file from NetScaler appli-
ance A to the target NetScaler appliance.
Step 4: Execute the import command to import the archived file. You can import the archive from
your NetScaler’s local file system, or you can use HTTP or HTTPS protocol to import the archive from
a server by using the URL.
Step 5: Execute the restore command to restore the profile configuration from the imported archive
First, archive the profile’s configuration, and then export the archive to a target location. At the com-
mand prompt, type the following commands:
where:
Execution of the above command creates 2 instances of the archive file. One in /var/tmp folder and
another in the /var/archive/appfw folder.
where:
• <archiveName> is the name of the archive to export. (The same name as in the previous com-
mand.
• <target> is a file path starting with local: as the prefix, followed by <archiveName>.
Execution of the export command saves the exported archive file on the file system of your NetScaler
appliance in the /var/tmp folder.
Examples:
After the above two commands are executed, the /var/tmp folder contains the archived_test_pr file
and the exported copy, dutA_test_pr, which are identical in size. From the CLI, you can drop into the
shell to navigate to the folder to verify that these files are there.
After exporting the archive file, you can use scp or some other such file transfer utility to transfer a copy
of the archive file from the NetScaler appliance on which they were created to your target NetScaler
appliance.
After you have successfully scp’d the archived file from the source appliance to the target appliance,
you are ready to import the profile’s archive, and then execute the restore command to replicate the
profile’s configuration on the target appliance.
Log onto the target appliance. Drop into the shell and cd to the /var/tmp folder to verify that the size
of the scp’d file on this appliance matches the size of the original archived file on the source appliance.
Exit the shell to return to the command line.
where
• <src> is the location of the archive file after it has been transferred from the source appliance on
which it was created. You can use a local file system and file name. If you have placed the archive
on a server, you can use a URL to import the archived file. If the path or file name contains
spaces, enclose the URL in straight double quotation marks.
• <name> is the name of the archive file to be imported.
• <string> is an optional description of the purpose of the Archive.
Examples:
This example restores the test_pr profile along with all bound objects (such as signatures, html error
page, relaxation rules and so on) on the target NetScaler appliance.
You can use the following CLI commands to access man pages for additional details.
The GUI is easier to use than the CLI. The utility performs both archive and export operations when
you click Export. Similarly it executes both import and restore when you click Import. The GUI can
access the local file system of the computer from which you access the utility. You can export a copy
of the archive and save it on your local computer. You can then import this copy directly in the target
appliance without having to manually transfer the archive file from one appliance to the other(s).
URL: You can choose to import an archive by specifying a URL. When this option is selected, you must
provide an absolute path for the archived file in the URL input box.
File: You can choose to import an archive from the local File. When this option is selected, a Local
File selection field is displayed. You can browse your computer’s local files to select the target archive
file.
Click Create to import the specified archive. Successful completion of the import operation creates
the profile configuration on the target appliance.
Highlights
• You can replicate the entire configuration (including all import objects as well as configured
relaxation rules for the profile) on multiple appliances, without needing to repeat configuration
steps, by using export and import profile functionality.
• The imported objects, such as signatures, WSDL, Schema, error page and so on, are included in
the archived tar file and replicated on the target appliance.
• Customized field types are included in the archived tar file and replicated on the target appli-
ance.
• The policy bindings of the archived profile are not replicated when the configuration is restored.
You must configure the policy and bind it to the profile after importing the profile to the appli-
ance.
• The name of the archive file can be up to 31 character long. As with profile names, an archive
name must begin with an alphanumeric character or underscore and contain only alphanu-
meric and underscore (_), number (#), period (.), space ( ), colon (:), at (@), equals (=) or hyphen
(-) characters.
• Comments associated with the archive should be descriptive enough to convey the purpose of
the archived configuration. The maximum allowed length for a comment is 255 characters.
• The “clear config –force basic” command does not remove the archived profiles.
• The import and export profile functionality is supported in high availability (HA) deployments.
Debugging tips
• Monitor the /var/log/ns.log during command executions to see if there are any ERROR mes-
sages.
• Additional logs (_restore.log, remove.log, import.log) are generated in the /var/tmp/folder.
They can help debug issues during the corresponding operations. When these logs reach one
MB in size, the log messages are purged to shrink the log file to one fourth of the original size.
• If the import command fails when you are using the URL option instead of the local file system,
verify that DNS name server and route settings are accurately configured.
• If you are using the HTTPS protocol to import the archive, the command might fail if the HTTPS
server requires client certificate authentication.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
• Deploy. The unmodified learned rule is placed on the list of rules or relaxations for this security
check.
• Skip. The learned rule is placed on a list of rules or relaxations that are not deployed.
The learned rule is removed when skipped. However, as they are not added to relaxations,
they might get learned again.
Learning is not performed only when relaxations are in place, except for field format rules. When rules
are skipped, they are only removed from learned database. As relaxations are not added, they might
get learned again. When rules are deployed, they are removed from learned database and also re-
laxations are added for the rules. As relaxations are added, they would not be learned again. For
fieldformat protection, learning is performed irrespective of relaxations.
Although you can use the command line interface for basic configuration of the learning feature, the
feature is designed primarily for configuration through the App Firewall wizard or the GUI. You can
perform only limited configuration of the learning feature by using the command line.
The wizard integrates configuration of learning features with configuration of the App Firewall as a
whole, and is therefore the easiest method for configuring this feature on a new NetScaler appliance
or when managing a simple App Firewall configuration. The GUI visualizer and manual interface both
provide direct access to all learned rules for all security checks, and are therefore often preferable
when you must review learned rules for a large number of security checks.
The learning database is limited to 20 MB in size, which is reached after approximately 2,000 learned
rules or relaxations are generated per security check for which learning is enabled. If you do not regu-
larly review and either approve or ignore learned rules and this limit is reached, an error is logged to
the NetScaler log and no more learned rules are generated until you review the existing learned rules
and relaxations.
If learning stops because the database has reached its size limit, you can restart learning either by
reviewing the existing learned rules and relaxations or by resetting the learning data. After learned
rules or relaxations are approved or ignored, they are removed from the database. After you reset the
learning data, all existing learning data is removed from the database and it is reset to its minimum
size. When the database falls below 20 MB in size, learning restarts automatically.
Specify the App Firewall profile to be configured and, for each security check that you want to include
in that profile, specify the minimum threshold or the percent threshold. The minimum threshold is
an integer representing the minimum number of user sessions that the App Firewall must process
before it learns a rule or relaxation (default: 1). The percent threshold is an integer representing the
percentage of user sessions in which the App Firewall must observe a particular pattern (URL, cookie,
field, attachment, or rule violation) before it learns a rule or relaxation (default: 0). Use the following
commands:
Example
The following example enables and configures the learning settings in the profile pr-basic for the HTML
SQL Injection security check. This is an appropriate initial test bed learning configuration, where you
have complete control over the traffic that is sent to the App Firewall.
To reset learning settings to their defaults by using the command line interface
To remove any custom configuration of the learning settings for the specified profile and security
check, and return the learning settings to their defaults, at the command prompt type the following
commands:
• save ns config
To display the learning settings for a profile by using the command line interface
To display unreviewed learned rules or relaxations for a profile by using the command
line interface
To remove specific unreviewed learned rules or relaxations from the learning database
by using the command line interface
Example
The following example removes all unreviewed learned relaxations for the pr-basic profile, HTML SQL
Injection security check, that apply to the LastName form field.
To remove all unreviewed learned data by using the command line interface
Example
The following example exports learned relaxations for the pr-basic profile and the HTML SQL Injection
security check to a comma-separated values (CSV) format file in the /var/learnt_data/ directory under
the filename specified in the -target parameter.
2. In the Profiles pane, select the profile, and then click Edit.
3. Click the Learning tab. At the top of the Learning tab is list of the security checks that are avail-
able in the current profile and that support the learning feature.
4. To configure the learning thresholds, select a security check, and then type the appropriate
values in the following text boxes:
Minimum number threshold. Depending on which security check’s learning settings you are
configuring, the minimum number threshold might refer to the minimum number of total user
sessions that must be observed, the minimum number of requests that must be observed, or the
minimum number of times a specific form field must be observed, before a learned relaxation
is generated. Default: 1
5. To remove all learned data and reset the learning feature, so that it must start its observations
again from the beginning, click Remove All Learned Data.
Note: This button removes only learned recommendations that have not been reviewed and
either approved or skipped. It does not remove learned relaxations that have been accepted
and deployed.
6. To restrict the learning engine to traffic from a specific set of IPs, click Trusted Learning Clients,
and add the IP addresses that you want to use to the list.
a) To add an IP address or IP address range to the Trusted Learning Clients list, click Add.
b) In the Add Trusted Learning Clients dialog box, Trusted Clients IP list box, type the IP
address or an IP address range in CIDR format.
c) In the Comments text area, type a comment that describes this IP address or range.
d) Click Create to add your new IP address or range to the list.
e) To modify an existing IP address or range, click the IP address or range, and then click
Open. Except for the name, the dialog box that appears is identical to the Add Trusted
Learning Clients dialog box.
f) To disable or enable an IP address or range, but leave it on the list, click the IP address or
range, and then click Disable or Enable, as appropriate.
g) To remove an IP address or range completely, click the IP address or range, and then click
Remove.
7. Click Close to return to the Configure App Firewall Profile dialog box.
8. Click Close to close the Configure App Firewall Profile dialog box, and return to the App Fire-
wall Profile screen.
2. Select the security check for which you want to review learned rules or relaxations, and then
click Manage Rules.
3. In the Manage Learned Rules dialog box, choose how you want to review the learned rules.
• To review the actual learned patterns as displayed in the window, do nothing and proceed
to the next step.
• To review the learned data hierarchically as a branching tree, enabling you to choose gen-
eral patterns that match many of the learned patterns, click** Visualizer**.
4. If you have chosen to review actual learned patterns, perform the following steps.
5. Select the first learned relaxation and choose how to handle it.
- To modify and then accept the relaxation, click Edit & Deploy, edit the relaxation regular ex-
pression, and then click OK.
- To accept the relaxation without modifications, click Deploy.
- To remove the relaxation from the list without deploying it, click Skip.
6. If you have chosen to use the Learning Visualizer, perform the following steps.
a) In the branching hierarchical display, select a node that contains a learned pattern, and
choose how to handle it.
The screen area beneath the tree structure, under Regex of Selected Node, displays a gen-
eralized expression that matches all of the patterns in that node. If you want to display
an expression that matches just one of the branches or just one of the leaves, select that
branch or leaf.
• To modify and then accept the learned relaxation, click Edit & Deploy, edit the relax-
ation regular expression, and then click OK.
• To remove the modification from the list without deploying it, click Skip.
8. Click Close to return to the Configure App Firewall Profile dialog box.
9. Click Close to close the Configure App Firewall Profile dialog box, and return to the App Fire-
wall Profile screen.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Following is supplemental information about particular aspects of App Firewall profiles. This infor-
mation explains how to include special characters in a security check rule or relaxation, and how to
use variables when configuring profiles.
Instead of using static values, to configure the App Firewall’s security checks and settings, you can now
use standard NetScaler named variables. By creating variables, you can more easily export and then
import configurations to new NetScaler appliances, or update existing NetScaler appliances from a
single set of configuration files. This simplifies updates when you use a test bed setup to develop a
complex App Firewall configuration that is tuned for your local network and servers and then transfer
that configuration to your production NetScaler appliances.
You create App Firewall configuration variables in the same manner as you do any other NetScaler
named variables, following standard NetScaler conventions. To create a named expression variable
by using the GUI, you use the Add Expression dialog box. To create a named expression variable by
using the NetScaler command line, you use the add expression command followed by the appropriate
parameter.
The following URLs and expressions can be configured with variables instead of static values:
• Start URL (-starturl)
• Deny URL ( -denyurl)
• Form Action URL for Form Field Consistency Check (-fieldconsistency)
• Action URL for XML SQL Injection Check (-xmlSQLInjection)
• Action URL for XML Cross-Site Scripting Check (-xmlXSS)
• Form Action URL for HTML SQL Injection Check (-sqlInjection)
• Form Action URL for Field Format Check (-fieldFormat)
• Form Origin URL and Form Action URL for Cross-Site Request Forgery (CSRF) Check (-csrfTag)
• Form Action URL for HTML Cross-Site Scripting Check (-crossSiteScripting)
• Safe Object (-safeObject)
• Action URL for XML Denial-of-Service (XDoS) check (-XMLDoS)
• URL for Web Services Interoperability check (-XMLWSIURL)
• <URL for XML Validation check (-XMLValidationURL)
• URL for XML Attachment check (-XMLAttachmentURL)
For more information, see “Policies and Expressions.”
To use a variable in the configuration, you enclose the variable name between two at (@) symbols and
then use it exactly as you would the static value that it replaces. For example, if you are configuring
the Deny URL check by using the GUI and want to add the named expression variable myDenyURL to
the configuration, you would type @myDenyURL@ into the Add Deny URL dialog box, Deny URL text
area. To do the same task by using the NetScaler command line, you would type add appfw profile
<name> -denyURLAction @myDenyURL@.
The NetScaler operating system supports direct entry of characters in the printable ASCII character
set only—characters with hexadecimal codes between HEX 20 (ASCII 32) and HEX 7E (ASCII 127). To
include a character with a code outside that range in your App Firewall configuration, you must enter
its UTF-8 hexadecimal code as a PCRE regular expression.
A number of character types require encoding using a PCRE regular expression if you include them in
your App Firewall configuration as a URL, form field name, or Safe Object expression. They include:
• Upper-ASCII characters. Characters with encodings from HEX 7F (ASCII 128) to HEX FF (ASCII
255). Depending on the character map used, these encodings can refer to control codes, ASCII
characters with accents or other modifications, non-Latin alphabet characters, and symbols not
included in the basic ASCII set. These characters can appear in URLs, form field names, and safe
object expressions.
• Double-Byte characters. Characters with encodings that use two 8-byte words. Double-byte
characters are used primarily for representing Chinese, Japanese, and Korean text in electronic
format. These characters can appear in URLs, form field names, and safe object expressions.
• ASCII control characters. Non-printable characters used to send commands to a printer. All
ASCII characters with hexadecimal codes less than HEX 20 (ASCII 32) fall into this category. These
characters should never appear in a URL or form field name, however, and would rarely if ever
appear in a safe object expression.
The NetScaler appliance does not support the entire UTF-8 character set, but only the characters
found in the following eight charsets:
• English US (ISO-8859-1). Although the label reads, “English US,” the App Firewall supports all
characters in the ISO-8859-1 character set, also called the Latin-1 character set. This charac-
ter set fully represents most modern western European languages and represents all but a few
uncommon characters in the rest.
• Chinese Traditional (Big5). The App Firewall supports all characters in the BIG5 character set,
which includes all of the Traditional Chinese characters (ideographs) commonly used in modern
Chinese as spoken and written in Hong Kong, Macau, Taiwan, and by many people of Chinese
ethnic heritage who live outside of mainland China.
• Chinese Simplified (GB2312). The App Firewall supports all characters in the GB2312 charac-
ter set, which includes all of the Simplified Chinese characters (ideographs) commonly used in
modern Chinese as spoken and written in mainland China.
• Japanese (SJIS). The App Firewall supports all characters in the Shift-JIS (SJIS) character set,
which includes most characters (ideographs) commonly used in modern Japanese.
• Japanese (EUC-JP). The App Firewall supports all characters in the EUC-JP character set, which
includes all characters (ideographs) commonly used in modern Japanese.
• Korean (EUC-KR). The App Firewall supports all characters in the EUC-KR character set, which
includes all characters (ideographs) commonly used in modern Korean.
• Turkish (ISO-8859-9). The App Firewall supports all characters in the ISO-8859-9 character set,
which includes all letters used in modern Turkish.
• Unicode (UTF-8). The App Firewall supports certain additional characters in the UTF-8 charac-
ter set, including those used in modern Russian.
When configuring the App Firewall, you enter all non-ASCII characters as PCRE-format regular expres-
sions using the hexadecimal code assigned to that character in the UTF-8 specification. Symbols and
characters within the normal ASCII character set, which are assigned single, two-digit codes in that
character set, are assigned the same codes in the UTF-8 character set. For example, the exclamation
point (!), which is assigned hex code 21 in the ASCII character set, is also hex 21 in the UTF-8 character
set. Symbols and characters from another supported character set have a paired set of hexadecimal
codes assigned to them in the UTF-8 character set. For example, the letter a with an acute accent (á)
is assigned UTF-8 code C3 A1.
The syntax you use to represent these UTF-8 codes in the App Firewall configuration is “xNN” for
ASCII characters; “\xNN\xNN” for non-ASCII characters used in English, Russian, and Turkish; and
“\xNN\xNN\xNN” for characters used in Chinese, Japanese, and Korean. For example, if you want
to represent a ! in an App Firewall regular expression as a UTF-8 character, you would type \x21. If you
want to include an á, you would type \xC3\xA1.
Note:
Normally you do not need to represent ASCII characters in UTF-8 format, but when those charac-
ters might confuse a web browser or an underlying operating system, you can use the character’s
UTF-8 representation to avoid this confusion. For example, if a URL contains a space, you might
want to encode the space as x20 to avoid confusing certain browsers and web server software.
Below are examples of URLs, form field names, and safe object expressions that contain non-ASCII
characters that must be entered as PCRE-format regular expressions to be included in the App Firewall
configuration. Each example shows the actual URL, field name, or expression string first, followed by
a PCRE-format regular expression for it.
1 http://www.utf8-chartable.de/unicode-utf8-table.pl
For the characters in the table on this web site to display correctly, you must have an appropriate
Unicode font installed on your computer. If you do not, the visual display of the character may be
in error. Even if you do not have an appropriate font installed to display a character, however, the
description and the UTF-8 and UTF-16 codes on this set of web pages will be correct.
In addition to matching content that contains a pattern, you can match content that does not con-
tain a pattern by using an inverted PCRE expression. To invert an expression, you simply include an
exclamation point (!) followed by white space as the first character in the expression.
Note: If an expression consists only of an exclamation point with nothing following, the exclama-
tion point is treated as a literal character, not syntax indicating an inverted expression.
The following names are assigned to built-in actions and profiles on the NetScaler appliance, and
cannot be used as names for a user-created App Firewall profile.
• AGRESSIVE
• ALLOW
• BASIC
• CLIENTAUTH
• COMPRESS
• CSSMINIFY
• DEFLATE
• DENY
• DNS-NOP
• DROP
• GZIP
• HTMLMINIFY
• IMGOPTIMIZE
• JSMINIFY
• MODERATE
• NOCLIENTAUTH
• NOCOMPRESS
• NONE
• NOOP
• NOREWRITE
• RESET
• SETASLEARNNSLOG_ACT
• SETNSLOGPARAMS_ACT
• SETSYSLOGPARAMS_ACT
• SETTMSESSPARAMS_ACT
• SETVPNPARAMS_ACT
• SET_PREAUTHPARAMS_ACT
• default_DNS64_action
• dns_default_act_Cachebypass
• dns_default_act_Drop
• nshttp_default_profile
• nshttp_default_strict_validation
• nstcp_default_Mobile_profile
• nstcp_default_XA_XD_profile
• nstcp_default_profile
• nstcp_default_tcp_interactive_stream
• nstcp_default_tcp_lan
• nstcp_default_tcp_lan_thin_stream
• nstcp_default_tcp_lfp
• nstcp_default_tcp_lfp_thin_stream
• nstcp_default_tcp_lnp
• nstcp_default_tcp_lnp_thin_stream
• nstcp_internal_apps
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Policy labels
Contributed by:
C
A policy label consists of a set of policies, other policy labels, and virtual server-specific policy banks.
The App Firewall evaluates each policy bound to the policy label in order of priority. If the policy
matches, it filters the connection as specified in the associated profile. Then it does whatever the
Goto parameter specifies, which can be to terminate policy evaluation, go to the next policy, or go to
the policy with the specified priority. If the Invoke parameter is set, it terminates processing of the
current policy label and begins to process the specified policy label or virtual server.
Example
Example
The following example binds the policy policy1 to the policy label policylbl1 with a priority of 1.
The Create App Firewall Policy Label or the Configure App Firewall Policy Label dialog box
opens. The dialog boxes are nearly identical.
3. If you are creating a new policy label, in the Create App Firewall Policy Label dialog box, type a
name for your new policy label.
The name can begin with a letter, number, or the underscore symbol, and can consist of from
one to 127 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
colon (:), and underscore (_) symbols.
4. Select **Insert Policy **to insert a new row and display a drop-down list with all existing App
Firewall policies.
5. Select the policy you want to bind to the policy label, or select New Policy to create a new policy
and follow the instructions in To create and configure a policy by using the GUI. The policy that
you selected or created is inserted into the list of globally bound App Firewall policies.
• To modify the policy priority, click the field to enable it, and then type a new priority. You
can also select Regenerate Priorities to renumber the priorities evenly.
• To modify the policy expression, double click that field to open the Configure App Firewall
Policy dialog box, where you can edit the policy expression.
• To set the Goto Expression, double click field in the Goto Expression column heading to
display the drop-down list, where you can choose an expression.
• To set the Invoke option, double click field in the Invoke column heading to display the
drop-down list, where you can choose an expression
7. Repeat steps 5 through 7 to bind any additional App Firewall policies you want to the policy
label.
8. Click Create or OK, and then click Close. A message appears in the status bar, stating that you
have successfully created or modified the policy label.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Policies
Contributed by:
C
The App Firewall uses two types of policies: firewall policies and auditing policies. Firewall policies
control which traffic is sent to the App Firewall. Auditing policies control the log server to which App
Firewall logs are sent.
Firewall policies can be complex because the policy rule can consist of multiple expressions in the
NetScaler expressions language, which is a full-fledged object oriented programming language capa-
ble of defining with extreme precision exactly which connections to filter. Because firewall policies
operate within the context of the App Firewall, they must meet certain criteria that are connected to
how the App Firewall functions and what traffic is appropriately filtered by it. As long as you keep
these criteria in mind, however, firewall policies are similar to policies for other NetScaler features.
The instructions here do not attempt to cover all aspects of writing firewall policies, but only provide
an introduction to policies and cover those criteria that are unique to the App Firewall.
Auditing policies are simple because the policy rule is always ns_true. You need only specify the log
server that you want to send logs to, the logging levels that you want to use, and a few other criteria
that are explained in detail.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
A firewall policy is a rule associated with a profile. The rule is an expression or group of expressions
that define the types of request/response pairs that the App Firewall is to filter by applying the profile.
Firewall policy expressions are written in the NetScaler expressions language, an object-oriented pro-
gramming language with special features to support specific NetScaler functions. The profile is the
set of actions that the App Firewall is to use to filter request/response pairs that match the rule.
Firewall policies enable you to assign different filtering rules to different types of web content. Not
all web content is alike. A simple web site that uses no complex scripting and accesses and handles
no private data might require only the level of protection provided by a profile created with basic
defaults. Web content that contains JavaScript-enhanced web forms or accesses an SQL database
probably requires more tailored protection. You can create a different profile to filter that content
and create a separate firewall policy that can determine which requests are attempting to access that
content. You then associate the policy expression with a profile you created and globally bind the
policy to put it into effect.
The App Firewall processes only HTTP connections, and therefore uses a subset of the overall
NetScaler expressions language. The information here is limited to topics and examples that are
likely to be useful when configuring the App Firewall. Following are links to additional information
and procedures for firewall policies:
• For procedures that explain how to create and configure a policy, see Creating and Configuring
App Firewall Policies.
• For a procedure that explains in detail how to create a policy rule (expression), see To create or
configure an App Firewall rule (expression).
• For a procedure that explains how to use the Add Expression dialog box to create a policy rule,
see To add a firewall rule (expression) by using the Add Expression dialog box.
• For a procedure that explains how to view the current bindings for a policy, see Viewing a Fire-
wall Policy’s Bindings.
• For procedures that explain how to bind an App Firewall policy, see Binding App Firewall Poli-
cies.
• For detailed information about the NetScaler expressions language, see Policies and Expres-
sions.
Note
App Firewall evaluates the policies based on the configured priority and goto expressions. At
the end of the policy evaluation, the last policy that evaluates to true is used and the security
configuration of the corresponding profile is invoked for processing the request.
In this scenario, if the target string “XYZ” is detected in the URL of the processed request, Policy_2
match is triggered as it has a higher priority even though Policy_1 is also a match. However, as
per the GoTo expression configuration of Policy_2, the policy evaluation continues and the next
policy Policy_1 is also processed. At the end of the policy evaluation, Policy_1 evaluates as true
and the basic security checks configured in Profile_1 are invoked.
priority consideration and as per the GoTo expression configuration, the policy evaluation ends
at this point. Policy_2 evaluates as true and the advanced security checks configured in Profile_2
are invoked.
NEXT
END
Policy evaluation is completed in one pass. Once the policy evaluation is completed for the re-
quest and the corresponding profile actions are invoked, the request does not go through an-
other round of policy evaluation.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
A firewall policy consists of two elements: a rule, and an associated profile. The rule selects the HTTP
traffic that matches the criteria that you set, and sends that traffic to the App Firewall for filtering. The
profile contains the filtering criteria that the App Firewall uses.
The policy rule consists of one or more expressions in the NetScaler expressions language. The
NetScaler expressions syntax is a powerful, object-oriented programming language that enables you
to precisely designate the traffic that you want to process with a specific profile. For users who are
not completely familiar with the NetScaler expressions language syntax, or who prefer to configure
their NetScaler appliance by using a web-based interface, the GUI provides two tools: the Prefix
menu and the Add Expression dialog box. Both help you to write expressions that select exactly the
traffic that you want to process. Experienced users who are thoroughly familiar with the syntax may
prefer to use the NetScaler command line to configure their NetScaler appliances.
Note: In addition to the default expressions syntax, for backward compatibility the NetScaler op-
erating system supports the NetScaler classic expressions syntax on NetScaler Classic and nCore
appliances and virtual appliances. Classic expressions are not supported on NetScaler Cluster
appliances and virtual appliances. Current NetScaler users who want to migrate existing config-
urations to the NetScaler Cluster must migrate any policies that contain classic expressions to
the default expressions syntax.
For detailed information about the NetScaler expressions languages, see “Policies and Expressions.”
You can create a firewall policy by using the GUI or the NetScaler command line.
Example
The following example adds a policy named pl-blog, with a rule that intercepts all traffic to or from
the host blog.example.com, and associates that policy with the profile pr-blog. This is an appropriate
policy to protect a blog hosted on a specific hostname.
The policy rule, also called the expression, defines the web traffic that the App Firewall filters by using
the profile associated with the policy. Like other NetScaler policy rules (or expressions), App Firewall
rules use NetScaler expressions syntax. This syntax is powerful, flexible, and extensible. It is too com-
plex to describe completely in this set of instructions. You can use the following procedure to create
a simple firewall policy rule, or you can read it as an overview of the policy creation process.
1. If you have not already done so, navigate to the appropriate location in the App Firewall wizard
or the NetScaler GUI to create your policy rule:
• If you are configuring a policy in the App Firewall wizard, in the navigation pane, click
App Firewall, then in the details pane click App Firewall Wizard, and then navigate to the
Specify Rule screen.
• If you are configuring a policy manually, in the navigation pane, expand App Firewall,
then Policies, and then Firewall. In the details pane, to create a new policy, click Add. To
modify an existing policy, select the policy, and then click Open.
2. On the Specify Rule screen, the Create App Firewall Profile dialog box, or the Configure App
Firewall Profile dialog box, click Prefix, and then choose the prefix for your expression from
the drop-down list. Your choices are:
• HTTP. The HTTP protocol. Choose this if you want to examine some aspect of the request
that pertains to the HTTP protocol.
• SYS. The protected Web site(s). Choose this if you want to examine some aspect of the
request that pertains to the recipient of the request.
• CLIENT. The computer that sent the request. Choose this if you want to examine some
aspect of the sender of the request.
• SERVER. The computer to which the request was sent. Choose this if you want to examine
some aspect of the recipient of the request.
After you choose a prefix, the App Firewall displays a two-part prompt window that displays the
possible next choices at the top, and a brief explanation of what the selected choice means at
the bottom.
If you chose HTTP as your prefix, your only choice is REQ, which specifies the Request/Response
pair. (The App Firewall operates on the request and response as a unit instead of on each sepa-
rately.) If you chose another prefix, your choices are more varied. For help on a specific choice,
click that choice once to display information about it in the lower prompt window.
When you have decided which term you want, double-click it to insert it into the Expression
window.
4. Type a period after the term you just chose. You are then prompted to choose your next term, as
described in the previous step. When a term requires that you type a value, fill in the appropriate
value. For example, if you choose HTTP.REQ.HEADER(“”), type the header name between the
quotation marks.
5. Continue choosing terms from the prompts and filling in any values that are needed, until your
expression is finished.
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
For shopping.example.com, substitute the name of the web host that you want to match.
• Specific web folder or directory. To match traffic from a particular folder or directory on
a Web host:
1 HTTP.REQ.URL.STARTSWITH(”https//www.example.com/folder”)
For www.example.com, substitute the name of the web host. For folder, substitute the
folder or path to the content that you want to match. For example, if your shopping cart is
in a folder called /solutions/orders, you substitute that string for folder.
1 HTTP.REQ.URL.ENDSWITH(”.gif”)
• Specific type of content: scripts. To match all CGI scripts located in the CGI-BIN directory:
1 HTTP.REQ.URL.STARTSWITH(”https//www.example.com/CGI-BIN”)
1 HTTP.REQ.URL.ENDSWITH(”.js”)
For more information about creating policy expressions, see “Policies and Expressions.”
Note: If you use the command line to configure a policy, remember to escape any double
quotation marks within NetScaler expressions. For example, the following expression is
correct if entered in the GUI:
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
If entered at the command line, however, you must type this instead:
1 HTTP.REQ.HEADER(”Host”).EQ(”shopping.example.com”)
To add a firewall rule (expression) by using the Add Expression dialog box
The Add Expression dialog box (also referred to as the Expression Editor) helps users who are not fa-
miliar with the NetScaler expressions language to construct a policy that matches the traffic that they
want to filter.
1. If you have not already done so, navigate to the appropriate location in the App Firewall wizard
or the NetScaler GUI:
• If you are configuring a policy in the App Firewall wizard, in the navigation pane, click
App Firewall, then in the details pane click App Firewall Wizard, and then navigate to the
Specify Rule screen.
• If you are configuring a policy manually, in the navigation pane, expand App Firewall,
then Policies, and then Firewall. In the details pane, to create a new policy, click Add. To
modify an existing policy, select the policy, and then click Open.
2. On the Specify Rule screen, in the Create App Firewall Profile dialog box, or in the Configure
App Firewall Profile dialog box, click Add.
3. In the Add Expression dialog box, in the Construct Expression area, in the first list box, choose
one of the following prefixes:
• HTTP. The HTTP protocol. Choose this if you want to examine some aspect of the request
that pertains to the HTTP protocol. The default choice.
• SYS. The protected Web site(s). Choose this if you want to examine some aspect of the
request that pertains to the recipient of the request.
• CLIENT. The computer that sent the request. Choose this if you want to examine some
aspect of the sender of the request.
• SERVER. The computer to which the request was sent. Choose this if you want to examine
some aspect of the recipient of the request.
4. In the second list box, choose your next term. The available terms differ depending on the choice
you made in the previous step, because the dialog box automatically adjusts the list to contain
only those terms that are valid for the context. For example, if you selected HTTP in the previ-
ous list box, the only choice is REQ, for requests. Because the App Firewall treats requests and
associated responses as a single unit and filters both, you do not need to specific responses
separately. After you choose your second term, a third list box appears to the right of the sec-
ond. The Help window displays a description of the second term, and the Preview Expression
window displays your expression.
5. In the third list box, choose the next term. A new list box appears to the right, and the Help
window changes to display a description of the new term. The Preview Expression window
updates to display the expression as you have specified it to that point.
6. Continue choosing terms, and when prompted filling in arguments, until your expression is com-
plete. If you make a mistake or want to change your expression after you have already selected
a term, you can simply choose another term. The expression is modified, and any arguments or
additional terms that you added after the term that you modified are cleared.
7. When you have finished constructing your expression, click OK to close the Add Expression
dialog box. Your expression is inserted into the Expression text area.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
After you have configured your App Firewall policies, you bind them to Global or a bind point to put
them into effect. After binding, any request or response that matches an App Firewall policy is trans-
formed by the profile associated with that policy.
When you bind a policy, you assign a priority to it. The priority determines the order in which the
policies you define are evaluated. You can set the priority to any positive integer. In the NetScaler OS,
policy priorities work in reverse order - the higher the number, the lower the priority.
Because the App Firewall feature implements only the first policy that a request matches, not any
additional policies that it might also match, policy priority is important for achieving the results that
you intend. If you give your first policy a low priority (such as 1000), you configure the App Firewall
to perform it only if other policies with a higher priority do not match a request. If you give your first
policy a high priority (such as 1), you configure the App Firewall to perform it first, and skip any other
policies that might also match. You can leave yourself plenty of room to add other policies in any
order, without having to reassign priorities, by setting priorities with intervals of 50 or 100 between
each policy when you bind your policies.
For more information about binding policies on the NetScaler appliance, see “Policies and Expres-
sions.”
Example
The following example binds the policy named pl-blog and assigns it a priority of 10.
• Default Global. Policies that are bound to this bind point process all traffic from all inter-
faces on the NetScaler appliance.
• Policy Label. Policies that are bound to a policy label process traffic that the policy label
routes to them. The policy label controls the order in which policies are applied to this
traffic.
• None. Do not bind the policy to any bind point.
3. Click Continue. A list of existing App Firewall policies appears.
4. Select the policy you want to bind by clicking it.
5. Make any additional adjustments to the binding.
• To modify the policy priority, click the field to enable it, and then type a new priority. You
can also select Regenerate Priorities to renumber the priorities evenly.
• To modify the policy expression, double click that field to open the Configure App Fire-
wall Policy dialog box, where you can edit the policy expression.
• To set the Goto Expression, double click field in the Goto Expression column heading to
display the drop-down list, where you can choose an expression.
• To set the Invoke option, double click field in the Invoke column heading to display the
drop-down list, where you can choose an expression
6. Repeat steps 3 through 6 to add any additional App Firewall policies you want to globally bind.
7. Click OK. A message appears in the status bar, stating that the policy has been successfully
bound.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
You can quickly check to determine what bindings are in place for any firewall policy by viewing the
bindings in the GUI.
1. Navigate to Security > Application Firewall > Policies > Firewall Policies
2. In the details pane, select the policy that you want to check, and then click Show Bindings. The
Binding Details for Policy: Policy message box is displayed, with a list of bindings for the selected
policy.
3. Click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Web application security and modern web sites are complex. In a number of scenarios, a NetScaler
policy might cause the App Firewall to behave differently in certain situations than a user who is fa-
miliar with policies would normally expect. Following are a number of cases where the App Firewall
may behave in an unexpected fashion.
• Request with a missing HTTP Host header and an absolute URL. When a user sends a request,
in the majority of cases the request URL is relative. That is, it takes as its starting point the Ref-
erer URL, the URL where the user’s browser is located when it sends the request. If a request
is sent without a Host header, and with a relative URL, the request is normally blocked both
because it violates the HTTP specification and because a request that fails to specify the host
could under some circumstances constitute an attack. If a request is sent with an absolute URL,
however, even if the Host header is missing, the request bypasses the App Firewall and is for-
warded to the web server. Although such a request violates the HTTP specification, it poses no
possible threat because an absolute URL contains the host.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Auditing policies
Contributed by:
C
Auditing policies determine the messages that are generated and logged during an App Firewall ses-
sion. These messages are logged in SYSLOG format to the local NSLOG server or to an external logging
server. Different types of messages are logged on the basis of the level of logging selected.
To create an auditing policy, you must first create either an NSLOG server or a SYSLOG server. After
specifying the server, you create the policy and specify the type of log and the server to which logs are
sent.
You can create two different types of auditing server: an NSLOG server or a SYSLOG server. The com-
mand names are different, but the parameters for the commands are the same.
To create an auditing server, at the command prompt, type the following commands:
Example
The following example creates a syslog server named syslog1 at IP 10.124.67.91, with loglevels of emer-
gency, critical, and warning, log facility set to LOCAL1, that logs all TCP connections:
• To modify an auditing server, type the set audit <type> command, the name of the auditing
server, and the parameters to be changed, with their new values.
• To remove an auditing server, type the rm audit <type> command and the name of the auditing
server.
Example
The following example modifies the syslog server named syslog1 to add errors and alerts to the log
level:
You can create an NSLOG policy or a SYSLOG policy. The type of policy must match the type of server.
The command names for the two types of policy are different, but the parameters for the commands
are the same.
Example
The following example creates a policy named syslogP1 that logs App Firewall traffic to a syslog server
named syslog1.
Example
The following example modifies the policy named syslogP1 to log App Firewall traffic to a syslog server
named syslog2.
3. In the Create Auditing Policy or Configure Auditing Policy dialog box, set the following param-
eters:
• Name
• Auditing Type
• Server
4. Click Create or OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Imports
Contributed by:
C
Several App Firewall features make use of external files that you upload to the App Firewall when con-
figuring it. Using the GUI, you manage those files in the Imports pane, which has four tabs correspond-
ing to the four types of files you can import: HTML error objects, XML error objects, XML schemas, and
Web Services Description Language (WSDL) files. Using the NetScaler command line, you can import
these types of files, but you cannot export them.
When a user’s connection to an HTML or Web 2.0 page is blocked, or a user asks for a non-existent
HTML or Web 2.0 page, the App Firewall sends an HTML-based error response to the user’s browser.
When configuring which error response the App Firewall should use, you have two choices:
• You can configure a redirect URL, which can be hosted on any Web server to which users also
have access. For example, if you have a custom error page on your Web server, 404.html, you
can configure the App Firewall to redirect users to that page when a connection is blocked.
• You can configure an HTML error object, which is an HTML-based Web page that is hosted on
the App Firewall itself. If you choose this option, you must upload the HTML error object to the
App Firewall. You do that in the Imports pane, on the HTML Error Object tab.
The error object must be a standard HTML file that contains no non-HTML syntax except for App Fire-
wall error object customization variables. It cannot contain any CGI scripts, server-parsed code, or
PHP code. The customization variables enable you to embed troubleshooting information in the er-
ror object that the user receives when a request is blocked. While most requests that the App Firewall
blocks are illegitimate, even a properly configured App Firewall can occasionally block legitimate re-
quests, especially when you first deploy it or after you make significant changes to your protected Web
sites. By embedding information in the error page, you provide the user with the information that he
or she needs to give to the technical support person so that any issues can be fixed.
The App Firewall error page customization variables are:
• ${NS_TRANSACTION_ID}. The transaction ID that the App Firewall assigned to this transaction.
• ${NS_APPFW_SESSION_ID}. The App Firewall session ID.
• ${NS_APPFW_VIOLATION_CATEGORY}. The specific App Firewall security check or rule that was
violated.
• ${NS_APPFW_VIOLATION_LOG}. The detailed error message associated with the violation.
• ${COOKIE The contents of the specified cookie. For <CookieName>, substitute the name of
the specific cookie that you want to display on the error page. If you have multiple cookies
whose contents you want to display for troubleshooting, you can use multiple instances of this
customization variable, each with the appropriate cookie name.
Note: If you have blocking enabled for the Cookie Consistency Check, any blocked cookies are
not displayed on the error page because the App Firewall blocks them.
To use these variables, you embed them in the HTML or XML of the error page object as if they were
an ordinary text string. When the error object is displayed to the user, for each customization variable
the App Firewall substitutes the information to which the variable refers. An example HTML error page
that uses custom variables is shown below.
6 NS_APPFW_VIOLATION_CATEGORY }
7 </td></tr> <tr><th align=”right” width=30%>Violation Log:</th><td
align=”left” valign=”top” width=70%>${
8 NS_APPFW_VIOLATION_LOG }
9 </td></tr> <tr><th align=”right” width=30%>Cookie Name:</th><td align
=”left” valign=”top” width=70%>${
10 COOKIE(”[cookieName]”) }
11 </td></tr> </table> <body> <html>
To use this error page, copy it into a text or HTML editor. Substitute the appropriate local informa-
tion for the following variables, which are enclosed in square brackets to distinguish them from the
NetScaler variables. (Leave those unchanged.):
When a user’s connection to an XML page is blocked, or a user asks for a nonexistent XML application,
the App Firewall sends an XML-based error response to the user’s browser. You configure the error
response by uploading an XML-based error page to the App Firewall in the Imports Pane, on the XML
Error Object tab. All XML error responses are hosted on the App Firewall. You cannot configure a
redirect URL for XML applications.
Note:
You can use the same customization variables in an XML error object as in an HTML error object.
XML Schema
When the App Firewall performs a validation check on a user’s request for an XML or Web 2.0 appli-
cation, it can validate the request against the XML schema or design type document (DTD) for that
application and reject any request that does not follow the schema or DTD. Both an XML schema and
a DTD are standard XML configuration files that describe the structure of a specific type of XML docu-
ment.
WSDL
When the App Firewall performs a validation check on a user’s request for an XML SOAP-based web
service, it can validate the request against the web services type definition (WSDL) file for that web
service. A WSDL file is a standard XML SOAP configuration file that defines the elements of a specific
XML SOAP web service.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Note: You cannot delete or export an imported file by using the command line.
Example
The following example imports an HTML error object from a file named error.html and assigns it the
name HTMLError.
Before you attempt to import an XML schema, DTD, or WSDL file, or an HTML or XML error object from
a network location, verify that the NetScaler can connect to the Internet or LAN computer where the
file is located. Otherwise, you cannot import the file or object.
1. Navigate to Security > Application Firewall > Imports.
2. Navigate to Application Firewall > Imports.
3. In the Application Firewall Imports pane, select the tab for the type of file you want to import,
and then click Add.
The tabs are HTML Error Page, XML Error Page, XML Schema or WSDL. The upload process is
identical on all four tabs from the user point of view.
4. Fill in the dialog fields.
• Name—A name for the imported object.
• Import From—Choose the location of the HTML file, XML file, XML schema or WSDL that
you want to import in the drop-down list:
– URL: A web URL on a website accessible to the appliance.
– File: A file on a local or networked hard disk or other storage device.
– Text: Type or paste the text of the custom response directly into a text field in the GUI.
The third text box changes to the appropriate value. The three possible values are provided
below.
• URL—Type the URL into the text box.
• File—Type the path and filename to the HTML file directly, or click Browse and browse to
the HTML file.
• Text—The third field is removed, leaving a blank space.
5. Click Continue. The File Contents dialog is displayed. If you chose URL or File, the File Contents
text box contains the HTML file that you specified. If you chose Text, the File Contents text box
is empty.
6. If you chose Text, type or copy and paste the custom response HTML that you want to import.
7. Click Done.
8. To delete an object, select the object, and then click Delete.
Before you attempt to export an XML schema, DTD, or WSDL file, or an HTML or XML error object, verify
that the App Firewall appliance can access the computer where the file is to be saved. Otherwise, you
2. In the App Firewall Imports pane, select the tab for the type of file you want to export.
The export process is identical on all four tabs from the user point of view.
6. In the Browse dialog box, navigate to the local file system and directory where you want to save
the exported file, and click Save.
You edit the text of HTML and XML error objects in the GUI without exporting and then reimporting
them.
1. Navigate to Security > Application Firewall > Imports, and then select the tab for the type of
file that you want to modify.
2. Navigate to Application Firewall > Imports, and then select the tab for the type of file that you
want to modify.
3. Select the file that you want to modify, and then click Edit.
The text of the HTML or XML error object is displayed in a browser text area. You can modify the
text by using the standard browser-based editing tools and methods for your browser.
Note: The edit window is designed to allow you to make minor changes to your HTML or XML
error object. To make extensive changes, you may prefer to export the error object to your local
computer and use standard HTML or XML web page editing tools.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Global configuration
Contributed by:
C
The App Firewall global configuration affects all profiles and policies. The Global Configuration items
are:
• Engine Settings. A collection of global settings—session cookie name, session time-out, maxi-
mum session lifetime, logging header name, undefined profile, default profile, and import size
limit—that pertain to all connections that the App Firewall processes, rather than to a specific
subset of connections.
• Confidential Fields. A set of form fields in web forms that contain sensitive information that
should not be logged to the App Firewall logs. Form fields such as password fields on a logon
page or credit card information on a shopping cart checkout form are normally designated as
confidential fields.
• Field Types. The list of web form field types used by the Field Formats security check. Each of
these field types is defined by a PCRE-compliant regular expression that defines the type of data
and the minimum/maximum length of data that should be allowed in that type of form field.
• XML Content Types. The list of content types recognized as XML and subjected to XML-specific
security checks. Each of these content types is defined by a PCRE-compliant regular expression
that defines the exact MIME type assigned to that content.
• JSON Content Types. The list of content types recognized as JSON and subjected to JSON-
specific security checks. Each of these content types is defined by a PCRE-compliant regular
expression that defines the exact MIME type assigned to that content.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Engine settings
Contributed by:
C
The engine settings affect all requests and responses that the App Firewall processes. They include
the following items:
• Cookie name—The name of the cookie that stores the NetScaler session ID.
• Session timeout—The maximum inactive period allowed. If a user session shows no activity for
this length of time, the session is terminated and the user is required to reestablish it by visiting
The App Firewall session limit is configurable using the following command:
Example
• Undefined Profile
• Default Profile
• Import Size Limit
• Learn Messages Rate Limit
• Entity Decoding
• Log Malformed Request
• Use Secret Key
• Learn Message Rate Limit
• Signatures Auto Update
4. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Confidential fields
Important:
In the following two cases, the Confidential Field designation does not function as expected:
• If a Web form has either a confidential field or an action URL longer than 256 characters, the
field or action URL is truncated in the NetScaler logs.
• With certain SSL transactions, the logs are truncated if either the confidential field or the action
URL is longer than 127 characters.
In either of these cases, the App Firewall masks a fifteen-character string with the letter “x,” instead
of the normal eight character string. To ensure that any confidential information is removed, the user
must use form field name and action URL expressions that match the first 256, or (in cases where SSL
is used) the first 127 characters.
To configure your App Firewall to treat a web-form field on a protected web site as confidential, you
add that field to the Confidential Fields list. You can enter the field name as a string, or you can enter
a PCRE-compatible regular expression specifying one or more fields. You can enable the confidential-
field designation when you add the field, or you can modify the designation later.
Example
The following example adds all web form fields whose names begin withPassword to the confidential
fields list.
• ‘save ns config’
Example
The following example modifies the confidential field designation to add a comment.
Examples
Following are some regular expressions that define form field names that you might find useful:
• ˆpasswd_ (Applies confidential-field status to all field names that begin with the “passwd_”
string.)
ˆ(([0-9a-zA-Z._-]* \x[0-9A-Fa-f][0-9A-Fa-f])+-
)?passwd_ (Applies
confidential-field status to all
field names that begin with
the string passwd_, or that
contain the string -passwd_
after another string that
might contain non-ASCII
special characters.)
Following are some regular expressions that define specific URL types that you might find useful. Sub-
stitute your own web host(s) and domain(s) for those in the examples.
• If the web form appears on multiple web pages on the web host www.example.com, but all of
those web pages are named logon.pl?, you could use the following regular expression:
1 https?://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_.-]*/)*logon
[.]pl\?
• If the web form appears on multiple web pages on the web host www.example-español.com,
which contains the n-tilde (ñ) special character, you could use the following regular expression,
which represents the n-tilde special character as an encoded UTF-8 string containing C3 B1, the
hexadecimal code assigned to that character in the UTF-8 charset:
1 https?://www[.]example-espa\xC3\xB1ol[.]com/([0-9A-Za-z][0-9A-Za-
z_.-]*/)* logon[.]pl\?
• If the web form containing query.pl appears on multiple web pages on different hosts within the
example.com domain, you could use the following regular expression:
1 https?://([0-9A-Za-z][0-9A-Za-z_-.]*[.])*example[.]com/([0-9A-Za-
z][0-9A-Za-z_-.]*/)*logon[.]pl\?
• If the web form containing query.pl appears on multiple web pages on different hosts in different
domains, you could use the following regular expression:
1 https?://([0-9A-Za-z][0-9A-Za-z_-.]*[.])*[0-9A-Za-z][0-9A-Za-z_
-.]+[.][a-z]{
2 2,6 }
3 /([0-9A-Za-z][0-9A-Za-z_-.]*/)*logon[.]pl\?
• If the web form appears on multiple web pages on the web host www.example.com, but all of
those web pages are named logon.pl?, you could use the following regular expression:
1 https?://www[.]example[.]com/([0-9A-Za-z][0-9A-Za-z_-.]*/)*logon
[.]pl\?
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Field types
Contributed by:
C
A field type is a PCRE-format regular expression that defines a particular data format and minimum/-
maximum data lengths for a form field in a web form. Field types are used in the Field Formats check.
The App Firewall comes with several default field types, which are:
• integer. A string of any length consisting of numbers only, without a decimal point, and with an
optional preceding minus sign (-).
• nohtml. A string of any length consisting of characters, including punctuation and spaces, that
does not contain HTML symbols or queries.
Assigning the any field type as the default field type, or to a field, allows active scripts, SQL
commands, and other possibly dangerous content to be sent to your protected web sites
and applications in that form field. You should use the any type sparingly, if you use it at
all.
You can also add your own field types to the Field Types list. For example, you might want to add a
field type for a social security number, postal code, or phone number in your country. You might also
want to add a field type for a customer identification number or store credit card number.
To add a field type to the Field Types list, you enter the field name as a literal string or PCRE-format
regular expression.
Example
The following example adds a field type named SSN that matches US Social Security numbers to the
Field Types list, and sets its priority to 1.
• save ns config
Example
• Comment
5. Click Create or OK.
6. To remove a field type from the Field Types list, select the field type listing you want to remove,
then click Remove to remove it, and then click OK to confirm your choice.
7. When you have finished adding, modifying, and removing field types, click Close.
Examples
Following are some regular expressions for field types that you might find useful:
^[1-9][0-9]{ 2,2 } -[0-9 } { 2,2 } -[0-9]{ 4,4 } $ U.S. Social Security
numbers
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
To add an XML content type pattern by using the command line interface
Example
The following example adds the pattern .*/xml to the XML Content Types list and designates it as a
regular expression.
To remove an XML content type pattern by using the command line interface
7. When you have finished adding and removing XML content type patterns, click Close.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
By default, the App Firewall treats files with the content type “application/json” as JSON files.The de-
fault setting enables the App Firewall to recognize JSON content in requests and responses, and to
handle that content appropriately.
You can configure the App Firewall to examine web content for additional strings or patterns that indi-
cate that those files are JSON files. This can ensure that the App Firewall recognizes all JSON content
on your site, even if certain JSON content does not follow normal JSON naming conventions, ensuring
that JSON content is subjected to JSON security checks.
To configure the JSON content types, you add the appropriate patterns to the JSON Content Types
list. You can enter a content type as a string, or you can enter a PCRE-compatible regular expression
specifying one or more strings. You can also modify the existing JSON content types patterns.
To add a JSON content type pattern by using the command line interface
Example
The following example adds the pattern .*/json to the JSON Content Types list and designates it as a
regular expression.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The information maintained in the logs and statistics, and displayed in the reports, provides important
guidance for configuring and maintaining the App Firewall.
When you enable the statistics action for App Firewall signatures or security checks, the App Firewall
maintains information about connections that match that signature or security check. You can view
• App Firewall. A summary of all statistics information gathered by your App Firewall appliance
for all profiles.
• App Firewall (per profile). The same information, but displayed per-profile rather than sum-
marized.
You can use this information to monitor how your App Firewall is operating and determine whether
there is any abnormal activity or abnormal amounts of hits on a signature or security check. If you
see such a pattern of abnormal activity, you can check the logs for that signature or security check, to
diagnose the issue, and then take corrective action.
The App Firewall reports provide information about your App Firewall configuration and how it is han-
dling traffic for your protected web sites.
The Payment Card Industry (PCI) Data Security Standard (DSS), version 1.2, consists of twelve security
criteria that most credit card companies require businesses who accept online payments via credit
and debit cards to meet. These criteria are designed to prevent identity theft, hacking, and other
types of fraud. If an internet service provider or online merchant does not meet the PCI DSS criteria,
that ISP or merchant risks losing authorization to accept credit card payments through its web site.
ISPs and online merchants prove that they are in compliance with PCI DSS by having an audit con-
ducted by a PCI DSS Qualified Security Assessor (QSA) Company. The PCI DSS report is designed to
assist them both before and during the audit. Before the audit, it shows which App Firewall settings
are relevant to PCI DSS, how they should be configured, and (most important) whether your current
App Firewall configuration meets the standard. During the audit, the report can be used to demon-
strate compliance with relevant PCI DSS criteria.
The PCI DSS report consists of a list of those criteria that are relevant to your App Firewall configura-
tion. Under each criterion, it lists your current configuration options, indicates whether your current
configuration complies with the PCI DSS criterion, and explains how to configure the App Firewall so
that your protected web site(s) will be in compliance with that criterion.
The PCI DSS report is located under System > Reports. To generate the report as an Adobe PDF file,
click Generate PCI DSS Report. Depending on your browser settings, the report is displayed in the
pop-up window or you are prompted to save it to your hard disk.
Note:
To view this and other reports, you must have the Adobe Reader program installed on your com-
puter.
• Firewall License and Feature Status. Tells you whether the App Firewall is licensed and en-
abled on your NetScaler appliance.
• Executive Summary. A table that lists the PCI DSS criteria and tells you which of those criteria
are relevant to the App Firewall.
• Detailed PCI DSS Criteria Information. For each PCI DSS criterion that is relevant to your App
Firewall configuration, the PCI DSS report provides a section that contains information about
whether your configuration is currently in compliance and, if it is not, how to bring it into com-
pliance.
• Configuration. Data for individual profiles, which you access either by clicking App Firewall
Configuration at the top of the report, or directly from the Reports pane. The App Firewall Con-
figuration report is the same as the PCI DSS report, with the PCI DSS-specific summary omitted,
and is described below.
The App Firewall Configuration report is located under System > Reports. To display it, click Generate
App Firewall Configuration Report. Depending on your browser settings, the report is displayed in the
pop-up window or you are prompted to save it to your hard disk.
The App Firewall Configuration report starts with a Summary page, which consists of the following
sections:
• App Firewall Policies. A table that lists your current App Firewall policies, showing the policy
name, the content of the policy, the action (or profile) it is associated with, and global binding
information.
• App Firewall Profiles. A table that lists your current App Firewall profiles and indicates which
policy each profile is associated with. If a profile is not associated with a policy, the table dis-
plays INACTIVE in that location.
To download all report pages for all policies, at the top of the Profiles Summary page click Download
All Profiles. You display the report page for each individual profile by selecting that profile in the table
at the bottom of the screen. The Profile page for an individual profile shows whether each check action
is enabled or disabled for each check, and the other configuration settings for the check.
To download a PDF file containing the PCI DSS report page for the current profile, click Download
Current Profile at the top of the page. To return to the Profiles Summary page, click App Firewall
Profiles. To go back to the main page, click Home. You can refresh the PCI DSS report at any time by
clicking Refresh in the upper right corner of the browser. You should refresh the report if you make
changes to your configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
January 6, 2019
Contributed by:
C
The App Firewall generated log messages can be quite useful for keeping track of the configurational
changes, App Firewall policy invocations, and security check violations.
When the log action is enabled for security checks or signatures, the resulting log messages provide
information about the requests and responses that the App Firewall has observed while protecting
your web sites and applications. The most important information is the action taken by the App Fire-
wall when a signature or a security check violation was observed. For some security checks, the log
message can provide additional useful information, such as the location and the detected pattern
that triggered the violation. You can deploy security checks in non-block mode and monitor the logs
to determine whether the transactions that are triggering security violations are valid transactions
(false positives). If they are, you can either remove, or reconfigure the signature or security checks,
deploy relaxations, or take other appropriate measures to mitigate the false positives before you en-
able blocking for that signature or security check. An excessive increase in the number of violation
messages in logs can indicate a surge in malicious requests. This can alert you that your application
might be under attack to exploit a specific vulnerability that is detected and thwarted by App Firewall
protections.
The App Firewall uses the NetScaler format logs (also called native format logs) by default. These logs
have the same format as those generated by other NetScaler features. Each log contains the following
fields:
You can search for any of these fields, or any combination of information from different fields. Your
selection is limited only by the capabilities of the tools you use to view the logs. You can observe the
App Firewall log messages in the GUI by accessing the NetScaler syslog viewer, or you can manually
connect to the NetScaler appliance and access logs from the command line interface, or you can drop
into shell and tail the logs directly from the /var/log/ folder.
The App Firewall also supports CEF logs. CEF is an open log management standard that improves
the interoperability of security-related information from different security and network devices and
applications. CEF enables customers to use a common event log format so that data can easily be col-
lected and aggregated for analysis by an enterprise management system. The log message is broken
into different fields so that you can easily parse the message and write scripts to identify important
information.
In addition to date, timestamp, client IP, log format, appliance, company, build version, module, and
security check information, App Firewall CEF Log messages include the following details:
For example, consider the following CEF format log message, which was generated when a Start URL
violation was triggered:
The above message can be broken down into different components. Refer to the CEP log components
table.
Example of a request check violation in CEF log format: request is not blocked
6 7W5kIWDRHN8PtK1Zc-txHkHNx1WknuG9DzTuM7t1THhluevXu9I4kp8%3D&as_fid=
feeec8758b4174
7 0eedeeb6b35b85dfd3d5def30c msg=Field consistency check failed for field
passwd cn1=1401
8 cn2=707 cs1=pr_ffc cs2=PPE1 cs3=Ycby5IvjL6FoVa6Ah94QFTIUpC80001 cs4=
ALERT cs5=2015 act=
9 not blocked
Geolocation, which identifies the geographic location from which requests originate, can help you
configure the App Firewall for the optimal level of security. To bypass security implementations such
as rate limiting, which rely on the IP addresses of the clients, malware or rogue computers can keep
changing the source IP address in requests. Identifying the specific region from where requests are
coming can help determine whether the requests are from a valid user or a device attempting to launch
cyberattacks. For example, if an excessively large number of requests are received from a specific area,
it is easy to determine whether they are being sent by users or a rogue machine. Geolocation analysis
of the received traffic can be very useful in deflecting attacks such as denial of service (DoS) attacks.
The App Firewall offers you the convenience of using the built-in NetScaler database for identifying
the locations corresponding to the IP addresses from which malicious requests are originating. You
can then enforce a higher level of security for requests from those locations. Citrix default syntax (PI)
expressions give you the flexibility to configure location based policies that can be used in conjunction
with the built-in location database to customize firewall protection, bolstering your defense against
coordinated attacks launched from rogue clients in a specific region.
You can use the NetScaler built-in database, or you can use any other database. If the database does
not have any location information for the particular client IP address, the CEF log shows geolocation
as an Unknown geolocation.
Note: Geolocation logging uses the Common Event Format (CEF). By default, CEF logging and GeoLo-
cationLogging are OFF. You must explicitly enable both parameters.
Using the command line to configure the log action and other log parameters
To configure the log action for a security checks of a profile by using the command line
Examples
The CEF logging is disabled by default. At the command prompt, type one of the following commands
to change or display the current setting:
To configure the logging of the credit card numbers by using the command line
1. Use the set command to enable GeoLocationLogging. You can enable the CEF logging at the
same time. Use the unset command to disable geolocation logging. The show command shows
the current settings of all the App Firewall parameters, unless you include the grep command
to show the setting for a specific parameter.
or
Default format (PI) expressions give you the flexibility to customize the information included in the
logs. You have the option to include the specific data that you want to capture in the App Firewall
generated log messages. For example, if you are using AAA-TM authentication along with the App
Firewall security checks, and would like to know the accessed URL that triggered the security check
violation, the name of the user who requested the URL, the source IP address, and the source port
from which the user sent the request, you can use the following commands to specify customized log
messages that include all the data:
Default format (PI) expressions give you the flexibility to customize the information included in the
logs. You have the option to include the specific data that you want to capture in the App Firewall
generated log messages. For example, if you are using AAA-TM authentication along with the App
Firewall security checks, and would like to know the accessed URL that triggered the security check
violation, the name of the user who requested the URL, the source IP address, and the source port
from which the user sent the request, you can use the following commands to specify customized log
messages that include all the data:
1 > sh version
2 NetScaler NS12.1: Build 50.0013.nc, Date: Aug 28 2018, 10:51:08 (64-
bit)
3 Done
The App Firewall offers you an option to isolate and redirect the App Firewall security log messages
to a different log file. This might be desirable if the App Firewall is generating a large number of logs,
making it difficult to view other NetScaler log messages. You can also use this option when you are
interested only in viewing the App Firewall log messages and do not want to see the other log mes-
sages.
To redirect the App Firewall logs to a different log file, configure a syslog action to send the App Firewall
logs to a different log facility. You can use this action when configuring the syslog policy, and bind it
globally for use by App Firewall.
Example:
1. Switch to the shell and use an editor such as vi to edit the /etc/syslog.conf file. Add a new entry
to use local2.* to send logs to a separate file as shown in the following example:
local2.\* /var/log/ns.log.appfw
2. Restart the syslog process. You can use the grep command to identify the syslog process ID
(PID), as shown in the following example:
3. From the command line interface, configure the syslog action and policy. Bind it as a global App
Firewall policy.
> add audit syslogAction sysact 1.1.1.1 -logLevel ALL -logFacility LOCAL2
1. All App Firewall security check violations will now be redirected to the /var/log/ns.log.appfw
file. You can tail this file to view the App Firewall violations that are getting triggered during the
processing of the ongoing traffic.
Warning: If you have configured the syslog policy to redirect the logs to a different log facility, the App
Firewall log messages no longer appear in the /var/log/ns.log file.
You can view the logs by using the syslog viewer, or by logging onto the NetScaler appliance, opening
a UNIX shell, and using the UNIX text editor of your choice.
Switch to the shell and tail the ns.logs in the /var/log/ folder to access the log messages pertaining to
the App Firewall security check violations:
• Shell
• tail -f /var/log/ns.log
You can use the vi editor, or any Unix text editor or text search tool, to view and filter the logs for
specific entries. For example, you can use grep command to access the log messages pertaining to
the Credit Card violations:
The NetScaler GUI includes a very useful tool (Syslog Viewer) for analyzing the log messages. You have
multiple options for accessing the Syslog Viewer:
• To view log messages for a specific security check of a profile, navigate to App Firewall > Pro-
files, select the target profile, and click Security Checks. Highlight the row for the target security
check and click Logs. When you access the logs directly from the selected security check of the
profile, it filters out the log messages and displays only the logs pertaining to the violations for
the selected security check. Syslog viewer can display App Firewall logs in the Native format as
well as the CEF format. However, in order for the syslog viewer to filter out the target profile
specific log messages, the logs must be in the CEF log format when accessed from the profile.
• You can also access the Syslog Viewer by navigating to NetScaler > System > Auditing. In the
Audit Messages section, click Syslog messages link to display the Syslog Viewer, which displays
all log messages, including all App Firewall security check violation logs for all profiles. This is
useful for debugging when multiple security check violations might be triggered during request
processing.
• Navigate to App Firewall > policies > Auditing. In the Audit Messages section, click Syslog mes-
sages link to display the Syslog Viewer, which displays all log messages, including all security
check violation logs for all profiles.
The HTML based Syslog Viewer provides the following filter options for selecting only the log messages
that are of interest to you:
• File—The current /var/log/ns.log file is selected by default, and the corresponding mes-
sages appear in the Syslog Viewer. A list of other log files in the /var/log directory are available
in a compressed .gz format. To download and un-compress an archived log file, just select the
log file from the dropdown option. The log messages pertaining to the selected file are then dis-
played in the syslog viewer. To refresh the display, click the Refresh icon (a circle of two arrows).
• Module list box—You can select the NetScaler module whose logs you want to view. You can
set it to APPFW for App Firewall logs.
• Event Type list box—This box contains a set of check boxes for selecting the type of event you
are interested in. For example, to view the log messages pertaining to the signature violations,
you can select the APPFW_SIGNATURE_MATCH check box. Similarly, you can select a check box
to enable the specific security check that is of interest to you. You can select multiple options.
• Severity—You can select a specific severity level to show just the logs for that severity level.
Leave all the check boxes blank if you want to see all logs.
To access the App Firewall security check violation log messages for a specific security check, fil-
ter by selecting APPFW in the dropdown options for Module. The Event Type displays a rich set
of options to further refine your selection. For example, if you select the APPFW_FIELDFORMAT
check box and click the Apply button, only log messages pertaining to the Field Formats secu-
rity check violations appear in the Syslog Viewer. Similarly, if you select the APPFW_SQL and
APPFW_STARTURL check boxes and click the Apply button, only log messages pertaining to
these two security check violations will appear in the syslog viewer.
If you place the cursor in the row for a specific log message, multiple options, such as Module, Event-
Type, EventID, ClientIP, TransactionID, and so on appear below the log message. You can select any
Highlights
• CEF Log Format support—The CEF log format option provides a convenient option to moni-
tor, parse, and analyze the App Firewall log messages to identify attacks, fine tune configured
settings to decrease false positives, and gather statistics.
• Click to Deploy—The Syslog viewer provides an option to filter, evaluate, and deploy relaxation
rules for single or multiple security check violations from one convenient location.
• Option to customize log message—You can use advanced PI expressions to customize log mes-
sages and include the data you want to see in the logs.
• Segregate App Firewall specific logs—You have an option to filter and redirect application-
firewall specific logs to a separate log file.
• Remote Logging—You can redirect the log messages to a remote syslog server.
• Geolocation Logging—You can configure the App Firewall to include the geolocation of the area
from where the request is received. A built-in geolocation database is available, but you have
the option to use an external geolocation database. The NetScaler appliance supports both IPv4
and IPv6 static geolocation databases.
• Information rich log message—Following are some examples of the type of information that
can be included in the logs, depending on the configuration:
– An App Firewall policy was triggered.
– A security check violation was triggered.
– A request was considered to be malformed.
– A request or the response was blocked or not blocked.
– Request data (such as SQL or XSS special characters) or response data (such as Credit card
numbers or safe object strings) was transformed.
– The number of credit cards in the response exceeded the configured limit.
– The credit card number and type.
– The log strings configured in the signature rules, and the signature ID.
– Geolocation information about the source of the request.
– Masked (X’d out) user input for protected confidential fields.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Appendices
Contributed by:
C
The following supplemental material provides additional detail about complex or peripheral App Fire-
wall tasks.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The NetScaler operating system supports direct entry of characters in the printable ASCII character
set only—characters with hexadecimal codes between HEX 20 (ASCII 32) and HEX 7E (ASCII 127). To
include a character with a code outside that range in your App Firewall configuration, you must enter
its UTF-8 hexadecimal code as a PCRE regular expression.
A number of character types require encoding using a PCRE regular expression if you include them in
your App Firewall configuration as a URL, form field name, or Safe Object expression. They include:
• Upper-ASCII characters. Characters with encodings from HEX 7F (ASCII 128) to HEX FF (ASCII
255). Depending on the character map used, these encodings can refer to control codes, ASCII
characters with accents or other modifications, non-Latin alphabet characters, and symbols not
included in the basic ASCII set. These characters can appear in URLs, form field names, and safe
object expressions.
• Double-Byte characters. Characters with encodings that use two 8-byte words. Double-byte
characters are used primarily for representing Chinese, Japanese, and Korean text in electronic
format. These characters can appear in URLs, form field names, and safe object expressions.
ASCII control characters. Non-printable characters used to send commands to a printer. All
ASCII characters with hexadecimal codes less than HEX 20 (ASCII 32) fall into this category. These
characters should never appear in a URL or form field name, however, and would rarely if ever
appear in a safe object expression.
The NetScaler appliance does not support the entire UTF-8 character set, but only the characters
found in the following eight charsets:
• English US (ISO-8859-1). Although the label reads, “English US,” the App Firewall supports all
characters in the ISO-8859-1 character set, also called the Latin-1 character set. This charac-
ter set fully represents most modern western European languages and represents all but a few
uncommon characters in the rest.
• Chinese Traditional (Big5). The App Firewall supports all characters in the BIG5 character set,
which includes all of the Traditional Chinese characters (ideographs) commonly used in modern
Chinese as spoken and written in Hong Kong, Macau, Taiwan, and by many people of Chinese
ethnic heritage who live outside of mainland China.
• Chinese Simplified (GB2312). The App Firewall supports all characters in the GB2312 charac-
ter set, which includes all of the Simplified Chinese characters (ideographs) commonly used in
• Japanese (SJIS). The App Firewall supports all characters in the Shift-JIS (SJIS) character set,
which includes most characters (ideographs) commonly used in modern Japanese.
• Japanese (EUC-JP). The App Firewall supports all characters in the EUC-JP character set, which
includes all characters (ideographs) commonly used in modern Japanese.
• Korean (EUC-KR). The App Firewall supports all characters in the EUC-KR character set, which
includes all characters (ideographs) commonly used in modern Korean.
• Turkish (ISO-8859-9). The App Firewall supports all characters in the ISO-8859-9 character set,
which includes all letters used in modern Turkish.
• Unicode (UTF-8). The App Firewall supports certain additional characters in the UTF-8 charac-
ter set, including those used in modern Russian.
When configuring the App Firewall, you enter all non-ASCII characters as PCRE-format regular expres-
sions using the hexadecimal code assigned to that character in the UTF-8 specification. Symbols and
characters within the normal ASCII character set, which are assigned single, two-digit codes in that
character set, are assigned the same codes in the UTF-8 character set. For example, the exclamation
point (!), which is assigned hex code 21 in the ASCII character set, is also hex 21 in the UTF-8 character
set. Symbols and characters from another supported character set have a paired set of hexadecimal
codes assigned to them in the UTF-8 character set. For example, the letter a with an acute accent (á)
is assigned UTF-8 code C3 A1.
The syntax you use to represent these UTF-8 codes in the App Firewall configuration is “xNN” for ASCII
characters; “xNNxNN” for non-ASCII characters used in English, Russian, and Turkish; and “xNNxN-
NxNN” for characters used in Chinese, Japanese, and Korean. For example, if you want to represent a
! in an App Firewall regular expression as a UTF-8 character, you would type x21. If you want to include
an á, you would type xC3xA1.
Note:
Normally you do not need to represent ASCII characters in UTF-8 format, but when those charac-
ters might confuse a web browser or an underlying operating system, you can use the character’s
UTF-8 representation to avoid this confusion. For example, if a URL contains a space, you might
want to encode the space as \x20 to avoid confusing certain browsers and web server software.
Below are examples of URLs, form field names, and safe object expressions that contain non-ASCII
characters that must be entered as PCRE-format regular expressions to be included in the App Firewall
configuration. Each example shows the actual URL, field name, or expression string first, followed by
a PCRE-format regular expression for it.
A form field name containing extended ASCII characters. Actual Name: nome_do_usuário Encoded
Name: ^nome_do_usu\xC3\xA1rio$
A safe object expression containing extended ASCII characters. Unencoded Expression [A-Z]{ 3,6
} ¥\[1-9\][0-9]{ 6,6 } Encoded Expression: [A-Z]{ 3,6 } \xC2\xA5[1-9][0-9]{ 6,6
}
You can find a number of tables that include the entire Unicode character set and matching UTF-8
encodings on the Internet. A useful web site that contains this information is located at the following
URL:
1 http://www.utf8-chartable.de/unicode-utf8-table.pl
For the characters in the table on this web site to display correctly, you must have an appropriate
Unicode font installed on your computer. If you do not, the visual display of the character may be
in error. Even if you do not have an appropriate font installed to display a character, however, the
description and the UTF-8 and UTF-16 codes on this set of web pages will be correct.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
The NetScaler App Firewall accepts and generates blocking rules for all vulnerability types that the
Whitehat scanners generate. However, certain vulnerabilities are most applicable to a web App Fire-
wall. Following are lists of those vulnerabilities, categorized by whether they are addressed by WASC
1.0, WASC 2.0, or best practices signature types.
• Abuse of Functionality
• Brute Force
• Content Spoofing
• Denial of Service
• Directory Indexing
• Information Leakage
• Insufficient Anti-automation
• Insufficient Authentication
• Insufficient Authorizatio
• Insufficient Session Expiration
• LDAP Injection
• Session Fixation
Best Practices
• Autocomplete Attribute
• Insufficient Cookie Access Control
• Insufficient Password Strength
• Invalid HTTP Method Usage
• Non-HttpOnly Session Cookie
• Persistent Session Cookie
• Personally Identifiable Information
• Secured Cachable HTTP Messages
• Unsecured Session Cookie
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Note:
The NetScaler App Firewall now uses request side streaming, which results in a significant perfor-
mance boost. Instead of buffering the entire request before processing it, the App Firewall now looks
at the incoming data, field by field, to inspect the input of each field for any configured security check
violation (SQL, XSS, Field Consistency, Field Formats, etc.). As soon as the processing of the data for
a field is completed, it is forwarded to the backend while the evaluation continues for the remaining
fields. This significantly improves the processing time specially when handling large posts where the
forms have large number of fields.
Note:
Citrix Web App Firewall supports a maximum post size of 20 MB without streaming. For better
resource utilization, Citrix recommends you to enable streaming option for payloads greater than
20 MB. Also, the back-end server must accept the chunked requests when streaming is enabled.
Although the streaming process is transparent to the users, minor configuration adjustments are re-
quired due to the following changes:
RegEx Pattern Match: RegEx pattern match is now restricted to 4K for contiguous character string
match.
Field Name Match: App Firewall learning engine can only distinguish the first 128 bytes of the name
for learning. If a form has multiple fields with names that have identical string match for the first
128 bytes, the learning engine may not be able to distinguish between them. Similarly, the deployed
relaxation rule might inadvertently relax all such fields.
Removing white spaces, percent decoding, unicode decoding, and charset conversion which is done
during canonicalization is carried out prior to security check inspection. The 128 byte limit is applica-
ble to the canonicalized representation of the field name in UTF-8 character format. The ASCII char-
acters are 1 byte but the UTF-8 representation of the characters in some international languages may
range from 1-4 bytes. If each character in the name takes 4 bytes when converted to UTF-8 format,
only first 32 characters in the name may be distinguished by the learned rule for such a language.
Field Consistency Check: When the field Consistency check is enabled, all the forms in the session
are now stored based on the “as_fid” tag inserted by the App Firewall without consideration for the
“action_url.”
• Mandatory Form tagging for Form Field consistency: When the field consistency check is en-
abled, the form tag must be enabled also. The Field Consistency protection might not work if
form tagging is turned off.
• Sessionless Form Field Consistency: The App Firewall no longer carries out the “GET” to
“POST” conversion of forms when sessionless field consistency parameter is enabled. The
form tag is required for sessionless field consistency also.
• Tampering of as_fid: If a form is submitted after tampering as_fid, it now triggers field consis-
tency violation even if no other field was tampered. In non-streaming requests, this was allowed
because the forms could be validated using the “action_url” stored in the session.
• Location: It is now a mandatory requirement that location must be specified for each pattern.
All patterns in the rule MUST have a <Location> tag.
• Fast Match: All signature rules must have a fast match pattern. If there is no fast match pattern,
an attempt will be made to select one if possible. Fast match must be a literal string but some
PCRE’s can be used for fast match if they contain a usable literal string.
– HTTP_ANY
– HTTP_RAW_COOKIE
– HTTP_RAW_HEADER
– HTTP_RAW_RESP_HEADER
– HTTP_RAW_SET_COOKIE
XSS/SQL Transform: Raw data is used for transformation because the SQL special characters ( single
quote(‘), backslash (), and semicolon (;)), and XSS tags ((<) and(>)) are same in all languages and do not
need canonicalization of data. All representations of these characters, such as HTML entity encoding,
percent encoding, or ASCII are evaluated for transform operation.
The App Firewall no longer inspects both the attribute name and value for the XSS transform opera-
tion. Now only XSS attribute names are transformed when streaming is engaged.
Processing XSS Tags: As part of the streaming changes in 10.5.e build onwards, the App Firewall
processing of the Cross-site Scripting tags has changed. In earlier releases, presence of either open
bracket (<), or close bracket (>), or both open and close brackets (<>) was flagged as Cross-site Script-
ing Violation. The behavior has changed in 10.5.e build onwards. Presence of only the open bracket
character (<), or only the close bracket character (>) is no longer considered as an attack. It is when an
open bracket character (<) is followed by a close bracket character (>), the Cross-site scripting attack
gets flagged. Both characters must be present in the right order (< followed by >) to trigger Cross-site
scripting violation.
Note
Change in SQL violation log Message: As part of the streaming changes in 10.5.e build onwards,
we now process the input data in blocks. RegEx pattern matching is now restricted to 4K for con-
tiguous character string matching. With this change, the SQL violation log messages might in-
clude different information compared to the earlier builds. The keyword and special character
in the input could be separated by a large number of bytes. We now keep track of the SQL key-
words and special strings when processing the data, instead of buffering the entire input value.
In addition to the field name, the log message now includes the SQL keyword, or the SQL special
character, or both the SQL keyword and the SQL special character, as determined by the con-
figured setting. The rest of the input is no longer included in the log message, as shown in the
following example:
Example:
In 10.5, when the App Firewall detects the SQL violation, the entire input string might be included
in the log message, as shown below:
SQL Keyword check failed for field text=”select a name from testbed1\;\(\;\)”.*<blocked>
In 11.0, we log only the field name, keyword and special character (if applicable) in the log mes-
sage, as shown below:
RAW POST Body: The security check inspections are always done on RAW POST body.
Form ID: The App Firewall inserted “as_fid” tag, which is a computed hash of the form, will no longer
be unique for the user session. It will now have an identical value for a specific form irrespective of
the user or the session.
Charset: If a request does not have a charset, the default charset specified in the application profile
is used when processing the request.
Counters:
Counters with prefix “se_” and “appfwreq_” are added to track the streaming engine and the App
Firewall streaming engine request counters respectively.
nsconsmg -d statswt0 -g se_err_
nsconsmg -d statswt0 -g se_tot_
nsconsmg -d statswt0 -g se_cur_
nsconsmg -d statswt0 -g appfwreq_err_
_err counters: indicate the rare event which should have succeeded but failed due to either memory
allocation problem or some other resource crunch.
_cur counters: counters indicating current values that keep changing based on usage from current
transactions.
Tips:
• The App Firewall security checks should work exactly the same as before.
• There is no set ordering for the processing of the security checks.
Important
Calculating the Cookie length: In release 10.5.e (in a few interim enhancement builds prior to
59.13xx.e build) as well as in the 11.0 release (in builds prior to 65.x), App Firewall processing of the
Cookie header was changed. In those releases, every cookie is evaluated individually, and if the
length of any one cookie received in the Cookie header exceeds the configured BufferOverflow-
MaxCookieLength, the Buffer Overflow violation is triggered. As a result of this change, requests
that were blocked in 10.5 and earlier release builds might be allowed, because the length of the
entire cookie header is not calculated for determining the cookie length. In some situations, the
total cookie size forwarded to the server might be larger than the accepted value, and the server
might respond with “400 Bad Request”.
Note that this change has been reverted. The behavior in the 10.5.e ->59.13xx.e and subse-
quent 10.5.e enhancement builds as well as in the 11.0 release 65.x and subsequent builds
is now similar to that of the non-enhancement builds of release 10.5. The entire raw Cookie
header is now considered when calculating the length of the cookie. Surrounding spaces
and the semicolon (;) characters separating the name-value pairs are also included in de-
termining the cookie length.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
January 6, 2019
Contributed by:
C
Note:
Troubleshooting a problem, which requires analysis of data received in the client request can be quite
challenging specially when there is heavy traffic flowing through the box. Diagnosing issues which
may affect the functionality or security of the application require a quick response.
The NetScaler now offers the option to isolate traffic for a specific App Firewall profile and collect
nstrace for the HTML requests that trigger a log or block action or malformed requests that might be
causing reset or aborts. The nstrace collected in –appfw mode will include details of the entire request
including the App Firewall generated log messages. You can use “Follow TCP stream” in the trace to
view the details of the individual transaction including headers, payload, as well as the corresponding
log message, together in the same screen.
This gives you a comprehensive overview regarding your traffic. Having a detailed view of the request,
payload, and associated log records can be very useful to analyze security check violation. You can
easily identify the pattern that is triggering the violation. If the pattern should be allowed, you can
take a decision to modify the configuration and/or add a relaxation rule.
This enhancement helps in troubleshooting the NetScaler and offers the following benefits:
1. Isolate traffic for specific profile: This enhancement can be quite useful when you need to
isolate traffic for only one profile or specific transactions of a profile for troubleshooting. You
no longer have to skim through the entire data collected in the trace or need special filters to
isolate requests that are of interest to you which can be tedious especially with heavy traffic.
You now have the option to view only the data that you are interested in.
2. Collect data for specific requests: The trace can be collected for a specified duration. You can
collect trace for only a couple of requests to isolate, analyze, and debug specific transactions if
needed.
3. Identify resets or aborts: Unexpected closing of connections are not easily visible. The trace
collected in –appfw mode captures a reset or an abort, triggered by the App Firewall. This allows
a quicker isolation of issue when you do not see a security check violation message. Malformed
requests or other non-RFC compliant requests terminated by App Firewall will now be easier to
identify.
4. View decrypted SSL traffic: HTTPS traffic is captured in plain text to allow for easier trou-
bleshooting.
5. Provides comprehensive view: Allows you to look at the entire request at the packet level,
check the payload, look at the logs to check what security check violation is being triggered
and identify the match pattern in the payload. If the payload consists of any unexpected data,
junk strings, or non-printable characters (null character, \r or \n etc), they are easy to discover
in the trace.
6. Modify configuration: The debugging can provide useful information to decide if the observed
behavior is the correct behavior or the configuration should be modified.
7. Expedite response time: Faster debugging on target traffic can improve the response time to
provide explanations and/or root cause analysis by Citrix engineering and support team.
Please see any task topic in eDocs for documenting tasks. Manual Configuration by using the com-
mand line interface
To configure debug tracing for a profile by using the command line interface
Step 1. Enable tracing for the profile. You can use the show command to verify the configured setting.
Step 2. Start collecting trace. You can continue to use all the options which are applicable for the
nstrace command.
• stop nstrace
Location of the trace: The nstrace is stored in a time-stamped folder which is created in the /var/n-
strace directory and can be viewed using wireshark. You can tail the /var/log/ns.log to see the log
messages providing details regarding the location of the new trace.
Tips:
• When –appfw mode option is used, the nstrace will only collect the data for the profile(s) for
which “trace” was enabled.
• Enabling trace on the profile will not automatically start collecting the traces till you explicitly
execute the “start nstrace” command to collect the trace.
• Although, enabling trace on a profile may not have any adverse effect on the performance of the
App Firewall but you may want to enable this feature only for the duration for which you want
to collect the data. It is recommended that you turn the –trace flag off after you have collected
the trace. This will prevent the risk of inadvertently getting data from profiles for which you had
enabled this flag in the past.
• The Block or Log action must be enabled for the security check for the transaction record to be
included in the nstrace.
• Resets and aborts will be logged independently of security checks actions when trace is “On”
for the profile(s).
• This feature is only applicable for troubleshooting the requests received from the client. The
traces in –appfw mode do not include the responses received from the server.
• You can continue to use all the options which are applicable for the nstrace command. For ex-
ample,
• If a request triggers multiple violations, the nstrace for that record will include all the corre-
sponding log messages.
• Signature violations triggering block and/or log action for request side checks will also be in-
cluded in the trace.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Note:
App Firewall support for Striped and partially striped configurations was introduced in NetScaler
release 11.0.
A cluster is a group of NetScaler appliances that are configured and managed as a single system. Each
appliance in the cluster is called a node. Depending on the number of nodes the configurations are
active on, cluster configurations are referred to as striped, partially striped, or spotted configurations.
The App Firewall is fully supported in all configurations.
The two main advantages of striped and partially striped virtual server support in cluster configura-
tions are the following:
1. Session failover support—Striped and partially striped virtual server configurations support ses-
sion failover. The advanced App Firewall security features, such as Start URL Closure and the
Form Field Consistency check, maintain and use sessions during transaction processing. In or-
dinary high availability configurations, or in spotted cluster configurations, when the node that
is processing the App Firewall traffic fails, all the session information is lost and the user has
to reestablish the session. In striped virtual server configurations, user sessions are replicated
across multiple nodes. If a node goes down, a node running the replica becomes the owner.
Session information is maintained without any visible impact to the user.
2. Scalability—Any node in the cluster can process the traffic. Multiple nodes of the cluster can pro-
cess the incoming requests served by the striped virtual server. This improves the App Firewall’s
ability to handle multiple simultaneous requests, thereby improving the overall performance.
Security checks and signature protections can be deployed without the need for any additional
cluster-specific App Firewall configuration. You just do the usual App Firewall configuration on the
configuration coordinator (CCO) node for propagation to all the nodes.
Note:
The session information is replicated across multiple nodes, but not across all the nodes in the
striped configuration. Therefore, failover support accommodates a limited number of simulta-
neous failures. If multiple nodes fail simultaneously, the App Firewall might lose the session
information if a failure occurs before the session is replicated on another node.
Highlights
• App Firewall offers scalability, high throughput, and session failover support in cluster deploy-
ments.
• All App Firewall security checks and signature protections are supported in all cluster configu-
rations.
• Character-Maps are not yet supported for a cluster. The learning engine recommends Field-
Types in learned rules for the Field Format security check.
• Stats and learned rules are aggregated from all the nodes in a cluster.
• Distributed Hash Table (DHT) provides the caching of the session and offers the ability to repli-
cate session information across multiple nodes. When a request comes to the virtual server, the
NetScaler appliance creates App Firewall sessions in the DHT, and can also retrieve the session
information from the DHT.
• Clustering is licensed with the Enterprise and Platinum licenses. This feature is not available
with the Standard license.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
Refer to the following troubleshooting and debugging information related to each of the App Firewall
functionality:
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
High CPU
Contributed by:
C
Following are some of the functionality and high CPU related debugging issues encoutered and the
best practices to follow when working with App Firewall:
• Identify misconfiguration
• Inspect logs in the following log files for security violations and recent configuration changes
• /var/log/ns.log
• /var/nslog/import.log
• /var/nslog/aslearn.log
Example:
• Conditional profile level trace helps identify the traffic and violation records
• Appfw sets the window size to 9845 when NetScaler resets the connection due to an invalid http
message.
Examples:
• Inspect for cpu usage, appfw, DHT and memory related activity. Monitor appfw sessions
• nsconmsg -g cc_cpu_use -g appfwreq -g as -g dht -g mem_AS_OBJ -g mem_AS_COMPONENT
-d current
• Monitor memory allocated and freed from App Firewall components and objects during the target
time period. It helps in isolating the protection leading to high CPU usage.
- Profiler output
- Observe logs
- startURLClosure
- Formfiledconsistency
- CSRF
- Cookie protections
Ascertain that autoupdate of signatures is not leading to high CPU (Disable to confirm).
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Memory
Contributed by:
C
Following are some of the best practices to follow when encountered with App Firewall usage memory
related issues:
• Look for global memory statistics to ascertain that there is enough memory in the system and there
are no memory allocation failures by executing the following command:
• Observe current allocated and maximum memory limits for appsecure, IP reputation, cache and
compression by executing the following command:
App Firewall does not automatically delete the logs after certain period of time or size.
• All AppFw logs are archived in the */var/log/ns.log* file. The ns.log file
performs the rollover task.
• There is no CLI option to increase App Firewall memory. App Firewall memory is platform-
specific.
• You may use the nsapimgr option to increase memory but it is not recommended.
The max allowed memory for App Firewall is determined by the platform and disabling IC does not
impact memory allocation.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Contributed by:
C
When you encounter large file upload failures, ensure that you check the following:
• Since release 11.0, the streaming flag can be enabled on per profile basis to avoid buffering by
executing the following command:
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Learning
Contributed by:
C
Following are some of the best practices recommended when encountered with Learning functional-
ity issues:
Aslearn process:
Example:
• Identify recent configuration commands executed prior to the observed problem by verifying the
ns.log file:
• /var/log/ns.log
• /var/log/aslearn.log
• Identify the GUI and CLI command which is failing by executing the following command:
Examples:
Examples:
Ok
• If 2000 learn items (per protection) are reached, you cannot start learning any more for that
protection
• If 20 MB size is reached for the database, stop learning for all protections
• du -h /var
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Signatures
Contributed by:
C
To add signature:
2. Give a meaningful name. The new sig object is added as a User-Defined object.
3. Enable the target rules that are pertinent to your specific need.
– Block and Log actions are enabled by default. Stats is another option
• Optimize the processing overhead by enabling only those signatures that are applicable for protect-
ing your application.
• You can add your own customized rules to inspect incoming requests to detect various types of at-
tacks, such as SQL injection or cross-site scripting attacks.
• You can also add rules to inspect the responses to detect and block leakage of sensitive information
such as credit card numbers.
• Add multiple security check conditions to create your own customized check.
Following are some of the best practices you can follow when encountered with issues related to Sig-
natures:
• Verify that the import command has succeeded on primary as well as secondary.
• Check ns.log to identify any errors during signature import and auto update.
• Check if the device is unable to access the Signature Update URL hosted on AWS for auto-update.
• Check for the version mismatch between Default signature and user-added ones.
• Check for version mismatch between signature objects on the primary and secondary nodes.
• Monitor for High CPU Utilization (disable auto-update to rule out issue with signature update).
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Trace Log
Contributed by:
C
1. Enable tracing for the profile. You can use the show command to verify the configured setting.
2. Start collecting trace. You can continue to use all the options which are applicable for the nstrace
command.
stop nstrace
Location of the trace: The nstrace is stored in a time-stamped folder which is created in the /var/n-
strace directory and can be viewed using wireshark. You can tail the /var/log/ns.log file to see the log
messages providing details regarding the location of the new trace.
• View decrypted SSL traffic: HTTPS traffic is captured in plain text to allow for easier trou-
bleshooting.
– Provides comprehensive view: Allows you to look at the entire request at the packet level, check the
payload, view logs to check what security check violation is being triggered and identify the match
pattern in the payload. If the payload consists of any unexpected data, junk strings, or non-printable
characters (null character, \r or \n etc), they are easy to discover in the trace.
– Expedite response time: Faster debugging on target traffic to do root cause analysis.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
Miscellaneous
Contributed by:
C
Following are the resolutions for some of the issues that you might encounter when using App Fire-
wall.
• App Firewall sets window size to 9845 when resetting connection for invalid http messages.
– The iprep process takes about five minutes to start after you enable the reputation feature. The IP
reputation feature might not work for that duration.
– Session timeout has a default value of 900 seconds. If session timeout is set to a low value, browser
may trigger false positives for checks which rely on sessionization (e.g CSRF, FFC). Check for session
timeout and look at the session ID (cs3 in CEF logs). If the sessionID is different, the session timeout
could be the reason.
This may be seen in scenarios where we come across a form field which is not in the forms in our
session.
– The session has timed out from when the form was sent to the client and when it was received.
– The form was generated on the client side using a java script.
1.
2. Citrix ADC
3. NetScaler 12.0
4. App Firewall
References
Contributed by:
C
Refer to the following additional reosurces for more information and useful tips when using App Fire-
wall:
• security relaxations
• Application
• Firewall
• Logs
• <https://regex101.com/>
• Datasheets
– Ensuring enough memory for App Firewall and configuring cache limit appropriately.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Cache Redirection
Contributed by:
C
In a typical deployment, different clients ask web servers for the same content repeatedly. To relieve
the origin web server of processing each request, a NetScaler appliance with cache redirection en-
abled can serve this content from a cache server instead of from the origin server.
The NetScaler appliance analyzes incoming requests, sends requests for cacheable data to cache
servers, and sends non-cacheable requests and dynamic HTTP requests to origin servers.
Cache redirection is a policy-based feature. By default, requests that match a policy are sent to the
origin server, and all other requests are sent to a cache server. For testing or maintenance, you might
want to skip policy evaluation and direct all requests to the cache or to the origin server.
You can combine content switching with cache redirection to cache selective content and serve con-
tent from specific cache servers for specific types of requested content.
A NetScaler appliance configured for cache redirection can be deployed at the edge of a network, in
front of the origin server, or anywhere along the network backbone. In an edge deployment, com-
monly used by Internet Service Providers (ISPs), cable companies, content delivery distribution net-
works, and enterprise networks, the NetScaler appliance resides directly in front of the clients. In a
server-side deployment, the NetScaler appliance is closer to the origin servers.
Cache redirection is used most commonly with the HTTP service type, but it also supports the secure
HTTPS protocol.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Once you have determined which built-in cache redirection policies to use, or have created user-
defined policies, proceed with configuring cache redirection. To use this feature, you must con-
figure at least one cache redirection virtual server, and, for normal operation, you must bind at
least one cache redirection policy to that virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
The NetScaler appliance provides built-in cache redirection policies that handle typical cache
requests. These policies are based on HTTP methods, the URL or URL tokens of the incoming request,
the HTTP version, or the HTTP headers and their values in the request.
Built-in cache redirection policies can be directly bound to a virtual server and do not need further
configuration.
Cache redirection policies use two types of appliance expressions languages, classic and default syn-
tax. For more information about these languages, see Policies and expressions.
The classic cache redirection policies evaluate basic characteristics of traffic and other data. For exam-
ple, classic cache redirection policies can determine whether an HTTP request or response contains
a particular type of header or URL.
The NetScaler appliance provides the following built-in classic cache redirection policies:
Built-in cache redirection policies based on default syntax expressions are called
default syntax cache redirection policies. For a complete description of default syntax expressions and
how to configure them, see
Policies and Expressions.
In addition to the same types of evaluations done by classic cache redirection policies, default syntax
cache redirection policies enable you to analyze more data (for example, the body of an HTTP request)
and to configure more operations in the policy rule (for example, directing the request to either cache
or origin server).
NetScaler appliances provide the following two built-in actions for the default syntax cache redirec-
tion policies:
• CACHE
• ORIGIN
As implied by their names, they direct the request to the cache server or the origin server, respectively.
Note
If you are using the built-in default syntax cache redirection policy, you cannot modify the action.
The NetScaler appliance provides the following built-in default syntax cache redirection policies:
You can display the available cache redirection polices by using the command line interface or the
configuration utility.
Example:
1. Navigate to Traffic Management > Cache Redirection > Policies. The configured cache redirec-
tion policies appear in the details pane.
2. Select one of the configured policies to view details.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
A cache redirection policy includes one or more expressions (also called rules). Each expression rep-
resents a condition that is evaluated when the client request is compared to the policy.
You do not explicitly configure actions for cache redirection policies. By default, the NetScaler appli-
ance considers any request that matches a policy to be non-cacheable and directs the request to the
origin server instead of the cache.
Cache redirection policies based on the classic policy format are called classic cache redirection poli-
cies. Each such policy has a name and includes a classic expression or a set of classic expressions that
are combined by using logical operators.
For classic cache redirection policies, you do not explicitly configure actions for the policies. By de-
fault, the NetScaler appliance considers any request that matches a policy to be non-cacheable and
directs the request to the origin server instead of the cache.
Cache redirection policies based on the newer policy format are called
Advanced redirection policies. Such policy has a name and includes a default syntax expression, or
a set of default syntax expressions that are combined by using logical operators, and the following
built-in actions:
• CACHE
• ORIGIN
For more information about classic expressions and default syntax expressions, see
Policies and Expressions.
At the command prompt, type the following commands to add a cache redirection policy and verify
the configuration:
Examples:
2 Done
3 > show cr policy Policy-CRD-3
4 Cache-By-Pass RULE: REQ.HTTP.HEADER If-Modified-Since EXISTS
Policy:Policy-CRD-3
5 Done
At the command prompt, type the following commands to add a cache redirection policy and verify
the configuration:
Examples:
• To modify a cache redirection policy, use the set cr policy command, which is just like add cr
policy command, except that you enter the name of an existing policy.
• To remove a policy, use the rm cr policy command, which accepts only the <name> argu-
ment. If the policy is bound to a virtual server, you have to unbind the policy, before you can
remove it.
For the details of unbinding a cache redirection policy, see “Unbind a policy from a cache redirection
virtual server.”
Configure a cache redirection policy with a simple expression by using the GUI
3. In the Create Cache Redirection Policy dialog box, in the Name* text box, type the name of the
policy, and then in the Expression area, click Add.
• Expression Type-General
• Flow Type -REQ
• Protocol -HTTP
• Qualifier -URL
• Operator - !=
• Value* - /*.jpeg
The simple expression in the following example checks for an If-Modified-Since header in a re-
quest:
5. When you are finished entering the expression, click OK or Create, and then click Close.
Configure a cache redirection policy with a compound expression by using the GUI
The name can begin with a letter, number, or the underscore symbol, and can consist of from
one to 127 letters, numbers, and the hyphen (-), period (.) pound (#), space ( ), at (@), equals (=),
and underscore (_) symbols. You should choose a name that will make it easy for others to tell
what type of content this policy was created to detect.
4. Choose the type of compound expression that you want to create. Your choices are:
• Match Any Expression. The policy matches the traffic if one or more individual expres-
sions match the traffic.
• Match All Expressions. The policy matches the traffic only if every individual expression
matches the traffic.
• Tabular Expressions. Switches the Expressions list to a tabular format with three
columns. In the rightmost column, you place one of the following operators:
– The AND [ && ] operator, to require that, to match the policy, a request must match
both the current expression and the following expression.
You can also group expressions in nested subgroups by selecting an existing expression
and clicking one of the following operators:
– The BEGIN SUBGROUP [+ ( ] operator, which tells the NetScaler appliance to begin
a nested subgroup with the selected expression. (To remove this operator from the
expression, click -( .)
– The END SUBGROUP [+ ) ] operator, which tells the NetScaler appliance to end the
current nested subgroup with the selected expression. (To remove this operator from
the expression, click -) .)
• Advanced Free-Form. Switches off the Expressions Editor entirely and turns the Expres-
sions list into a text area in which you can type a compound expression. This is both the
most powerful and the most difficult method of creating a policy expression, and is rec-
ommended only for those thoroughly familiar with the NetScaler appliance classic expres-
sions language.
For more information about creating classic expressions in the Advanced Free-Form text
area, see “Configuring Classic Policies and Expressions”.
Caution: If you switch to Advanced Free Form expression editing mode, you cannot switch
back to any of the other modes. Do not choose this expression editing mode unless you
are sure that you want to use it.
5. If you chose Match Any Expression, Match All Expressions, or Tabular Expressions, click Add to
display the Add Expression dialog box.
You should leave the expression type set to General for cache redirection policies.
6. In the Flow Type drop-down list, choose a flow type for your expression.
The flow type determines whether the policy examines incoming or outgoing connections. You
have two choices:
The protocol determines the type of information that the policy examines in the request or re-
sponse. Depending upon whether you chose REQ or RES in the previous drop-down list, either
all four or only three of the following choices are available:
8. Choose a qualifier for your expression from the Qualifier drop-down list.
The contents of the Qualifier drop-down list depend on which protocol you chose. The following
table describes the choices available for each protocol.
9. Choose the operator for your expression from the Operator drop-down list.
Your choices depend on the qualifier you chose in the previous step. The complete list of oper-
ators that can appear in this drop-down list is:
If you want this policy to operate on requests sent to a specific Host, you can leave the default,
the equals (==) sign.
10. If the Value text box is visible, type the appropriate string or number into the text box.
For example, if you want this policy to select requests sent to the host shopping.example.com,
you would type that string in the Value text box.
11. If you chose HEADER as the qualifier, type the header you want in the Header Name text box.
14. Click Close to close the Add Expression dialog box and return to the Create Cache Redirection
Policy dialog box.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Depending on your deployment and network topology, you can configure one of the following types
of cache redirection:
• Transparent. A transparent cache can reside on a variety of points along a network backbone
to alleviate traffic along the delivery route. In transparent mode, the cache redirection virtual
server intercepts all traffic flowing to the NetScaler appliance and applies cache redirection poli-
cies to determine whether content should be served from the cache or from the origin server.
• Forward proxy. A forward proxy cache server resides on the edge of an enterprise LAN and faces
the WAN. In the forward proxy mode, the cache redirection virtual server resolves the hostname
of the incoming request by using a DNS server and forwards requests for non-cacheable content
to the resolved origin servers. Cacheable requests are sent to the configured cache servers.
• Reverse proxy. Reverse proxy caches are configured for specific origin servers. Incoming traffic
directed to the reverse proxy, can either be served from a cache server or be sent to the origin
server with or without modification to the URL.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
When you configure transparent cache redirection, the NetScaler appliance evaluates all traffic it re-
ceives, to determine whether it is cacheable. This mode alleviates traffic along the delivery route and
is often used when the cache server resides on the backbone of an ISP or carrier.
By default, cacheable requests are sent to a cache server, and non-cacheable requests to the origin
server. For example, when the NetScaler appliance receives a request that is directed to a web server,
it compares the HTTP headers in the request with a set of policy expressions. If the request does not
match the policy, the appliance forwards the request to a cache server. If the request does match a
policy, the appliance forwards the request, unchanged, to the web server.
For details on how to modify this default behavior, see “Direct policy hits to the cache instead of the
origin.”
To configure transparent redirection, first enable cache redirection and load balancing, and configure
edge mode. Then, create a cache redirection virtual server with a wildcard IP address (*), so that this
virtual server can receive traffic coming to the appliance on any IP address the appliance owns. To this
virtual server, bind cache redirection policies that describe the types of requests that should not be
cached. Then, create a load balancing virtual server that will receive traffic from the cache redirection
virtual server for cacheable requests. Finally, create a service that represents a physical cache server
and bind it to the load balancing virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
The appliance cache redirection and load balancing features are not enabled by default. They must
be enabled before any cache redirection configuration can take effect.
At the command prompt, type the following command to enable cache redirection and load balancing
and verify the settings:
1 - enable ns feature cr lb
2 - show ns feature
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
When deployed at the edge of a network, the NetScaler appliance dynamically learns about the
servers on that network. Edge mode enables the appliance to dynamically learn about up to 40,000
HTTP servers and proxy TCP connections for these servers.
This mode turns on the collection of statistics for the dynamically learned services and is typically
used in transparent deployments for cache redirection.
At the command prompt, type the following commands to enable edge mode and verify the setting:
Example:
14 ...
15 ...
16 ...
17 16) Bridge BPDUs BridgeBPDUs OFF
18 Done
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
By default, a cache redirection virtual server forwards cacheable requests to the load balancing virtual
server for the cache, and forwards non-cacheable requests to the origin server (except in a reverse
proxy configuration, in which non-cacheable requests are sent to a load balancing virtual server).
There are three types of cache redirection virtual servers: transparent, forward proxy, and reverse
proxy.
A transparent cache redirection virtual server uses an IP address of * and a port number, usually 80,
that can accept HTTP traffic sent to any IP address that the appliance represents. As a result, you
can configure only one transparent cache redirection virtual server. Any additional cache redirection
virtual servers that you configure must be forward proxy or reverse proxy redirection servers.
add a cache redirection virtual server in transparent mode by using the cli
At the command prompt, type the following commands to add a cache redirection virtual server and
verify the configuration:
Example:
• To modify a virtual server, use the set cr vserver command, which is just like using the add cr
vserver command, except that you enter the name of an existing virtual server.
• To remove a virtual server, use the rm cr vserver command, which accepts only the <name>
argument.
Add a cache redirection virtual server in transparent mode by using the GUI
3. In the Create Virtual Server (Cache Redirection) dialog box, specify values for the following pa-
rameters as shown:
• Name*—name
• Port*—port
*A required parameter
4. In the Protocol drop-down list, select a supported protocol (for example, HTTP). If the virtual
server is to receive traffic on a port other than the standard port for the selected protocol, enter
a new value in the Port field.
6. Verify that Cache Type is set to TRANSPARENT and Redirect is set to POLICY.
7. Click Create, and then click Close. The Cache Redirection Virtual Servers pane displays the new
virtual server.
8. Select the new cache redirection virtual server to display the details of its configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Cache redirection policies are not automatically bound to the cache redirection virtual server. A policy
based cache redirection virtual server cannot function unless you bind at least one policy to it.
Example:
6 Done
7 > bind cr vserver Vserver-CRD-1 -policyName bypass-cookie
8 Done
9
10 > show cr vserver Vserver-CRD-1
11 Vserver-CRD-1 (*:80) - HTTP Type: CONTENT
12 State: UP ARP:DISABLED
13 Client Idle Timeout: 180 sec
14 Down state flush: ENABLED
15 Disable Primary Vserver On Down : DISABLED
16 Default: Content Precedence: RULE Cache:
TRANSPARENT
17 On Policy Match: ORIGIN L2Conn: OFF OriginUSIP: OFF
18 Redirect: POLICY Reuse: ON Via: ON ARP: OFF
19
20 1) Cache bypass Policy: bypass-cache-control
21 2) Cache bypass Policy: bypass-dynamic-url
22 3) Cache bypass Policy: bypass-urltokens
23 4) Cache bypass Policy: bypass-cookie
24 Done
Bind a user-defined policy to a cache redirection virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
When you unbind a policy from the cache redirection virtual server, the NetScaler appliance no longer
applies the policy when evaluating client requests.
Unbind a policy from a cache redirection virtual server by using the command CLI
Example:
Unbind a user-defined policy from a cache redirection virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
The cache redirection virtual server on the NetScaler appliance can send requests to either a cache
server farm, if the request is cacheable, or to the origin server farm if the request is not cacheable.
Each cache server is represented on the appliance by a service, which is bound to a load balancing
virtual server that receives requests from the cache redirection virtual server and forwards those re-
quests to the servers.
For details on configuring load balancing virtual servers and other configuration options, see “Load
Balancing.”
At the command prompt, type the following commands to create a load balancing virtual server and
verify the configuration:
Example:
3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the following param-
eters as shown:
• Name*-name
• IP Address*- IPAddress
• Port*-port
*A required parameter
4. In the Protocol list, select a supported protocol (for example, HTTP). If the virtual server is to
receive traffic on a port other than the well-known port for the selected protocol, enter a new
value in the Port field.
5. Click Create, and then click Close. The Load Balancing Virtual Servers pane displays the new
virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
On the NetScaler appliance, a service represents a physical server on the network. In the transparent
cache redirection configuration, the service represents the cache server. Cacheable requests are sent
by the cache redirection virtual server to the load balancing virtual server, which in turn forwards each
request to the correct service, which passes it on to the cache server.
At the command prompt, type the following commands to create an HTTP service and verify the con-
figuration:
Example:
• To modify a service, use the set service command, which is just like using the add service com-
mand, except that you enter the name of an existing service.
• To remove a service, use the rm service command, which accepts only the <name> argument.
3. In the Create Service dialog box, specify values for the following parameters as shown:
• Service Name*—name
• Server*— IP
• Port*—port
*A required parameter
4. In the Protocol* drop-down list, select a supported protocol (for example, HTTP).
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
You must bind a service to the load balancing virtual server. This enables the load balancer to forward
the request to the server that the service represents. If your configuration changes, you can unbind a
service from the load balancing virtual server.
Example:
Unbind a service from a load balancing virtual server by using the CLI
To unbind a service, use the unbind lb vserver command instead of bind lb vserver.
Bind/unbind a service from a load balancing virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Disable the use the proxy port setting for transparent caching
A method to solve this problem is to assign a source port range to the NetScaler appliance. This al-
lotment enables network devices to unambiguously identify the NetScaler appliance that sent the
request.
Assign a source port range to a NetScaler appliance by using the appliance GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
If a load balancing virtual server is configured to listen on a particular IP address and port combina-
tion, it takes precedence over the cache redirection virtual server for any requests destined for that
address-port combination. Therefore, the cache redirection virtual server does not process those re-
quests.
If you want to override this functionality and let the cache redirection virtual server decide whether
the request should be served from the cache or not, configure the particular load balancing virtual
server to be cacheable.
Such a configuration is typically used when an ISP uses a NetScaler appliance at the edge of its net-
work and all traffic flows through the appliance.
Enable load balancing virtual servers to redirect requests to the cache by using the CLI
Example:
For transparent cache redirection, the appliance intercepts all traffic and evaluates every request to
determine whether it is cacheable. Non-cacheable requests are sent unchanged to the origin server.
When using transparent cache redirection, you may want to turn off cache redirection for load balanc-
ing virtual servers that always direct traffic to origin servers.
Turn off caching for a load balancing virtual server by using the CLI
To turn off caching for a load balancing virtual, use the unset lb vserver command instead of set lb
vserver. Specify a value of NO value for the cacheable parameter.
Enable or disable load balancing virtual servers to redirect requests to the cache by
using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
A forward proxy is a single point of contact for a client or group of clients. In this configuration, the
NetScaler appliance redirects non-cacheable requests to an origin server and redirects cacheable re-
quests to either a forward proxy cache or a transparent cache.
When the appliance is configured as a forward proxy, users must modify their browsers so that the
browser sends requests to the forward proxy instead of the destination servers.
A forward proxy cache redirection virtual server on the appliance compares the request with a policy
for caching. If the request is not cacheable, the appliance queries a DNS load balancing virtual server
for resolution of the destination, and then sends the request to the origin server. If the request is
cacheable, the appliance forwards the request to a load balancing virtual server for the cache.
The appliance relies on a host domain name or IP address in the request’s HOST header to determine
the requested destination. If there is no HOST header in the request, the appliance inserts a HOST
header based on the destination IP address in the request.
Typically, the NetScaler appliance acts as a forward proxy in an enterprise LAN. In such a configuration,
the appliance resides at the edge of an enterprise LAN and intercepts client requests before they are
fanned out to the WAN. Configuring the appliance in the forward proxy mode reduces traffic on the
WAN.
To configure forward proxy cache redirection, first enable load balancing and cache redirection on
the appliance. Then, configure a DNS load balancing virtual server and associated services. Also con-
figure a load balancing virtual server and bind to it appropriate services for the cache. Configure a
forward proxy cache redirection virtual server and bind the DNS and load balancing virtual servers to
it. You must also configure caching policies and bind them to the cache redirection virtual server. To
complete the setup, configure the client browsers to use the forward proxy.
For details on how to enable cache redirection and load balancing on the appliance, see “Enable cache
redirection and load balancing.”
For details on how to create a load balancing virtual server, see “Create a load balancing virtual server.”
For details on how to configure services that represent the cache server, see “Configure an HTTP ser-
vice.”
For details on how to bind the service to a virtual server, see “Bind/unbind a service to/from a load
balancing virtual server.”
For details on how to create a forward proxy cache redirection server, see “Configure a cache redirec-
tion virtual server”, and create a virtual server of type TRANSPARENT or FORWARD.
For details on binding cache redirection policies to the cache redirection virtual server, see “Configure
a cache redirection policy.”
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
At the command line, type the following commands to create a DNS service and verify the configura-
tion :
Example:
3. In the Create Service dialog box, specify values for the following parameters as shown:
• Service Name*—name
• Server*—IP
• Port*—port
*A required parameter
1. In the Protocol* drop down list, select a supported protocol (for example, DNS).
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
The DNS virtual server enables the forward proxy to perform DNS resolution before forwarding a client
request to an origin server. The DNS load balancing virtual server is associated with the DNS service
that represents the physical DNS server on the network.
At the command line, type the following commands to create a DNS load balancing virtual server and
verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
For the DNS server to respond to DNS requests, the service representing the DNS server must be bound
to the DNS virtual server.
Bind the DNS service to the load balancing virtual server by using the CLI
At the command prompt, type the following commands to bind the DNS service to the load balancing
virtual server and verify the configuration:
Example:
Unbind a DNS service from the load balancing virtual server by using the CLI
Bind/Unbind a DNS service to/from a load balancing virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
When you configure the NetScaler appliance as forward proxy cache redirection virtual server in the
network, you must configure the client Web browser to send requests to the forward proxy. Typically,
when you use a forward proxy, the only route to the servers in the network is through the forward
proxy.
Refer the documentation for your browser to configure the browser to use a forward proxy. Specify the
IP address and port number of the forward proxy cache redirection virtual server for this configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
A reverse proxy resides in front of one or more Web servers and shields the origin server from client
requests. Often, a reverse proxy cache is a front-end for all client requests to a server. An administrator
assigns a reverse proxy cache to a specific origin server. This is unlike transparent and forward proxy
caches, which cache frequently requested content for all requests to any origin server, and the choice
of a server is based on the request.
Unlike a transparent proxy cache, the reverse proxy cache has its own IP address and can replace
destination domains and URLs in a non-cacheable request with new destination domains and URLs.
You can deploy reverse proxy cache redirection at the origin-server side or at the edge of a network.
When deployed at the origin server, the reverse proxy cache redirection virtual server is a front-end
for all requests to the origin server.
In the reverse proxy mode, when the appliance receives a request, a cache redirection virtual server
evaluates the request and forwards it to either a load balancing virtual server for the cache or a load
balancing virtual server for the origin. The incoming request can be transformed by changing the host
header or the host URL before they it is sent to the backend server.
To configure reverse proxy cache redirection, first enable cache redirection and load balancing. Then,
configure a load balancing virtual server and services to send cacheable requests to the cache servers.
Also configure a load balancing virtual server and associated services for the origin servers. Then,
configure a reverse proxy cache redirection virtual server and bind relevant cache redirection policies
to it. Finally, configure mapping policies and bind them to the reverse proxy cache redirection virtual
server.
The mapping policies have an associated action that enables the cache redirection virtual server to
forward any non-cacheable request to the load balancing virtual server for the origin.
For details on how to enable cache redirection and load balancing on the appliance, see Enable cache
redirection and load balancing.
For details on how to create a load balancing virtual server, see Create a load balancing virtual server.
For details on how to configure services that represent the cache server, see Configure an HTTP ser-
vice.
For details on how to bind the service to a virtual server, see Bind/unbind a service to/from a load
balancing virtual server.
For details on how to create a reverse proxy cache redirection server, see Configure a cache redirection
virtual server, and create a virtual server of type REVERSE.
For details on binding built-in cache redirection policies to the cache redirection virtual server, see
Bind policies to the cache redirection virtual server.
If an incoming request is non-cacheable, the reverse-proxy cache redirection virtual server replaces
the domain and URL in the request with the domain and URL of a target origin server and forwards
the request to the load balancing virtual server for the origin.
A mapping policy enables the reverse proxy cache redirection virtual server to replace the destination
domain and URL and forward the request to the load balancing virtual server for the origin.
A mapping policy must first translate the domain and the URL, and then pass the request on to the
origin load balancing virtual server.
A mapping policy can map a domain, a URL prefix, and a URL suffix, as follows:
• Domain mapping: You can map a domain without a prefix or suffix. The domain mapping is
the default mapping for the virtual server (for example, mapping www.mycompany.com to
www.myrealcompany.com).
• Prefix mapping: You can replace a specified pattern prefixed as part of the URL (for example,
mapping www.mycompany.com/sports/index.html to www.mycompany.com/news/index.html).
• Suffix mapping: You can replace the file suffix in the URL (for example, mapping www.mycompany.com/sport
to www.mycompany.com/sports/index.asp).
The source and the destination strings being mapped must be similar. If you specify a source domain,
you must specify a destination domain, and if you specify a source suffix, you must specify a destina-
tion suffix. Similarly, if you specify an exact URL from the source, the target URL must also be an exact
URL.
Once you configure mapping policies for the reverse proxy mode, you must bind them to the cache
redirection virtual server.
You can use combinations of the source URL, target URL, and source and target domains to configure
all three types of domain mapping.
Configure a mapping policy for reverse proxy mode by using the CLI
At the command prompt, type the following command to add a policy map and verify the configura-
tion:
1 - add policy map <mapPolicyName> -sd <string> [-su <string>] [-td <
string>] [-tu <string>]
2 - show policy map [<mapPolicyName>]
Example:
2 Done
3 > show policy map myOtherMappingPolicy
4 1) Name: myOtherMappingPolicy
5 Source Domain: www.mycompany.com Source Url: /news.html
6 Target Domain: www.myrealcompany.com Target Url: /realnews.
html
7 Done
Configure a mapping policy for reverse proxy mode by using the GUI
3. In the Create Map Policy dialog box, specify values for the following parameters as shown:
• Name*- mapPolicyName
• Source Domain*-sd
• Target Domain*-td
• Source URL-su
• Target URL-tu
*A required parameter
4. Click Create, and then click Close. The Map pane displays the new mapping policy.
Bind the mapping policy to the cache redirection virtual server by using the CLI
At the command prompt, type the following commands to bind the mapping policy to the cache redi-
rection virtual server and verify the configuration:
Example:
Bind the mapping policy to the cache redirection virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Selective cache redirection sends requests for particular types of content, for example, images, to one
cache server or group of cache servers and sends other types of content to a different cache server or
group of cache servers. You can configure advanced cache redirection in transparent, reverse proxy,
or forward proxy modes.
In selective cache redirection, the NetScaler appliance intercepts a client request and forwards non-
cacheable requests to the original destination in the client request. For cacheable requests, the appli-
ance sends the requests to the destination cache server that can serve content of a specific content
type.
Selective cache redirection involves configuring content switching policies in addition to cache redi-
rection policies. The appliance first evaluates the cache redirection policies that are bound to the
cache redirection virtual server. If a request matches a cache redirection policy, the cache redirec-
tion virtual server sends the request to the origin server or a load balancing virtual server for the ori-
gin. If no cache redirection policies match the request, the appliance evaluates the content switching
policies bound to the cache redirection virtual server. If a content switching policy matches the re-
quest, the cache redirection virtual server redirects the request to a load balancing virtual server for
the cache.
To configure selective cache redirection, first enable cache redirection, load balancing, and content
switching on the NetScaler appliance. Then, configure a load balancing virtual server for the cache
and an associated HTTP service. After this, configure a cache redirection virtual server and bind both
the cache redirection and content switching policies to it. Once you have bound the policies, you can
configure the virtual server to give precedence to either rule based or URL based content-switching
policies.
When configured for transparent mode cache redirection in an edge deployment topology, the appli-
ance sends all cacheable HTTP traffic to a transparent cache farm. Clients access the Internet through
the appliance, which is configured as a Layer 4 switch that receives traffic on port 80.
The appliance can direct requests for images (for example, .gif and .jpg files) to one server in the trans-
parent cache farm, and all other requests for static content to other servers in the farm. For this con-
figuration, you configure content switching policies to send images to the image cache and send all
other cacheable content to a default cache.
Note
The configuration described here is for transparent selective cache redirection. Therefore, it does
not require a load balancing virtual server for the origin, as would a reverse proxy configuration.
To configure this type of selective cache redirection, first enable cache redirection, load balancing,
and content switching. Then, configure a load balancing virtual server for the cache and configure an
associated HTTP service. Then, configure a cache redirection virtual server and create and bind both
cache redirection and content switching policies to this virtual server.
For details on how to enable cache redirection and load balancing on the appliance, see Enable cache
redirection and load balancing.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
To configure selective cache redirection, after you enable both the load balancing and cache redirec-
tion features on the appliance, you must enable content switching.
1 - enable ns feature CS
2
3 - show ns feature
Example:
3. In Configure Basic Features dialog box, select the check box next to the Content Switching, and
then click OK.
4. In Enable/Disable Feature(s)? dialog box, click Yes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Create a load balancing virtual server and an HTTP service for each type of cache server that will be
used. For example, if you want to serve JPEG files from one cache server and GIF files from another
cache server, and use a third cache server for the rest of the content, create an HTTP service and
virtual server for each of the three types of cache servers. Then bind each service to its respective
virtual server.
For details on how to create a load balancing virtual server, see Create a load balancing virtual server.
For details on how to configure services that represent the cache server, see Configure an HTTP ser-
vice.
For details on how to bind the service to a virtual server, see Bind/unbind a service to/from a load
balancing virtual server.
For details on how to create a transparent proxy cache redirection server, see Configure a cache redi-
rection virtual server, and create a virtual server of type TRANSPARENT.
For details on binding built-in cache redirection policies to the cache redirection virtual server, see
Bind policies to the cache redirection virtual server.
To identify requests that contain a .gif or .jpeg extension as cacheable, you configure a cache redirec-
tion policy and bind it to the cache redirection virtual server.
Note
If a request matches a policy, the NetScaler appliance forwards it to the origin server. As a result,
in the following procedure, you configure policies to match requests that do
not have “.gif” or “.jpeg” extensions.
To configure cache redirection for a specific type of content, configure a policy that uses a simple
expression, as described in Configure a cache redirection policy.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
You must create a content switching policy to identify specific types of content to be cached in one
cache server or farm and identify other types of content to serve from another cache server or farm.
For example, you can configure a policy to determine the location for image files with .gif and .jpeg
extensions.
After defining the content switching policy, you bind it to a cache redirection virtual server and spec-
ify a load balancing virtual server. Requests that match the policy are forwarded to the named load
balancing virtual server. Requests that do not match the content switching policy are forwarded to
the default load balancing virtual server for the cache.
For more details about the content switching feature and configuring content switching policies, see
Content switching.
You must first create the content switching policy and then bind it to the cache redirection virtual
server.
Examples:
3. In the Create Content Switching Policy dialog box, in the Name text box, type a name for the
policy.
5. In the Create Expression dialog box, choose the expression syntax that you want to use.
• If you want to use default syntax, accept the default and proceed to the next 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. The default syntax Ex-
pression view has fewer elements than does the classic syntax Expression view. In the default
syntax Expression view, instead of a preview window, a button provides access to an expres-
sion evaluator. The evaluator evaluates the expression you entered, to verify that it is valid, and
displays an analysis of the expression’s effect.
For information about using the advanced syntax, see Configure advanced policy expression:
Get started.
7. Click Create and click Close. The policy you created appears in the Content Switching Policies
pane.
Bind the content switching policy to a cache redirection virtual server by using the CLI
At the command prompt, type the following commands to bind the content switching policy to a cache
redirection virtual server and verify the configuration:
Example:
Bind the content switching policy to a cache redirection virtual server by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
You can configure a content switching policy based on either a rule, which is a generic configuration to
accommodate various content types, or a URL, which is more specific and defines exactly the type of
content that has to be sent to a particular cache server. Essentially, the same content can be defined
by either a rule based policy or a URL based policy.
Once you bind content switching policies of either type to a cache redirection virtual server, you can
configure the virtual server to give precedence to either rule based or URL based policies. This will, in
turn, decide which servers the particular requests are directed to.
To configure precedence for policy evaluation, use the precedence parameter, which specifies the type
of policy (URL or RULE) that takes precedence on the content redirection virtual server.
At the command prompt, type the following commands to configure precedence for policy evaluation
and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
To administer a cache redirection virtual server, you need to view cache redirection statistics. You
might need to enable or disable cache redirection servers, or direct policy hits to the cache instead of
the origin. Administrative tasks also include backing up a cache redirection virtual server and manag-
ing client connections.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
You can view properties of a cache redirection virtual server and statistics on the traffic that has passed
through a cache redirection virtual server. You can also view the cache redirection virtual servers and
policies that you have bound to load balancing virtual servers.
To view statistics for a specific cache redirection virtual servers, use the name parameter to specify
the name of the virtual server for which statistics will be displayed. Otherwise, statistics for all cache
redirection virtual servers are displayed. Maximum Length: 127
View statistics for a cache redirection virtual server by using the CLI
Example:
View statistics for a cache redirection virtual server by using the GUI
2. In the details pane, select the virtual server for which you want to view statistics, (for example,
Vserver-CRD-1), and then click Statistics.
Omit the server name to display basic statistics for all cache redirection virtual servers. Include the
server name to display detailed statistics for that virtual server, including number and size of requests
and responses that pass through the virtual server
View the statistics of a cache redirection virtual server by using the monitoring and
dashboard utilities
1. To view the statistics by using the monitoring utilities, click the Monitoring tab.
2. In the Select Group drop-down menu, choose CR Virtual Servers. A list of cache redirection
virtual servers appears.
3. To view the statistics by using the dashboard utilities, click the Dashboard tab.
4. Click Applet Client or Web Start Client next to Statistical Utility.
5. In the Select Group drop-down menu, choose CR Virtual Servers. The dashboard displays sum-
mary statistics for the cache redirection virtual servers.
6. To see a chart of virtual server activity, click Chart. A graphical representation of the virtual
server statistics appears.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
When you create a cache redirection virtual server, it is enabled by default. If you disable a cache
redirection virtual server, its state changes to OUT OF SERVICE and it stops redirecting cacheable client
requests. However, the NetScaler appliance continues to respond to ARP and ping requests for the IP
address of this virtual server.
Examples:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
By default, when a request matches a policy, the NetScaler appliance forwards the request either to
the origin server directly, or to a load balancing virtual server for the origin, depending on how you
have configured cache redirection.
You can change the default behavior so that when a request matches a policy, the request is forwarded
to a load balancing virtual server for the cache.
To change the destination for a policy hit to the origin or the cache, use the onPolicyMatch parameter,
which specifies where to send requests that match the cache redirection policy.
Note
For this option to work, you must select the cacheredirection type as POLICY.
Change the destination for a policy hit to the origin or the cache by using the CLI
At the command prompt, type the following commands to change the destination for a policy hit and
verify the configuration:
Example:
Change the destination for a policy hit to the origin or the cache by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Cache redirection can fail if the primary virtual server fails, or if it is unable to handle excessive traffic.
You can specify a backup virtual server to take over the processing of traffic when the primary virtual
server fails.
To specify a backup cache redirection virtual server, use the backupVServer parameter, which specifies
Backup Virtual Server. Maximum Length: 127
At the command prompt, type the following commands to specify a backup cache redirection virtual
server and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
You can configure timeouts on a cache redirection virtual server so that client connections are not kept
open indefinitely. You can also insert Via headers in requests. To possibly reduce network congestion,
you can reuse open TCP connections. You can enable or disable delayed cleanup of cache redirection
virtual server connections.
You can configure the appliance to send ICMP responses to PING requests according to your settings.
On the IP address corresponding to the virtual server, set the ICMP RESPONSE to VSVR_CNTRLD, and
on the virtual server, set the ICMP VSERVER RESPONSE.
• When you set ICMP VSERVER RESPONSE to PASSIVE on all virtual servers, appliance always re-
sponds.
• When you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, appliance responds
even if one virtual server is UP.
• When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others, appliance
responds even if one virtual server set to ACTIVE is UP.
You can specify expiration of client requests by setting a timeout value for the cache redirection virtual
server. The timeout value is the number of seconds for which the cache redirection virtual server waits
to receive a response for the client request.
To configure a time-out value, use the cltTimeout parameter, which specifies the time, in seconds,
after which the NetScaler appliance closes any idle client connections. The default value is 180sec for
HTTP/SSL-based services and 9000sec for TCP-based services.
At the command prompt, type the following commands to configure client timeout and verify the
configuration:
Example:
A Via header lists the protocols and recipients between the start and end points for a request or a
response and informs the server of proxies through which the request was sent. You can configure
the cache redirection virtual server to insert a Via header in each HTTP request. The via parameter is
enabled by default when you create a cache redirection virtual server.
To enable or disable Via-header insertion in client requests, use the via parameter, which specifies the
state of the system in inserting a Via header in the HTTP requests.
Default value: ON
Example:
13
14 1) Cache bypass Policy: bypass-cache-control
15 2) Cache bypass Policy: Policy-CRD
16 Done
17 >
You can configure the NetScaler appliance to reuse TCP connections to the cache and origin servers
across client connections. This can improve performance by saving the time required to establish a
session between the server and the appliance. The reuse option is enabled by default when you create
a cache redirection virtual server.
To enable or disable the reuse of TCP connections, use the reuse parameter, which specifies the state
of reuse of TCP connections to the cache or origin servers across client connections.
Default value: ON
Example:
5 State: UP ARP:DISABLED
6 Client Idle Timeout: 6000 sec
7 Down state flush: ENABLED
8 Disable Primary Vserver On Down : DISABLED
9 Default: Content Precedence: URL Cache: TRANSPARENT
10 On Policy Match: CACHE L2Conn: OFF OriginUSIP: OFF
11 Redirect: POLICY Reuse: ON Via: ON ARP: OFF
12 Backup: Vserver-CRD-2
13
14 1) Cache bypass Policy: bypass-cache-control
15 2) Cache bypass Policy: Policy-CRD
16 Done
The down state flush option performs delayed cleanup of connections on a cache redirection virtual
server. The down state flush option is enabled by default when you create a cache redirection virtual
server.
To enable or disable the down state flush option, set the downStateFlush parameter.
Enable of disable the down state flush option by using the CLI
At the command prompt, type the following commands to configure delayed connection clean up and
verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
January 6, 2019
Contributed by:
C
To efficiently handle large amounts of cached data, typically several gigabytes per second, an Internet
Service Provider (ISP) deploys several dedicated cache servers. The cache redirection feature of the
NetScaler appliance can help load balance the cache servers, but a single appliance or a couple of
appliances might not efficiently handle the large volume of traffic.
You can solve the problem by deploying the NetScaler appliances in two tiers (layers), where the ap-
pliances in the upper tier load balance those in the lower tier and the appliances in the lower tier load
balance the cache servers. This arrangement is called n-tier cache redirection.
For purposes such as auditing and security, an ISP has to track client details such as the IP address,
information provided, and the time of the interaction. Therefore, client connections through a
NetScaler appliance have to be fully transparent. However, if you configure transparent cache
redirection, with the NetScaler appliances deployed in parallel, the IP address of the client has to
be shared among all the appliances. Sharing of the client IP address creates a conflict that makes
network devices, such as routers, cache servers, origin servers, and other NetScaler appliances,
unable to determine the appliance, and therefore the client, to which the response should be sent.
To solve the problem, appliance n-tier cache redirection splits the source port range among the ap-
pliances in the lower tier and includes the client IP address in the request sent to the cache servers.
The upper-tier NetScaler appliances are configured to do sessionless load balancing in order to avoid
unnecessary load on the appliances.
When the lower-tier NetScaler appliance communicates with a cache server, it uses a mapped IP ad-
dress (MIP) to represent the source IP address. Therefore, the cache server can identify the appliance
from which it received the request and send the response to the same appliance.
The lower-tier NetScaler appliance inserts the client IP address into the header of the request sent to
the cache server. The client IP in the header helps the appliance to determine the client to which the
packet should be forwarded when it receives the response from a cache server, or the origin server in
case of a cache miss. The origin server determines the response to be sent according to the client IP
inserted in the request header.
The origin server sends the response to an upper-tier appliance, including the source port number
from which the origin server received the request. The entire source port range, 1024 to 65535, is dis-
tributed among the lower-tier NetScaler appliances. Each lower-tier appliance is exclusively assigned
a group of addresses within the range. This allotment enables the upper-tier appliance to unambigu-
ously identify the lower-tier NetScaler appliance that sent the request to the origin server. The upper-
tier appliance can therefore forward the response to the correct lower-tier appliance.
The upper-tier NetScaler appliances are configured to do policy-based routing, and the routing poli-
cies are defined to determine the IP address of the destination appliance from the source port range.
The following setup is necessary for the functioning of n-tier cache redirection:
• Configure the cache redirection port range on the appliance. Assign an exclusive range to each
lower-tier appliance.
• Configure a load balancing virtual server and enable MAC-based redirection.
• Create a service for each cache server that is to be load balanced by this appliance. When creat-
ing the service, enable insertion of client IP in the header. Then, bind all the services to the load
balancing virtual server.
• Configure a transparent mode cache redirection virtual server with the following settings:
– Enable the Origin USIP option.
– Add a source IP expression to include the client IP in the header.
– Enable the Use Port Range option.
The following figure shows how cache redirection works when a client request is cacheable and the
response is sent from a cache server.
Two NetScaler appliances, L1NS1 and L1NS2, are deployed in the upper tier, and four NetScaler ap-
pliances, L2NS1, L2NS2, L2NS3, and L2NS4, are deployed in the lower tier. Client A sends a request,
which is forwarded by the router. Cache servers CRS1, CRS2, and CRS3 service the cache requests.
Origin Server O services the uncached requests.
Traffic flow
The following figure shows how cache redirection works when a client request is sent to an origin
server for a response.
Two NetScaler appliances, L1NS1 and L1NS2, are deployed in the upper tier, and four NetScaler ap-
pliances, L2NS1, L2NS2, L2NS3, and L2NS4, are deployed in the lower tier. Client A sends a request,
which is forwarded by the router. Cache servers CRS1, CRS2, and CRS3 service the cache requests.
Origin Server O services the uncached requests.
Traffic flow
The following figure shows how cache redirection works when a client request is not cached.
Two NetScaler appliances, L1NS1 and L1NS2, are deployed in the upper tier, and four NetScaler ap-
pliances, L2NS1, L2NS2, L2NS3, and L2NS4, are deployed in the lower tier. Client A sends a request,
which is forwarded by the router. Cache servers CRS1, CRS2, and CRS3 service the cache requests.
Origin Server O services the uncached requests.
Traffic flow
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Configure an upper-tier appliance for n-tier cache redirection by using the command
CLI
Configure an upper-tier appliance for n-tier cache redirection by using the GUI
1. Enable L3 mode:
a) In the navigation pane, click System, and then click Settings.
b) In the Settings group, click the Configure modes link.
c) Select the Layer 3 Mode (IP Forwarding) check box.
d) Click OK.
2. Configure policy-based routing (PBR):
a) Navigate to System > Network > PBRs.
b) In the Policy-Based Routing (PBRs) pane, click Add.
c) Type a name for the PBR.
d) Select the action as Allow.
e) In the Next Hop box, type the IP address of the service, which represents a lower-tier ap-
pliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Cache Redirection
Contributed by:
C
Configure a lower-tier appliance for n-tier cache redirection by using the CLI
Configure a lower-tier appliance for n-tier cache redirection by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Clustering
Contributed by:
C
Note
A NetScaler cluster is a group of nCore appliances working together as a single system image. Each
appliance of the cluster is called a node. The cluster can have one appliance or as many as 32 NetScaler
nCore hardware or virtual appliances as nodes.
The client traffic is distributed between the nodes to provide high availability, high throughput, and
scalability.
To create a cluster, you must add the appliances as cluster nodes, set up communication between
the nodes, set up links to the client and server networks, configure the appliances, and configure the
distribution of client and server traffic.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
The following table lists the NetScaler appliance configurations that are not supported in NetScaler
10 and also gives the status of the features in subsequent releases.
Important
• Unless specified otherwise in this table, all NetScaler appliance features are supported in a
cluster.
• The “Node-level” entry in the table indicates that the feature is supported only on individual
cluster nodes.
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
SSL FIPS No No No No No No
SSL No No No No No No
Certificate
Bundle
Content No Yes Yes Yes Yes Yes
switching
actions;
Note: The
content
switching
feature is
supported
from
NetScaler
10.1
onwards.
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Cluster Con-
figuration 10 10.1 10.5 11.0 11.1 12.0
Load balancing, load balancing persistency, DNS load balancing, SIP, maxClient, Spillover (connec-
tion and dynamic), Spillover based on bandwidth, DataStream, Compression control, Content filter-
ing, TCP buffering, Cache redirection, Distributed Denial-of-Service (DDoS), Client Keep-alive, Basic
networking (IPv4 and IPv6), OSPF (IPv4 and IPv6), RIP (IPv4 and IPv6), RIP (IPv4 and IPv6), VLAN,
ICMP, Fragmentation, MBF, ACL, Simple ACL, MSR, Path MTU discovery, IP-IP, SNMP, Policies (clas-
sic and advanced), Rewrite, Responder, HTTP callout, Web server logging, Audit logging (nslog and
syslog), USIP, Location commands, HTML injection, NITRO API, AppExpert, KRPC.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
October 9, 2018
Contributed by:
C
NetScaler appliances that are to be added to a cluster must satisfy the following criteria:
• All appliances must have the same software version and build.
• All appliances must be of the same platform type. This means that a cluster must have either all
hardware appliances (MPX) or virtual appliances (VPX) or SDX NetScaler appliance instances.
Note
– For a cluster of hardware appliances (MPX), the appliances must be of the same model
type.
– For the formation of the heterogeneous cluster, all appliances must be of MPX platform
type.
– For a cluster of virtual appliances (VPX), the appliances must be deployed on the fol-
lowing hypervisors: XenServer, Hyper-V, VMware ESX, and KVM.
– Clusters of SDX NetScaler appliance instances are supported in NetScaler 10.1 and later
releases. To create a cluster of SDX NetScaler appliance instances, see “Set up a cluster
of Citrix NetScaler instances”.
– Jumbo frames are supported on a NetScaler cluster that is made up of NetScaler ap-
pliance SDX instances.
• All appliances must have the same licenses. Also, depending on the NetScaler appliance ver-
sion, there are some additional aspects to address:
Note
For a cluster of virtual appliances, that has large configurations, it is recommended to use 6 GB
RAM for each node of the cluster.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Cluster overview
January 6, 2019
Contributed by:
C
A NetScaler cluster is formed by grouping NetScaler appliances together. Based on the network lo-
cation of the NetScaler appliances that you intend adding to the cluster, you must be aware of the
following cluster setups:
Note
Unless specified otherwise, cluster features and configurations are the same for L2 and L3 clus-
ters.
• L2 cluster: In this cluster deployment, all cluster nodes belong to the same network.
• L3 cluster (also referred to as ‘cluster in INC mode’): In this cluster deployment, cluster nodes
can belong to different networks. The cluster nodes from a specific network must be grouped
into nodegroups that include only nodes from that network. From the following figure, we see
that nodes n1, n2, n3 are in the same network and are grouped into Nodegroup1.
Similarly, the case for nodes n4 and n5, that are grouped in Nodegroup2. In the third network,
there are two nodegroups. Nodegroup3 includes n6 and n7 and Nodegroup4 includes n8 and
n9.
Note
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
All configurations on a NetScaler cluster are performed on the cluster IP address, which is the man-
agement address of the cluster. This cluster IP address is owned by a cluster node that is referred to
as the cluster configuration coordinator as shown in the following figure:
The configurations that are available on the configuration coordinator are automatically propagated
to the other cluster nodes and therefore all cluster nodes have the same configurations.
• The following commands when executed on the cluster IP address are not propagated to other
cluster nodes:
– shutdown. Shuts down only the configuration coordinator.
– reboot. Reboots only the configuration coordinator.
– rm cluster instance. Removes the cluster instance from the node that you are executing
the command on.
• For a command to propagate to other cluster nodes:
– The quorum must be configured on cluster instance.
– The majority of the cluster quorum with (n/2 + 1) of the cluster nodes must be active for
the cluster to be operational.
– A cluster can run with a minimum number of nodes when majority rule (n/2 + 1) is relaxed.
When a node is added to a cluster, the configurations and the files (SSL certificates, licenses, DNS,
and so on) that are available on the cluster configuration coordinator are synchronized to the newly
added cluster node. When an existing cluster node, that was intentionally disabled or that had failed,
is once again added, the cluster compares the configurations available on the node with the configu-
rations available on the configuration coordinator. If there is a mismatch in configurations, the node
is synchronized by using one of the following:
• Full synchronization. If the difference between configurations exceeds 255 commands, all the
configurations of the configuration coordinator are applied to the node that is rejoining the clus-
ter. The node remains operationally unavailable for the duration of the synchronization.
• Incremental Synchronization. If the difference between configurations is less than or equal
to 255 commands, only the configurations that are not available are applied to the node that is
rejoining the cluster. The operational state of the node remains unaffected.
Note
You can also manually synchronize the configurations and files. For more information, see “
Synchronizing Cluster Configurations” and “
Synchronizing Cluster Files”.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
By virtue of command propagation, all nodes in a cluster have the same configurations. However,
you may want some configurations to be available only on certain cluster nodes. While you cannot
restrict the nodes on which the configurations are available, you can specify the nodes on which the
configurations are active.
Depending on the number of nodes the configurations are active on, cluster configurations are re-
ferred to as striped, partially striped, or spotted configurations.
Figure 1. Three-node cluster with striped, partially striped, and spotted configurations
Note
When you disable USIP, Citrix recommends you to use spotted SNIP addresses. You can use
striped SNIP addresses only if there is a shortage of IP addresses. The use of striped IP addresses
can result in ARP flux issues if no spotted IP addresses are present in the same subnet for ARP
resolution.
When you enable USIP, Citrix recommends you to use striped SNIP addresses as a gateway for
server initiated traffic.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
The interfaces of NetScaler appliances that are added to a cluster, are prefixed with a node ID. This
helps identify the cluster node to which the interface belongs. Therefore, the interface identifier c/u,
where c is the controller number and u is the unit number, now becomes n/c/u, where n is the node
ID. For example, in the following figure, interface 1/2 of node n1 is represented as 0/1/2, interface 1/1
of node n2 is represented as 1/1/1, and interface 1/4 of node n3 is represented as 2/1/4.
• Server communication-
The cluster communicates with the server through the physical connections between the cluster
node and the server-side connecting device. The logical grouping of these physical connections
is called the server data plane.
• Client communication- The cluster communicates with the client through the physical connec-
tions between the cluster node and the client-side connecting device. The logical grouping of
these physical connections is called the client data plane.
• Inter-node communication- The cluster nodes can also communicate with each other. The
manner in which they communicate depends on whether the node exists on the same network
or across networks.
– Cluster nodes within the same network communicate with each other by using the cluster
backplane. The backplane is a set of interfaces in which one interface of each node is con-
nected to a common switch, which is called the cluster backplane switch. The different
types of traffic that goes through backplane, which is used by internode communication
are:
The following figures shows the communication interfaces in L2 clusters and L3 clusters.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
In a cluster setup, external networks view the collection of NetScaler appliances as a single entity. So,
the cluster must select a single node that must receive the traffic. The cluster does this selection by
using Equal Cost Multiple Path (ECMP) or cluster link aggregation traffic distribution mechanism. The
selected node is called the flow receiver.
Note
For an L3 cluster (nodes across different networks), only ECMP traffic distribution can be used.
The flow receiver gets the traffic and then, using internal cluster logic determines the node that must
process the traffic. This node is called the flow processor. The flow receiver steers the traffic to the flow
processor over the backplane (if the flow receiver and the flow processor are on the same network) or
through the tunnel (if the flow receiver and the flow processor are on different networks).
Note
• The flow receiver and flow processor must be nodes capable of serving traffic.
• From NetScaler 11 onwards, you can disable steering on the cluster backplane. For more
Cluster nodegroups
January 6, 2019
Contributed by:
C
Note
• To define spotted and partially striped configurations. For more information, see “Nodegroups
for Spotted and Partially-Striped Configurations”.
• To configure redundancy of nodegroups. For more information, see “Configuring Redundancy
for Nodegroups”.
Note: Supported from NetScaler 10.5 Build 52.1115.e onwards.
• To define an L3 cluster (also called a cluster in INC mode). In an L3 cluster, cluster nodes can be
from different networks. You must group nodes that belong to a network in a single nodegroup.
For example, if n1, n2, n3 are in network1 and n4, n5, n6 are in network2, then NG1 must include
nodes of network1 and NG2 must include nodes of network2. For setting up an L3 cluster, see
“Creating a NetScaler cluster”.
Note
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
For a cluster to be functional, a majority of the nodes (n/2 + 1) must be operationally active (operational
state is ACTIVE). Check table below.
Important
From NetScaler release 10.5, you can configure the cluster to be functional even when the major-
ity criteria is not satisfied. This configuration must be performed when creating a cluster.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Routing in a cluster
Contributed by:
C
Routing in a cluster works in much the same way as routing in a standalone system. A few points to
note:
• All routing configurations must be performed from the cluster IP address and the configurations
are propagated to the other cluster nodes.
• Routes are limited to the maximum number of ECMP routes supported by the upstream router.
1 !
2 interface vlan97
3 !
4 router ospf
5 owner-node 0
6 ospf router-id 97.131.0.1
7 exit-owner-node
8 owner-node 1
9 ospf router-id 97.131.0.2
10 exit-owner-node
11 owner-node 2
12 ospf router-id 97.131.0.3
13 exit-owner-node
14 redistribute kernel
15 network 97.0.0.0/8 area 0
16 !
• Retrieve node-specific routing configurations by specifying the node(s) in the owner-node argu-
ment as follows:
1 > vtysh
2 ns# owner-node 0 1
3 ns(node-0 1)# show cluster state
4 ns(node-0 1)# exit-owner-node
• Clear node-specific routing configurations by specifying the node(s) in the owner-node argu-
ment as follows:
1 > vtysh
2 ns# owner-node 0 1
3 ns(node-0 1)# clear config
4 ns(node-0 1)# exit-owner-node
• Routing protocol daemons can run and adjacencies can be formed on active and inactive nodes
of a cluster.
• Only active nodes advertise host routes to striped VIP addresses. Spotted VIP addresses are
advertised by active owner node.
• Active and inactive nodes can learn dynamic routes and install them into the routing table.
• Routes learnt on a node are propagated to other nodes in the cluster only if route propagation
is configured. This is mostly needed in asymmetric topologies where the unconnected nodes
may not be able to form adjacencies.
Note*
Make sure that route propagation is not configured in a symmetric cluster topology as it
can result in making the node unavailable to the cluster.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
CLIP address. An IP address owned by the cluster coordinator node (CCO). The CLIP address can float
between different nodes in a cluster setup. If the CLIP is moved to a different node of the cluster, that
node becomes the CCO. The CCO is the NetScaler appliance that is responsible for management tasks
in the cluster. A network administrator uses the CLIP address to connect to the cluster to perform
configuration and management tasks, such as accessing unified GUI, reporting, tracing packet flow,
and collecting logs. The CCO node does not have an NSIP address. Only configurations performed on
the CCO through the cluster IP address are propagated to other nodes in the cluster.
Striped IP address. A logical IP address available on all nodes of the cluster, it can be either a VIP or
SNIP address.
Spotted IP address. A logical IP (preferably SNIP address) is available only on one node. A spotted
IP address has visibility on only that node. To minimize traffic-steering overhead, Citrix recommends
that you use spotted SNIP address for backend communication with the server.
For example, in a four-node cluster group, you must configure each node with a spotted SNIP address.
For more information on how to configure a spotted IP configuration, see Striped, Partially Striped,
and Spotted Configurations.
You can define a SNIP address to be active on only one node, or active on all nodes. If a virtual IP
address and Subnet IP address is available only on a specific node, it is of spotted configuration or if
the Subnet IP address and Virtual server IP address are available on all nodes, it is defined as striped
configuration.
Note
In a four-node cluster setup, you must configure a spotted SNIP address on each node. For more
information about configuring a spotted IP configuration, see Striped, Partially Striped, and Spot-
ted Configurations.
In an L3 cluster setup, only spotted SNIP configuration is supported, as shown in the following table.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
Understanding L3 Cluster
The demand to expand the high availability deployment and increase the scalability of the client traffic
across different networks guided to establish L3 cluster. The L3 cluster lets you to group NetScaler
appliances across individual subnets (L2 cluster).
L3 cluster is also referred to as “cluster in Independent Network Configuration (INC) mode”. In L3
cluster deployment, the cluster nodes in the same network are grouped together to form a Nodegroup.
L3 cluster uses GRE tunneling to steer the packets across networks. The heartbeat messages across
L3 clusters will be routed.
This document includes the following details:
• Architecture
• Example
Architecture
• GRE Tunnel. The ** packets between nodes in a L3 cluster are exchanged over an unencrypted
GRE tunnel that uses the NSIP addresses of the source and destination nodes for routing. The
steering mechanism will change for nodes belonging to different network. The packets are
steered through a GRE tunnel to the node on the other subnet, instead of rewriting the MAC.
Example
• Three NetScaler appliances (n1, n2, and n3) nodes are grouped together into Nodegroup1.
• Similarly, the nodes n4 and n5 are grouped in Nodegroup2. In the third network, there are two
nodegroups. Nodegroup3 includes n6 and n7 and Nodegroup4 includes n8 and n9.
• The NetScaler appliances that belong to the same network are combined together to form a
Nodegroup.
• The backplane is not mandatory while configuring L3 subnets. If the backplane is not specified,
the node will not go to backplane fail state.
Note
If you have some cluster nodes in the L2 network, it is mandatory to enable steering on the
cluster backplane, else the nodes will go to backplane fail state.
• The external traffic distribution in L3 cluster supports only Equal Cost Multiple Path (ECMP).
• The following parameters are processed when steering is disabled is an L3 cluster deployment:
– ICMP errors
– Fragmentation
– Striped SNIPs or MIPs
• The entities (route, route6, pbr, and pbr6) can be bound to configuration nodegroup.
• The cluster nodes should not be added to a config nodegroup via “add cluster node” command.
• The “clear config extended+” command will not clear the entities (route, route6, pbr,
pb6, rnat, IP tunnel, ip6tunnel). These entities should be cleared when an “add cluster instance
–INC enabled” command is configured.
Configuring L3 Cluster
In an L3 cluster configuration, the cluster command has different attributes to configure that is based
on nodes, and nodegroups. The L3 cluster configuration also includes an IPv6 profile apart from IPv4
profiles.
save ns config
reboot -warm
Note
24
25 > add cluster nodegroup ng2
26
27 Done
28
29 > add cluster node 4 2.2.2.1 ‒ state ACTIVE ‒ nodegroup ng2
30
31 Done
32
33 > add cluster node 5 2.2.2.2 ‒ state ACTIVE ‒ nodegroup ng2
34
35 Done
36
37 > join cluster -clip 1.1.1.100 -password nsroot
You must configure the cluster IP address to be advertised to the upstream router to make the cluster
configuration accessible from any subnet. The cluster IP address is advertised as a kernel route by
the dynamic routing protocols configured on a node.
• Enable the host route option of the cluster IP address. The host route option pushes the clus-
ter IP address to ZebOS routing table for kernel route redistribution through dynamic routing
protocols.
• Configuring a dynamic routing protocol on a node. A dynamic routing protocol advertises
the cluster IP address to the upstream router. For more information on configuring a dynamic
routing protocol, see Configuring Dynamic Routes.
To enable the host route option of the cluster IP Address by using the NetScaler CLI
The spotted and partially striped configurations on L3 cluster slightly differs from L2 cluster. The con-
figuration might differ from node to node as the nodes reside on different subnets. The network con-
figurations can be node specific in L3 cluster, hence you have to configure the spotted or partially
striped configurations based on the below-mentioned parameters.
To configure spotted, partially striped configurations on a NetScaler appliance over L3 cluster perform
the following tasks:
• To add a cluster ownergroup to an IPv4 static route table of the NetScaler appliance
• To add a cluster ownergroup to an IPv6 static route table of the NetScaler appliance
• To add a VLAN
The following commands are sample examples of spotted and partially striped configurations
which can be configured by using the NetScaler CLI.
Configure nodegroup
In an L3 cluster, to replicate the same set of configurations on more than one nodegroup, the following
commands are used:
• To add an IPv4 static route to the routing table of the NetScaler appliance
Sample Configuration
To support the above configuration, a new nodegroup ‘all’ has to be defined and you have to configure
the following commands:
Sample configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
NetScaler appliances that you want to add to the cluster must satisfy the criteria specified in “Prereq-
uisites for Cluster Nodes”. Before actually setting up a cluster, you must be aware of cluster basics.
For information, see “Cluster Overview”.
Forming a cluster requires you to set up inter-node communication, create the cluster (by adding the
first NetScaler appliance), and then add the other cluster nodes. Each of these steps is explained with
relevant details in subsequent topics.
Note
While there are some differences in setting up an L2 and L3 cluster, there are many similarities
too. The subsequent topics explain the setup for both cluster types while highlighting the con-
figurations that are specific to L3 clusters.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
The nodes in a cluster setup communicate with one another using the following inter-node communi-
cation mechanisms:
• Nodes that are within the network (same subnet) communicate with each other through the
cluster backplane. The backplane must be explicitly set up. See the detailed steps listed below.
• Across networks, steering of packets is done through a GRE tunnel and other node-to-node com-
munication is routed across nodes as required.
Note:
– A cluster can include nodes from different networks from NetScaler 11.0 onwards.
– In an L3 cluster deployment, packets between NetScaler appliance nodes are exchanged
over an unencrypted GRE tunnel that uses the NSIP addresses of the source and destina-
tion nodes for routing. When this exchange occurs over the internet, in the absence of
an IPSec tunnel, the NSIPs will be exposed on the internet and this could result in secu-
rity issues. Citrix advises customers to establish their own IPSec solution when using a L3
cluster.
1. Identify the network interface that you want to use for the backplane.
2. Connect an Ethernet or optical cable from the selected network interface to the cluster back-
plane switch.
For example, to use interface 1/2 as the backplane interface for node 4, connect a cable from the 1/2
interface of node 4 to the backplane switch.
• Do not use the appliance’s management interface (0/x) as the backplane interface. In a cluster,
the interface 0/1/x is read as:
0 -> node ID 0
1/x -> NetScaler appliance interface
• Backlane interfaces must not be used for the client or server data planes.
• Configure a link aggregate (LA) channel to optimize the throughput of the cluster backplane.
• Citrix recommends that you dedicate a separate switch for the backplane, so that large amounts
of traffic can be handled seamlessly.
• Backplane interfaces of all nodes of a cluster must be connected to the same switch and bound
to the same L2 VLAN.
• If you have multiple clusters with the same cluster instance ID, make sure that the backplane
interfaces of each cluster are bound to a different VLAN.
• The backplane interface is always monitored, regardless of the HA monitoring settings of that
interface.
• The state of MAC spoofing on the different virtualization platforms can affect the steering mech-
anism on the cluster backplane. Therefore, make sure the appropriate state is configured:
– XenServer - Disable MAC spoofing
– Hyper-V - Enable MAC spoofing
– VMware ESX - Enable MAC spoofing (also make sure “Forged Transmits” is enabled)
• The MTU for the cluster backplane is automatically updated. However, if jumbo frames are con-
figured on the cluster, the MTU of the cluster backplane must be explicitly configured. The value
must be set to 78 + X, where X is the maximum MTU of the client and server data planes. For ex-
ample, if MTU of server data plane is 7500 and of the client data plane is 8922, then the MTU of
cluster backplane must be set to 78 + 8922 = 9000. To set this MTU, use the following command:
• The MTU for interfaces of the backplane switch must be specified to be greater than or equal to
1578 bytes, if the cluster has features like MBF, L2 policies, ACLs, routing in CLAG deployments,
and vPath.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
To create a cluster, start by taking one of the NetScaler appliances that you want to add to the cluster.
On this node, you must create the cluster instance and define the cluster IP address. This node is
the first cluster node and is called the cluster configuration coordinator. All configurations that are
performed on the cluster IP address are stored on this node and then propagated to the other cluster
nodes.
The responsibility of configuration coordination in a cluster is not fixed to a specific node. It can
change over time depending on the following factors:
• The priority of the node. The node with the highest priority (lowest priority number) is made
the configuration coordinator. Therefore, if a node with a priority number lower than that of
the existing configuration coordinator is added, the new node takes over as the configuration
coordinator.
Note
• If the current configuration coordinator goes down. The node with the next lowest priority num-
ber takes over as the configuration coordinator. If the priority is not set or if there are multiple
nodes with the lowest priority number, the configuration coordinator is selected from one of
the available nodes.
Note
The configurations of the appliance (including SNIP addresses and VLANs) are cleared by implic-
itly executing the
clear ns config extended command. However, the default VLAN and NSVLAN are not cleared from
the appliance. Therefore, if you want the NSVLAN on the cluster, make sure it is created before
the appliance is added to the cluster.
For an L3 cluster (cluster nodes on different networks), networking configurations are not cleared
Important
HA Monitor (HAMON) on a cluster setup is used to monitor the health of an interface on each
node. The HAMON parameter should be enabled on each node to monitor the state of the inter-
face. If the operational state of the HAMON enabled interface goes down due to any reason, the
respective cluster node is marked as unhealthy (NOT UP) and that node cannot serve traffic.
1. Log on to an appliance (for example, appliance with NSIP address 10.102.29.60) that you want
to add to the cluster.
Note
3. [Only for an L3 cluster] Create a nodegroup. In the next step, the newly added cluster node must
be associated with this nodegroup.
Note
This nodegroup will include all or a subset of the NetScaler appliances that belong to the
same network.
• The nodegroup parameter must be set to the name of the nodegroup created above.
• The backplane parameter is mandatory for nodes that are associated with a node-
group that has more than one node, so that the nodes within the network can com-
municate with each other.
Example
Adding a node for an L2 cluster (all cluster nodes are in the same network).
Adding a node for an L3 cluster which includes a single node from each network. Here, you do not
have to set the backplane.
Adding a node for an L3 cluster which includes multiple nodes from each network. Here, you have to
set the backplane so that nodes within a network can communciate with each other.
Example
save ns config
reboot -warm
Verify the cluster configurations by using the show cluster instance command. Verify that the output
of the command displays the NSIP address of the appliance as a node of the cluster.
1. Log on to an appliance (for example, an appliance with NSIP address 10.102.29.60) that you
intend to add to the cluster.
2. Navigate to System > Cluster.
3. In the details pane, click the Manage Cluster link.
4. In the Cluster Configuration dialog box, set the parameters required to create a cluster. For a
description of a parameter, hover the mouse cursor over the corresponding text box.
5. Click Create.
6. In the Configure cluster instance dialog box, make sure that the Enable cluster instance check
box is selected.
7. In the Cluster Nodes pane, select the node and click Open.
8. In the Configure Cluster Node dialog box, set the State.
9. Click OK, and then click Save.
10. Warm reboot the appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
• Set up the backplane interface for the node. Check preceding topic.
• Check if the licenses that are available on the appliance match those availabe on the con-
figuration coordinator. The appliance is added only if the licenses match.
• If you want the NSVLAN on the cluster, make sure that the NSVLAN is created on the appli-
ance before it is added to the cluster.
• <Citrix recommends that you add the node as a passive node. Then, after joining the node
to the cluster, complete the node specific configuration from the cluster IP address. Run
the force cluster sync command if the cluster has only spotted IP addresses, has L3 VLAN
binding, or has static routes.
• When an appliance with a preconfigured link aggregate (LA) channel is added to a cluster,
the LA channel continues to exist in the cluster environment. The LA channel is renamed
from LA/x to nodeId/LA/x, where LA/x is the LA channel identifier.
1. Log on to the cluster IP address and, at the command prompt, do the following:
• Add the appliance (for example, 10.102.29.70) to the cluster.
add cluster node <nodeId> <IPAddress> -state <state> -backplane <
interface_name> -nodegroup <name>
Note For an L3 cluster:
– The nodegroup parameter must be set to a nodegroup that has nodes of the same
network.
* If this node belongs to the same network as the first node that was added,
then configure the nodegroup that was used for that node.
* If this node belongs to a different network, then create a nodegroup and
bind this node to the nodegroup.
* The backplane parameter is mandatory for nodes that are associated
with a nodegroup that has more than one node, so that the nodes within
the network can communicate with each other.
Example
1 ‘‘‘
2 > add cluster node 1 10.102.29.70 -state PASSIVE -backplane 1/1/1
3 ‘‘‘
• If the node is added to a cluster that has only spotted IPs, the configurations are synchro-
nized before the spotted IP addresses are assigned to that node. In such cases, L3 VLAN
bindings can be lost. To avoid this loss, either add a striped IP or add the L3 VLAN bindings.
• Define the required spotted configurations.
• Set the MTU for the backplane interface.
1 save ns config
1 reboot -warm
To join a previously added node to the cluster by using the configuration utility
If you have used the command line to add a node to the cluster, but have not joined the node to the
cluster, you can use the following procedure.
Note
When a node joins the cluster, it takes over its share of traffic from the cluster and hence an ex-
isting connection can get terminated.
1. Log on to the node that you want to join to the cluster (for example, 10.102.29.70).
2. Navigate to System > Cluster.
3. In the details pane, under Get Started, click the Join Cluster link.
4. In the Join to existing cluster dialog box, set the cluster IP address and the nsroot password of
the configuration coordinator. For a description of a parameter, hover the mouse cursor over
the corresponding text box.
5. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can view the details of the cluster instance and the cluster nodes by logging on to the cluster IP
address.
Note
When executed from the NSIP address of a cluster node that is not the configuration coordinator,
this command displays the status of the cluster on this node.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
After you have created the NetScaler cluster and performed the required configurations, you must
deploy Equal Cost Multiple Path (ECMP) or cluster Link Aggregation (LA) on the client data plane (for
client traffic) or server data plane (for server traffic). These mechanisms distribute external traffic
across the cluster nodes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
By using the Equal Cost Multiple Path (ECMP) mechanism on a cluster deployment, active cluster
nodes advertise the virtual server IP addresses. The cluster node which receives the advertised traffic
steers the traffic to the node that must process the traffic. There can be redundant steering in spot-
ted and partially striped virtual servers. Therefore, from NetScaler 11 onwards, spotted and partially
striped virtual server IP addresses advertise the owner nodes, which reduce the redundant steering.
You must have detailed knowledge of routing protocols to use ECMP. For more information, see “Con-
figuring Dynamic Routes. For more information on routing in a cluster, see “Routing in a Cluster”.
• Enable the required routing protocol (OSPF, RIP, BGP, or ISIS) on the cluster IP address.
• Bind the interfaces and the spotted IP address (with dynamic routing enabled) to a VLAN.
• Configure the selected routing protocol and redistribute the kernel routes on the ZebOS by using
the vtysh shell.
You must perform similar configurations on the cluster IP address and on the external connecting
device.
Note
• Make sure that the licenses on the cluster support dynamic routing, otherwise ECMP does
not work.
• ECMP is not supported for wildcard virtual servers since RHI needs a VIP address to adver-
tise to a router and wildcard virtual servers do not have associated VIP addresses.
As seen in the above figure, the ECMP router can reach the VIP address via SNIP0, SNIP1, or SNIP2.
3. Add a VLAN.
Example
Example
5. Add a spotted SNIP address for each node and enable dynamic routing on it.
Example
6. Bind one of the spotted SNIP addresses to the VLAN. When you bind one spotted SNIP address to
a VLAN, all other spotted SNIP addresses defined on the cluster in that subnet are automatically
bound to the VLAN.
Example
Note
You can use NSIP addresses of the cluster nodes instead of adding SNIP addresses. If so,
you do not have to perform steps 3 - 6.
Note
For VIP addresses to be advertised, RHI setting must done by using the vserverRHILevel
parameter as follows:
For OSPF specific RHI settings, there are additional settings that can be done as follows:
Use the add ns ip6 command to perform the above commands on IPv6 addresses.
8. Configure ECMP on the external switch. The following sample configurations are provided for
the Cisco® Nexus 7000 C7010 Release 5.2(1) switch. Similar configurations must be performed
on other switches.
In a cluster setup, on an owner node that has a spotted SNIP address configuration, you can now dis-
able the ownerDownResponse option. By default, the option is enabled, allowing the node to respond
to an ICMP/ARP/ICMP6/ND6 request coming from the upstream router. You can now disable this op-
tion to allow the router to monitor if a cluster node is active or inactive. When the router sends a
request, if the option is disabled, it identifies the owner node to be inactive and unavailable for traffic
distribution.
To configure ECMP for static routes traffic distribution by using the command line interface
disable
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
To configure ECMP with BGP routing protocol, perform the following steps:
1 > vtysh
2 conf t
3 router bgp 65535
4 neighbor 10.100.26.1 remote-as 65535
6. Configure BGP on the external switch. The following sample configurations are provided for
the Cisco® Nexus 7000 C7010 Release 5.2(1) switch. Similar configurations must be performed
on other switches.
3 bgp log-neighbor-changes
4 neighbor 10.100.26.14 remote-as 65535
5 neighbor 10.100.26.15 remote-as 65535
6 no auto-summary
7 dont-capability-negotiate
8 dont-capability-negotiate
9 no dynamic-capability
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
Cluster link aggregation, as the name suggests, is a group of interfaces of cluster nodes. It is an ex-
tension of NetScaler appliance link aggregation. The only difference is that, while link aggregation
requires the interfaces to be from the same device, in cluster link aggregation, the interfaces are from
different nodes of the cluster. For more information about link aggregation, see “Configuring Link
Aggregation”.
Important
• Cluster link aggregation is supported for a cluster of virtual (VPX) appliances that are de-
ployed on ESX and KVM hypervisors, with the following restrictions:
• Dedicated interfaces need to be used. This means that the interfaces must not be shared
with other virtual machines.
• If the cluster link aggregation member interfaces are manually disabled or if cluster link
aggregation itself is manually disabled, then interface power down capability is achieved
only by LACP timeout mechanism.
Note: Cluster link aggregation is not supported on VPX appliances that are deployed on
XenServer, AWS, and Hyper-V.
• Starting from 12. 0 release, cluster link aggregation is supported on NetScaler appliance
SDX appliances.
• The number of interfaces that can be bound to cluster LA is 16 (from each node), and the
maximum number of interfaces in cluster LA can be (16 * n), where n is the number of nodes
in a cluster. The total number of interfaces in cluster LA depends on the number of interfaces
for every port channel on upstream switch.
For example, consider a three-node cluster where all three nodes are connected to the upstream
switch. A cluster LA channel (CLA/1) is formed by binding interfaces 0/1/2, 1/1/2, and 2/1/2.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You must configure a static cluster LA channel on the cluster IP address and on the external connecting
device. If possible, configure the upstream switch to distribute traffic based on IP address or port
instead of MAC address.
Note
Make sure that you configure the cluster LA channel on the cluster IP address before con-
figuring link aggregation on the external switch. Otherwise, the switch will forward traffic
to the cluster even though the cluster LA channel is not configured. This can lead to loss
of traffic.
Example
Note
You must not specify the speed as AUTO. Rather, you must explicitly specify the speed as 10,
100, 1000, or 10000. Only interfaces that have the speed matching the <speed> attribute
in the cluster LA channel are added to the active distribution list.
3. Bind the required interfaces to the cluster LA channel. Make sure that the interfaces are not used
for the cluster backplane.
Example
Example
Note
You can bind the cluster LA channel to a VLAN by using the bind vlan command. The inter-
faces of the channel are automatically bound to the VLAN.
5. Configure static LA on the external switch. The following sample configurations are provided
for the Cisco® Nexus 7000 C7010 Release 5.2(1). Similar configurations must be performed on
other switches.
1
2 Global config:
3 Configure terminal
4
5 Interface level config:
6
7 interface Ethernet2/47
8 switchport
9 switchport access vlan 10
10 channel-group 7 mode on
11 no shutdown
12
13 interface Ethernet2/48
14 switchport
15 switchport access vlan 10
16 channel-group 7 mode on
17 no shutdown
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You must perform similar configurations on the cluster IP address and on the external connecting
device. If possible, configure the upstream switch to distribute traffic based on IP address or port
instead of MAC address.
Points to remember:
• Enable LACP (by specifying the LACP mode as either ACTIVE or PASSIVE).
Note
Make sure the LACP mode is not set as PASSIVE on both the NetScaler cluster and the ex-
• Specify the same LACP key on each interface that you want to be the part of the channel. For
creating a cluster LA channel, the LACP key can have a value from 5 through 8. For example, if
you set the LACP key on interfaces 0/1/2, 1/1/2, and 2/1/2 to 5, CLA/1 is created. The interfaces
0/1/2, 1/1/2, and 2/1/2 are automatically bound to CLA/1. Similarly, if you set the LACP key to 6,
CLA/2 channel is created.
On the cluster IP address, for each interface that you want to add to the cluster LA channel, type:
Note
Similarly, configure dynamic LA on the external switch. The following sample configurations are pro-
vided for the Cisco® Nexus 7000 C7010 Release 5.2(1). Similar configurations must be performed on
other switches.
1
2 Global config:
3 Configure terminal
4 feature lacp
5 Interface level config:
6
7 interface Ethernet2/47
8 switchport
9 switchport access vlan 10
10 channel-group 7 mode active
11 no shutdown
12
13 interface Ethernet2/48
14 switchport
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
A NetScaler cluster provides link redundancy for LACP to ensure that all nodes have the same partner
key.
To understand the need for link redundancy, let us consider the example of the following cluster setup
along with the accompanying cases (with attention to case 3):
In this setup, interfaces I1, I2, I3 and I4 are bound to LACP channel with KEY 5. On the partner side,
I1 and I2 are connected to Switch 1 to form a single LA channel with KEY 1. Similarly, I3 and I4 are
connected to Switch 2 to form a single LA channel with KEY 2.
Now let us consider the following cases to understand the need for link redundancy:
In this case, cluster LA on both the nodes would stop receiving LACPDUs from Key2 and would
start receiving LACPDUs from Key1. On both the nodes, cluster LA is connected to KEY 1 and I1
and I2 will be UP and channel on both the nodes would be UP.
In this case, cluster LA on both the nodes would stop receiving LACPDUs from Key1 and would
start receiving LACPDUs from Key2. On both the nodes, cluster LA is connected to Key2 and I3
and I4 will be UP and channel on both the nodes would be UP.
In this case, it is possible that cluster LA on node1 chooses Key1 as its partner and cluster LA on
node2 chooses Key2 as its partner. This means that I1 on node1 and I4 on node2 are receiving
traffic which is undesirable. This can happen because the LACP state machine is node-level and
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Configuring linksets
January 6, 2019
Contributed by:
C
Linksets must be used when some cluster nodes are not physically connected to the external network.
In such a cluster topology, the unconnected cluster nodes use the interfaces specified in the linkset to
communicate with the external network through the cluster backplane. Linksets are typically used in
scenarios when the connecting devices have insufficient ports to connect the cluster nodes.
Note
For example, consider a three node cluster where the upstream switch has only two ports available.
Using linksets, you can connect two nodes to the switch and leave the third node unconnected. In
the following figure, a linkset (LS/1) is formed by binding the interfaces 0/1/2 and 1/1/2. NS2 is the
unconnected node of the cluster.
The linkset informs NS2 that it can use interfaces 0/1/2 and 1/1/2 to communicate with the network
devices. All traffic to and from NS2 is now routed through interfaces 0/1/2 or 1/1/2.
2. Create a linkset.
Example
3. Bind the required interfaces to the linkset. Make sure the interfaces are not used for the cluster
backplane.
Example
Example
Note
You can bind the linkset to a VLAN by using the bind vlan command. The interfaces of the
linkset are automatically bound to the VLAN.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
By virtue of the default cluster behavior, all configurations performed on the cluster IP address are
available on all nodes of the cluster. However, there might be cases where you need some configura-
tions to be available only on specific cluster nodes.
You can achieve this requirement by defining a nodegroup that includes the specific cluster nodes,
and then binding the configuration to that nodegroup. This ensures that the configuration is active
only on those cluster nodes. These configurations are called partially-striped or spotted (if active only
one a single node). For more information, see Striped, Partially Striped, and Spotted Configurations.
For example, consider a cluster with three nodes. You create a nodegroup NG0 that includes node n1
and another nodegroup NG1 that includes n2 and n3. Bind load balancing virtual servers .77 to NG0
and load balancing virtual server .69 to NG1.
This means that virtual server .77 will be active only on n1 and consequently only n1 will receive traffic
that is directed to .77. Similarly, virtual server .69 will be active only on nodes n2 and n3 and conse-
quently only n2 and n3 will receive traffic that is directed to .69.
Figure 1. NetScaler cluster with nodegroups configured for spotted and partial-striped configurations
• Load balancing, content switching, cache redirection, authentication, authorization, and audit-
ing virtual servers
Note
• VPN virtual server (Supported from NetScaler 10.5 Build 50.10 onwards)
• Global Server Load Balancing (GSLB) sites and other GSLB entities (Supported from NetScaler
10.5 Build 52.11 onwards)
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Behavior of nodegroups
Contributed by:
C
Due to the interoperability of nodegroups with different NetScaler features and entities, there are
some behavioral aspects to be noted. Nodes in a nodegroup can also be backed up. Read on for more
information.
• A cluster node that belongs to a nodegroup with entities bound to it, cannot be removed.
• A cluster instance that has nodegroups with entities bound to it, cannot be removed.
• You cannot add an entity that has a dependency on another entity that is not part of the node-
group. If you need to do so, first remove the dependency. Then, add both the entities to the
nodegroup and reassociate the entities.
Examples:
– Assume you have a virtual server, VS1, whose backup is virtual server VS2. To add VS1 to
a nodegroup, first make sure that VS2 is removed as the backup server of VS1. Then, bind
each server individually to the nodegroup, and then configure VS2 as the backup for VS1.
– Assume you have a content switching virtual server, CSVS1, whose target load balancing
virtual server is LBVS1. To add CSVS1 to a nodegroup, first remove LBVS1 as the target.
Then, bind each server individually to the nodegroup, and then configure LBVS1 as the
target.
– Assume you have a load balancing virtual server, LBVS1, that has a policy which invokes
another load balancing virtual server, LBVS2. To add either one of the virtual servers, first
remove the association. Then, bind each server individually to the nodegroup, and then
reassociate the virtual servers.
• You cannot bind an entity to a nodegroup that has no nodes and that has the strict option en-
abled. Consequently, you cannot unbind the last node of a nodegroup that has entities bound
to it and that has the strict option enabled.
• The strict option cannot be modified for a nodegroup that has no nodes but has entities bound
to it.
By default, a nodegroup is designed to provide back up nodes for members of a nodegroup. If a node-
group member goes down, a cluster node that is not a member of the nodegroup dynamically replaces
the failed node. This node is called the replacement node.
Note: For a single-member nodegroup, a backup node is automatically preselected when an entity is
bound to the nodegroup.
When the original member of the nodegroup comes up, the replacement node, by default, is replaced
by the original member node.
From NetScaler 10.5 Build 50.10 onwards, however, the NetScaler appliance allows you to change this
replacement behavior. When you enable the sticky option, the replacement node is retained even
after the original member node comes up. The original node takes over only when the replacement
node goes down.
You can also disable the backup functionality. To do this, you must enable the strict option. In this
scenario, when a nodegroup member goes down, no other cluster node is picked up as a backup node.
The original node continues being part of the nodegroup when it comes up. This option ensures that
entities bound to a nodegroup are active only on nodegroup members.
Note
The strict and sticky option can be set only when creating a nodegroup.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Check NetScaler appliance Features Supported in a Cluster to see the NetScaler versions from which
GSLB, Citrix Gateway, and application firewall are supported in a cluster.
Example
3. Bind the required nodes to the nodegroup. Type the following command for each member of
the nodegroup:
Example
4. Bind the entity to the nodegroup. Type the following command once for every entity that you
want to bind:
Note
The gslbSite and service parameters are available from NetScaler 10.5 onwards.
Example
To bind virtual servers VS1 and VS2 and rate limit identifier named identifier1.
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
Note
Nodegroups can be configured such that when one nodegroup goes down, another nodegroup can
take over and process traffic. For example, when a nodegroup NG1 goes down, NG2 takes over.
Note
This functionality can be used to configure datacenter redundancy where each nodegroup is con-
figured as a datacenter.
To achieve this use case, cluster nodes must be logically grouped into nodegroups, where some node-
groups must be configured as ACTIVE and others as SPARE. The active nodegroup with the highest
priority (that is, the lowest priority number) is made operationally active and therefore serves traffic.
When a node from this operationally active nodegroup goes down, the node count of this nodegroup
is compared with the node count of the other active nodegroups in order of their priority. If a node-
group has a higher or equal node count, that nodegroup is made operationally active. Else, the spare
nodegroups are checked.
Note
The following figure shows a nodegroup setup that has nodegroup redundancy defined. NG1 is initially
the active nodegroup. When it loses one of the nodes, the spare nodegroup (NG3) with the highest
priority starts serving traffic.
2. Create the active nodegroup and bind the required cluster nodes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Note
The default behavior of a NetScaler cluster is to direct the traffic that it receives (flow receiver) to an-
other node (flow processor) that must then process the traffic. This process of directing the traffic
from flow receiver to flow processor occurs over the cluster backplane and is called steering.
If required, you can disable steering so that the process becomes local to the flow receiver and there-
fore makes the flow receiver as the flow processor. Such a configuration setup can come handy when
you have a high latency link.
Note
• For partially striped virtual servers, if the flow receiver is a non-owner node, the traffic is steered
to a owner node. If however, the flow receiver is a owner node, then steering is disabled.
• For spotted virtual servers, flow receiver is the flow processor, and hence there is no need for
steering.
Some points to remember when disabling the steering mechanism:
• Striped SNIPs are not supported as steering is disabled.
• MPTCP and FTP does not work.
• L2 mode must be disabled.
• If USIP is enabled, traffic may not reach back to the same node as the steering is disabled.
• Traffic that is directed to the cluster IP address is steered to the configuration coordinator.
• When a node joins or leaves a cluster, it is possible that more than 1/N connections will be af-
fected. This is due to the fact that a change in the nodes available, may cause the routes to be
rehashed. As a result, the traffic will be routed to another node and due to the non-availability
of steering, the traffic will not be processed.
Steering can be disabled at the individual virtual server level or at the global level. The global config-
uration takes precedence over the virtual server setting.
• Disabling backplane steering for all striped virtual servers
Configured at cluster instance level. Traffic meant for any striped virtual server will not be
steered on cluster backplane.
add cluster instance \<clId\> -processLocal ENABLED
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
NetScaler appliance configurations that are available on the configuration coordinator are synchro-
nized to the other nodes of the cluster when:
Additionally, you can forcefully synchronize the configurations that are available on the configuration
coordinator (full synchronization) to a specific cluster node. Make sure you synchronize one cluster
node at a time, otherwise the cluster can get affected.
At the command prompt of the appliance on which you want to synchronize the configurations, type:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
The cluster uses Precision Time Protocol (PTP) to synchronize the time across cluster nodes. PTP uses
multicast packets to synchronize the time. If there are some issues in time synchronization, you must
disable PTP and configure Network Time Protocol (NTP) on the cluster.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
The files available on the configuration coordinator are called cluster files. These files are automati-
cally synchronized on the other cluster nodes when the node is added to the cluster and periodically,
during the lifetime of the cluster. Additionally, you can manually synchronize the cluster files.
The directories and files from the configuration coordinator that are synchronized are:
• /nsconfig/ssl/
• /var/netscaler/ssl/
• /var/vpn/bookmark/
• /nsconfig/dns/
• /nsconfig/htmlinjection/
• /netscaler/htmlinjection/ens/
• /nsconfig/monitors/
• /nsconfig/nstemplates/
• /nsconfig/ssh/
• /nsconfig/rc.netscaler
• /nsconfig/resolv.conf
• /nsconfig/inetd.conf
• /nsconfig/syslog.conf
• /nsconfig/snmpd.conf
• /nsconfig/ntp.conf
• /nsconfig/httpd.conf
• /nsconfig/sshd_config
• /nsconfig/hosts
• /nsconfig/enckey
• /var/nslw.bin/etc/krb5.conf
• /var/nslw.bin/etc/krb5.keytab
• /var/lib/likewise/db/
• /var/download/
• /var/wi/tomcat/webapps/
• /var/wi/tomcat/conf/Catalina/localhost/
• /var/wi/java_home/lib/security/cacerts
• /var/wi/java_home/jre/lib/security/cacerts
• /nsconfig/license/
• /nsconfig/rc.conf
Tip
Files (certificates and key files) that are copied to the cluster configuration coordinator manually
(or through the shell) are not automatically available on the other cluster nodes. You must exe-
cute the “sync cluster files” command from the cluster IP address before executing a command
that depends on these file(s).
5. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can view the statistics of a cluster instance and cluster nodes to evaluate the performance or to
troubleshoot the operation of the cluster.
To view the statistics of a cluster instance by using the command line interface
To view the statistics of a cluster node by using the command line interface
Note
When executed from the cluster IP address, this command displays the cluster level statistics.
However, when executed from the NSIP address of a cluster node, the command displays node
level statistics.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can discover the appliances present in the same subnet as the current node. The required dis-
covered appliances can then be selectively added to the cluster. This operation can be performed to
either create a new cluster or to add nodes to an existing cluster.
Note
• The discover operation can be performed only through the configuration utility.
• This operation cannot discover NetScaler appliances from different networks.
• When performing this operation to add nodes to an existing cluster, the L3 VLAN configu-
rations will be cleared from the node. You must make sure to define these configurations
once the appliance is added to the cluster.
• Backplane interface - Specify the interfaces to be used as the backplane interface. This is
an optional parameter. If you do not specify this parameter, you must update it after the
node is added to the cluster.
5. Click OK.
6. Select the appliances that you want to add to the cluster.
7. Click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can temporarily remove a node from a cluster by disabling the cluster instance on that node. A
disabled node is not synchronized with the cluster configurations. When the node is enabled again,
the cluster configurations are automatically synchronized on it. For more information, see Synchro-
nization across cluster nodes.
A disabled node cannot serve traffic and all existing connections on this node are terminated.
Note
If the configurations of a disabled non-configuration coordinator node are modified (through the
NSIP address of the node), the configurations are not automatically synchronized on that node.
You must manually synchronize the configurations as described in
Synchronizing Cluster Configurations.
At the command prompt of the node that you want to disable, type:
1. On the node that you want to disable, navigate to System > Cluster, and click Manage Cluster.
2. In the Configure cluster instance dialog box, unselect the Enable cluster instance check box.
Note
To disable the cluster instance on all the nodes, perform the above procedure on the cluster
IP address.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
When a node is removed from the cluster, the cluster configurations are cleared from the node (by
internally executing the clear ns config -extended command). The SNIP addresses, MTU settings of
the backplane interface, and all VLAN configurations (except the default VLAN and NSVLAN) are also
cleared from the appliance.
Note
• If the deleted node was the cluster configuration coordinator, another node is automatically
selected as the cluster configuration coordinator, and the cluster IP address is assigned to
that node. All the current cluster IP address sessions will be invalid and you will have to
start a new session.
• To delete the whole cluster, you must remove each node individually. When you remove
the last node, the cluster IP address(es) are deleted.
• When an active node is removed, the traffic serving capability of the cluster is reduced by
one node. Existing connections on this node are terminated.
For NetScaler 10
1. Log on to the node that you want to remove from the cluster and remove the reference to the
cluster instance.
2. Log on to the cluster IP address and remove the node from which you removed the cluster in-
stance.
Make sure you do not run the rm cluster node command from the local node as this results
in inconsistent configurations between the configuration coordinator and the node.
On the cluster IP address, navigate to System > Cluster > Nodes, select the node you want to remove
and click Remove.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
To remove a node from a cluster that uses cluster link aggregation as the traffic distribution mecha-
nism, you must make sure that the node is made passive so that it does not receive any traffic and
then, on the upstream switch, remove the corresponding interface from the channel.
For detailed information on cluster link aggregation, see Using Cluster Link Aggregation.
To remove a node from a cluster that uses cluster link aggregation as the traffic
distribution mechanism
2. Set the state of the cluster node that you want to remove to PASSIVE.
3. On the upstream switch, remove the corresponding interface from the channel by using switch-
specific commands.
Note
You do not have to manually remove the nodes interface on the cluster link aggregation
channel. It is automatically removed when the node is deleted in the next step.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
If a Jumbo frame is enabled on a Cluster interface, the backplane interface should be large enough to
support the all packets in the Jumbo frame. This is achieved by setting the Maximum Transmission
Unit (MTU) of the backplane as:
To verify the above configuration, you must send a jumbo probe (of the above computational size)
to all peer nodes of a Cluster setup. If the probe does not succeed, the appliance displays a warning
message in the output of the “show cluster instance” command.
Warning
The MTU for a backplane interface must be large enough to handle all packets in the frame. It
must be equal to <MTU_VAL>. If the recommended value is not user configurable, you must re-
view the MTU value of jumbo interfaces.
|Sl. no | Member Nodes |Health |Admin State |Operation State|
|—- |—- |—- |—- |—- |
| 1 | Node ID: 1; Node IP: 10.102.53.167 | UP | Active | ACTIVE (Configuration Coordinator) |
| 2 | Node ID: 2; Node IP: 10.102.53.168 | UP | Active | Active |
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can use a route monitor to make a Cluster node dependent on the internal routing table whether
it contains or does not contain dynamically learnt route. In a Cluster system, a route monitor on each
node checks the internal routing table to ensure there is a route entry for reaching a particular network
is always present. If the route entry is not present, the state of the route monitor changes to DOWN.
In a cluster deployment, if the client-side or server side-link of a node goes down, traffic is steered to
this node through the peer nodes for processing. The steering of traffic is implemented by configuring
dynamic routing and adding static ARP entries, pointing to the special MAC address of each node, on
all the nodes. If there are a large number of nodes in a cluster deployment, adding and managing
static ARP entries with special MAC addresses on all the nodes is a cumbersome task. Now, nodes
implicitly use special MAC addresses for steering packets. Therefore, static ARP entries pointing to
special MAC addresses are no longer required to be added to the cluster nodes.
Consider a scenario where Node 1 is bound to route monitor 1.1.1.0 255.255.255.0. When a dynamic
route fails, Node 1 become INACTIVE. Health status is available in the Show Cluster Node command
by node id as show below.
1 Node ID: 1
2 IP: 10.102.169.96
3 Backplane: 1/1/2
4 Health: NOT UP
5 Reason(s): Route Monitor(s) of the node have failed
6 Route Monitor - Network: 1.1.1.0 Netmask: 255.255.255.0 State:
DOWN
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
SNMP mib is device specific information that has been configured on the SNMP agent for the purpose
of identifying a NetScaler appliance, such as appliance name, administrator, location. In a cluster
setup, you can now configure the SNMP MIB in any node by including the “ownerNode” parameter in
the set snmp mib command. Without this parameter, the set snmp mib command applies only to the
Cluster Coordinator (CCO) node.
To display the MIB configuration for a cluster node other than the CCO, include the “ownerNode” pa-
rameter in the show snmp mib command
To configure and view MIB configuration on CLIP by using the command line interface.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
In a cluster deployment of NetScaler appliances, you can use the new command “show prop status”
for faster monitoring and troubleshooting of issues related to command-propagation failure on non-
CCO nodes. This command displays up to 20 of the most recent command propagation failures on all
non-CCO nodes. You can use either the NetScaler appliance command line or the NetScaler GUI to
perform this operation after accessing them through the CLIP address or through the NSIP address of
any node in the cluster deployment.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
In a cluster, if a node leaves the system or if a node joins the system, some of the existing connections
(1/Nth connections, where N is the cluster size) at cluster level or specific virtual server level are lost.
To address the loss, you must gracefully handle the existing connections. This is done by configur-
ing “retain connections on cluster” option in the CLIP address and specifying timeout interval in the
node’s NSIP.
1. Cluster upgrade
2. New Node Addition
To upgrade a cluster, you must upgrade one node at a time. Before upgrading a node, you must set it
to passive state and then set it to active state after the upgrade. To avoid terminating existing connec-
tions when upgrading the node, shut it down gracefully with a configured timeout interval. Otherwise,
1/Nth (where N is the cluster size) of the cluster’s connections are terminated.
Note
If existing sessions are not completed within the configured timeout interval, they get terminated
after the grace time.
Following are the steps to gracefully handle nodes in a cluster upgrade scenario:
1. Consider a cluster setup of five nodes (n0, n1, n2, n3, n4).
2. Before you shut down a node, you must configure “retainConnectionsOnCluster” option to re-
tain all existing connections of this node at cluster level or virtual server level for specific time
interval.
example
On CLIP
OR
3. Now, log on to the NSIP address of node n3 and set the node n3 to PASSIVE with a timeout
internal.
Example
saveconfig
4. After the grace period expires, close all connections, shut down n3 and reboot the NetScaler
appliance.
5. Upgrade the appliance. Then, with the CLI connected to the appliance’s NSIP address, set the
node to ACTIVE.
Example
saveconfig
7. After all nodes are upgraded and set to ACTIVE, reset the retainConnectionsOnCluster option
from the CLIP address.
Example
OR
saveconfig
Note
If you have an appliance that is already serving traffic, and you want to add this appliance as a node
to a cluster without terminating its existing connections, set the option to retain existing connections
either at Global level or specific virtual sever level and save the configuration. Now set the option to
retain connections to NO, to allow existing connections from other nodes to be reassigned to the new
node.
Following are the steps to gracefully handle nodes if a node newly added:
1. You must save the existing configuration that has “retainConnectionsOnCluster” option en-
abled to retain all existing connections of this node at cluster level or virtual server level for
specific time interval.
On CLIP
set cluster instance x – retainConnectionsOnCluster YES
OR
set lb vserver xxxx –retainConnectionsOnCluster Yes
2. Add a new node n5 to the cluster setup.
3. Disable “the retainConnectionOnCluster” option to “NO” for distributing existing connections from
other nodes to the newly added node n5.
On CLIP
set cluster instance x – retainConnectionsOnCluster NO
OR
set lb vserver xxxx –retainConnectionsOnCluster NO
Note: The backplane steering depends on the type of traffic distribution mechanism (ECMP, CLAG,
and USIP) on a cluster setup. The increase in backplane steering is based on the traffic type.
To retain existing connections at the global (cluster) level by using the command line
You can retain existing connections either at global level or at a specific virtual server level. This option
is configured to retain all existing connections at global level. By default, this option is disabled.
To retain existing connections of a specific virtual server in the cluster by using the command
line
This option is configured to retain existing connections specific to a load balancing virtual server. To
retain those connections, we enable this option at the virtual server level. By default, this option is
disabled.
To set a cluster node to passive state with a gracefully timeout interval. This setting is performed in
the node’s NSIP as propagation is disabled during cluster upgrade.
1. Navigate to Configuration > System > Cluster and click Manage Cluster.
2. On the Manage Cluster page, select Retain Connections on Cluster option.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
You can test clustered appliances for IPv6 Ready Logo certification. Modified commands for testing
IPv6 core protocols, such as for ND test cases, Router Solicitation processing, and sending route adver-
tisement and router redirection messages are available in a clustered setup. Following are the IPv6
functionalities available for testing the IPv6 core protocols.
Following are the modified functionalities available to pass IPv6 core protocols, such as ND test cases,
Router Solicitation processing and sending Route advertisement and router redirection messaging in
IPv6readylogo phase2 test suite.
With these modified commands, the following configurations are supported in a clustered appliance.
For a clustered setup to pass IPv6 Ready Logo test cases, you can execute the following configurations
on the Cluster Management IP address (CLIP).
Global configuration
A global IPv6 configuration enables you to set the global IPv6 parameters (such as relearning,
routeRedirection, ndBasereachTime, nRetransmissionTime, natprefix, td, and doodad) to run the
basic IPv6 configuration.
The basic IPv6 configuration enables you to create an IPv6 address and bind to a VLAN interface. You
must perform the following configurations to test the IPv6 core protocols.
To add a VLAN to the clustered setup by using the NetScaler command line
To add another VLAN to the clustered set up by using the NetScaler command line
This command adds the global prefix as on-link prefix into RA information for subsequent Router Ad-
vertisements. At the command prompt, type:
To add IPv6 SNIP address on a VLAN by using the NetScaler command line
To display link local IPv6 address attached to VLAN by using the NetScaler command line
1 sh VLAN
Example 1
1 add vlan 2
2 add vlan 3
3 bind vlan 2 -ifnum 1/2
4 bind vlan 3 -ifnum 1/3
5 add ip6 fe80::9404:60ff:fedd:a464/64 -vlan 2 -scope link-local -type
SNIP
6 add ip6 fe80::c0ee:7bff:fede:263f/64 -vlan 3 -scope link-local -type
SNIP
7 add ip6 3ffe:501:ffff:100:9404:60ff:fedd:a464/64 -vlan 2
8 add ip6 3ffe:501:ffff:101:c0ee:7bff:fede:263f/64 -vlan 3
9 bind vlan 2 -ipAddress 3ffe:501:ffff:100:9404:60ff:fedd:a464/64
10 bind vlan 3 -ipAddress 3ffe:501:ffff:101:c0ee:7bff:fede:263f/64
Example 2
1 sh vlan
2 1) VLAN ID: 2 VLAN Alias Name:
3 Interfaces : 1/6
4 IPs :
5 3ffe:501:ffff:100:2e0:edff:fe15:ea2a/64
6 3) VLAN ID: 3 VLAN Alias Name:
7 Link-local IPv6 addr: fe80::9404:60ff:fedd:a464/64
8 Interfaces : 1/5
9 IPs :
10 3ffe:501:ffff:101:2e0:edff:fe15:ea2b/64
11 Done
To test IPv6 core protocols, you can use the following new or modified IPv6 configurations.
To set VLAN specific Router Advertisement parameters by using the NetScaler command line
To set an on-link global prefix’s configurable parameters by using the NetScaler command line
To add configurable parameters to an on-link global prefix by using the NetScaler command line
To set on-link link IPv6 prefix’s configurable parameters by using the NetScaler command line
To bind an on-link link IPv6 prefix’s configurable parameters by using the NetScaler command line
1 help sh nd6RAvariables
Example
1 > sh nd6RAvariables
2 1) Vlan : 1
3 SendAdvert : NO CeaseAdv : NO SourceLLAddress:
YES
4 UnicastOnly : NO ManagedFlag : NO OtherConfigFlag:
NO
5 CurHopLimit : 64 MaxRtrAdvInterv: 600 MinRtrAdvInterv:
198
6 LinkMTU : 0 ReachableTime : 0 RetransTimer :
0
7 DefaultLifetime: 1800 LastRAsentTime : 0 NextRAdelay :
0
8
9 2) Vlan : 2
10 SendAdvert : NO CeaseAdv : NO SourceLLAddress:
YES
11 UnicastOnly : NO ManagedFlag : NO OtherConfigFlag:
NO
12 CurHopLimit : 64 MaxRtrAdvInterv: 600 MinRtrAdvInterv:
198
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Managing heartbeat messages in a cluster is similar to managing them in a high availability (HA) con-
figuration. Nodes can send and receive heartbeat messages to and from each other on all interfaces
that are enabled. To avoid increased traffic resulting from hearbeat messages, you can now disable
the heartbeat option on node interfaces. However, the heartbeat option on the backplane interface
cannot be disabled, because it is required for maintaining connectivity among the cluster nodes.
For more information about managing heart messages, see Managing High Availability Heartbeat Mes-
sages on a NetScaler Appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
In a cluster setup, on a node has a spotted SNIP address, you can configure the ownerDownResponse
option. By default, the option is enabled, allowing the spotted IP address to respond to PING or ARP
requests (coming from the upstream router) when the node is inactive. If you disable the option, the
IP address cannot respond to the router requests when the owner node is inactive.
To know how this feature is used for monitoring static routes in ECMP deployment, see Using Equal
Cost Multiple Path (ECMP) topic.
Example
1. Navigate to System > Network > IPs and click Add to create a spotted SNIP address.
2. On the Create IP Address page, select or clear the ownerDownResponse check box.
Navigate to System > Network > IPs, select an IP address, and click Edit to select or clear the own-
erDownResponse check box.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
In a cluster set up with MSR option enabled on the route, only active nodes can probe to a static route
and reach a network while inactive and spare nodes have no link to the route and cannot probe to it.
You can now configure an inactive or spare node to send PING and ARP probe to IPv4 route and send
ping6 and nd6 probe to IPv6 route. You can perform this only in a Spotted Cluster configuration in
which the SNIP address is active and owned exclusively only by one node.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
When you migrate a high availability (HA) setup to a cluster setup, all configurations must be compat-
ible and must be supportable in the cluster. To achieve this, you can now configure virtual router IDs
(VRIDs and VRID6s) on a node interface.
Important: Currently, only a single-node active cluster system supports VRIDs and VRID6s.
For instructions for configuring VRIDs and VRID6s, see Configuring Virtual MAC Addresses.
To configure a virtual router ID on a single-node active cluster, add the VRID or VRID6 and bind it to
the cluster-node interface.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
This section aims at explaining some scenarios in which the NetScaler cluster can be setup and also
how it can be configured for different features and network topologies. These are just some scenarios
that we have documented. Provide feedback if you want some other scenarios to be included.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
A two-node cluster is an exception to the rule that a cluster is functional only when a minimum of (n/2
+1) nodes, where n is the number of cluster nodes, are able to serve traffic. If that formula were applied
to a two-node cluster, the cluster would fail if one node went down (n/2 +1=2).
A two-node cluster is functional even if only one node is able to serve traffic.
Creating a two node cluster is the same as creating any other cluster. You must add one node as the
configuration coordinator and the other node as the other cluster node.
Note
Incremental configuration synchronization is not supported in a two-node cluster. Only full syn-
chronization is supported.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Migrating an existing high availability (HA) setup to a cluster setup requires you to first remove the
NetScaler appliances from the HA setup and create a backup of the HA configuration file. You must
then use the two appliances to create a cluster and upload the backed-up configuration file to the
cluster.
Note
• Before uploading the backed-up HA configuration file to the cluster, you must modify it to
make it cluster compatible. Refer to the relevant step of the procedure below.
• Use the batch -f <backup_filename> command to upload the backed-up configuration file.
The above approach is a very basic migration solution which results in downtime for the deployed ap-
plication. As such, it must be used only in deployments where there is no consideration to application
availability.
However, in most deployments, the availability of the application is of paramount importance. For
such cases, you must use the approach where an HA setup can be migrated to a cluster setup without
any resulting downtime. In this approach, an existing HA setup is migrated to a cluster setup by first
removing the secondary appliance and using that appliance to create a single-node cluster. After the
cluster becomes operational and serves traffic, the primary appliance of the HA setup is added to the
cluster.
To convert a HA setup to cluster setup (without any downtime) by using the command
line interface
Let us consider the example of a HA setup with primary appliance (NS1) - 10.102.97.131 and secondary
appliance (NS2) - 10.102.97.132.
2. Log on to any one of the HA appliances, go to the shell, and create a copy of the ns.conf file (for
example, ns_backup.conf).
3. Log on to the secondary appliance, NS2, and clear the configurations. This operation removes
NS2 from the HA setup and makes it a standalone appliance.
Note
• This step is required to make sure that NS2 does not start owning VIP addresses, now
that it is a standalone appliance.
• At this stage, the primary appliance, NS1, is still active and continues to serve traffic.
4. Create a cluster on NS2 (now no longer a secondary appliance) and configure it as a PASSIVE
node.
• Remove the features that are not supported on a cluster. For the list of unsupported fea-
tures, see NetScaler appliance Features Supported by a Cluster. This is an optional step.
If you do not perform this step, the execution of unsupported commands will fail.
• Remove the configurations that have interfaces, or update the interface names from the
c/u convention to the n/c/u convention.
Example
• The backup configuration file can have SNIP addresses or MIP addresses. These addresses
are striped on all the cluster nodes. It is recommended that you add spotted IP addresses
for each node.
Example
Example
• Change all other relevant networking configuration that depend on spotted IPs. For ex-
ample, L3 VLAN, RNAT configuration which uses SNIPs as NATIP, INAT rules that refers to
SNIPs/MIPs).
• Make the topological changes to the cluster by connecting the cluster backplane, the clus-
ter link aggregation channel, and so on.
• Apply configurations from the backed-up and modified configuration file to the configura-
tion coordinator through the cluster IP address.
• Configure external traffic distribution mechanisms like ECMP or cluster link aggregation.
• Log on to the primary appliance, NS1, and disable all the interfaces on it.
Note
There might be a small amount (in the order of seconds) of downtime between disabling
the interfaces and making the cluster node active.
8. Log on to the primary appliance, NS1, and remove it from the HA setup.
• Clear all the configurations. This operation removes NS1 from the HA setup and makes it
a standalone appliance.
• Log on to NS1 and join it to the cluster by sequentially executing the following commands:
10. Log on to NS1 and perform the required topological and configuration changes.
11. Log on to the cluster IP address and set NS1 as an ACTIVE node.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
October 9, 2018
Contributed by:
C
Note
An L2 cluster is one where all the nodes are from the same network and an L3 cluster is one that can
include nodes from different networks. You can seamlessly transition from one type of cluster to the
other without any downtime for the applications that are deployed on the NetScaler appliance.
You can transition to an L3 cluster when you want the cluster to include nodes from other networks.
1. Create a nodegroup.
Example
This nodegroup is used in the next step to group all the nodes from the existing L2 cluster.
Example
This command achieves the dual purpose of transitioning to L3 cluster and also adding all the
nodes of the L2 cluster to the nodegroup.
3. Now, you can add more nodes to the cluster as explained in “Adding a Node to the Cluster”.
You can transition to an L2 cluster when you want to retain nodes that belong to a single network.
1. Remove the cluster nodes from the networks that you do not want to retain.
Example
Example
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Note
To set up GSLB in a cluster you must bind the different GSLB entities to a node group. The node group
must have a single member node.
Note
Log on to the cluster IP address and perform the following operations at the command prompt:
1. Configure the different GSLB entities. For information, see GSLB Configuration Entities.
Note
When creating the GSLB site, make sure that you specify the cluster IP address and public
cluster IP address (needed only when the cluster is deployed behind a NAT device). These
parameters are required to ensure the availability of the GSLB auto-sync functionality.
Note
Enable the sticky option if you want to set up GSLB based on VPN users.
Note
Make sure that the IP address of the local GSLB site IP address is striped (available across
all cluster nodes).
5. Bind the ADNS (or ADNS-TCP) service or the DNS (or DNS-TCP) load balancing virtual server to
the node group.
7. [Optional] To setup GSLB based on VPN users, bind the VPN virtual server to the GSLB node
group.
Log on to the cluster IP address and perform the following operations in the Configuration tab:
2. Create a node group and perform other node group related configurations.
Navigate to System > Cluster > Node Groups to perform the required configurations.
For the detailed configurations to be performed, see the description provided in the CLI procedure
mentioned above.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Cache redirection in a cluster works in the same way as it does on a standalone NetScaler appliance.
The only difference is that the configurations are done on the cluster IP address. For more information
on cache redirection, see “Cache Redirection.”
• Before configuring cache redirection, make sure that you have connected all nodes to the exter-
nal switch and that you have linksets configured. Otherwise, client requests will be dropped.
• When MAC mode is enabled on a load balancing virtual server, make sure MBF mode is enabled
on the cluster by using the enable ns mode MBF command. Otherwise, the requests are sent to
origin server directly instead of being sent to the cache server.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Note
To use L2 mode in a cluster setup, you must make sure of the following:
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
In an asymmetric cluster topology, some cluster nodes are not connected to the upstream network.
In such a case, you must use linksets. To optimize the performance, you can bind the interfaces that
are connected to the switch as a cluster LA channel and then bind the channel to a linkset.
To understand how a combination of cluster LA channel and linksets can be used, consider a three-
node cluster for which the upstream switch has only two ports available. You can connect two of the
cluster nodes to the switch and leave the other node unconnected.
Note
Similarly, you can also use a combination of ECMP and linksets in an asymmetric topology.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Backplane on LA channel
January 6, 2019
Contributed by:
C
In this deployment, LA channels are used for the cluster backplane.
• NS0 - nodeId: 0, NSIP: 10.102.29.60
• NS1 - nodeId: 1, NSIP: 10.102.29.70
• NS2 - nodeId: 2, NSIP: 10.102.29.80
c) Log on to the nodes 10.102.29.70 and 10.102.29.80 to join the nodes to the cluster.
As seen in the above commands the interfaces 0/1/1, 1/1/1, and 2/1/1 are configured as the back-
plane interfaces of the three cluster nodes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Common interfaces for client and server and dedicated interfaces for
backplane
January 6, 2019
Contributed by:
C
This is a one-arm deployment of the NetScaler cluster. In this deployment, the client and server net-
works use the same interfaces to communicate with the cluster. The cluster backplane uses dedicated
interfaces for inter-node communication.
To deploy a cluster with a common interface for the client and server and a different inter-
face for the cluster backplane
2. Log on to the first node that you want to add to the cluster and do the following:
4. Log on to the nodes 10.102.29.70 and 10.102.29.80 to join the nodes to the cluster.
As seen in the above commands the interfaces 0/1/1, 1/1/1, and 2/1/1 are configured as the back-
plane interfaces of the three cluster nodes.
1. On the cluster IP address, create VLANs for the backplane interfaces and for the client and server
interfaces.
2. On the switch, create VLANs for the interfaces corresponding to the backplane interfaces and the
client and server interfaces. The following sample configurations are provided for the Cisco®
Nexus 7000 C7010 Release 5.2(1) switch. Similar configurations must be performed on other
switches.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
In this deployment, the client, server, and backplane use dedicated interfaces on the same switch to
communicate with the NetScaler cluster.
To deploy a cluster with a common switch for the client, server, and backplane
2. Log on to the first node that you want to add to the cluster and do the following:
4. Log on to the nodes 10.102.29.70 and 10.102.29.80 to join the nodes to the cluster.
As seen in the above commands the interfaces 0/1/1, 1/1/1, and 2/1/1 are configured as the back-
plane interfaces of the three cluster nodes.
1. On the cluster IP address, create VLANs for the backplane, client, and server interfaces.
2. On the switch, create VLANs for the interfaces corresponding to the backplane interfaces and the
client and server interfaces. The following sample configurations are provided for the Cisco®
Nexus 7000 C7010 Release 5.2(1) switch. Similar configurations must be performed on other
switches.
8 interface Ethernet2/48
9 switchport access vlan 200
10 switchport mode access
11 end
12
13 //For the server interfaces. Repeat for each interface...
14 interface Ethernet2/49
15 switchport access vlan 300
16 switchport mode access
17 end
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Common switch for client and server and dedicated switch for
backplane
January 6, 2019
Contributed by:
C
In this deployment, the clients and servers use different interfaces on the same switch to communi-
cate with the NetScaler cluster. The cluster backplane uses a dedicated switch for inter-node commu-
nication.
To deploy a cluster with the same switch for the clients and servers and a different switch
for the cluster backplane
• Log on to the first node that you want to add to the cluster and do the following:
• Log on to the nodes 10.102.29.70 and 10.102.29.80 to join the nodes to the cluster.
As seen in the above commands the interfaces 0/1/1, 1/1/1, and 2/1/1 are configured as the back-
plane interfaces of the three cluster nodes.
2. On the cluster IP address, create VLANs for the backplane, client, and server interfaces.
3. On the switch, create VLANs for the interfaces corresponding to the backplane interfaces and the
client and server interfaces. The following sample configurations are provided for the Cisco®
Nexus 7000 C7010 Release 5.2(1) switch. Similar configurations must be performed on other
switches.
6
7 //For the client interfaces. Repeat for each interface...
8 interface Ethernet2/48
9 switchport access vlan 200
10 switchport mode access
11 end
12
13 //For the server interfaces. Repeat for each interface...
14 interface Ethernet2/49
15 switchport access vlan 300
16 switchport mode access
17 end
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
In this deployment, each cluster node is connected to a different switch and trunk links are configured
between the switches.
The cluster configurations will be the same as the other deployments scenarios. Most of the client-side
configurations will be done on the client-side switches.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
The following example can be used to configure a four-node cluster with ECMP
, cluster LA, or Linksets.
1 save ns config
1 reboot -warm
3. Join the added nodes to the cluster. This step is not applicable for the first node.
1 save ns config
1 reboot -warm
5. Configure any one of the following (ECMP, cluster LA, or Linkset) traffic distribution mechanisms
for the cluster.
ECMP
• Add a VLAN.
1 add vlan 97
• Add a spotted SNIP on each node and enable dynamic routing on it.
Static cluster LA
Dynamic cluster LA
Linksets. Assume that the node with nodeId 3 is not connected to the switch. You
must configure a linkset so that the unconnected node can use the other node inter-
faces to communicate with the switch.
b) Add a linkset.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Virtual Router Redundancy Protocol (VRRP) is supported in a cluster setup for both IPv4 and IPv6. The
two VRRP features supported in a cluster setup are Interface based VRRP and IP based VRRP.
The Interface based VRRP feature is applicable only to a two-node cluster with one node active state
and the other serving as a spare.
In this feature, the same VMAC address is configured on both the nodes of the cluster. This VMAC
address is used in GARP advertisements and ARP responses for the IP addresses configured on a node.
This feature is useful in an active-spare two-node cluster setup that has external devices/routers that
do not accept GARP advertisements.
With the same VMAC address on both cluster nodes, when the active node goes down and the spare
node takes over as active, the MAC address for the IP addresses on the new active node remain un-
changed and the ARP tables on the external devices/routers do not need to be updated.
Perform the following tasks on a cluster setup to configure interface based VRRP for IPv4:
• Add a VRID. A VRID is an integer used by the Cluster setup to form a VMAC address.
• Bind the VRID to node interfaces. Bind the interfaces to the created VRID. The bound interfaces
(in the current active node) use the VMAC address in GARP advertisements and ARP responses
for its IPv4 addresses. You must associate the VRID to the interfaces of both nodes of the active-
spare cluster setup. This is because unlike in a high availability setup, interface IDs differ in a
cluster setup.
1 - add vrid <ID>
2 - show vrid <ID>
To bind the VRID to an interface by using the NetScaler appliance Command line
1 - bind vrid <ID> -ifnum <interface_name>
2 - show vrid <ID>
1. Navigate to System > Network > VMAC and, on the VMAC tab, click Add.
2. On the Create VMAC page, specify a value in the Virtual Router ID* field, bind interfaces in the
Associate Interfaces section, and then click Create.
“‘
Perform the following tasks on a cluster setup to configure interface based VRRP for IPv6:
• Add a VRID6. A VRID6 is an integer used by the Cluster setup to form a VMAC6 address. The
generic VMAC6 address is in the form of 00:00:5e:00:01:<VRID6>.
• Bind the VRID6 to node interfaces. Bind the interfaces to the created VRID6. The bound in-
terfaces (in the current active node) use the VMAC6 address in GARP advertisements and ARP
responses for its IPv6 addresses. You must associate the VRID6 to the interfaces of both nodes
of the active-spare cluster setup. This is because unlike in a high availability setup, interface
IDs differ in a cluster setup.
1 - add vrid6 <ID>
2 - show vrid6 <ID>
To bind the VRID6 to an interface by using the NetScaler appliance Command line
• bind vrid6 <ID> -ifnum <interface_name>
• show vrid6 <ID>
1. Navigate System > Network > VMAC and, on the VMAC6 tab, click Add.
2. On the Create VMAC6 page, specify a value in the Virtual Router ID* field, bind interfaces in the
Associate Interfaces section, and then click Create.
IP based VRRP
In IP based VRRP, striped VIP addresses bound to the same VRID are configured on all nodes of a cluster
setup. These VIP addresses are active on all the nodes
One of the cluster nodes acts as the VRID owner and sends out the VRRP advertisement to other nodes.
In case of failure of the VRID owner node, another node in the cluster assumes the ownership of the
VRID and starts sending VRRP advertisements. You can also assign a specific cluster node as the owner
of the VRID.
Perform the following tasks on a cluster setup for configuring IP based VRRP for IPv4:
• Add a VRID. A VRID is an integer used by the Cluster setup to form a VMAC address. The
generic VMAC address is in the form of 00:00:5e:00:02:<VRID>.
• (Optional) Assign a node as the owner of the VMAC address. You can set the owner node
parameter (while adding or modifying VRID6) to the ID of the cluster node to assign it as the
owner of the VMAC address. If the assigned owner node fails, one of the UP cluster nodes is
dynamically elected as the owner of the VMAC address.
• Bind the VRID to the VIP address of the nodes. Bind the created VRID to the striped VIP ad-
dress.
To bind the VRID to VIP address by using the NetScaler appliance Command line
1. Navigate to System > Network > VMAC and, on the VMAC tab, click Add.
2. On the Create VMAC page, specify a value in the Virtual Router ID field and then click Create.
1. Navigate to System > Network > IPs, on the IPV4s tab, select a VIP address and click Edit.
2. Set the Virtual Router ID parameter while editing the VIP configuration.
4 Done
Perform the following tasks on a cluster setup for configuring IP based VRRP for IPv6:
• Add a VRID6. A VRID6 is an integer used by the Cluster setup to form a VMAC6 address. The
generic VMAC6 address is in the form of 00:00:5e:00:02:<VRID6>.
• (Optional) Assign a node as the owner of the VMAC6 address. You can set the owner node
parameter (while adding or modifying VRID6) to the ID of the cluster node to assign it as the
owner of the VMAC6 address. If the assigned owner node fails, one of the UP cluster nodes is
dynamically elected as the owner of the VMAC6 address.
• Bind the VRID6 to the VIP6 address of the nodes. Bind the created VRID6 to the striped VIP6
address.
To bind the VRID6 to VIP6 address by using the NetScaler appliance Command line
1. Navigate to System > Network > VMAC and, on the VMAC6 tab, click Add.
2. On the Create VMAC6 page, specify a value in the Virtual Router ID field and then click Create.
1. Navigate to System > Network > IPs, on the IPV6s tab, select a VIP address and click Edit.
2. Set the Virtual Router ID parameter while editing the VIP6 configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
All the nodes of a NetScaler cluster must be running the same software version. Therefore, to upgrade
or downgrade the cluster, you must upgrade or downgrade each NetScaler appliance of the cluster,
one node at a time.
A node that is being upgraded or downgraded is not removed from the cluster. The node continues
to be a part of the cluster and serves traffic uninterrupted, except for the down-time when the node
reboots after it is upgraded or downgraded.
However, due to software version mismatch among the cluster nodes, configuration propagation is
disabled on the cluster and is enabled only after all the cluster nodes are of the same version. Since
configuration propagation is disabled during upgrading on downgrading a cluster, you cannot per-
form any configurations through the cluster IP address during this time.
Important
• When you are upgrading a cluster to NetScaler 11.0 build 64.x from an earlier NetScaler 11.0
build, cluster configuration propagation is disabled. This exception arises because the clus-
ter version in build 64.x is different from the one in previous NetScaler 11.0 builds.
Traditionally, this issue occurred only during an upgrade of a cluster to a different NetScaler ver-
sion (for example, from 10.5 to 11.0). It must be noted that normally the cluster version matches
the NetScaler version.
Note
Configuration propagation remains disabled until all the cluster nodes are upgraded to Build
64.x.
• You cannot add cluster nodes while upgrading or downgrading the cluster software version.
• You can perform node-level configurations through the NSIP address of individual nodes, but
make sure to perform the same configurations on all the nodes to maintain them in synch.
• You cannot execute the “start nstrace” command from the cluster IP address when the cluster
is being upgraded. However, you can get the trace of individual nodes by performing this oper-
ation on individual cluster nodes through their NSIP address.
• Owing to changes in cluster licensing that were made in NetScaler 10.5 Build 52.11 see Prerequi-
sites for cluster nodes, look into the following:
– If the cluster is setup in a build prior to NetScaler 10.5 Build 52.11, the cluster will work with
the separate cluster license file. No changes are required.
– If the cluster is setup in NetScaler 10.5 Build 52.11 or later releases and then downgraded to
a build prior to NetScaler 10.5 Build 52.11, the downgraded cluster will not work as it now
expects a separate cluster license file.
• While upgrading from any NetScaler 10.1 build to a later release, syncookie must be disabled
on all TCP profiles (using the “set ns tcpProfile <name> -synCookie DISABLED” command) and
after that a striped SNIP must be added on the CLIP subnet. Once upgraded, syncookie can be
enabled again.
• While upgrading the NetScaler appliance from a NetScaler 10.1 build to a NetScaler 10.5 build,
do not execute the “show audit messages” command as this can cause the NetScaler appliance
to become unresponsive.
• NetScaler 10.5 54.x and 55.x builds are not suitable for cluster deployment. This is because, for
services that need probing, SYN packets are processed locally (on the flow receiver) even though
syncookie is disabled.
• When a cluster is being upgraded, it is possible that the upgraded nodes have some additional
features activated that are not available on the nodes that are not upgraded. This results in a
license mismatch warning while the cluster is being upgraded. This warning will be automati-
cally resolved when all the cluster nodes are upgraded.
Important
• Citrix recommends that you wait for the previous node to become active before upgrading
or downgrading the next node.
• Citrix recommends that the cluster configuration node must be upgraded/downgraded last
to avoid multiple disconnect of cluster IP sessions.
1. Make sure the cluster is stable and the configurations are synchronized on all the nodes.
2. Access each node through its NSIP address and perform the following:
• Upgrade or downgrade the cluster node. For detailed information about upgrading and
downgrading the software of an appliance, see Upgrade and downgrade a NetScaler ap-
pliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
As a rule, NetScaler appliances that are a part of a cluster cannot be individually configured from their
NSIP address. However, there are some operations that are an exception to this rule. These opera-
tions, when executed from the NSIP address, are not propagated to other cluster nodes.
• save ns config
• reboot
• shutdown
For example, when you execute the command disable interface 1/1/1 from the NSIP address of a cluster
node, the interface is disabled only on that node. Since the command is not propagated, the interface
1/1/1 remains enabled on all the other cluster nodes.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
Important
The formation or supportability of a heterogeneous cluster is possible and limited only to MPX
hardware platforms.
The supportability and formation of the heterogeneous cluster depend on certain NetScaler models.
The following table lists the platforms that are supported in the formation of a heterogeneous cluster.
Note
If you run the “join cluster” command from the node that has an unequal number of packet en-
gines, the following error message appears: “Mismatch in the number of active PPEs between
CCO and local node”.
1. The number of packet engines present on all of the MPX hardware appliances should be same
in the cluster deployment.
2. The extra management CPU setting should be same on all the cluster nodes.
3. The newly added node should have the same capacity on the data planes and backplane, as
that of existing cluster nodes.
4. If there are mixed platform devices supporting different ciphers, then the cluster would agree
upon a common cipher list.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
FAQs
November 6, 2018
Contributed by:
C
A list of the frequently asked questions about clustering (NetScaler 11.0, 10.5, 10.1). Click a question to
view its answer.
A NetScaler cluster can include one appliance or as many as 32 NetScaler appliance nCore hardware or
virtual appliances. Each of these nodes must satisfy the criteria specified in Prerequisites for Cluster
Nodes.
No. A NetScaler appliance can belong to can belong to one cluster only.
The cluster IP address is the management address of a NetScaler cluster. All cluster configurations
must be performed by accessing the cluster through this address. The subnet mask of the cluster IP
address is fixed at 255.255.255.255.
How can I make a specific cluster node as the cluster configuration coordinator?
To manually set a specific node as the cluster configuration coordinator, you must set the priority of
that node to the lowest numeric value (highest priority). To understand, let us consider a cluster with
three nodes that have the following priorities:
n1 - 29, n2 - 30, n3 - 31
Here, n1 is the configuration coordinator. If you want to make n2 the configuration coordinator, you
must set its priority to a value that is lower than n1, for example, 28. On saving the configuration, n2
becomes the configuration coordinator.
Note
n2 with its original priority value of 30 will also become the configuration coordinator when
n1 goes down, as the node with the next lowest priority value is selected in the event that the
configuration coordinator goes down.
Why are the network interfaces of a cluster represented in 3-tuple (n/u/c) notation instead of the
regular 2-tuple (u/c) notation?
When a NetScaler appliance is part of a cluster, you must be able to identify the node to which the
interface belongs. Therefore, the network interface naming convention for cluster nodes is modified
from u/c to n/u/c, where n denotes the node Id.
The hostname of a cluster node must be specified by executing the set ns hostname command
through the cluster IP address. For example, to set the hostname of the cluster node with ID 2, the
command is:
Can I automatically detect NetScaler appliances so that I can add them to a cluster?
Yes. The configuration utility allows you to discover appliances that are present in the same subnet as
the NSIP address of the configuration coordinator. For more information, see Discovering NetScaler
Appliances.
Is the traffic serving capability of a cluster affected if a node is removed or disabled or reboot or
shutdown or made inactive?
Yes. When any of these operations are performed on an active node of the cluster, the cluster will have
one less node to serve traffic. Also, existing connections on this node are terminated.
I have multiple standalone appliances, each of which has different configurations. Can I add
them to a single cluster?
Yes. You can add appliances that have different configurations to a single cluster. However, when the
appliance is added to the cluster, the existing configurations are cleared. To use the configurations
that are available on each of the individual appliances, you must:
Can I migrate the configurations of a standalone NetScaler appliance or an HA setup to the clus-
tered setup?
No. When a node is added to a clustered setup, its configurations are implicitly cleared by using
the clear ns config command (with the extended option). In addition, the SNIP addresses and all
VLAN configurations (except default VLAN and NSVLAN) are cleared. Therefore, it is recommended
that you back up the configurations before adding the appliance to a cluster. Before using the backed-
up configuration file for the cluster, you must:
1. Edit the configuration file to remove features that are not supported in a cluster environment.
2. Update the naming convention of interfaces from two-tuple (x/y) format to three-tuple (x/y/z)
format.
3. Apply the configurations to the configuration coordinator node of the cluster by using the batch
command.
Yes, by default, backplane interfaces have presence on all the L3 VLANs that are configured on the
cluster.
How can I configure a cluster that includes nodes from different networks?
Note
A cluster that includes nodes from different networks is called a L3 cluster (sometimes referred to as
a cluster in INC mode). In an L3 cluster, all nodes that belong to a single network must be grouped
together in a single nodegroup. Therefore, if a cluster includes two nodes each from three different
networks, you will have to create 3 nodegroups (one for each network) and associate each of these
nodegroups with the nodes that belong to that network. For configuration information, see the steps
to setup a cluster.
• To make the NSVLAN available in a cluster, make sure that each appliance has the same NSVLAN
configured before it is added to cluster.
• To remove the NSVLAN from a cluster node, first remove the node from the cluster and then
delete the NSVLAN from the appliance.
I have a cluster setup where some NetScaler appliance nodes are not connected to the external
network. Can the cluster still function normally?
Yes. The cluster supports a mechanism called linksets, which allows unconnected nodes to serve traf-
fic by using the interfaces of connected nodes. The unconnected nodes communicate with the con-
nected nodes through the cluster backplane. For more information, see Using Linksets.
How can deployments that require MAC-Based Forwarding (MBF) be supported in a clustered
setup?
Deployments that use MBF must use linksets. For more information, see Using Linksets.
No. Access to individual cluster nodes through the NSIP addresses is read-only. Therefore, when you
log on to the NSIP address of a cluster node you can only view the configurations and the statistics.
You cannot configure anything. However, there are some operations you can execute from the NSIP
address of a cluster node. For more information, see Operations Supported on Individual Nodes.
No, you cannot explicitly disable the propagation of cluster configurations among cluster nodes. How-
ever, during a software upgrade or downgrade, a version mismatch error can automatically disable
configuration propagation.
Can I change the NSIP address or change the NSVLAN of a NetScaler appliance when it is a part
of the cluster?
No. To make such changes you must first remove the appliance from the cluster, perform the changes,
and then add the appliance to the cluster.
Yes. A cluster supports VLANs between cluster nodes. The VLANs must be configured on the cluster IP
address.
• L2 VLAN. You can create a layer2 VLAN by binding interfaces that belong to different nodes of
the cluster.
• L3 VLAN. You can create a layer3 VLAN by binding IP addresses that belong to different nodes
of the cluster. The IP addresses must belong to the same subnet. Make sure that one of the
following criteria is satisfied. Otherwise, the L3 VLAN bindings can fail.
– All nodes have an IP address on the same subnet as the one bound to the VLAN.
– The cluster has a striped IP address and the subnet of that IP address is bound to the VLAN.
When you add a new node to a cluster that has only spotted IPs, the sync happens before spotted IP
addresses are assigned to that node. In such cases, L3 VLAN bindings can be lost. To avoid this loss,
either add a striped IP or add the L3 VLAN bindings on the NSIP of the newly added node.
SNMP monitors the cluster, and all the nodes of the cluster, in the same way that it monitors a stan-
dalone appliance. The only difference is that SNMP on a cluster must be configured through the clus-
ter IP address. When generating hardware specific traps, two additional varbinds are included to iden-
tify the node of the cluster: node ID and NSIP address of the node.
What details must I have available when I contact technical support for cluster-related issues?
The NetScaler appliance provides a show techsupport -scope cluster command that extracts config-
uration data, statistical information, and logs of all the cluster nodes. You must run this command on
the cluster IP address.
Send this archive to the technical support team to debug the issue.
In case of cluster deployments, make sure the default gateway of the server points to a striped IP
address (if you are using a NetScaler appliance-owned IP address). For example, in case of LB deploy-
ments with USIP enabled, the default gateway must be a striped SNIP address.
Can I view routing configurations of a specific cluster node from the cluster IP address?
Yes. You can view and clear the configurations specific to a node by specifying the owner node while
entering the vtysh shell.
For example, to view the output of a command on nodes 0 and 1, the command is as follows:
1 \> vtysh
2
3 ns# owner-node 0 1
4 ns(node-0 1)\# show cluster state
5 ns(node-0 1)\# exit-cluster-node
6 ns\#
How can I specify the node for which I want to set the LACP system priority?
Note
In a cluster, you must set that node as the owner node by using the set lacp command.
For example: To set the LACP system priority for node with ID 2:
Note
Configuring IP tunnels in a cluster is the same as on a standalone appliance. The only difference is
that in a cluster setup, the local IP address must be a striped SNIP or MIP address.
How can I add a failover interface set (FIS) on the nodes of a NetScaler cluster?
Note
On the cluster IP address, specify the ID of the cluster node on which the FIS must be added, using the
command as follows:
Note
You can bind spotted IP addresses to a net profile. This net profile can then be bound to spotted load
balancing virtual server or service (that is defined using a nodegroup). The following recommenda-
tions must be followed, failing which, the net profile configurations are not honored and the USIP/US-
NIP settings will be used:
Note
• If the strict parameter of the nodegroup is set to Yes, the net profile must contain a mini-
mum of one IP address from each nodegroup member.
• If the strict parameter of the nodegroup is set to No, the net profile must include at least
one IP address from each of the cluster nodes.
Note
1. Make sure that the Java package and the WI package are present in the same directory on all
the cluster nodes.
2. Create a load balancing virtual server that has persistency configured.
3. Create services with IP addresses as the NSIP address of each of the cluster nodes that you want
to serve WI traffic. This step can only be configured using the NetScaler CLI.
4. Bind the services to the load balancing virtual server.
Note
If you are using WIonNS over a VPN connection, make sure that the load balancing virtual server
is set as WIHOME.
No. Management access to a cluster node, must not be configured on a cluster LA channel (for exam-
ple, CLA/1) or its member interfaces. This is because when the node is INACTIVE, the corresponding
cluster LA interface is marked as power down and therefore looses management access.
How cluster nodes communicate to each other and what are the different types of traffic that
goes through backplane?
A backplane is a set of interfaces in which one interface of each node is connected to a common switch,
which is called the cluster backplane switch. The different types of traffic that goes through back-
plane, which is used by internode communication are:
Each node of the cluster uses a special MAC cluster backplane switch address to communicate
with other nodes through the backplane. The cluster special MAC is of the form: 0x02 0x00 0x6F
<cluster_id> <node_id> <reserved>, where <cluster_id> is the cluster instance ID, <node_id> is the
node number of the NetScaler appliance that are added to a cluster.
Note
The amount of traffic that is handled by a backplane will have negligible CPU overhead.
Only steered data traffic goes over the GRE tunnel. The packets are steered through the GRE tunnel to
the node on the other subnet.
How Node to Node Messaging (NNM) and heartbeat messages are exchanged, and how are they
routed?
The NNM, heartbeat messages, and cluster protocol are non-steering traffic. These messages are not
sent through the tunnel, but they are routed directly.
What are the MTU recommendations when Jumbo frames are enabled for layer 3 cluster tun-
neled traffic?
The following are the layer 3 cluster recommendations of Jumbo MTU over GRE tunnel:
• The Jumbo MTU can be configured among cluster nodes across the L3 path to accommodate
GRE tunnel overhead.
• The fragmentation does not happen for full sized packets which need to be steered.
• Steering of traffic continues to work even if Jumbo frames are not allowed, but with more over-
head due to fragmentation.
How the global hash key is generated and shared across all nodes?
The rsskey for a standalone appliance is generated at the boot time. In a cluster setup, the first node
holds the rsskey of the cluster. Every new node joining to the cluster will synchronize the rsskey.
What is the need of “set rsskeytype –rsskey symmetric” command for *:*, USIP on, useproxyport
off, topologies?
This is not specific to cluster, applies to a standalone appliance as well. With USIP ON, and use proxy
port disabled, symmetric rsskey reduces both Core to Core (C2C) steering and node to node steering.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
If a failure occurs in a NetScaler cluster, the first step in troubleshooting is to get information on the
cluster instance and the cluster nodes by running the show cluster instance <clId> and show cluster
node <nodeId> commands respectively.
If you are not able to find the issue by using the above two approaches, you can use one of the follow-
ing:
• Isolate the source of the failure. Try bypassing the cluster to reach the server. If the attempt
is successful, the problem is probably with the cluster setup.
• Check the commands recently executed. Run the history command to check the recent con-
figurations performed on the cluster. You can also review the ns.conf file to verify the configu-
rations that have been implemented.
• Check the ns.log files. Use the log files, available in the /var/log/ directory of each node, to
identify the commands executed, status of commands, and the state changes.
• Check the newnslog files. Use the newnslog files, available in the /var/nslog/ directory of each
node, to identify the events that have occurred on the cluster nodes. You can view multiple
newnslog files as a single file, by copying the files to a single directory, and then running the
following command:
If you still cannot resolve the issue, you can try tracing the packets on the cluster or use the show
techsupport -scope cluster command to send the report to the technical support team.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
January 6, 2019
Contributed by:
C
The NetScaler appliance operating system provides a utility called nstrace to get a dump of the packets
that are received and sent out by an appliance. The utility stores the packets in trace files. You can
use these files to debug problems in the flow of packets to the cluster nodes. The trace files must be
viewed with the Wireshark application.
• Can be configured to trace packets selectively by using classic expressions and default expres-
sions.
• Can capture the trace in multiple formats: nstrace format (.cap) and TCP dump format (.pcap).
• Can aggregate the trace files of all cluster nodes on the configuration coordinator.
• Can merge multiple trace files into a single trace file (only for .cap files).
You can use the nstrace utility from the NetScaler appliance command line or the NetScaler appliance
shell.
Run the start nstrace command on the appliance. The command creates trace files in the /var/n-
strace/<date-timestamp> directory. The trace file names are of the form nstrace<id>.cap.
You can view the status by executing the show nstrace command. You can stop tracing the packets by
executing the stop nstrace command.
Note
You can also run the nstrace utility from the NetScaler appliance shell by executing the
nstrace.sh file. However, it is recommended that you use the nstrace utility through the NetScaler
appliance command line interface.
You can trace the packets on all the cluster nodes and obtain all the trace files on the configuration
coordinator.
Run the start nstrace command on the cluster IP address. The command is propagated and executed
on all the cluster nodes. The trace files are stored in individual cluster nodes in the /var/nstrace/<date-
timestamp> directory. The trace file names are of the form nstrace<id>_node<id>.cap.
You can use the trace files of each node to debug the nodes operations. But if you want the trace
files of all cluster nodes in one location, you must run the stop nstrace command on the cluster IP
address. The trace files of all the nodes are downloaded on the cluster configuration coordinator in
the /var/nstrace/<date-timestamp> directory as follows:
You can prepare a single file from the trace files (supported only for .cap files) obtained from the cluster
nodes. The single trace files gives you a cumulative view of the trace of the cluster packets. The trace
entries in the single trace file are sorted based on the time the packets were received on the cluster.
where,
• srcdir is the directory from which the trace files are merged. All trace files within this directory
are merged into a single file.
• dstdir is the directory where the merged trace file are created.
• filename is the name of the trace file that is created.
• filesize is the size of the trace file.
Examples
Following are some examples of using the nstrace utility to filter packets.
1 start nstrace -filter ”INTF == 0/1/1 && INTF == 1/1/1 && INTF ==
2/1/1”
• To trace the packets from a source IP address 10.102.34.201 or from a system whose source port
is greater than 80 and the service name is not “s1”:
Note
When you run the “start nstrace” command, you can set the new “capsslkeys” parameter to capture
the SSL master keys for all SSL sessions. If you include this parameter, a file named nstrace.sslkeys
is generated along with the packet trace. This file can be imported into Wireshark to decrypt the SSL
traffic in the corresponding trace file.
This functionality is similar to web browsers exporting session keys that can later be imported into
Wireshark for decrypting SSL traffic.
1. Generates smaller trace files that do not include the extra packets created by the SSLPLAIN
mode of capturing.
2. Provides the ability to view plaintext [SP(1] from the trace and choose whether to share the mas-
ter keys file or protect sensitive data by not sharing it.
1. SSL sessions cannot be decrypted if initial packets of the session are not captured.
2. SSL sessions cannot be captured if the Federal Information Processing Standard (FIPS) mode is
enabled.
To capture SSL session keys by using the command line interface (CLI)
At the command prompt, type the following commands to enable or disable SSL session keys in a
trace file and verify trace operation.
1. Navigate to Configuration > System > Diagnostics > Technical Support Tools and click Start
new Trace to start tracing encrypted packets on an appliance.
2. On the Start Trace page, select the Capture SSL Master Keys check box.
3. Click OK and Done.
On the Wireshark GUI, navigate to Edit > Preferences > Protocols > SSL > (Pre)-Master-Secret log
filename and specify the master key files obtained from the appliance.
1.
2. Citrix ADC
3. NetScaler 12.0
4. Clustering
Contributed by:
C
While joining a node to the cluster, I get the following message, “ERROR: Invalid interface
name/number.” What must I do to resolve this error?
This error occurs if you provided an invalid or incorrect backplane interface while using the add cluster
nodecommand to add the node. To resolve this error, verify the interface you provided while adding
the node. Make sure that you have not specified the appliance’s management interface as the back-
plane interface, and that the <nodeId> bit of the interface is the same as the node’s Id. For example,
if the nodeId is 3, the backplane interface must be 3/<c>/<u>.
While joining a node to the cluster, I get the following message, “ERROR: Clustering cannot be
enabled, because the local node is not a member of the cluster.” What must I do to resolve this
error?
This error occurs when you try to join a node without adding the node’s NSIP to the cluster. To re-
solve this error, you must first add the node’s NSIP address to the cluster by using the add cluster
node command and then execute the join cluster command.
While joining a node to the cluster, I get the following message, “ERROR: Connection refused.”
What must I do to resolve this error?
• Connectivity problems. The node cannot connect to the cluster IP address. Try pinging the
cluster IP address from the node that you are trying to join.
• Duplicate cluster IP address. Check to see if the cluster IP address exists on some non-cluster
node. If it does, create a new cluster IP address and try re-joining the cluster.
While joining a node to the cluster, I get the following message, “ERROR: License mismatch be-
tween the configuration coordinator and the local node.” What must I do to resolve this error?
The appliance that you are joining to the cluster must have the same licenses as the configuration
coordinator. This error occurs when the licenses on the node you are joining do not match the licenses
on the configuration coordinator. To resolve this error, run the following commands on both the nodes
and compare the outputs.
• show ns hardware
• show ns license
• ls /nsconfig/license
What must I do when the configurations of a cluster node are not in synch with the cluster con-
figurations?
In most cases, the configurations are automatically synchronized between all the cluster nodes. How-
ever, if you feel that the configurations are not synchronized on a specific node, you must force the
synchronization by executing the force cluster sync command from the node that you want to syn-
chronize. For more information, see Synchronizing Cluster Configurations.
When configuring a cluster node, I get the following message, “ERROR: Session is read-only; connect
to the cluster IP address to modify the configuration.”
All configurations on a cluster must be done through the cluster IP address and the configurations are
propagated to the other cluster nodes. All sessions established through the NSIP address of individual
nodes are read-only.
Why does the node state show “INACTIVE” when the node health shows “UP”?
A healthy node can be in the INACTIVE state for a number of reasons. A scan of ns.log or error counters
can help you determine the exact reason.
How can I resolve the health of a node when its health shows “NOT UP”?
Node health “Not UP” indicates that there are some issues with the node. To know the root cause,
you must run the show cluster node command. This command displays the node properties and the
reason for the node failure.
What must I do when the health of a node shows as “NOT UP” and the reason indicates that
configuration commands have failed on a node?
This issue arises when some commands are not executed on the cluster nodes. In such cases, you
must make sure that the configurations are synchronized using one of the following options:
• If some of the cluster nodes are in this state, you must perform the force cluster synchronization
operation on those nodes. For more information, see Synchronizing Cluster Configurations.
• If all cluster nodes are in this state, you must disable and then enable the cluster instance on all
the cluster nodes.
When I run the set vserver command, I get the following message, “No such resource.” What
must I do to resolve this issue?
The set vserver command is not supported in clustering. The unset vserver, enable vserver, disable
vserver, and rm vserver commands are also not supported. However, the show vserver command
is supported.
I cannot configure the cluster over a Telnet session. What must I do?
Over a telnet session, the cluster IP address can be accessed only in read-only mode. Therefore, you
cannot configure a cluster over a telnet session.
I notice a significant time difference across the cluster nodes. What must I do to resolve this
issue?
When PTP packets are dropped due to backplane switch or if the physical resources are over-
committed in a virtual environment, the time will not get synchronized.
To synchronize the times, you must do the following on the cluster IP address:
1. Disable PTP.
2. Configure Network Time Protocol (NTP) for the cluster. For more information, see Setting up
Clock Synchronization.
What must I do, if there is no connectivity to the cluster IP address and the NSIP address of a
cluster node?
If you cannot access to the cluster IP address or the NSIP of a cluster node, you must access the appli-
ance through the serial console. If the NSIP address is reachable, you can SSH to the cluster IP address
from the shell by executing the following command at the shell prompt:
1. Disable the cluster instance on that node (since you cannot execute commands from the NSIP
of a cluster node).
Some nodes of the cluster have two default routes. How can I remove the second default route
from the cluster node?
To delete the additional default route, do the following on each node that has the extra route:
The cluster functionality gets affected when an existing cluster node comes online. What must I
do to resolve this issue?
If RPC password of node is changed from the cluster IP address when that node is out of the cluster,
then, when the node comes online, there is a mismatch in rpc credentials and this could affect cluster
functionality. To solve this issue, use the set ns rpcNode command to update the password on the
NSIP of the node which has come online.
1.
2. Citrix ADC
3. NetScaler 12.0
Content Switching
January 6, 2019
Contributed by:
C
In today’s complex Web sites, you may want to present different content to different users. For exam-
ple, you may want to allow users from the IP range of a customer or partner to have access to a special
Web portal. You may want to present content relevant to a specific geographical area to users from
that area. You may want to present content in different languages to the speakers of those languages.
You may want to present content tailored to specific devices, such as smartphones, to those who use
the devices. The NetScaler content switching feature enables the appliance to distribute client re-
quests across multiple servers on the basis of specific content that you wish to present to those users.
To configure content switching, first create a basic content switching setup, and then customize 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 content that is being switched, creating a content
switching virtual server, creating policies to choose which requests are directed to which load bal-
ancing virtual server, and binding the policies to the content switching virtual server. You can then
customize the setup to meet your needs by setting precedence for your policies, protecting your setup
by configuring a backup virtual server, and improving the performance of your setup by redirecting
requests to a cache.
Content Switching enables the NetScaler appliance to direct requests sent to the same Web host to dif-
ferent servers with different content. For example, you can configure the appliance 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 the appliance to perform content switching based
on TCP/IP headers and payload.
You can also use content switching to configure the appliance to redirect requests to different servers
with different content on the basis of various client attributes. Some of those client attributes are:
• Device Type. The appliance examines the user agent or custom HTTP header in the client re-
quest for the type of device from which the request originated. Based on the device type, it
directs the request to a specific Web server. For example, if the request came from a cell phone,
the request is directed to a server that is capable of serving content that the user can view on
his or her cell phone. A request from a computer is directed to a different server that is capable
of serving content designed for a computer screen.
• Language. The appliance examines the Accept-Language HTTP header in the client request and
determines the language used by the client’s browser. The appliance then sends the request to
a server that serves content in that language. For example, using content switching based on
language, the appliance can send someone whose browser is configured to request content in
French to a server with the French version of a newspaper. It can send someone else whose
browser is configured to request content in English to a server with the English version.
• Cookie. The appliance examines the HTTP request headers for a cookie that the server set pre-
viously. If it finds the cookie, it directs requests to the appropriate server, which hosts custom
content. For example, if a cookie is found that indicates that the client is a member of a cus-
tomer loyalty program, the request is directed to a faster server or one with special content. If
it does not find a cookie, or if the cookie indicates that the user 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, and sends the
client request to the right server. For example, GET requests for images can be directed to an
image server, while POST requests can be directed to a faster server that handles dynamic con-
tent.
• Layer 3/4 Data. The appliance examines requests for the source or destination IP, source or des-
tination 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 IPs that belong to customers can
be directed to a custom web portal on a faster server, or one with special content.
A typical content switching deployment consists of the entities described in the following diagram.
A content switching configuration consists of a content switching virtual server, a load balancing setup
consisting of load balancing virtual servers and services, and content switching policies. To configure
content switching, you must configure a content switching virtual server and associate it with policies
and load balancing virtual servers. This process creates a content group—a group of all virtual servers
and policies involved in a particular content 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 the associated
content switching policies to that request. The priority of the policy defines the order in which the
policies bound to the content switching virtual server are evaluated. If you are using default syntax
policies, when you bind a policy to the content switching virtual server, you must assign a priority to
that policy. If you are using NetScaler classic policies, you can assign a priority to your policies, but
are not required to do so. If you assign priorities, the policies are evaluated in the order that you set.
If you do not, the NetScaler appliance evaluates your policies in the order in which they were created.
In addition to configuring policy priorities, you can manipulate the order of policy evaluation by using
Goto expressions and policy bank invocations. For more details about default syntax policy configu-
ration, see “Configuring Default Syntax Policies.”
After it evaluates the policies, the content switching virtual server routes the request to the appropri-
ate 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 are using an
external load balancer, you must create a load balancing virtual server for it and bind its virtual server
as a service to the content switching virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Before you configure content switching, you must understand how content switching is set up and
how the services and virtual servers are connected.
To configure a basic, functional content switching setup, first enable the content switching feature.
Then, create at least one content group. For each content group, create a content switching virtual
server to accept requests to a group of web sites that use content switching. Also create a load bal-
ancing setup, which includes a group of load balancing virtual servers to which the content switching
virtual server directs requests. To specify which requests to direct to which load balancing virtual
server, create at least two content switching policies, one for each type of request that is to be redi-
rected. When you have created the virtual servers and policies, bind the policies to the content switch-
ing virtual server. You can also bind a policy to multiple content switching virtual servers. When you
bind a policy, you specify the load balancing virtual server to which requests that match the policy
are to be directed.
In addition to binding individual policies to a content switching virtual server, you can bind policy
labels. If you create additional content groups, you can bind a policy or policy label to more than one
of the content switching virtual servers.
Note
After creating a content group, you can modify its content switching virtual server to customize
the configuration. For information on modifying the configuration of an existing content switch-
ing virtual server, see “
Customizing the Basic Content Switching Configuration.” For information on disabling and re-
enabling entities, unbinding policies, and removing entities, see “
Managing a Content Switching Setup.”
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
To use the content switching feature, you must enable content switching. You can configure content
switching entities even though the content switching feature is disabled. However, the entities will
not work.
At the command prompt, type the following commands to enable content switching and verify the
configuration:
• enable ns feature CS
• show ns feature
Example
Navigate to System > Settings and, in the Modes and Features group, select Configure Basic Fea-
tures, and select Content Switching.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can add, modify, and remove content switching virtual servers. The state of a virtual server is
DOWN when you create it, because the load balancing virtual server is not yet bound to it.
Example
Navigate to Traffic Management > Content Switching > Virtual Servers, and add a virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
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 is being switched. This is
true even when your setup has only one server for each version of the content, and you are therefore
not doing any load balancing with those servers. You can also configure actual load balancing with
multiple load-balanced servers that mirror each version of the content. In either scenario, the content
switching virtual server needs to have a specific load balancing virtual server assigned to each version
of the content that is being switched.
The load balancing virtual server then forwards the request to a service. If it has only one service
bound to it, it selects that service. If it has multiple services bound to it, it uses its configured load
balancing method to select a service for the request, and forwards that request 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 on setting up
a basic load balancing configuration, see Set up basic load balancing.
1.
2. Citrix ADC
3. NetScaler 12.0
After you create an action, you create a content switching policy and specify the action in the policy,
so that the action is performed when that policy matches a request.
Note
You can also, for a content switching policy that uses a default syntax rule, specify the target load
balancing virtual server when binding the policy to a content switching virtual server, instead of
using a separate action. For domain-based policies, URL-based policies, and rule based policies
that use classic expressions, an action is not available. So, for these types of policies, you specify
the name of the target load balancing virtual server when binding the policy to a content switch-
ing virtual server. For more information, see “
Binding Policies to a Content Switching Virtual Server.”
Configuring an Action that Specifies the Name of the Target Load Balancing Virtual
Server
If you choose to specify the name of the target load balancing virtual server in a content switching
action, you need as many content switching policies as you have target load balancing virtual servers.
Content switching decisions, in this case, are based on the rule in the content switching policy, and the
action merely specifies the target load balancing virtual server. When a request matches the policy,
the request is forwarded to the specified load balancing virtual server.
To create and verify a content switching action that specifies the name of the target load
balancing virtual server, by using the command line interface
Example
10
11 Done
12 >
To configure a content switching action that specifies the name of the target load balancing
virtual server, by using the configuration utility
Configuring an Action that Specifies an Expression for Selecting the Target at Run Time
If you choose to configure a request-based expression that can dynamically compute the name of the
target load balancing virtual server, you need to configure only one content switching policy to select
the appropriate virtual server. The rule for the policy can be a simple TRUE (the policy matches all
requests) because, in this case, content switching decisions are based on the expression in the action.
By configuring an expression in an action, you can drastically reduce the size of your content switching
configuration.
If you choose to configure a request-based expression for computing the name of the target load bal-
ancing virtual server at run time, you must carefully consider how to name the load balancing virtual
servers in the configuration. You must be able to derive their names by using the request-based policy
expression in the action.
For example, if you are switching requests on the basis of the URL suffix (file extension of the re-
quested resource), when naming the load balancing virtual servers, you can follow the convention
of appending the URL suffix to a predetermined string, such as mylb_. For example, load balancing
virtual servers for HTML pages and PDF files could be named mylb_html and mylb_pdf, respectively.
In that case, the rule that you can use in the content switching action, to select the appropriate load
balancing virtual server, is “mylb_“+HTTP.REQ.URL.SUFFIX. If the content switching virtual server re-
ceives a request for an HTML page, the expression returns mylb_html, and the request is switched to
virtual server mylb_html.
To create a content switching action that specifies an expression, by using the command line
interface
At the command line, type the following commands to create a content switching action that specifies
an expression and verify the configuration:
Example
To configure a content switching action that specifies an expression by using the configuration
utility
1.
2. Citrix ADC
3. NetScaler 12.0
March 6, 2019
Contributed by:
C
A content switching policy defines a type of request that is to be directed to a load balancing virtual
server. These policies are applied in the order of the priorities assigned to them or (if you are using
NetScaler appliance classic policies and do not assign priorities when binding them) in the order in
which the policies were created.
• Domain-based policies. The NetScaler appliance compares the domain of an incoming URL
with the domains specified in the policies. The appliance then returns the most appropriate
content. Domain-based policies must be classic policies; default syntax policies are not sup-
ported for this type of content switching policy.
• URL-based policies. The appliance compares an incoming URL with the URLs specified in the
policies. The appliance then returns the most appropriate URL-based content, which is usually
the longest matching configured URL. URL-based policies must be classic policies; default syn-
tax policies are not supported for this type of content switching policy.
• Rule-based policies. The appliance compares incoming data to expressions specified in the
policies. You create rule-based policies by using either a classic expression or a default syn-
tax expression. Both classic and default syntax policies are supported for rule-based content
switching policies.
Note
A rule based policy can be configured with an optional action. A policy with an action 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 poli-
cies are evaluated in order of priority. If you do not set specific priorities when binding your
policies, the policies are evaluated in the order in which they were created.
For information about NetScaler appliance classic policies and expressions, see “Configuring Classic
Policies and Expressions.”
For information about Default Syntax policies, see “Configuring Advanced Policy Expressions”
Example:
Example:
Navigate to Traffic Management > Content Switching > Policies, select a policy and, in the Action
list, select Rename.
Navigate to Traffic Management > Content Switching > Policies, and configure a content switching
policy.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A policy label is a user-defined bind point to which policies are bound. When a policy label is invoked,
all the policies bound to it are evaluated in the order of the priority that you assigned to them. A policy
label can include one or more policies, each of which can be assigned its own result. A match on one
policy in the policy label can result in proceeding to the next policy, invoking a different policy label
or appropriate resource, or an immediate end 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 policies bound to the
policy label. The policy label type specifies the protocol that was assigned to the policies bound to
the label. It must match the service type of the content switching virtual server to which the policy
that invokes the policy label is bound. For example, you can bind TCP Payload policies to a policy
label of type TCP only. Binding TCP Payload policies 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 is equivalent to
the action that is associated with other types of policies, such as rewrite and responder policies) or a
gotoPriorityExpression option and/or an invoke option. That is, for a given policy in a content switch-
ing policy label, you can specify a target, or you can set the gotoPriorityExpression option and/or the
invoke option. Additionally, if multiple policies evaluate to true, only the target of the last policy that
evaluates to true is considered.
You can use either the NetScaler appliance CLI or the configuration utility to configure content switch-
ing policy labels. In the NetScaler appliance CLI, you first create a policy label by using the add cs
policylabel command. Then, you bind policies to the policy label, one policy at a time, by using the
bind cs policylabel command. In the NetScaler appliance GUI, you perform both tasks in a single dia-
log box.
To create a content switching policy label by using the command line interface
Example
To rename a content switching policy label by using the command line interface
Example
Navigate to Traffic Management > Content Switching > Policy Labels , select a policy label and, in the
Action list, select Rename.
To bind a policy to a content switching policy label by using the command line interface
At the command prompt, type the following commands to bind a policy to a policy label and verify
the configuration:
Example
Note: If a policy is configure with an action, the target virtual server (targetVserver), go to priority
expression (gotoPriorityExpression), and invoke (invoke) parameters are not required. If a policy
is not configure with an action, you need to configure at least one of the following parameters:
To unbind a policy from a policy label by using the command line interface
At the command prompt, type the following commands to unbind a policy from a policy label and
verify the configuration:
Example
rm cs policylabel <labelName>
Navigate to Traffic Management > Content Switching > Policy Labels, configure a policy label, bind
policies to the label, and optionally specify a priority, gotoPriority expression, and an invoke option.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
After you create your content switching virtual server and policies, you bind each policy to the content
switching virtual server. When binding the policy to the content switching virtual server, you specify
the target load balancing virtual server.
Note
If your content switching policy uses a default syntax rule, you can configure a content switching
action for the policy. If you configure an action, you must specify the target load balancing virtual
server when you are configuring the action, not when you are binding the policy to the content
switching virtual server. For more information about configuring a content switching action, see
Configuring a Content Switching Action.
To bind a policy to a content switching virtual server and select a target load balancing
virtual server by using the command line interface
Example:
Note
The parameters, target load balancing virtual server (targetVserver), go to priority expression
(gotoPriorityExpression), and invoke method (invoke) cannot be used if a policy has an action.
To bind a policy to a content switching virtual server and select a target load balancing
virtual server by using the configuration utility
Navigate to Traffic Management > Content Switching > Virtual Servers, open a virtual server and,
in the
Content Switching Policy Binding section, bind a policy to the virtual server, and specify a target load
balancing virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure policy based logging for a content switching policy. Policy based logging enables
you to specify a format for log messages. The contents of the log message are defined by using a
default syntax expression in the content switching policy. When the content switching action specified
in the policy is performed, the NetScaler appliance constructs the log message from the expression
and writes the message to the log file. Policy based logging is particularly useful if you want to test
and troubleshoot a configuration in which content switching actions identify the target load balancing
virtual server at run time.
Note
If multiple policies bound to a given virtual server evaluate to TRUE and are configured with an
audit message action, the NetScaler appliance does not perform all the audit message actions. It
performs only the audit message action that is configured for the policy whose content switching
action is performed.
To configure policy based logging for a content switching policy, you must first configure an audit
message action. For more information about configuring an audit message action, see Configuring
the NetScaler appliance for Audit Logging. After you configure the audit message action, you specify
the action in a content switching policy.
To configure policy based logging for a content switching policy by using the command
line interface
At the command line, type the following commands to configure policy based logging for a content
switching policy and verify the configuration:
Example
To configure policy based logging for a content switching policy by using the
configuration utility
Navigate to Traffic Management > Content Switching > Policies, open a policy and, in the Log Action
list, select a log action for the policy.
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
To verify that your content switching configuration is correct, you need to view the content switching
entities. To verify proper operation after your content switching configuration has been deployed, you
can view the statistics that are generated as the servers are accessed.
You can view the properties of content switching virtual servers that you have configured on the
NetScaler appliance. You can use the information to verify whether the virtual server is correctly
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 its traffic-management settings.
The content switching policies are displayed in the order of their priority. If more than one policy has
the same priority, they are shown in the order in which they are bound to the virtual server.
Note
If you have configured the content switching virtual server to forward traffic to a load balancing
virtual server, you can also view the content switching policies by viewing the properties of the
load balancing virtual server.
To view the properties of content switching virtual servers by using the command line interface
To list basic properties of all content switching virtual servers in your configuration, or detailed prop-
erties 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 1.
2 show cs vserver Vserver-CS-1
3 Vserver-CS-1 (10.102.29.161:80) - HTTP Type: CONTENT
4 State: UP
5 Last state change was at Thu Jun 30 10:48:59 2011
6 Time since last state change: 6 days, 20:03:00.760
7 Client Idle Timeout: 180 sec
8 Down state flush: ENABLED
9 Disable Primary Vserver On Down : DISABLED
10 Appflow logging: DISABLED
11 Port Rewrite : DISABLED
12 State Update: DISABLED
You can view the properties of the content switching policies that you defined, such as the name,
domain, and URL or expression, and use the information to find any mistakes in the configuration, or
to troubleshoot if something is not working as it should.
To view the properties of content switching policies by using the command line interface
To list either basic properties of all content switching policies in your configuration or detailed prop-
erties of a specific content switching policy, at the command prompt, type one of the following com-
mands:
• show cs policy
• show cs policy \<PolicyName\>
Example
1 show cs policy
2
3 show cs policy Policy-CS-1
To view the properties of content switching policies by using the configuration utility
Navigate to Traffic Management > Content Switching > Policies, select a policy and, in the Action
list, select Show Bindings.
The Content Switching Visualizer is a tool that you can use to view a content switching configuration
in graphical format. You can use the visualizer to view the following configuration items:
• A summary of the load balancing virtual servers to which the content switching virtual server is
bound.
• All services and service groups that are bound to the load balancing virtual server and all moni-
tors 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 be content
switching policies. Many types of policies, such as Rewrite policies, can be bound 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 the configuration util-
ity.
To view a content switching configuration by using the Visualizer in the configuration utility
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 Related Tasks tab, and then
click Statistics.
6. To view a comparative list of the parameters whose values either differ or are not defined across
service containers for a load balancing virtual server, click the icon for a container, 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 Attributes Diff di-
alog box, in the Group column for the container, click Details. This comparative list helps you
determine which service container has the configuration you want to apply to all the service
containers.
8. To view the number of requests received per second at a given point in time by the virtual servers
in the configuration, and the number of hits per second at a given point in time for rewrite,
responder, and cache policies, click Show Stats. The statistical information is displayed on the
respective nodes in the Visualizer. This information is not 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 appliance nCore builds.
9. To copy configuration details for an element to a document or spreadsheet, click the icon for
that element, click Related Tasks, click Copy Properties, and then paste the information into a
document.
10. To export the entire configuration that is displayed in the Visualizer to an application template
file, click the icon for the content switching virtual server, click Related Tasks, and then click
Create Template. When creating the application template, you can configure variables in some
policy expressions and actions. For more information about creating the application template
file and configuring variables for a template, see AppExpert.
1.
2. Citrix ADC
3. NetScaler 12.0
December 5, 2018
Contributed by:
C
After you configure a basic content switching setup, you might need to customize it to meet your re-
quirements. If your web servers are UNIX-based and rely on case sensitive pathnames, you can con-
figure case sensitivity for policy evaluation. You can also set precedence for evaluation of the content
switching policies that you configured. You can configure HTTP and SSL content switching virtual
servers to listen on multiple ports instead of creating separate virtual servers. If you want to config-
ure content switching for a specific a virtual LAN, you can configure a content switching virtual server
with a listen policy.
You can configure the content switching virtual server to treat URLs as case sensitive in URL-based
policies. When case sensitivity is configured, the NetScaler appliance considers case when evaluating
policies. For example, if case sensitivity is off, the URLs /a/1.htm and /A/1.HTM are treated as identical.
If case sensitivity is on, those URLs are treated as separate and can be switched to different targets.
Example:
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual
server.
2. In Advanced Settings, select Traffic Settings, and then select Case Sensitive.
Precedence refers to the order in which policies that are bound to a virtual server are evaluated. You
do not normally have to configure precedence: the default precedence works correctly in many cases.
If you want to make sure that one policy or set of policies is applied first, however, and another policy
or set of policies is applied only if the first set does not match a request, you can configure either
URL-based precedence or rule-based precedence.
If there are multiple matching URLs for the incoming request, the precedence (priority) for URL-based
policies is:
If you configure precedence based on URL, the request URL is compared to the configured URLs. If
none of the configured URLs match the request URL, then rule-based policies are checked. If the re-
quest URL does not match any rule-based policies, or if the content group selected 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 the request is for-
warded 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 based on client attributes
(such as Accept-Language), you must use rule-based precedence.
If you configure precedence based on rules, which is the default setting, the request is tested on the
basis of the rule-based policies you have configured. If the request does not match any rule-based
policies, or if the content group selected for the incoming request is down, the request is processed
in the following manner:
• If a default group is configured for the content switching virtual server, the request is forwarded
to the default group.
• If the configured default group is down or if no default group is configured, an “HTTP 404 Not
Found” error message is sent to the client.
Example:
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual
server.
2. In Advanced Settings, select Traffic Settings, and then specify Precedence.
Support for multiple ports for HTTP and SSL type content switching virtual servers
You can configure the NetScaler appliance so that HTTP and SSL content switching virtual servers
listen on multiple ports, without having to configure separate virtual servers. This feature is especially
useful if you want to base a content switching decision on a part of the URL and other L7 parameters.
Instead of configuring multiple virtual servers with the same IP address and different ports, you can
configure one IP address and specify the port as *. As a result, the configuration size is also reduced.
To configure an HTTP or SSL content switching virtual server to listen on multiple ports by
using the command line
Example
To configure an HTTP or SSL content switching virtual server to listen on multiple ports by
using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and create a virtual
server of type HTTP or SSL.
2. Use an asterisk (*) to specify the port.
If you want to configure content switching for traffic on a specific virtual local area network (VLAN),
you can create a wildcarded virtual server with a listen policy that restricts it to processing traffic only
on the specified VLAN.
To configure a wildcarded virtual server that listens to a specific VLAN by using the command
line interface
Example:
To configure a wildcarded virtual server that listens to a specific VLAN by using the
configuration utility
Navigate to Traffic Management > Content Switching > Virtual Servers, and configure a virtual
server. Specify a listen policy that restricts it to processing traffic only on the specified VLAN.
After you have created this virtual server, you bind it to one or more services as described in Binding
Services to the Virtual Server.
You can specify the version of Microsoft® SQL Server® for a content switching virtual server that is of
type MSSQL. The version setting is recommended if you expect some clients to not be running the
same version as your Microsoft SQL Server product. The version setting provides compatibility be-
tween the client-side and server-side connections by ensuring that all communication conforms to
the server’s version.
To set the Microsoft SQL Server version parameter by using the command line interface
At the command prompt, type the following commands to set the Microsoft SQL Server version pa-
rameter for a content switching virtual server and verify the configuration:
Example
To set the Microsoft SQL server version parameter by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, configure a virtual
server and specify the protocol as MYSQL.
2. In Advanced Settings, select MySQL, and specify the Server Version.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
For Diameter-protocol traffic, you can configure the NetScaler appliance (or virtual appliance) to act
as a relay agent that load balances and forwards a packet to the appropriate destination on the ba-
sis of the message content (AVP value in the message). Since the appliance does not perform any
application-level processing, it provides relaying services for all diameter applications as specified by
the configured content switching policies. Therefore, the appliance advertises the Relay Application
ID in the capability exchange answer (CEA) message when the client establishes a diameter connec-
tion. You must configure a content switching virtual server, load balancing virtual servers, and ser-
vices to represent the diameter nodes. When a request reaches the content switching virtual server,
the virtual server applies the content switching policies associated with that type of request. After
evaluating the policies, the content switching virtual server routes the request to the appropriate load
balancing virtual server, which sends it to the appropriate service.
A diameter interface provides a connection between the different diameter nodes. The following sam-
ple deployment uses Cx and Rx interfaces. A Cx interface provides a connection between a CSCF and
an HSS. An Rx interface provides a connection between a CSCF and a PCRF. All the messages reach the
NetScaler appliance. Depending on whether the message is for a Cx or an Rx interface, and on the con-
tent switching policies defined, the NetScaler appliance selects an appropriate load balancing server
pool.
Sample Configuration
1. For each entity, create a service, a load balancing server, and bind the service to the virtual
server.
2. Create a content switching virtual server and two actions (one for each load balancing virtual
server). Create two content switching policies and bind these policies to the content switching
1 add
cs vserver cs_diameter DIAMETER 10.1.1.10 3868
2 add
cs action cx_action -targetLBVserver vs_cx
3 add
cs action rx_action ‒ targetLBvserver vs_rx
4 add
cs policy cx_policy -rule ”DIAMETER.REQ.AUTH_APPLICATION_ID.EQ
(16777216)” -action cx_action
5 add cs policy rx_policy -rule ”DIAMETER.REQ.AUTH_APPLICATION_ID.EQ
(16777236)” -action rx_action
6 bind cs vserver cs_diameter -policyName rx_policy -priority 100
7 bind cs vserver cs_diameter -policyName cx_policy -priority 110
1.
2. Citrix ADC
3. NetScaler 12.0
November 2, 2018
Contributed by:
C
Content switching may fail when the content switching virtual server goes DOWN or fails to handle
excessive traffic, or for other reasons. To reduce the chances of failure, you can take the following
measures to protect the content switching setup against failure:
If the primary content switching virtual server is marked DOWN or DISABLED, the NetScaler appliance
can direct requests to a backup content switching virtual server. It can also send a notification mes-
sage to the client regarding the site outage or maintenance. The backup content switching virtual
server is a proxy and is transparent to the client.
When configuring the backup virtual server, you can specify the configuration parameter Disable Pri-
mary When Down to ensure that, when the primary virtual server comes back up, it remains the sec-
ondary until you manually force it to take over as the primary. This is useful if you want to ensure that
any updates to the database on the server for the backup are preserved, enabling you to synchronize
the databases before restoring the primary virtual server.
You can configure a backup content switching virtual server when you create a content switching
virtual server or when you change the optional parameters of an existing content switching virtual
server. You can also configure a backup content switching virtual server for an existing backup con-
tent switching virtual server, thus creating cascaded backup content switching virtual servers. The
maximum depth of cascaded backup content switching virtual servers is 10. The appliance searches
for a backup content switching virtual server that is up and accesses that content switching virtual
server to deliver the content.
Note: If a content switching virtual server is configured with both a backup content switching
virtual server and a redirect URL, the backup content switching virtual server takes precedence
over the redirect URL. The redirect is used when the primary and backup virtual servers are down.
To set up a backup content switching virtual server by using the command line interface
Example
To set up a backup content switching virtual server by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, configure a virtual server
and specify the protocol as MYSQL.
2. In Advanced Settings, select Protection, and specify a Backup Virtual Server.
The spillover option diverts new connections arriving at a content switching virtual server to a backup
content switching virtual server when the number of connections to the content switching virtual
server exceeds the configured threshold value. The threshold value is dynamically calculated, or you
can set the value. The number of established connections (in case of TCP) at the virtual server is com-
pared with the threshold value. When the number of connections reaches the threshold, new connec-
tions are diverted to the backup content switching virtual server.
If the backup content switching virtual servers reach the configured threshold and are unable to take
the load, the primary content switching virtual server diverts all requests to the redirect URL. If a redi-
rect URL is not configured on the primary content switching virtual server, subsequent requests are
dropped.
To configure a content switching virtual server to divert new connections to a backup virtual
server by using the command line interface
Example
To set a content switching virtual server to divert new connections to a backup virtual server
by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, configure a virtual server
and specify the protocol as MYSQL.
2. In Advanced Settings, select Protection, and configure spillover.
You can configure a redirect URL to communicate the status of the NetScaler appliance in the event
that a content switching virtual server of type HTTP or HTTPS is DOWN or DISABLED. This URL can be
local or remote.
Redirect URLs can be absolute URLs or relative URLs. If the configured redirect URL contains an abso-
lute URL, the HTTP redirect is sent to the configured location, regardless of the URL specified in the
incoming HTTP request. If the configured redirect URL contains only the domain name (relative URL),
the HTTP redirect is sent to a location after appending the incoming URL to the domain configured in
the redirect URL.
Citrix recommends using an absolute URL. That is, a URL ending in /, for example www.example.com/
instead of a relative URL. A relative URL redirection might result in the vulnerability scanner reporting
a false positive.
Note: If a content switching virtual server is configured with both a backup virtual server and a redirect
URL, the backup virtual server takes precedence over the redirect URL. A redirect URL is used when
the primary and backup virtual servers are down.
When redirection is configured and the content switching virtual server is unavailable, the appliance
issues an HTTP 302 redirect to the user’s browser.
To configure a redirect URL for when the content switching virtual server is unavailable by
using the command line interface
Example
To configure a redirect URL for when the content switching virtual server is unavailable by
using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, configure a virtual server
and specify the protocol as MYSQL.
2. In Advanced Settings, select Protection, and specify a Redirect URL.
The content switching feature enables the distribution of client requests across multiple servers on
the basis of the specific content presented to the users. For efficient content switching, the content
switching virtual server distributes the traffic to the load balancing virtual servers according to the
content type, and the load balancing virtual servers distribute the traffic to the physical servers ac-
cording to the specified load balancing method.
For smooth traffic management, it is important for the content switching virtual server to know the sta-
tus of the load balancing virtual servers. The state update option helps to mark the content switching
virtual server DOWN if the load balancing virtual server bound to it is marked DOWN. A load balancing
virtual server is marked DOWN if all the physical servers bound to it are marked DOWN.
The status of the content switching virtual server is marked as UP. It remains UP even if there is no
bound load balancing virtual server that is UP.
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 content switching virtual
server becomes UP.
If more than one load balancing virtual server is bound and if one of them is specified as the default,
the status of the content switching virtual server reflects the status of the default load balancing virtual
server.
If more than one load balancing virtual server is bound without any of them being specified as the
default, the status of the content switching virtual server is marked UP only if all the bound load bal-
ancing virtual servers are UP.
To configure the state update option by using the command line interface
Example
1. Navigate to Traffic Management > Content Switching > Virtual Servers, configure a virtual server
and specify the protocol as MYSQL.
2. In Advanced Settings, select Traffic Settings, and then select State Update.
When a physical server receives a surge of requests, it becomes slow to respond to the clients 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, the NetScaler appliance provides
features such as surge protection, which controls the rate at which new connections to a service can
be established.
The appliance does connection multiplexing between clients and physical servers. When it receives a
client request to access a service on a server, the appliance looks for an already established connection
to the server that is free. If it finds a free connection, it uses that connection to establish a virtual
link between the client and the server. If it does not find an 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 appliance cannot establish a new connection with the server, it sends the client
request to a surge queue. If all the physical servers bound to the load balancing or content switching
virtual server reach the upper limit on client connections (max client value, surge protection threshold
or maximum capacity of the service), the appliance cannot establish a connection with any server. The
surge protection feature uses the surge queue to regulate the speed at which connections are opened
with the physical servers. The appliance maintains a different surge queue for each service bound to
the virtual server.
The length of a surge queue increases whenever a request comes for which the appliance cannot es-
tablish a connection, and the length decreases whenever a request in the queue gets 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 flush it. You can
flush the surge queue of a specific service or service group, or of all the services and service groups
bound to a load balancing virtual server. Flushing a surge queue does not affect the existing connec-
tions. 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 content switching virtual
server forwards some requests to a particular load balancing virtual server, and the load balancing vir-
tual server also receives some other requests, when you flush the surge queue of the content switch-
ing virtual server, only the requests received from this content switching virtual server are flushed;
the other requests in the surge queue of the load balancing virtual server are not flushed.
Note: You cannot flush the surge queues of cache redirection, authentication, VPN or GSLB vir-
tual servers or GSLB services.
Do not use the Surge Protection feature if Use Source IP (USIP) is enabled.
• You can specify the name of a service, service group, or virtual server whose surge queue has to
be flushed.
• If you specify a name while executing the command, surge queue of the specified entity will be
flushed. If more than one entity has the same name, the appliance flushes surge queues of all
those entities.
• If you specify the name of a service group, and a server name and port while executing the com-
mand, the appliance flushes the surge queue of only the specified service group member.
• You cannot directly specify a service group member (<serverName> and <port>) without
specifying 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 the surge queue for
a specific service group member.
• If you execute the command without specifying any names, the appliance flushes the surge
queues of all the entities present on the appliance.
• If a service group member is identified with a server name, you must specify the server name in
this command; you cannot specify its IP address.
Examples
Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server and, in
the Action list, select Flush Surge Queue.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
After a content switching setup is configured, it may require periodic changes. When operating sys-
tems or software are updated, or hardware wears out and is replaced, you may need to take down
your setup. Load on your setup may increase, requiring additional resources. You may also modify
the configuration to improve performance.
These tasks may require unbinding policies from the content switching virtual server, or disabling or
removing content switching virtual servers. After you have made changes to your setup, you may need
to re-enable servers and rebind policies. You might also want to rename your virtual servers.
When you unbind a content switching policy from its virtual server, the virtual server no longer in-
cludes that policy when determining where to direct requests.
To unbind a policy from a content switching virtual server by using the command line interface
Example:
To unbind a policy from a content switching virtual server by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open the virtual
server.
2. Click in the Policies section, select the policy, and click Unbind.
You normally remove a content switching virtual server only when you no longer require the virtual
server. When you remove a content switching virtual server, the NetScaler appliance first unbinds all
policies from the content switching virtual server, and then removes it.
To remove a content switching virtual server by using the command line interface
rm cs vserver <name>
Example:
1 rm cs vserver Vserver-CS-1
Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server, and
click Delete.
Content switching virtual servers are enabled by default when you create them. You can disable a
content switching virtual server for maintenance. If you disable the content switching virtual server,
the state of the content switching virtual server changes to Out of Service. While out of service, the
content switching virtual server does not respond to requests.
Example:
Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server and,
in the Action list, select Enable or Disable.
You can rename a content switching virtual server without unbinding it. The new name is propagated
automatically to all affected parts of the NetScaler appliance configuration.
Example:
Navigate to Traffic Management > Content Switching > Virtual Servers, select a virtual server and,
in the Action list, select Rename.
You can modify an existing policy by configuring rules or changing the URL of the policy, or you can
remove a policy. You can also rename an existing advanced content switching policy. You can create
different policies based on the URL. URL-based policies can be of different types, as described in the
following table.
Note
You can configure rule-based content switching using classical policy expressions or advanced
policy expressions.
Example:
November 2, 2018
Contributed by:
C
To ensure efficient management of client connections, you can configure the content switching virtual
servers on the NetScaler appliance.
• Configuring the ICMP Response. You can configure the NetScaler appliance to send ICMP re-
sponses to PING requests according to your settings. On the IP address corresponding to the
virtual server, set the ICMP RESPONSE to VSVR_CNTRLD, and on the virtual server, set the 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, the NetScaler
appliance always responds.
– When you set ICMP VSERVER RESPONSE to ACTIVE on all virtual servers, the NetScaler ap-
pliance responds even if one virtual server is UP.
– When you set ICMP VSERVER RESPONSE to ACTIVE on some and PASSIVE on others,
NetScaler appliance responds even if one virtual server set to ACTIVE is UP.
The NetScaler appliance cache redirection feature redirects HTTP requests to a cache. You can signif-
icantly reduce the burden of responding to HTTP requests and improve your Web site performance
through proper implementation of the cache redirection feature.
A cache stores frequently requested HTTP content. When you configure cache redirection on a virtual
server, the NetScaler appliance sends cacheable HTTP requests to the cache and non-cacheable HTTP
requests to the origin Web server. For more information on cache redirection, see “Cache Redirection.”
To configure cache redirection on a virtual server by using the command line interface
Example
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings, and select Cacheable.
Under certain conditions, you can configure the down state flush setting to terminate existing con-
nections when a service or a virtual server is marked DOWN. Terminating existing connections frees
resources and in certain cases speeds recovery of overloaded load balancing setups.
To configure the down state flush setting on a virtual server by using the command line
interface
Example
To configure the down state flush setting on a virtual server by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings, and then select Down State Flush.
Virtual servers and the services that are bound to them may use different ports. When a service re-
sponds to an HTTP connection with a redirect, you may need to configure the NetScaler appliance to
modify the port and the protocol to ensure that the redirection goes through successfully. You do this
by enabling and configuring the redirectPortRewrite setting.
To configure HTTP redirection on a virtual server by using the command line interface
Example
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings, and select Rewrite.
Inserting the IP Address and Port of a Virtual Server in the Request Header
If you have multiple virtual servers that communicate with different applications on the same service,
you must configure the NetScaler appliance to add the IP address and port number of the appropri-
ate 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 that sent the request.
If the primary virtual server is down and the backup virtual server is up, the configuration settings
of the backup virtual server are added to the client requests. If you want the same header tag to be
added, regardless of whether the requests are from the primary virtual server or backup virtual server,
you must configure the required header tag on both virtual servers.
Note: This option is not supported for wildcarded virtual servers or dummy virtual servers.
To insert the IP address and port of the virtual server in the client requests by using the
command line interface
Example
To insert the IP address and port of the virtual server in the client requests by using the
configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings and, in the Virtual Server IP Port Insertion list, select
VIPADDR or V6TOV4MAPPING, and specify a port header in Virtual Server IP Port Insertion Value.
You can configure a virtual server to terminate any idle client connections after a configured time-out
period elapses. When you configure this setting, the NetScaler appliance waits for the time you specify
and, if the client is idle after that time, it closes the client connection.
To set a time-out value for idle client connections by using the command line interface
Example
To set a time-out value for idle client connections by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings, and specify a Client Idle Time-Out value.
You can now set the L2Conn option for a content switching virtual server. With the L2Conn option set,
connections to the content switching virtual server are identified by the combination of the 4-tuple
(<source IP>:<source port>::<destination IP>:<destination port>) and Layer 2 connection parameters.
The Layer 2 connection parameters are the MAC address, VLAN ID, and channel ID.
To set the L2Conn option for a content switching virtual server by using the command line
interface
At the command line, type the following commands to configure the L2Conn parameter for a content
switching virtual server and verify the configuration:
Example
To set the L2Conn option for a content switching virtual server by using the configuration utility
1. Navigate to Traffic Management > Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Traffic Settings, and then select Layer 2 Parameters.
1.
2. Citrix ADC
3. NetScaler 12.0
Troubleshooting
Contributed by:
C
If the content switching feature does not work as expected after you have configured it, you can use
some common tools to access NetScaler appliance resources and diagnose the problem.
For best results, use the following resources to troubleshoot a content switching issue on a NetScaler
appliance:
• Configuration file
• Relevant newnslog file
• Trace files
• Network topology diagram for the network setup of the customer
• Citrix documentation, such as release notes, Knowledge Center articles, and eDocs
The most common content switching issues involve the content switching feature not working at all,
or working only intermittently, and Service Unavailable responses.
• Issue
The content switching feature is not functioning.
Resolution
Check the configuration as follows:
– Verify that the appliance is licensed for content switching.
– Verify that the feature is enabled.
– From the configuration file, verify that valid content switching policies are correctly bound
to the load balancing virtual servers.
• Issue
Client receives a 503 - Service Unavailable response.
Resolution
– Verify the URL and policy bindings. The client receives the 503 response when none of the
policies you have configured is evaluated and no default load balancing virtual server is
defined and bound to the content switching virtual server.
– From the configuration, verify the policies and URL being accessed by the client.
– Verify that for every type of request the respective policy is evaluated. If the policy is not
evaluated, check the policy expression and update it if necessary.
– Verify the URL and HTTP request and response headers. To do so, record an HTTPHeader
trace and, if necessary, record the packet traces on the appliance and the client.
• Issue
Intermittently, the content switching feature is not working as expected.
Resolution
– Study the network topology diagram, if available, of the setup to understand the various
devices installed between the client and the server(s).
– Verify the configuration and policy bindings. Make sure that the URL in the policy expres-
sion matches to the one in the client request.
– Verify that appropriate priorities are assigned to the policies. An incorrect precedence or
priority assigned to a policy can cause a problem.
– Run the following commands to verify the bindings and the values of the policy hit coun-
ters in the output of the commands:
– Using iehttpheaders or a similar utility, determine whether the HTTP headers for the re-
quests or responses provide any pointers to the issue.
– If the issue is still not resolved, contact Citrix Technical Support with appropriate data for
further investigation.
1.
2. Citrix ADC
3. NetScaler 12.0
DataStream
January 6, 2019
Contributed by:
C
The NetScaler DataStream feature provides an intelligent mechanism for request switching at the
database layer by distributing requests based on the SQL query being sent.
When deployed in front of database servers, a NetScaler appliance ensures optimal distribution of
traffic from the application servers and Web servers. Administrators can segment traffic according to
information in the SQL query and on the basis of database names, usernames, character sets, and
packet size.
You can either configure load balancing to switch requests based on load balancing algorithms or
elaborate the switching criteria by configuring content switching to make a decision based on an SQL
query parameters. You can further configure monitors to track the state of database servers.
Note: NetScaler DataStream is supported only for MySQL and MS SQL databases. For information
about the supported protocol version, character sets, special queries, and transactions, see DataS-
tream Reference.
In DataStream, the ADC appliance is placed in-line between the application and/or Web servers and
the database servers. On the appliance, the database servers are represented by services.
A typical DataStream deployment consists of the entities described in the following diagram.
As shown in this figure, a DataStream configuration can consist of an optional content switching vir-
tual server (CS), a load balancing setup consisting of load balancing virtual servers (LB1 and LB2) and
services (Svc1, Svc2, Svc3, and Svc4), and content switching policies (optional).
The clients (application or Web servers) send requests to the IP address of a content switching virtual
server (CS) configured on the NetScaler appliance. The appliance, then, authenticates the clients us-
ing the database user credentials configured on the appliance. The content switching virtual server
(CS) applies the associated content switching policies to the requests. After evaluating the policies,
the content switching virtual server (CS) routes the requests to the appropriate load balancing virtual
server (LB1 or LB2), which, then, distributes the requests to the appropriate database servers (repre-
sented by services on the appliance) based on the load balancing algorithm. The NetScaler appliance
uses the same database user credentials to authenticate the connection with the database server.
If a content switching virtual server is not configured on the appliance, the clients (application or Web
servers) send their requests to the IP address of a load balancing virtual server configured on the
appliance. The NetScaler appliance authenticates the client by using the database user credentials
configured on the appliance, and then uses the same credentials to authenticate the connection with
the database server. The load balancing virtual server distributes the requests to the database servers
according to the load balancing algorithm. The most effective load balancing algorithm for database
switching is the least connection method.
DataStream uses connection multiplexing to enable multiple client-side requests to be made over the
same server-side connection. The following connection properties are considered:
• User name
• Database name
• Packet size
• Character set
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
In databases, a connection is always stateful, which means that as soon as a connection is established,
it must be authenticated.
You need to configure your database user name and password on the NetScaler appliance. For exam-
ple, if you have a user John configured on the database, you need to configure the user John on the
ADC too. When you add the database user names and passwords on the ADC, these are added to the
nsconfig file.
Note
The ADC uses these user credentials to authenticate the clients, and then authenticate the server con-
nections with the database servers.
Example:
Navigate to System > User Administration > Database Users, and configure a database user.
If you have changed the password of the database user on the database server, you must reset the
password of the corresponding user configured on the ADC appliance.
To reset the password of a database user by using the command line interface
Example:
Navigate to System > User Administration > Database Users, select a user, and enter new values for
the password.
If a database user no longer exists on the database server, you can remove the user from the ADC
appliance. However, if the user continues to exist on the database server and you remove the user
from the ADC appliance, any request from the client with this user name does not get authenticated,
and therefore, does not get routed to the database server.
1 rm db user <username>
Example:
1 rm db user nsdbuser
Navigate to System > User Administration > Database Users, select a user, and click Delete.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A database profile is a named collection of parameters that is configured once but applied to multiple
virtual servers that require those particular parameter settings. After creating a database profile, you
bind it to load balancing or content switching virtual servers. You can create as many profiles as you
need.
At the command line, type the following commands to create a database profile and verify the config-
uration:
Example:
Navigate to System > Profiles and, on the Database Profiles tab, configure a database profile.
1. Navigate to Traffic Management > Load Balancing > Virtual Servers or Traffic Management
> Content Switching > Virtual Servers, and open a virtual server.
2. In Advanced Settings, select Profiles and, in the DB Profile list, select a profile to bind to the
virtual server. To create a new profile, click plus (+).
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Before configuring a load balancing setup, you must enable the load balancing feature. Then, begin
by creating at least one service for each database server in the load balancing group. With the services
configured, you are ready to create a load balancing virtual server and bind the services to the virtual
server.
Note:
For databases, the load balancing can only occur on homogenous database servers (database
servers that contain the exact same databases). For a configuration that contains unique
databases on different servers, you must use content switching. If some of your database
servers host identical content, you can use load balancing on those servers only. You can
then use content switching policies to send requests to the load balancing virtual server that
manages load balancing for those databases.
The NetScaler appliance currently stores the database name and login information during the
database session. When a query is made to the database, it uses that information to connect to
the specific database server.
• Protocol
Use the
MYSQL protocol type for MySQL databases and
MSSQL protocol type for MS SQL databases while configuring virtual servers and services. The
MySQL and TDS protocols are used by the clients to communicate with the respective database
servers by using SQL queries. For information about the MySQL protocol, see
http://dev.mysql.com/doc/internals/en/client-server-protocol.html. For information about
the TDS protocol, see
http://msdn.microsoft.com/en-us/library/dd304523(v=prot.13).aspx.
• Port
Port on which the virtual server listens for client connections. Use port 3306 for MySQL database
servers.
• Method
It is recommended that you use the Least Connection method for better load balancing and
lower server load. However, other methods, such as Round Robin, Least Response Time, Source
IP Hash, Source IP Destination IP Hash, Least Bandwidth, Least Packets, and Source IP Source
Port Hash, are also supported.
Note: URL Hash method is not supported for DataStream.
If you are using the Microsoft SQL Server, and you expect some clients to not be running the
same version as your Microsoft SQL Server product, set the
Server Version parameter for the load balancing virtual server. The version setting provides
compatibility between the client-side and server-side connections by ensuring that all commu-
nication conforms to the server’s version. For more information about setting the
Server Version parameter, see
Configuring the MySQL and Microsoft SQL server version setting.
If you are using the MySQL Server, and you expect some clients to not be running the same
version as your MySQL Server product, set the Server Version parameter for the load balancing
virtual server. The version setting provides compatibility between the client-side and server-
side connections by ensuring that all communication conforms to the server’s version. For more
information about setting the
Server Version parameter, see
Configuring the MySQL and Microsoft SQL server version setting.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can segment traffic according to information in the SQL query, on the basis of database names,
user names, character sets, and packet size.
You can configure content switching policies with default syntax expressions to switch content based
on connection properties, such as user name and database name, command parameters, and the SQL
query to select the server.
The default syntax expressions evaluate traffic associated with MYSQL and MS SQL database servers.
You can use request-based expressions in default syntax policies to make request switching decisions
at the content switching virtual server bind point and response-based expressions (expressions that
begin with MYSQL.RES) to evaluate server responses to user-configured health monitors.
Note:
For databases, the load balancing can only occur on homogenous database servers (database
servers that contain the exact same databases). For a configuration that contains unique
databases on different servers, you must use content switching. If some of your database
servers host identical content, you can use load balancing on those servers only. You can
then use content switching policies to send requests to the load balancing virtual server that
manages load balancing for those databases.
The NetScaler appliance currently stores the database name and login information during the
database session. When a query is made to the database, it uses that information to connect to
the specific database server.
• Protocol
Use the
MYSQL protocol type for MySQL databases and
MSSQL protocol type for MS SQL databases while configuring virtual servers and services. The
MySQL and TDS protocols are used by the clients to communicate with the respective database
servers by using SQL queries. For information about the MySQL protocol, see
an SQL query to the database server and evaluate the server response to check whether it matches
the configured rule.
Examples:
In the following example, the value of the error message is evaluated to determine the state of the
server.
In the following example, the number of rows in the response is evaluated to determine the state of
the server.
In the following example, the value of a particular column is evaluated to determine the state of the
server.
Examples:
In the following example, the value of the error message is evaluated to determine the state of the
server.
In the following example, the number of rows in the response is evaluated to determine the state of
the server.
In the following example, the value of a particular column is evaluated to determine the state of the
server.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A commonly used deployment scenario is the master/slave database architecture where the master
database replicates all information to the slave databases.
For master/slave database architecture, you may want all WRITE requests to be sent to the master
database and all READ requests to the slave databases.
The following figure shows the entities and the values of the parameters you need to configure on the
appliance.
Figure 1. DataStream Entity Model for Master/Slave Database Setup
In this example scenario, a service (Svc_mysql_1) is created to represent the master database and is
bound to a load balancing virtual server (Lb_vsr_mysql_master). Three more services (Svc_mysql_2,
Svc_mysql_3, and Svc_mysql_4) are created to represent the three slave databases, and they are
bound to another load balancing virtual server (Lb_vsr_mysql_slave).
A content switching virtual server (Cs_vsr_mysql_1) is configured with associated policies to send all
WRITE requests to the load balancing virtual server, Lb_vsr_mysql_master, and all READ requests to
the load balancing virtual server, Lb_vsr_mysql_slave.
When a request reaches the content switching virtual server, the virtual server applies the associated
content switching policies to that request. After evaluating the policies, the content switching virtual
server routes the request to the appropriate load balancing virtual server, which sends it to the appro-
priate service.
The following table lists the names and values of the entities and the policy configured on the
NetScaler appliance.
To configure DataStream for a master/slave database setup by using the command line
interface
12
13 bind lb vserver Lb_vsr_mysql_master svc_mysql_1
14
15 bind lb vserver Lb_vsr_mysql_slave svc_mysql_2
16
17 bind lb vserver Lb_vsr_mysql_slave svc_mysql_3
18
19 bind lb vserver Lb_vsr_mysql_slave svc_mysql_4
20
21 add cs vserver Cs_vsr_mysql_1 mysql 10.102.29.161 3306
22
23 add cs policy Cs_select ‒ rule ”MYSQL.REQ.QUERY.COMMAND.contains(”
select”)”
24
25 bind cs vserver Cs_vsr_mysql_1 Lb_vsr_mysql_master
26
27 bind cs vserver Cs_vsr_mysql_1 Lb_vsr_mysql_slave ‒ policy Cs_select ‒
priority 10
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can configure the token method of load balancing for DataStream to base the selection of
database servers on the value of the token extracted from the client (application or web server)
requests. These tokens are defined by using SQL expressions. For subsequent requests with the
same token, the Citrix ADC appliance sends the requests to the same database server that handled
the initial request. Requests with the same token are sent to the same database server until the
maximum connection limit is reached or the session entry has aged out.
You can use the following sample SQL expressions to define tokens:
MySQL MS SQL
MYSQL.REQ.QUERY.TEXT MSSQL.REQ.QUERY.TEXT
MYSQL.REQ.QUERY.TEXT(n) MSSQL. REQ.QUERY.TEXT(n)
MYSQL.REQ.QUERY.COMMAND MSSQL.REQ.QUERY.COMMAND
MYSQL.CLIENT.USER MSSQL.CLIENT.USER
MYSQL.CLIENT.DATABASE MSSQL.CLIENT.DATABASE
MYSQL.CLIENT.CAPABILITIES
The following example shows how the Citrix ADC DataStream feature works when you configure the
token method of load balancing.
Figure 1. How DataStream Works with the Token Method of Load Balancing
In this example, the token is the name of the database. A request with token books is sent to Database
Server1 and a request with token music is sent to Database Server2. All subsequent requests with
token books are sent to Database Server1 and requests with token music are sent to Database Server2.
This configuration provides pseudo persistence with the database servers.
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, configure a virtual server
and specify the protocol as MYSQL.
2. Click in the Service section, and configure two services specifying the protocol as MYSQL. Bind
these services to the virtual server.
3. In Advanced Settings, click Method and, in the Load Balancing Method list, select TOKEN and
specify the expression as MYSQL.CLIENT.DATABASE.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure the Citrix ADC appliance to operate transparently between MSSQL clients and
servers, and to only log or analyze details of all client-server transactions. Transparent mode is de-
signed so that the Citrix ADC appliance only forwards MSSQL requests to the server, and then relays
the server’s responses to the clients. As the requests and responses pass through the appliance,
the appliance logs information gathered from them, as specified by the audit logging or AppFlow
configuration, or collects statistics, as specified by the Action Analytics configuration. You do not
have to add database users to the appliance.
When operating in transparent mode, the Citrix ADC appliance does not perform load balancing, con-
tent switching, or connection multiplexing for the requests. However, it responds to a client’s pre-
login packet on behalf of the server so that it can prevent encryption from being agreed upon during
the pre-login handshake. The login packet and subsequent packets are forwarded to the server.
For logging or analyzing MSSQL requests in transparent mode, you have to do the following:
• Configure the Citrix ADC appliance as the default gateway for both clients and servers.
• Do one of the following on the Citrix ADC appliance:
– If you can configure the use source IP address (USIP) option globally, create a load bal-
ancing virtual server with a wildcard IP address and the port number on which the MSSQL
servers listen for requests (a port-specific wildcard virtual server). Then, enable the USIP
option globally. If you configure a port-specific wildcard virtual server, you do not have to
create MSSQL services on the appliance. The appliance discovers the services on the basis
of the destination IP address in the client requests.
– If you do not want to configure the USIP option globally, create MSSQL services with
the USIP option enabled on each of them. If you configure services, you do not have to
create a port-specific wildcard virtual server.
• Configure audit logging, AppFlow, or Action Analytics to log or collect statistics about the re-
quests. If you configure a virtual server, you can bind your policies either to the virtual server
or to the global bind point. If you do not configure a virtual server, you can bind your policies
to only the global bind point.
You can configure transparent mode by configuring a port-specific wildcard virtual server and en-
abling Use Source IP (USIP) mode globally. When a client sends its default gateway (the Citrix ADC
appliance) a request with the IP address of an MSSQL server in the destination IP address header, the
appliance checks whether the destination IP address is available. If the IP address is available, the
virtual server forwards the request to the server. Otherwise, it drops the request.
At the command prompt, type the following commands to create a wildcard virtual server and verify
the configuration:
Example:
Navigate to Traffic Management > Load Balancing > Virtual Servers, and create a virtual server. Specify
MSSQL as the protocol and * as the IP address.
At the command prompt, type the following commands to enable USIP mode globally and verify the
configuration:
Example:
1. Navigate to System > Settings and, in Modes and Features, select Configure Modes.
2. Select Use Source IP.
You can configure transparent mode by configuring MSSQL services and enabling USIP on each ser-
vice. When a client sends its default gateway (the Citrix ADC appliance) a request with the IP address
of an MSSQL server in the destination IP address header, the appliance forwards the request to the
destination server.
To create an MSSQL service and enable USIP mode on the service by using the command line
interface
At the command prompt, type the following commands to create an MSSQL service, with USIP en-
abled, and verify the configuration:
Example
1. Navigate to Traffic Management > Load Balancing > Services, and configure a service.
2. Specify protocol as MSSQL and, in Settings, select Use Source IP.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A database server farm should be load balanced not only on the basis of the states of the servers,
but also on the basis of the availability of the database on each server. A service might be up, and a
load balancing device might show it as being in the UP state, but the requested database might be
unavailable on that service. If a query is forwarded to a service on which the database is unavailable,
the request is not served. Therefore, a load balancing device must be aware of the availability of a
database on each service and, when making a load balancing decision, it must consider only those
services on which the database is available.
As an example, consider that database servers server1, server2, and server3 host databases my-
database1 and mydatabase2. If mydatabase1 becomes unavailable on server2, the load balancing
device must be aware of that change in state, and it must load balance requests for mydatabase1
across only server1 and server3. After mydatabase1 becomes available on server2, the load balancing
device must include server2 in load balancing decisions. Similarly, if mydatabase2 becomes unavail-
able on server3, the device must load balance requests for mydatabase2 across only server1 and
server2, and it must include server3 in its load balancing decisions only when mydatabase2 becomes
available. This load balancing behavior must be consistent across all the databases that are hosted
on the server farm.
The Citrix ADC appliance implements this behavior by retrieving a list of all the databases that are
active on a service. To retrieve the list of active databases, the appliance uses a monitor that is con-
figured with an appropriate SQL query. If the requested database is unavailable on a service, the ap-
pliance excludes the service from load balancing decisions until it becomes available. This behavior
ensures uninterrupted service to clients.
Note
Database specific load balancing is currently supported for only MSSQL and MySQL service types.
This support is also available for Microsoft SQL Server 2012 high availability deployment.
To set up database specific load balancing, you must enable the load balancing feature, configure a
load balancing virtual server of type MSSQL or MySQL, configure the services that host the database,
and bind the services to the virtual server. The monitor needs valid user credentials to log on to the
database server, so you must configure a database user account on each of the servers and then add
the user account to the Citrix ADC appliance. Then, you configure an MSSQL-ECV or MYSQL-ECV mon-
itor and bind the monitor to each service. Finally, you must test the configuration to ensure that it is
working as intended. Before you perform these configuration tasks, make sure you understand how
database specific load balancing works.
For database specific load balancing, you configure a monitor that periodically queries each database
server for the names of all the active databases on it. The Citrix ADC appliance stores the results, and
regularly updates the records on the basis of the information retrieved through monitoring. When
a client queries a particular database, the appliance uses the configured load balancing method to
select a service, and then checks its records to determine whether the database is available on that
service. If the records indicate that the database is not available, it uses the configured load balancing
method to select the next available service, and then repeats the check. The appliance forwards the
query to the first available service on which the database is active.
You can configure load balancing entities such as services and virtual servers when the load balancing
feature is disabled, but they will not function until you enable the feature.
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
1 enable ns feature LB
2
3 show ns feature
Example:
Navigate to System > Settings and, in Configure Basic Features, select Load Balancing.
Configuring a Load Balancing Virtual Server for Database Specific Load Balancing
To configure a virtual server to load balance databases on the basis of availability, you enable the
database specific load balancing parameter on the virtual server. Enabling the parameter modifies
the load balancing logic so that the Citrix ADC appliance refers the results of the monitoring probe
sent to the selected service, before forwarding the query to that service.
To configure a load balancing virtual server for database specific load balancing
At the command prompt, type the following command to configure a load balancing virtual server for
database specific load balancing and verify the configuration:
Configuring Services
After you enable the load balancing feature, you must create at least one service for each application
server that is to be included in your load balancing setup. The services that you configure provide
the connections between the Citrix ADC appliance and the load balanced servers. Each service has a
name and specifies an IP address, a port, and the type of data that is served.
If you create a service without first creating a server object, the IP address of the service is also the
name of the server that hosts the service. If you prefer to identify servers by name rather than IP
address, you can create server objects and then specify a server’s name instead of its IP address when
you create a service.
In databases, a connection is always stateful, which means that as soon as a connection is established,
it must be authenticated.
You need to configure your database user name and password on the Citrix ADC. For example, if you
have a user John configured on the database, you need to configure the user John on the ADC too.
When you add the database user names and passwords on the ADC, these are added to the nsconfig
file.
Note
The ADC uses these user credentials to authenticate the clients, and then authenticate the server con-
nections with the database servers.
Example:
Navigate to System > User Administration > Database Users, and configure a database user.
If you have changed the password of the database user on the database server, you must reset the
password of the corresponding user configured on the Citrix ADC appliance.
To reset the password of a database user by using the command line interface
Example:
Navigate to System > User Administration > Database Users, select a user, and enter new values for
the password.
If a database user no longer exists on the database server, you can remove the user from the Citrix ADC
appliance. However, if the user continues to exist on the database server and you remove the user
from the ADC appliance, any request from the client with this user name does not get authenticated,
and therefore, does not get routed to the database server.
1 rm db user <username>
Example:
1 rm db user nsdbuser
Navigate to System > User Administration > Database Users, select a user, and click Delete.
To retrieve a list of all the active databases on a database instance, you create a monitor that logs on
to the database server by using a valid user credentials and runs an appropriate SQL query. The SQL
query you need to use depends on your SQL server deployment. For example, in an MSSQL database
mirroring setup, you can use the following query to retrieve a list of active databases available on a
server instance.
In a MySQL database setup you can use the following queries to retrieve a list of active databases
available on a server instance.
show databases:
You also configure the monitor to evaluate the response for an error condition, and to store the results
if there is no error. If the response contains an error, the monitor marks the service as DOWN, and the
appliance excludes the service from load balancing decisions until an error is no longer returned.
Note
The database specific load balancing feature is supported only for the MSSQL and MySQL service
types. Therefore, the monitor type must be MSSQL-ECV or MYSQL-ECV.
To configure a monitor to retrieve the names of all the active databases hosted on a service by
using the command line
At the command prompt, type the following commands to retrieve the names of all the active
databases hosted on a service and verify the configuration:
To configure a monitor to retrieve the names of all the active databases hosted on a service by
using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Monitors and configure a monitor of type
MSSQL-ECV or MYSQL-ECV.
2. In Special Parameters, specify a user name, query, and a rule
For example, for MSSQL-ECV, the query should be “select name from sys.databases where
state=0”), and a rule should be MSSQL.RES.TYPE.NE(ERROR).
For MSSQL-ECV, the query should be “show databases” and a rule should be MYSQL.RES.TYPE.NE(ERROR).
Consider the following scenario in which database specific load balancing is configured in a high avail-
ability group deployment. S1 through S5 are the services on the ADC appliance. DB1 through DB4 are
the databases on the servers represented by the services S1 through S5. AV1 and AV2 are the avail-
ability groups. Each availability group contains up to one primary database server instance and up
to four secondary database server instances. A service, representing the servers in the availability
group, can be primary for one availability group and secondary for another availability group. Each
availability group contains different databases and one listener, which is a service. All requests arrive
on the listener service that resides on the primary database. AVI contains databases DB1 and DB2.
AV2 contains databases DB3 and DB4. L1 and L2 are the listeners on AV1 and AV2 respectively. S1 is the
primary service for AV1 and S2 is the primary service for AV2.
1. A READ query for AV1 is load balanced between S4 and S5. S1 is the primary for AV1.
2. A WRITE query for AV1 is directed to L1.
3. A READ query for AV2 is load balanced between S1 and S3. S2 is the primary for AV2.
4. A WRITE query for AV1 is directed to L2.
Sample Configuration
To configure a load balancing virtual server for database specific load balancing:
To configure services:
To configure a monitor to retrieve the names of all the active databases hosted on a service by
using the command line:
To configure a load balancing virtual server for database specific load balancing:
12
13 Done
To configure services:
To configure a monitor to retrieve the names of all the active databases hosted on a service by
using the command line:
1.
2. Citrix ADC
3. NetScaler 12.0
DataStream Reference
Contributed by:
C
This reference describes the MySQL and TDS protocols, the database versions, the authentication
methods, and the character sets supported by the DataStream feature. It also describes how the Citrix
ADC handles transaction requests and special queries that modify the state of a connection.
You can also configure the Citrix ADC appliance to generate audit log messages for the DataStream
feature.
Character Sets
The character set used by the client while sending a request may be different from the character set
used in the database server responses. Although the charset parameter is set during the connection
establishment, it can be changed at any time by sending an SQL query. The character set is asso-
ciated with a connection, and therefore, requests on connections with one character set cannot be
multiplexed onto a connection with a different character set.
The Citrix ADC appliance parses the queries sent by the client and the responses sent by the database
server.
The character set associated with a connection can be changed after the initial handshake by using
the following two queries:
Transactions
In MySQL, transactions are identified by using the connection parameter AUTOCOMMIT or the BE-
GIN:COMMIT queries. The AUTOCOMMIT parameter can be set during the initial handshake, or after
the connection is established by using the query SET AUTOCOMMIT.
The Citrix ADC appliance explicitly parses each and every query to determine the beginning and end
of a transaction.
In MySQL protocol, the response contains two flags to indicate whether the connection is a transac-
tion, the TRANSACTION and AUTOCOMMIT flags.
If the connection is a transaction, the TRANSACTION flag is set. Or, if the AutoCommit mode is OFF, the
AUTOCOMMIT flag is not set. The ADC appliance parses the response, and if either the TRANSACTION
flag is set or the AUTOCOMMIT flag is not set, it does not do connection multiplexing. When these
conditions are no longer true, the ADC appliance begins connection multiplexing.
Note
Special Queries
There are special queries, such as SET and PREPARE, that modify the state of the connection and may
break request switching, and therefore, these need to be handled differently.
On receiving a request with special queries, the Citrix ADC appliance sends an OK response to the
client and additionally, stores the request in the connection.
When a non-special query, such as INSERT and SELECT, is received along with a stored query, the Citrix
ADC appliance first, looks for the server-side connection on which the stored query has already been
sent to the database server. If no such connections exist, the ADC appliance creates a new connection,
and sends the stored query first, and then, sends the request with the non-special query.
In case of SET, USE db, and INIT_DB special queries, the appliance modifies a field in the server side
connection corresponding to the special query. This results in better reuse of the server side connec-
tion.
The following is a list of the special queries for which the ADC appliance has a modified behavior.
• SET query
The SET SQL queries define variables that are associated with the connection. These queries
are also used to define global variables, but as of now, the ADC appliance is unable to differen-
tiate between local and global variables. For this query, the ADC appliance uses the ‘store and
forward’ mechanism.
Using this query, the user can change the database associated with a connection. In this case,
the ADC appliance parses the <db> value sent and modifies a field in the server side connection
to reflect the new database to be used.
• INIT_DB command
Using this query, the user can change the database associated with a connection. In this case,
ADC appliance parses the value sent and modifies a field in the server side connection to reflect
the new database to be used.
• COM_PREPARE
• PREPARE query
This query is used to create prepared statements that are associated with a connection. For this
query, the ADC appliance uses the ‘store and forward’ mechanism.
You can now configure the Citrix ADC appliance to generate audit log messages for the DataStream
feature. Audit log messages are generated when client-side and server-side connections are estab-
lished, closed, or dropped. The categories of messages that you can log and view are ERROR and
INFO. Error messages for client-side connections begin with “CS” and error messages for server-side
connections begin with “SS.” Additional information is provided where necessary. For example, log
messages for closed connections (CS_CONN_CLOSED) include only the connection ID. However, log
messages for established connections (CS_CONN_ESTD) include information such as the user name,
database name, and the client IP address in addition to the connection ID.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can configure the NetScaler appliance to function as an authoritative domain name server (ADNS
server) for a domain. You can add the DNS resource records that belong to the domain for which
the appliance is authoritative and configure resource record parameters. You can also configure the
NetScaler appliance as a proxy DNS server that load balances a farm of DNS name servers that are ei-
ther within your network or outside your network. You can configure the appliance as an end resolver
and forwarder. You can configure DNS suffixes that enable name resolution when fully qualified do-
main names are not configured. The appliance also supports the DNS ANY query that retrieves all the
records that belong to a domain.
You can configure the NetScaler appliance to concurrently function as an authoritative DNS server for
one domain and a DNS proxy server for another domain. When you configure the NetScaler appliance
as the authoritative DNS server or DNS proxy server for a zone, you can enable the appliance to use
the Transmission Control Protocol (TCP) for response sizes that exceed the size limit specified for the
User Datagram Protocol (UDP).
You can configure the NetScaler appliance to function as an ADNS server, DNS proxy server, end re-
solver, and forwarder. You can add DNS resource records on the NetScaler appliance, including ser-
vice (SRV) records, IPv6 (AAAA) records, address (A) records, mail exchange (MX) records, canonical
name (CNAME) records, pointer (PTR) records, start of authority (SOA) records, and text (TXT) records.
Also, you can configure the NetScaler to load balance external DNS name servers.
The NetScaler appliance can be configured as the authority for a domain. To do this, you add valid
SOA and NS records for the domain.
An ADNS server is a DNS server that contains complete information about a zone.
To configure the NetScaler appliance as an ADNS server for a zone, you must add an ADNS service,
and then configure the zone. To do so, you add valid SOA and NS records for the domain. When a
client sends a DNS request, the NetScaler appliance searches the configured resource records for the
domain name. You can configure the ADNS service to be used with the NetScaler Global Server Load
Balancing (GSLB) feature.
You can delegate a subdomain, by adding NS records for the subdomain to the zone of the parent do-
main. You can then make the NetScaler authoritative for the subdomain, by adding a “glue record” for
each of the subdomain name servers. If GSLB is configured, theNetScaler makes a GSLB load balanc-
ing decision based on its configuration and replies with the IP address of the selected virtual server.
The following figure shows the entities in an ADNS GSLB setup and a DNS proxy setup.
The NetScaler appliance can function as a DNS proxy. Caching of DNS records, which is an important
function of a DNS proxy, is enabled by default on the NetScaler appliance. This enables the NetScaler
appliance to provide quick responses for repeated translations. You must also create a load balancing
DNS virtual server, and DNS services, and then bind these services to the virtual server.
The NetScaler provides two options, minimum time to live (TTL) and maximum TTL for configuring
the lifetime of the cached data. The cached data times out as specified by your settings for these
two options. The NetScaler checks the TTL of the DNS record coming from the server. If the TTL is
less than the configured minimum TTL, it is replaced with the configured minimum TTL. If the TTL is
greater than the configured maximum TTL, it is replaced with the configured maximum TTL.
The NetScaler also allows caching of negative responses for a domain. A negative response indicates
that information about a requested domain does not exist, or that the server cannot provide an answer
for the query. The storage of this information is called negative caching. Negative caching helps speed
up responses to queries on a domain, and can optionally provide the record type.
• NXDOMAIN error message - If a negative response is present in the local cache, the NetScaler
returns an error message (NXDOMAIN). If the response is not in the local cache, the query is for-
warded to the server, and the server returns an NXDOMAIN error to the NetScaler. The NetScaler
caches the response locally, then returns the error message to the client.
• NODATA error message - The NetScaler sends a NODATA error message, if the domain name in
query is valid but records of the given type are not available.
The NetScaler supports recursive resolution of DNS requests. In recursive resolution, the resolver
(DNS client) sends a recursive query to a name server for a domain name. If the queried name server is
authoritative for the domain, it responds with the requested domain name. Otherwise, the NetScaler
queries the name servers recursively until the requested domain name is found.
Before you can apply the recursive query option, you must first enable it. You can also set the number
of times the DNS resolver must send a resolution request (DNS retries) if a DNS lookup fails.
You can configure the NetScaler as a DNS forwarder. A forwarder passes DNS requests to external
name servers. The NetScaler allows you to add external name servers and provides name resolution
for domains outside the network. The NetScaler also allows you to set the name lookup priority to
DNS or Windows Internet Name Service (WINS).
When a client sends a DNS request to find the DNS resource record, it receives a list of IP addresses
resolving to the name in the DNS request. The client then uses one of the IP addresses in the list,
generally, the first record or IP address. Hence, a single server is used for the total TTL of the cache
and is overloaded when a large number of requests arrive.
When the NetScaler receives a DNS request, it responds by changing the order of the list of DNS re-
source records in a round robin method. This feature is called round robin DNS. Round robin dis-
tributes the traffic equally between data centers. The NetScaler performs this function automatically.
You do not have to configure this behavior.
Functional Overview
If the NetScaler is configured as an ADNS server, it returns the DNS records in the order in which the
records are configured. If the NetScaler is configured as a DNS proxy, it returns the DNS records in the
order in which it receives the records from the server. The order of the records present in the cache
matches the order in which records are received from the server.
The NetScaler then changes the order in which records are sent in the DNS response in a round robin
method. The first response contains the first record in sequence, the second response contains the
second record in sequence, the third response contains the third record in sequence, and the order
continues in the same sequence. Thus, clients requesting the same name can connect to different IP
addresses.
As an example of round robin DNS, consider DNS records that have been added as follows:
1 add dns addRec ns1 1.1.1.1 add dns addRec ns1 1.1.1.2 add dns addRec
ns1 1.1.1.3 add dns addRec ns1 1.1.1.4
When the NetScaler receives a query for the A record of ns1, the Address records are served in a round
robin method as follows. In the first DNS response, 1.1.1.1 is served as the first record:
In the second DNS response, the second IP address, 1.1.1.2 is served as the first record:
In the third DNS response, the third IP address, 1.1.1.2 is served as the first record:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You configure resource records on the NetScaler ADC appliance when you configure the appliance as
an ADNS server for a zone. You can also configure resource records on the appliance if the resource
records belong to a zone for which the appliance is a DNS proxy server. On the appliance, you can
configure the following record types:
• Service records
• AAAA records
• Address records
• Mail Exchange records
• Name Server records
• Canonical records
• Pointer records
• NAPTR records
• Start of Authority records
• Text records
The following table lists the record types that you can configure for a domain name record on the
NetScaler appliance. For example, you can configure a maximum of 25 IP addresses for one record.
Address (A) 25
IPv6 (AAAA) 5
Mail exchange (MX) 12
Name server (NS) 16
Service (SRV) 8
Pointer (PTR) 20
Canonical name (CNAME) 1
Start of Authority (SOA) 1
Text (TXT) 20
Naming Authority Pointer (NAPTR) 20
Note:
The maximum number of IP addresses for a specific hostname is 25. However, the number of
different address records can be more than 25.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The SRV record provides information about the services available on the NetScaler appliance. An SRV
record contains the following information: name of the service and the protocol, domain name, TTL,
DNS class, priority of the target, weight of records with the same priority, port of the service, and host
name of the service. The NetScaler chooses the SRV record that has the lowest priority setting first.
If a service has multiple SRV records with the same priority, clients use the weight field to determine
which host to use.
At the command prompt, type the following commands to add an SRV record and verify the configu-
ration:
Example:
• To modify an SRV record, type the set dns srvRec command, the name of the domain for
which the SRV record is configured, the name of the target host that hosts the associated service,
and the parameters to be changed, with their new values.
• To remove an SRV record, type the rm dns srvRec command, the name of the domain for
which the SRV record is configured, and the name of the target host that hosts the associated
service.
Navigate to Traffic Management > DNS > Records > SRV Records and create an SRV record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
At the command prompt, type the following commands to add an AAAA record and verify the configu-
ration:
Example:
To remove an AAAA record and all of the IPv6 addresses associated with the domain name, type the
rm dns aaaaRec command and the domain name for which the AAAA record is configured. To re-
move only a subset of the IPv6 addresses associated with the domain name in an AAAA record, type
the
rm dns aaaaRec command, the domain name for which the AAAA record is configured, and the IPv6
addresses that you want to remove.
Navigate to Traffic Management > DNS > Records > AAAA Records and create an AAAA record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Address (A) records are DNS records that map a domain name to an IPv4 address.
You cannot delete Address records for a host participating in global server load balancing (GSLB). How-
ever, the NetScaler deletes Address records added for GSLB domains when you unbind the domain
from a GSLB virtual server. Only user-configured records can be deleted manually. You cannot delete
a record for a host referenced by records such as NS, MX, or CNAME.
At the command prompt, type the following commands to add an Address record and verify the con-
figuration:
Example:
To remove an Address record and all of the IP addresses associated with the domain name, type the
rm dns addRec command and the domain name for which the Address record is configured. To
remove only a subset of the IP addresses associated with the domain name in an Address record, type
the
rm dns addRec command, the domain name for which the Address record is configured, and the IP
addresses that you want to remove.
Navigate to Traffic Management > DNS > Records > Address Records and create an Address record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Mail Exchange (MX) records are used to direct email messages across the Internet. An MX record con-
tains an MX preference that specifies the MX server to be used. The MX preference values range from 0
through 65536. An MX record contains a unique MX preference number. You can set the MX preference
and the TTL values for an MX record.
When an email message is sent through the Internet, a mail transfer agent sends a DNS query request-
ing the MX record for the domain name. This query returns a list of host names of mail exchange
servers for the domain, along with a preference number. If there are no MX records, the request is
made for the Address record of that domain. A single domain can have multiple mail exchange servers.
At the command prompt, type the following commands to add an MX record and verify the configura-
tion:
1 - add dns mxRec <domain> -mx <string> -pref <positive_integer> [-TTL <
secs>]
2 - show dns mxRec <domain>
Example:
• To modify an MX record, type the set dns mxRec command, the name of the domain for which
the MX record is configured, the name of the MX record, and the parameters to be changed, with
their new values.
• To set the TTL parameter to its default value, type the unset dns mxRec command, the name of
the domain for which the MX record is configured, the name of the MX record, and -TTL without
any TTL value. You can use the unset dns mxRec command to unset only the TTL parameter.
• To remove an MX record, type the rm dns mxRec command, the name of the domain for which
the MX record is configured, and the name of the MX record.
Navigate to Traffic Management > DNS > Records > Mail Exchange Records and create an MX record.
1.
2. Citrix ADC
3. NetScaler 12.0
May 9, 2019
Contributed by:
C
Name Server (NS) records specify the authoritative server for a domain. You can configure a maximum
of 16 NS records. You can use an NS record to delegate the control of a subdomain to a DNS server.
At the command prompt, type the following commands to create an NS record and verify the configu-
ration:
Example:
Navigate to Traffic Management > DNS > Records > Name Server Records and create an NS record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A canonical name record (CNAME record) is an alias for a DNS name. These records are useful when
multiple services query the DNS server. The host that has an address (A) record cannot have a CNAME
record.
In some cases, a NetScaler appliance in proxy mode requests an address record from the cache instead
of the server.
At the command prompt, type the following commands to create a CNAME record and verify the con-
figuration:
Example:
Navigate to Traffic Management > DNS > Records > Canonical Records and create a CNAME record.
NetScaler when deployed in a proxy mode does not always send the query for an address record to the
back-end server. This happens when for a answer to a query for an address record, a partial CNAME
chain is present in the cache. There are few conditions in which the ADC caches the partial CNAME
record and serves the query from the cache. Following are the conditions:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
NAPTR (Naming Address Pointer) is one of the most commonly used DNS record in telecommunica-
tions domain. NAPTR records map the Internet telephony address space to the Internet address space.
They therefore enable a mobile device to send a request to the correct server. The combination of
NAPTR records with Service Records (SRV) allows the chaining of multiple records to form complex
rewrite rules that produce new domain labels or uniform resource identifiers (URIs). The DNS code
for NAPTR is 35.
NetScalers support NAPTR in two modes: ADNS mode and proxy mode. In proxy mode, the ADC
caches the response from the servers and uses the cached records to server future queries. A max-
imum of 20 NAPTR records can be added for a particular domain in NetScaler. NetScaler caches the
reply to a DNS NAPTR record query. Any subsequent requests for the NAPTR record is served from the
cache.
At the command prompt, type the following commands to add a NAPTR record and verify the config-
uration:
Navigate to Traffic Management > DNS > Records > NAPTR Records and create an NAPTR record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A pointer (PTR) record translates an IP address to its domain name. IPv4 PTR records are represented
by the octets of an IP address in reverse order with the string “in-addr.arpa.” appended at the end.
For example, the PTR record for the IP address 1.2.3.4 is 4.3.2.1.in-addr.arpa.
IPv6 addresses are reverse mapped under the domain IP6.ARPA. IPv6 reverse-maps use a sequence
of nibbles separated by dots with the suffix “.IP6.ARPA” as defined in RFC 3596. For example,
the reverse lookup domain name corresponding to the address, 4321:0:1:2:3:4:567:89ab would be
b.a.9.8.7.6.5.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.0.0.0.0.1.2.3.4.IP6.ARPA.
At the command prompt, type the following commands to add a PTR record and verify the configura-
tion:
Example:
Navigate to Traffic Management > DNS > Records > PTR Records and create a PTR record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A Start of Authority (SOA) record is created only at the zone apex and contains information about the
zone. The record includes, among other parameters, the primary name server, contact information
(e-mail), and default (minimum) time-to-live (TTL) values for records.
At the command prompt, type the following commands to add an SOA record and verify the configu-
ration:
Example:
• To modify an SOA record, type the set dns soaRec command, the name of the domain for
which the record is configured, and the parameters to be changed, with their new values.
• To remove an SOA record, type the rm dns soaRec command and the name of the domain for
which the record is configured.
Navigate to Traffic Management > DNS > Records > SOA Records and create an SOA record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Domain hosts store TXT records for informative purposes. A TXT record’s RDATA component, which
consists of one or more character strings of variable length, can store practically any information that
a recipient might need to know about the domain, including information about the service provider,
contact person, email addresses, and associated details. SPF (Sender Policy Framework) protection
has been the most prominent use case for the TXT record.
All configuration types (authoritative DNS, DNS proxy, end resolver, and forwarder configurations) on
the NetScaler appliance support TXT records. You can add a maximum of 20 TXT resource records to
a domain. Each resource record is stored with a unique, internally generated record ID. You can view
the ID of a record and use it to delete the record. However, you cannot modify a TXT resource record.
At the command prompt, type the following commands to create a TXT resource record and verify the
configuration:
Example:
5 ”Contact: Mark”
6 ”Email: [email protected]”
7 Done
At the command prompt, type the following commands to remove a TXT resource record and verify
the configuration:
Example:
You can use the show dns txtRec command first to view the record ID of the TXT resource record that
you want to remove, as shown:
The simpler method of deleting a TXT record is to use the record ID. If you want to provide the strings,
enter them in the order in which they are stored in the record. In the following example, the TXT record
is deleted by using its record ID.
Navigate to Traffic Management > DNS > Records > TXT Records and create a TXT record.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can view the DNS statistics generated by the NetScaler appliance. The DNS statistics include run-
time, configuration, and error statistics.
stat dns
Example:
18 Error Statistics
19 Nonexistent domain 17
20 No AAAA records 0
21 No A records 13
22 .
23 .
24 .
25 Done
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A DNS zone entity on the NetScaler ADC appliance facilitates the ownership of a domain on the appli-
ance. A zone on the appliance also enables you to implement DNS Security Extensions (DNSSEC) for
the zone, or to offload the zone’s DNSSEC operations from the DNS servers to the appliance. DNSSEC
sign operations are performed on all the resource records in a DNS zone. Therefore, if you want to
sign a zone, or if you want to offload DNSSEC operations for a zone, you must first create the zone on
the NetScaler appliance.
You must create a DNS zone on the appliance in the following scenarios:
• The NetScaler appliance owns all the records in a zone, that is, the appliance is operating as the
authoritative DNS server for the zone. The zone must be created with the proxyMode parameter
set to NO.
• The NetScaler appliance owns only a subset of the records in a zone, and all the other resource
records in the zone are hosted on a set of back-end name servers for which the appliance is
configured as a DNS proxy server. A typical configuration where the NetScaler appliance owns
only a subset of the resource records in the zone is a global server load balancing (GSLB) con-
figuration. Only the GSLB domain names are owned by the NetScaler appliance, while all the
other records are owned by the back-end name servers. The zone must be created with the
proxyMode parameter set to YES.
• You want to offload DNSSEC operations for a zone from your authoritative DNS servers to the
appliance. The zone must be created with the proxyMode parameter set to YES. You might need
to configure additional settings for the zone.
The current topic describes how to create a zone for the first two scenarios. For more information
about how to configure a zone for offloading DNSSEC operations to the appliance, see Offload DNSSEC
operations to the NetScaler appliance.
Note
If the NetScaler is operating as the authoritative DNS server for a zone, you must create Start
of Authority (SOA) and name server (NS) records for the zone before you create the zone. If
the NetScaler is operating as the DNS proxy server for a zone, SOA and NS records must not be
created on the NetScaler appliance. For more information about creating SOA and NS records,
see Configure DNS resource records.
When you create a zone, all existing domain names and resource records that end with the name of the
zone are automatically treated as a part of the zone. Additionally, any new resource records created
with a suffix that matches the name of the zone are implicitly included in the zone.
At the command prompt, type the following command to add a DNS zone to the NetScaler appliance
and verify the configuration:
Example:
• To modify a DNS zone, type the set dns zone command, the name of the DNS zone, and the
parameters to be changed, with their new values.
• To remove a DNS zone, type the rm dns zone command and the name of the dns zone.
Navigate to Traffic Management > DNS > Zones and create a DNS zone.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
You can configure the NetScaler appliance to function as an authoritative domain name server (ADNS)
for a domain. As an ADNS server for a domain, the NetScaler resolves DNS requests for all types of
DNS records that belong to the domain. To configure the NetScaler to function as an ADNS server for
a domain, you must create an ADNS service and configure NS and Address records for the domain on
the NetScaler. The ADNS service can be configured using the subnet IP address (SNIP) or a separate IP
address. The following topology diagram shows a sample configuration and the flow of requests and
responses.
The following table shows the parameters that are configured for the ADNS service illustrated in the
preceding topology diagram.
To configure an ADNS setup, you must configure the ADNS service. For instructions on configuring the
ADNS service, see “Load balancing”.
During DNS resolution, the ADNS server directs the DNS proxy or local DNS server to query the
NetScaler for the IP address of the domain. Because the NetScaler is authoritative for the domain,
it sends the IP address to the DNS proxy or local DNS server. The following diagram describes the
placement and role of the ADNS server in a GSLB configuration.
Note: In ADNS mode, if you remove SOA and ADNS records, the following do not function for the do-
main hosted by the NetScaler: ANY query (for more information about the ANY query, see
DNS ANY query, and negative responses, such as NODATA and NXDOMAIN.
An ADNS service is used for global service load balancing. For more information about creating a GSLB
setup, see “Global server load balancing”. You can add, modify, enable, disable, and remove an ADNS
service. For instructions on creating an ADNS service, see Configure services.
Note: You can configure the ADNS service to use SNIP or any new IP address.
When you create an ADNS service, the NetScaler responds to DNS queries on the configured ADNS
service IP and port.
You can verify the configuration by viewing the properties of the ADNS service You can view properties
such as name, state, IP address, port, protocol, and maximum client connections.
By default, some clients use the User Datagram Protocol (UDP) for DNS, which specifies a limit of 512
bytes for the payload length of UDP packets. To handle payloads that exceed 512 bytes in size, the
client must use the Transmission Control Protocol (TCP). To enable DNS communications over TCP,
you must configure the NetScaler appliance to use the TCP protocol for DNS. The NetScaler then sets
the truncation bit in the DNS response packets. The truncation bit specifies that the response is too
large for UDP and that the client must send the request over a TCP connection. The client then uses
the TCP protocol on port 53 and opens a new connection to the NetScaler. The NetScaler listens on
port 53 with the IP address of the ADNS service to accept the new TCP connections from the client.
To configure the NetScaler to use the TCP protocol, you must configure an ADNS_TCP service. For
instructions on creating an ADNS_TCP service, see
Load balancing.
Important
To configure the NetScaler to use UDP for DNS and use TCP only when the payload length of UDP
exceeds 512 bytes, you need to configure the ADNS and ADNS_TCP services. The IP address of
the ADNS_TCP service must be same as the IP address of the ADNS service.
After you create an ADNS service, you can add DNS records. For instructions on adding DNS records,
see Configure DNS resource records.
Domain delegation is the process of assigning responsibility for a part of the domain space to another
name server. Therefore, during domain delegation, the responsibility for responding to the query is
delegated to another DNS server. Delegation uses NS records.
In the following example, sub1.abc.com is the subdomain for abc.com. The procedure describes the
steps to delegate the subdomain to the name server ns2.sub1.abc.com and add an Address record for
ns2.sub1.abc.com.
To configure domain delegation, you need to perform the following tasks, which are described in the
sections that follow:
For instructions on configuring SOA records, see Create SOA records for authoritative information.
For instructions on configuring an NS record, see Create NS records for an authoritative server. In the
Name Server drop-down list, select the primary authoritative name server, for example, ns1.abc.com.
For instructions on configuring Address records, see Create address records for a domain name. In
the Host Name and IP address text boxes, type the domain name for the DNS Address record and the
IP address, for example, ns1.abc.com and 10.102.11.135, respectively.
For instructions on configuring NS records, see Create NS records for an authoritative server.
In the Name Server drop-down list, select the primary authoritative name server, for example,
ns2.sub1.abc.com.
NS records are usually defined immediately after the SOA record (but this is not a restriction.) A do-
main must have at least two NS records. If an NS record is defined within a domain, it must have a
matching Address record. This Address record is referred to as a glue record. Glue records speed up
DNS queries.
For instructions on adding glue records for a subdomain, see the procedure for adding an Address (A)
record, Configure DNS resource records.
For instructions on configuring Address records, see [Create address records for a domain name]/(/en-
us/netscaler/12/dns/configure-dns-resource-records/create-address-records.html). In Host Name
and IP address text boxes, type the domain name for the DNS Address record and the IP address, for
example, ns2.sub1.abc.com and 10.102.12.135, respectively.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
As a DNS proxy server, the NetScaler ADC appliance can function as a proxy for either a single DNS
server or a group of DNS servers. The flow of requests and responses is illustrated in the following
sample topology diagram.
By default, the NetScaler appliance caches responses from DNS name servers. When the appliance
receives a DNS query, it checks for the queried domain in its cache. If the address for the queried do-
main is present in its cache, the NetScaler returns the corresponding address to the client. Otherwise,
it forwards the query to a DNS name server that checks for the availability of the address and returns
it to the NetScaler. The NetScaler then returns the address to the client.
For requests for a domain that has been cached earlier, the NetScaler serves the Address record of the
domain from the cache without querying the configured DNS server.
The appliance discards a record stored in its cache when the time-to-live (TTL) value of the record
reaches the configured value. A client that requests an expired record has to wait until the NetScaler
retrieves the record from the server and updates its cache. To avoid this delay, the NetScaler proac-
tively updates the cache by retrieving the record from the server before the record expires.
The following table lists sample names and the values of the entities that need to be configured on
the NetScaler.
The following diagram shows the entities of a DNS Proxy and the values of the parameters to be con-
figured on the NetScaler.
Note
To configure DNS proxy, you need to know how to configure load balancing services and virtual
servers.
To configure a DNS Proxy on the NetScaler, configure a load balancing virtual server of type DNS. To
configure a DNS virtual server to load balance a set of DNS servers that support recursive queries, you
must set the Recursion Available option. With this option, the RA bit is set to ON in the DNS replies
from the DNS virtual server.
For instructions on creating a load balancing virtual server, see “Load Balancing”.
After creating a load balancing virtual server of type DNS, you must create DNS services. You can add,
modify, enable, disable, and remove a DNS service. For instructions on creating a DNS service, see
“Load Balancing”.
To complete the DNS Proxy configuration, you must bind the DNS services to the load balancing virtual
server. For instructions on binding a service to a load balancing virtual server, see “Load Balancing”.
Some clients use the User Datagram Protocol (UDP) for DNS communications. However, UDP specifies
a maximum packet size of 512 bytes. When payload lengths exceed 512 bytes, the client must use the
Transmission Control Protocol (TCP). When a client sends the NetScaler ADC appliance a DNS query,
the appliance forwards the query to one of the name servers. If the response is too large for a UDP
packet, the name server sets the truncation bit in its response to the NetScaler. The truncation bit
indicates that the response is too large for UDP and that the client must send the query over a TCP
connection. The NetScaler relays the response to the client with the truncation bit intact and waits for
the client to initiate a TCP connection with the IP address of the DNS load balancing virtual server, on
port 53. The client sends the request over a TCP connection. The NetScaler appliance then forwards
the request to the name server and relays the response to the client.
To configure the NetScaler to use the TCP protocol for DNS, you must configure a load balancing virtual
server and services, both of type DNS_TCP. You can configure monitors of type DNS_TCP to check the
state of the services. For instructions on creating DNS_TCP virtual servers, services, and monitors, see
“Load Balancing.”
For updating the records proactively, the NetScaler uses a TCP connection to the server to retrieve the
records.
Important To configure the NetScaler to use UDP for DNS and use TCP only when the payload
length of UDP exceeds 512 bytes, you need to configure DNS and DNS_TCP services. The IP ad-
dress of the DNS_TCP service must be same as that of the DNS service.
The TTL is the same for all DNS records with the same domain name and record type. If the TTL value
is changed for one of the records, the new value is reflected in all records of the same domain name
and type. The default TTL value is 3600 seconds. The minimum is 0, and the maximum is 604800. If
a DNS entry has a TTL value less than the minimum or greater than the maximum, it is saved as the
minimum or maximum TTL value, respectively.
At the NetScaler command prompt, type the following commands to specify the minimum and maxi-
mum TTL and verify the configuration:
Example:
Note: When the TTL expires, the record is deleted from the cache. The NetScaler proactively contacts
the servers and obtains the DNS record just before the DNS record expires.
You can delete all DNS records present in the cache. For example, you might want to flush DNS records
when a server is restarted after modifications are made.
You can add DNS records to a domain for which the NetScaler ADC appliance is configured as a DNS
proxy server. For information about adding DNS records, see Configuring DNS Resource Records.
For information about removing a load balancing virtual server, see Load Balancing.
You can limit the number of concurrent DNS requests on a single client connection, which is identi-
fied by the <clientip:port>-<vserver ip:port> tuple. Concurrent DNS requests are those requests that
the NetScaler appliance has forwarded to the name servers and for which the appliance is awaiting
responses. Limiting the number of concurrent requests on a client connection enables you to pro-
tect the name servers when a hostile client attempts a Distributed Denial of Service (DDoS) attack by
sending a flood of DNS requests. When the limit for a client connection is reached, subsequent DNS
requests on the connection are dropped till the outstanding request count goes below the limit. This
limit does not apply to the requests that the NetScNetScaleraler appliance serves out of its cache.
The default value for this parameter is 255. This default value is sufficient in most scenarios. If the
name servers serve a large number of concurrent DNS requests under normal operating conditions,
you can specify either a large value or a value of zero (0). A value of 0 disables this feature and specifies
that there is no limit to the number of DNS requests that are allowed on a single client connection. This
is a global parameter and applies to all the DNS virtual servers that are configured on the NetScaler
appliance.
Specify the maximum number of concurrent DNS requests allowed on a single client
connection by using the CLI
At the command prompt, type the following commands to specify the maximum number of concur-
rent DNS requests allowed on a single client connection and verify the configuration:
Example:
Specify the maximum number of concurrent DNS requests allowed on a single client
connection by using the GUI
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A resolver is a procedure that is invoked by an application program that translates a domain/host
name to its resource record. The resolver interacts with the LDNS, which looks up the domain name
to obtain its IP address. The NetScaler can provide end-to-end resolution for DNS queries.
In recursive resolution, the NetScaler appliance queries different name servers recursively to access
the IP address of a domain. When the NetScaler receives a DNS request, it checks its cache for the DNS
record. If the record is not present in the cache, it queries the root servers configured in the ns.conf
file. The root name server reports back with the address of a DNS server that has detailed information
about the second-level domain. The process is repeated until the required record is found.
When you start the NetScaler appliance for the first time, 13 root name servers are added to the ns.conf
file. The NS and Address records for the 13 root servers are also added. You can modify the ns.conf
file, but the NetScaler does not allow you to delete all 13 records; at least one name server entry is
required for the appliance to perform name resolution. The following diagram illustrates the process
of name resolution.
Figure 1. Recursive resolution
In the process shown in the diagram, when the name server receives a query for the address of
s1.s2.s3.com, it first checks the root name servers for s1.s2.s3.com. A root name server reports back
with the address of the .com name server. If the address of s1.s2.s3.com is found in the name server,
it responds with a suitable IP address. Otherwise, it queries other name servers for s3.com, then
for s2.s3.com to retrieve the address of s1.s2.s3.com. In this way, resolution always starts from root
name servers and ends with the domain’s authoritative name server.
Note: For recursive resolution functionality, caching should be enabled.
To configure the NetScaler appliance to function as an end resolver, you must enable recursive reso-
lution on the appliance.
At the command prompt, type the following commands to enable recursive resolution and verify the
configuration:
Example:
The NetScaler appliance can be configured to make a preconfigured number of attempts (called DNS
retries) when it does not receive a response from the server to which it sends a query. By default, the
number of DNS retries is set to 5.
At the command prompt, type the following commands to set the number of retries and verify the
configuration:
Example:
Contributed by:
C
You can create a name server by specifying its IP address or by configuring an existing virtual server
as the name server.
While adding name server, you can provide an IP address or a virtual server IP address. If you add
IP address based name servers, the NetScaler appliance load balances requests to the configured
name servers in round robin method. If you add a virtual server, you can configure any load balancing
method.
To verify the configuration, you can use the sh dns <recordtype> <domain> command. If the
queried records are not present in the cache, the resource records are fetched from the configured
external name servers.
Add a name server (when the NetScaler appliance acts as a forwarder) by using the CLI
Example:
Add a name server (when the NetScaler appliance acts as a resolver) by using the CLI
Example:
Note:
• To remove a name server, at the NetScaler CLI, type the rm dns nameServer command
followed by the IP address of the name server.
• To view the details of the DNS nameserver, at the NetScaler CLI, type show dns
nameServer command followed by the IP address of the name server.
Navigate to Traffic Management > DNS > Name Servers and create a name server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can set the lookup priority to either DNS or WINS. This option is used in the SSL VPN mode of
operation.
At the command prompt, type the following commands to set the lookup priority to DNS and verify
the configuration:
Example:
If the DNS virtual server that you have configured is DOWN and if you set the
-nameLookupPriority to DNS, the NetScaler does not attempt WINS lookup. Therefore, if a DNS
virtual server is not configured or is disabled, set the
-nameLookupPriority to WINS.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The following procedure describes the steps to enable or disable an existing name server.
At the command prompt, type the following commands to enable or disable a name server and verify
the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure the NetScaler appliance to log the DNS requests and responses that it handles. The
appliance logs the DNS requests and responses in SYSLOG format. You can choose to log either DNS
requests or DNS responses, or both, and send the syslog messages to a remote log server. The log
messages can be used to:
A NetScaler appliance can log the following sections in the DNS request or response, on the basis of
your configuration:
• Header Section
• Questions Section
• Answer Section
• Authority Section
• Additional Section
DNS profiles
You can use a DNS profile to configure various DNS parameters that you want the DNS endpoint to
apply to the DNS traffic. In the profile, you can enable logging, caching and negative caching.
Important: From NetScaler 11.0 release, enabling DNS caching using global DNS parameters has been
deprecated. You can enable or disable DNS caching using DNS profiles. You can now enable DNS
caching for an individual virtual server by enabling DNS caching in a DNS profile and setting the DNS
profile to the individual virtual server.
You can configure a NetScaler appliance to log only the DNS queries that are received by the DNS
endpoints on the appliance.
Note: If errors occur during processing of a query, they are logged if this option is set in the DNS profile.
You can configure a NetScaler appliance to log all the Answer sections in the DNS responses that ap-
pliance sends to the client. DNS Answer Section logging is very useful when NetScaler is configured
as a DNS resolver, or in GLSB use cases.
To configure a NetScaler appliance to log Authority and Additional sections in the DNS responses,
enable Extended logging with Answer Section logging.
Note: If errors occur during processing of either queries or responses, the errors are logged if this
option is set in the DNS profile.
Following is an example of a message logged when the cache lookup is completed and the response
is embedded in the packet:
You can configure a NetScaler appliance to log the errors or failures that occur when it processes a
DNS query or response. For these errors, the appliance logs the DNS header, Question sections and
OPT records.
Following is an example of a message logged when an error occurs during processing of a DNS request
or response:
You can configure custom logging based on DNS expressions by configuring the logAction on DNS
policies, Rewrite, or Responder policies. You can specify that logging occurs only when a particular
DNS policy evaluates to true. For more information, see Configure policy based logging for DNS.
NetScaler appliance log DNS requests and responses in the following Syslog format:
• <transport>:
– T = TCP
– U = UDP
• <client IP>#< client ephemeral port >:
DNS client IP address and port number
• <DNS endpoint IP>#<port>:
NetScaler DNS endpoint IP address and port number
• <query id>:
Query ID
• <opcode>:
Operation code. Supported Values:
– Q : query
– I : inverse query
– S: status
– X0: unassigned
– N : notify
– U : update
– X1-10: unassigned values
• <header flags>:
Flags. Supported Values:
– RD : recursion desired
– TC : truncated
– AA : authoritative response
– CD : check disabled
– AD : authenticated data
– Z : unassigned
– RA : recursion available
– R : response
• <rcode>:
Response Code. Supported Values:
– NO : no error
– F format error
– S : server failure
– NX : non-existent domain
– NI : not implemented
– R: query refused
– YX : Name Exists when it should not
– YXR : RR Set Exists when it should not
– NXR: RR Set that should exist does not
– NAS : Server Not Authoritative for zone
– NA : Not Authorized
– NZ : Name not contained in zone
– X1-5: unassigned
Answer Section is logged if answer section logging is enabled in the DNS profile.
Authority and Additional sections are logged if extended logging is enabled in the DNS profile.
The log format would differ depending on the type of record. For more information see Under-
standing the Record Logging Format.
When a DNS query with ECS option that includes either IPv4 or IPv6 address is sent, the ECS
option is logged with either “ECS/Q” indicating that the values in the log are from the query or
“ECS/R” indicating that the values in the log are from the response.
The value of Scope Prefix-Length is also set appropriately. In case of the DNS Query, it is set to
zero,and for response, it is set to the calculated value.
where:
• If response logging is enabled, only the following record types are logged:
For all other record types, only L3/L4 parameters, DNS Header, and Question section are logged.
• DNS proactive update requests or responses are logged according to the settings in the default
profile.
• On the virtual server, if sessionless option and response logging is enabled, L3/L4 parameters,
DNS Header, and DNS Question section are logged instead of the response.
• If you have set DNS profile for a DNS policy with action type Rewrite Response, NetScaler appli-
ance does not log the query or the manipulated responses. To log the required information you
need to use audit message action in the DNS policy.
• DNS transactions that are due to DNS monitoring traffic are not logged.
Configure DNS logging for NetScaler configured as DNS Proxy by using the CLI
1. Add a syslog action and enable DNS in the action. At the command prompt, type:
Example:
2. Create a syslog policy and specify the created syslog action in the policy. At the command
prompt, type:
Example:
Example:
4. Create a DNS profile and enable any of the following type of logs that you want to configure:
Example:
Example:
Example:
7. Bind the service to the virtual server. At the command prompt, type:
Example:
8. Set the created DNS profile to the virtual server. At the command prompt, type:
Example:
Sample DNS logging configuration for NetScaler appliance configured as DNS proxy
6 Done
7 > bind system global syslogpol1
8 Done
9 > add dns profile dnsprofile1 -dnsqueryLogging ENABLED
10 Done
11 > add lb vserver lb1 dns 100.100.100.10 53 ‒ dnsProfileName dnsprofile1
12 Done
13 > add service svc1 10.102.84.140 dns 53
14 Done
15 > bind lb vserver lb1 svc1
16 Done
Policy based logging enables you to specify a format for log messages. The contents of a log message
are defined by using a default syntax expression. When the message action specified in the policy is
performed, the NetScaler appliance constructs the log message from the expression and writes the
message to the log file. You can configure the appliance to log only when a particular DNS policy
evaluates to True.
Note
If you have set a DNS policy with a DNS profile for the request side, NetScaler appliance logs only
the query.
To configure policy based logging for a DNS policy, you must first configure an audit message action.
For more information about configuring an audit message action, see
Configure the NetScaler appliance for audit logging. After configuring the audit message action, spec-
ify the message action in a DNS policy.
Configure policy based logging for a DNS policy by using the CLI
At the command prompt, type the following commands to configure policy based logging for a DNS
policy and verify the configuration:
Example 1:
In a GSLB deployment, if you want to respond with different IP addresses to the client requests coming
from a particular subnet, instead of responding with IP addresses used for general purposes (such as
the IP addresses of internal users), you can configure a DNS policy with the action type as DNS view. In
this case, you can configure DNS logging on the specified DNS action such that you can log the specific
responses.
Note: In the above configuration, if you query for the domain configured on a GSLB virtual server, for
example,
sampletest.com, all the internal users of subnet 100.100.100.0/24 are served with the DNS view IP ad-
dresses, and the responses are logged. Client requests for other subnets are not logged.
Example 2:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure DNS suffixes that enable the NetScaler appliance to complete non-fully qualified
domain names (non-FQDNs) during name resolution. For example, during the process of resolving
the domain name abc (which is not fully qualified), if a DNS suffix example.com is configured, the
appliance appends the suffix to the domain name (abc.example.com) and resolves it. If DNS suffixes
are not configured, the appliance appends a period to the non-FQDNs and resolves the domain name.
DNS suffixes have significance and are valid only when the NetScaler is configured as an end resolver
or forwarder. You can specify a suffix of up to 127 characters.
At the command prompt, type the following commands to create a DNS suffix and verify the configu-
ration:
Example:
To remove a DNS suffix by using the NetScaler command line, at the NetScaler command prompt, type
the rm dns suffix command and the name of the DNS suffix.
Navigate to Traffic Management > DNS > DNS Suffix and create DNS suffixes.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
An ANY query is a type of DNS query that retrieves all records available for a domain name. The ANY
query must be sent to a name server that is authoritative for a domain.
In the ADNS mode, the NetScaler appliance returns the records held in its local cache. If there are no
records in the cache, the appliance returns the NXDOMAIN (negative) response.
If the NetScaler can match the domain delegation records, it returns the NS records. Otherwise, it
returns the NS records of the root domain.
In proxy mode, the NetScaler appliance checks its local cache. If there are no records in the cache, the
appliance passes the query to the server.
If a GSLB domain is configured on the NetScaler appliance and an ANY query is sent for the GSLB do-
main (or GSLB site domain), the appliance returns the IP address of the GSLB service that it selects
through the Load Balancing decision. If the multiple IP response (MIR) option is enabled, the IP ad-
dresses of all GSLB services are sent.
For the NetScaler to return these records when it responds to the ANY query, all records corresponding
to a GSLB domain must be configured on the NetScaler.
Note
If records for a domain are distributed between the NetScaler and a server, only records config-
ured on the NetScaler are returned.
The NetScaler provides the option to configure DNS views and DNS policies. These are used for per-
forming global server load balancing. For more information, see Global Server Load Balancing.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The NetScaler appliance supports caching of negative responses for a domain. A negative response
indicates that information about a requested domain does not exist, or that the server cannot provide
an answer for the query. The storage of this information is called negative caching. Negative caching
helps speed up responses to queries about a domain.
Note:
Negative caching is supported only when the back-end server is configured as an authoritative
DNS (ADNS) server for the queried domain.
• NXDOMAIN error message—If a negative response is present in the local cache, the NetScaler
returns an error message (NXDOMAIN). If the response is not in the local cache, the query is
forwarded to the server, and the server returns an NXDOMAIN error to the NetScaler appliance.
The appliance caches the response locally, then returns the error message to the client.
• NODATA error message—If the domain name in query is valid but records of the given type are
not available, the appliance sends a NODATA error message.
When negative caching is enabled, the appliance caches the negative response from the DNS server
and serves the future requests from the cache only. This helps speed up responses to queries and also
to reduce the DNS traffic. Negative caching can be used in all deployments, that is, when a NetScaler
appliance is serving as a proxy, as an end resolver, or as a forwarder.
You can enable or disable negative caching using DNS profile, for more information see, DNS profiles.
By default, negative caching is enabled in the default DNS profile (default-dns-profile) that are bound
by default to a DNS virtual server or in the newly created DNS profile.
At the command prompt, type the following commands to enable or disable negative caching and
verify the configuration:
Specify service or virtual server level DNS parameters by using the CLI
Example:
Example:
Specify service or virtual server level DNS parameters by using the GUI
Navigate to System > Profiles> DNS Profile, and create the DNS profile.
Navigate to Traffic Management > Load Balancing> Services/Virtual Servers, and create the
DNS profile, which should be bound to the service/virtual server.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In NetScaler Proxy mode, if a back-end server that supports EDNS0 Client Subnet (ECS) sends a re-
sponse containing the ECS option, the NetScaler appliance forwards the response as-is to the client
and stores it in the cache, along with the client subnet information. Further DNS requests that are
from the same subnet of the same domain, and for which the server would send the same response,
are then served from the cache instead of being directed to the server.
Note:
• ECS caching is disabled by default. You have to enable caching of EDNS0 client-subnet data in
the associated DNS profile.
• The number of subnets that you can cache for a domain is limited to the available subnet IDs,
that is, 1270 in the NetScaler appliance. Optionally, you can set the limit to a lower number
(minimum value: 1 ipv4/ipv6).
Limit the number of subnets that can be cached per domain by using the CLI
Example:
In the example shown in the above figure, the client at IP address 2.2.2.2 sends a query for
www.example.com to the DNS resolver, and the DNS resolver sends the following response:
At this point, the response and the client-subnet identifier (2.2.2.0/24) are cached. Further requests
from the same subnet and domain will be served from the cache.
For example, if the client’s IP address is 2.2.2.100 and the query is for www.example.com, the query is
served from the cache instead of being sent to the backend server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
DNS Security Extensions (DNSSEC) is an Internet Engineering Task Force (IETF) standard that aims
to provide data integrity and data origin authentication in communications between name servers
and clients while still transmitting User Datagram Protocol (UDP) responses in clear text. DNSSEC
specifies a mechanism that uses asymmetric key cryptography and a set of new resource records that
are specific to its implementation.
The DNSSEC specification is described in RFC 4033, “DNS Security Introduction and Requirements,”
RFC 4034, “Resource Records for the DNS Security Extensions,” and RFC 4035, “Protocol Modifications
for the DNS Security Extensions.” The operational aspects of implementing DNSSEC within DNS are
discussed in RFC 4641, “DNSSEC Operational Practices.”
You can configure DNSSEC on the NetScaler ADC. You can generate and import keys for signing DNS
zones. You can configure DNSSEC for zones for which the NetScaler is authoritative. You can configure
the ADC as a DNS proxy server for signed zones hosted on a farm of backend name servers. If the ADC
is authoritative for a subset of the records belonging to a zone for which the ADC is configured as a
DNS proxy server, you can include the subset of records in the DNSSEC implementation.
1.
2. Citrix ADC
3. NetScaler 12.0
Configure DNSSEC
Contributed by:
C
Configuring DNSSEC involves enabling DNSSEC on the NetScaler ADC appliance, creating a Zone Sign-
ing Key and a Key Signing Key for the zone, adding the two keys to the zone, and then signing the zone
with the keys.
The NetScaler appliance does not act as a DNSSEC resolver. DNSSEC on the ADC is supported only in
the following deployment scenarios:
You must enable DNSSEC on the NetScaler for the ADC to respond to DNSSEC-aware clients. By de-
fault, DNSSEC is enabled.
You can disable the DNSSEC feature if you do not want the NetScaler to respond to clients with
DNSSEC-specific information.
At the command prompt, type the following commands to enable or disable DNSSEC and verify the
configuration:
Example:
For each DNS zone that you want to sign, you must create two pairs of asymmetric keys. One pair,
called the Zone Signing Key, is used to sign all the resource record sets in the zone. The second pair is
called the Key Signing Key and is used to sign only the DNSKEY resource records in the zone.
When the Zone Signing Key and Key Signing Key are created, the suffix .key is automatically appended
to the names of the public components of the keys and the suffix .private is automatically appended
to the names of their private components.
Additionally, the NetScaler also creates a Delegation Signer (DS) record and appends the suffix .ds to
the name of the record. If the parent zone is a signed zone, you must publish the DS record in the
parent zone to establish the chain of trust.
When you create a key, the key is stored in the /nsconfig/dns/ directory, but it is not automatically
published in the zone. After you create a key by using the create dns key command, you must explic-
itly publish the key in the zone by using the add dns key command. The process of generating a key
has been separated from the process of publishing the key in a zone to enable you to use alternative
means to generate keys. For example, you can import keys generated by other key-generation pro-
grams (such as bind-keygen) by using Secure File Transfer Protocol (SFTP) and then publish the keys
in the zone. For more information about publishing a key in a zone, see Publish a DNS key in a zone.
Perform the steps described in this topic to create a Zone Signing Key and then repeat the steps to
create a Key Signing Key. The example that follows the command syntax first creates a Zone Signing
Key pair for the zone example.com. The example then uses the command to create a Key Signing Key
pair for the zone.
At the NetScaler command prompt, type the following command to create a DNS key:
create dns key -zoneName <string> -keyType <keyType> -algorithm RSASHA1 -
keySize <positive_integer> -fileNamePrefix <string>
Example:
1 > create dns key -zoneName example.com -keyType zsk -algorithm RSASHA1
-keySize 1024 -fileNamePrefix example.com.zsk.rsasha1.1024
2 File Name: /nsconfig/dns/example.com.zsk.rsasha1.1024.key (public); /
nsconfig/dns/example.com.zsk.rsasha1.1024.private (private); /
nsconfig/dns/example.com.zsk.rsasha1.1024.ds (ds)
3 This operation may take some time, Please wait...
4 Done
5 > create dns key -zoneName example.com -keyType ksk -algorithm RSASHA1
-keySize 4096 -fileNamePrefix example.com.ksk.rsasha1.4096
6 File Name: /nsconfig/dns/example.com.ksk.rsasha1.4096.key (public); /
nsconfig/dns/example.com.ksk.rsasha1.4096.private (private); /
nsconfig/dns/example.com.ksk.rsasha1.4096.ds (ds)
7 This operation may take some time, Please wait...
8 Done
2. In the details area, click Create DNS Key and create a DNS key.
Note: For
File Name Prefix, if you want to modify the file name prefix of an existing key, click the arrow
next to the
Browse button, click either
Local or
Appliance (depending on whether the existing key is stored on your local computer or in the
/nsconfig/dns/ directory on the appliance), browse to the location of the key, and then double-
click the key. The
File Name Prefix box is populated with only the prefix of the existing key. Modify the prefix ac-
cordingly.
A key (Zone Signing Key or Key Signing Key) is published in a zone by adding the key to the NetScaler.
A key must be published in a zone before you sign the zone.
Before you publish a key in a zone, the key must be available in the /nsconfig/dns/ directory. There-
fore, if you used other means to generate the key—means other than the create dns key command
on the NetScaler (for example, by using the bind-keygen program on another computer)—make sure
that the key is added to the /nsconfig/dns/ directory before you publish the key in the zone.
If the key has been generated by another program, you can import the key to your local computer and
use the NetScaler configuration utility to add the key to the /nsconfig/dns/ directory. Or, you can use
other means to import the key to the directory, such as the Secure File Transfer Protocol (SFTP).
You must use the add dns key command for each public-private key pair that you want to publish in
a given zone. If you created a Zone Signing Key pair and a Key Signing Key pair for a zone, use the
add dns key command to first publish one of the key pairs in the zone and then repeat the command
to publish the other key pair. For each key that you publish in a zone, a DNSKEY resource record is
created in the zone.
The example that follows the command syntax first publishes the Zone Signing Key pair (that was
created for the example.com zone) in the zone. The example then uses the command to publish the
Key Signing Key pair in the zone.
At the command prompt, type the following command to publish a key in a zone and verify the con-
figuration:
Example:
Navigate to
Traffic Management > DNS > Keys.
Note: For
Public Key and
Private Key, to add a key that is stored on your local computer, click the arrow next to the
Browse button, click
Local, browse to the location of the key, and then double-click the key.
You can configure the parameters of a key that has been published in a zone. You can modify the key’s
expiry time period, notification period, and time-to-live (TTL) parameters. If you change the expiry
time period of a key, the NetScaler automatically re-signs all the resource records in the zone with the
key, provided that the zone is currently signed with the particular key.
At the command prompt, type the following command to configure a key and verify the configuration:
Example:
2. In the details pane, click the key that you want to configure, and then click Open.
3. In the Configure DNS Key dialog box, modify the values of the following parameters as shown:
• Expires—expires
• Notification Period—notificationPeriod
• TTL—TTL
4. Click OK.
To secure a DNS zone, you must sign the zone with the keys that have been published in the zone.
When you sign a zone, the NetScaler creates a Next Secure (NSEC) resource record for each owner
name. Then, it uses the Key Signing Key to sign the DNSKEY resource record set. Finally, it uses the
Zone Signing Key to sign all the resource record sets in the zone, including the DNSKEY resource record
sets and NSEC resource record sets. Each sign operation results in a signature for the resource record
sets in the zone. The signature is captured in a new resource record called the RRSIG resource record.
At the command prompt, type the following command to sign a zone and verify the configuration:
Example:
At the command prompt, type the following command to unsign a zone and verify the configuration:
Example:
9 Record Types : A
10 Domain Name : ns2.example.com
11 Record Types : A
12 Done
You can view the NSEC records that the NetScaler automatically creates for each owner name in the
zone.
View the NSEC record for a given record in a zone by using the CLI
At the command prompt, type the following command to view the NSEC record for a given record in
a zone:
Example:
View the NSEC record for given record in a zone by using the GUI
1. Navigate to Traffic Management > DNS > Records > Next Secure Records.
2. In the details pane, click the name of the record for which you want to view the NSEC record.
The NSEC record for the record you select is displayed in the Details area.
You remove a key from the zone in which it is published when the key has expired or if the key has been
compromised. When you remove a key from the zone, the zone is automatically unsigned with the
key. Removing the key with this command does not remove the key files present in the /nsconfig/dns/
directory. If the key files are no longer needed, they have to be explicitly removed from the directory.
At the command prompt, type the following command to remove a key and verify the configuration:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
When the NetScaler ADC is authoritative for a given zone, all the resource records in the zone are con-
figured on the ADC. To sign the authoritative zone, you must create keys (the Zone Signing Key and the
Key Signing Key) for the zone, add the keys to the ADC, and then sign the zone, as described in Create
DNS keys for a zone, Publish a DNS key in a zone, and Sign and unsign a DNS zone, respectively.
If any global server load balancing (GSLB) domains configured on the ADC belong to the zone being
signed, the GSLB domain names are signed along with the other records that belong to the zone.
After you sign a zone, responses to requests from DNSSEC-aware clients include the RRSIG resource
records along with the requested resource records. DNSSEC must be enabled on the ADC. For more
information about enabling DNSSEC, see Enable and disable DNSSEC.
Finally, after you configure DNSSEC for the authoritative zone, you must save the NetScaler configu-
ration.
1.
2. Citrix ADC
3. NetScaler 12.0
Configure DNSSEC for a zone for which the NetScaler is a DNS proxy
server
Contributed by:
C
The procedure for signing a zone for which the NetScaler ADC is configured as a DNS proxy server
depends on whether or not the ADC owns a subset of the zone information owned by the backend
name servers. If it does, the configuration is considered a partial zone ownership configuration. If the
ADC does not own a subset of the zone information, the NetScaler configuration for managing the
backend servers is considered a zone-less DNS proxy server configuration. The basic DNSSEC configu-
ration tasks for both NetScaler configurations are the same. However, signing the partial zone on the
NetScaler requires some additional configuration steps.
Important: When configured in proxy mode, the ADC does not perform signature verification on
DNSSEC responses before updating the cache.
If you configure the ADC as a DNS proxy to load balance DNSSEC aware resolvers (servers), you must
set the Recursion Available option while configuring the DNS virtual server. If a DNSSEC query arrives
with Checking Disabled (CD) bit set, the query is passed on to the server with the CD bit retained, and
the response from the server is not cached. In releases prior to 10.5.e build xx.x, the ADC unset the CD
bit before passing it to the server and also cached the server response.
For a zone-less DNS proxy server configuration, zone signing must be performed on the backend name
servers. On the NetScaler, you configure the ADC as a DNS proxy server for the zone. You create a load
balancing virtual server of protocol type DNS, configure services on the ADC to represent the name
servers, and then bind the services to the load balancing virtual server. For more information about
these configuration tasks, see Configure the NetScaler as a DNS proxy server.
When a client sends the ADC a DNS request with the DNSSEC OK (DO) bit set, the ADC checks its cache
for the requested information. If the resource records are not available in its cache, the ADC forwards
the request to one of the DNS name servers, and then relays the response from the name server to
the client. Additionally, the ADC caches the RRSIG resource records along with the response from the
name server. Subsequent requests from DNSSEC-aware clients are served from the cache (including
the RRSIG resource records), subject to the time-to-live (TTL) parameter. If a client sends a DNS re-
quest without setting the DO bit, the ADC responds with only the requested resource records, and
does not include the RRSIG resource records that are specific to DNSSEC.
In some NetScaler configurations, even though the authority for a zone lies with the backend name
servers, a subset of the resource records that belong to the zone might be configured on the NetScaler.
The ADC owns (or is authoritative for) only this subset of records. Such a subset of records can be
considered to constitute a partial zone on the ADC. The ADC owns the partial zone. All other records
are owned by the backend name servers.
A typical partial zone configuration on the NetScaler is seen when global server load balancing (GSLB)
domains are configured on the ADC, and the GSLB domains are a part of a zone for which the backend
name servers are authoritative.
Signing a zone that includes only a partial zone on the ADC involves including the partial zone infor-
mation in the backend name server zone files, signing the zone on the backend name servers, and
then signing the partial zone on the ADC. The same key set must be used to sign the zone on the name
servers and the partial zone on the ADC.
1. Include the resource records that are contained in the partial zone, in the zone files of the name
servers.
2. Create keys and use the keys to sign the zone on the backend name servers.
1. Create a zone with the name of the zone that is owned by the backend name servers. When
configuring the partial zone, set the proxyMode parameter to YES. This zone is the partial zone
that contains the resource records owned by the ADC.
For example, if the name of the zone that is configured on the backend name servers is exam-
ple.com, you must create a zone named example.com on the ADC, with the proxyMode param-
eter set to YES. For more information about adding a zone, see Configure a DNS zone.
Note
Do not add SOA and NS records for the zone. These records should not exist on the ADC
for a zone for which the ADC is not authoritative.
2. Import the keys (from one of the backend name servers) to the ADC and then add them to the /n-
sconfig/dns/ directory. For more information about how you can import a key and add it to the
ADC, see Publish a DNS key in a zone.
3. Sign the partial zone with the imported keys. When you sign the partial zone with the keys,
the ADC generates RRSIG and NSEC records for the resource record sets and individual resource
records in the partial zone, respectively. For more information about signing a zone, see sign
and unsign a DNS zone.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
If global server load balancing (GSLB) is configured on the NetScaler ADC and the ADC is authoritative
for the zone to which the GSLB domain names belong, all GLSB domain names are signed when the
zone is signed. For more information about signing a zone for which the ADC is authoritative, see
Configure DNSSEC when the NetScaler appliance is authoritative for a zone.
If the GSLB domains belong to a zone for which the backend name servers are authoritative, you must
first sign the zone on the name servers, and then sign the partial zone on the ADC to complete the
DNSSEC configuration for the zone. For more information, see Configure DNSSEC for a partial zone
ownership configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
Zone Maintenance
When a zone is updated, that is, when new records are added to the zone or existing records are
changed, the process of re-signing the new (or modified) record is performed automatically by the
NetScaler ADC. If a zone contains multiple Zone Signing Keys, the ADC re-signs the new (or modified)
record with the key with which the zone is signed at the point in time when the re-signing is to be
performed.
On the NetScaler, you can use the pre-publish and double signature methods to perform a rollover
of the Zone Signing Key and Key Signing Key. More information about these two rollover methods is
The following topics map commands on the ADC to the steps in the rollover procedures discussed in
RFC 4641.
The key expiry notification is sent through an SNMP trap called dnskeyExpiry. Three MIB variables,
dnskeyName, dnskeyTimeToExpire, and dnskeyUnitsOfExpiry are sent along with the dnskeyExpiry
SNMP trap. For more information, see Citrix NetScaler SNMP OID Reference at NetScaler 12.0 SNMP
OID Reference.
RFC 4641, “DNSSEC Operational Practices” defines four stages for the pre-publish key rollover method:
initial, new DNSKEY, new RRSIGs, and DNSKEY removal. Each stage is associated with a set of tasks
that you must perform on the ADC. Following are the descriptions of each stage and the tasks that you
must perform. The rollover procedure described here can be used for both Key Signing Keys and Zone
Signing Keys.
• Stage 1: Initial. The zone contains only those key sets with which the zone has currently been
signed. The state of the zone in the initial stage is the state of the zone just before you begin the
key rollover process.
Example:
Consider the key, example.com.zsk1, with which the zone example.com is currently signed. The
zone contains only those RRSIGs that were generated by the example.com.zsk1 key, which is
due for expiry. The Key Signing Key is example.com.ksk1.
• Stage 2: New DNSKEY. A new key is created and published in the zone (that is, the key is added
to the ADC), but the zone is not signed with the new key until the pre-roll phase is complete.
In this stage, the zone contains the old key, the new key, and the RRSIGs generated by the old
key. Publishing the new key for the complete duration of the pre-roll phase gives the DNSKEY
resource record (that corresponds to the new key) enough time to propagate to the secondary
name servers.
Example:
A new key example.com.zsk2 is added to the example.com zone. The zone is not signed with ex-
ample.com.zsk2 until the pre-roll phase is complete. The example.com zone contains DNSKEY
resource records for both example.com.zsk1 and example.com.zsk2.
NetScaler commands:
– Create a new DNS key by using the create dns key command.
For more information about creating a DNS key, including an example, see Create DNS keys
for a zone.
– Publish the new DNS key in the zone by using the add dns key command.
For more information about publishing the key in the zone, including an example, see Pub-
lish a DNS key in a zone.
• Stage 3: New RRSIGs. The zone is signed with the new DNS key and then unsigned with the
old DNS key. The old DNS key is not removed from the zone and remains published until the
RRSIGs that were generated by the old key expire.
Example:
The zone is signed with example.com.zsk2 and then unsigned with example.com.zsk1. The
zone continues to publish example.com.zsk1 until the RRSIGs that were generated by exam-
ple.com.zsk1 expire.
NetScaler commands:
– Sign the zone with the new DNS key by using the sign dns zone command.
– Unsign the zone with the old DNS key by using the unsign dns zone command.
For more information about signing and unsigning a zone, including examples, see Sign and
unsign a DNS zone.
• Stage 4: DNSKEY Removal. When the RRSIGs that were generated by the old DNS key expire,
the old DNS key is removed from the zone.
Example:
The old DNS key example.com.zsk1 is removed from the example.com zone.
NetScaler commands
On the ADC, you remove the old DNS key by using the rm dns key command. For more informa-
tion about removing a key from a zone, including an example, see Remove a DNS key.
RFC 4641, “DNSSEC Operational Practices” defines three stages for double signature key rollover: ini-
tial, new DNSKEY, and DNSKEY removal. Each stage is associated with a set of tasks that you must
perform on the ADC. Following are the descriptions of each stage and the tasks that you must per-
form. The rollover procedure described here can be used for both Key Signing Keys and Zone Signing
Keys.
• Stage 1: Initial. The zone contains only those key sets with which the zone has currently been
signed. The state of the zone in the initial stage is the state of the zone just before you begin the
key rollover process.
Example:
Consider the key, example.com.zsk1, with which the zone example.com is currently signed. The
zone contains only those RRSIGs that were generated by the example.com.zsk1 key, which is
due for expiry. The Key Signing Key is example.com.ksk1.
• Stage 2: New DNSKEY. The new key is published in the zone and the zone is signed with the
new key. The zone contains the RRSIGs that are generated by the old and the new keys. The
minimum duration for which the zone must contain both sets of RRSIGs is the time required for
all the RRSIGs to expire.
Example:
A new key example.com.zsk2 is added to the example.com zone. The zone is signed with exam-
ple.com.zsk2. The example.com zone now contains the RRSIGs generated from both keys.
NetScaler commands
– Create a new DNS key by using the create dns key command.
For more information about creating a DNS key, including an example, see Create DNS keys
for a zone.
– Publish the new key in the zone by using the add dns key command.
For more information about publishing the key in the zone, including an example, see Pub-
lish a DNS key in a zone.
– Sign the zone with the new key by using the sign dns zone command.
For more information about signing a zone, including examples, see Sign and unsign a DNS
zone.
• Stage 3: DNSKEY Removal. When the RRSIGs that were generated by the old DNS key expire,
the old DNS key is removed from the zone.
Example:
The old DNS key example.com.zsk1 is removed from the example.com zone.
NetScaler commands:
On the ADC, you remove the old DNS key by using the rm dns key command.
For more information about removing a key from a zone, including an example, see Remove a
DNS key.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
For DNS zones for which your DNS servers are authoritative, you can offload DNSSEC operations to
the NetScaler. In a DNSSEC offloading deployment, a DNS server sends unsigned responses. The ADC
signs the response on the fly before relaying it to the client. The ADC also caches the signed response.
Apart from reducing the load on the DNS servers, offloading DNSSEC operations to the ADC gives you
the following benefits:
• You can sign records that the DNS servers generate programmatically. Such records cannot be
signed by routine zone signing operations performed on the DNS servers.
• You can serve signed responses to clients even if you have not implemented DNSSEC on your
servers.
For setting up DNSSEC offloading, you must configure a DNS load balancing virtual server, configure
services that represent the DNS servers, and then bind the services to the virtual server. For infor-
mation about configuring a DNS load balancing virtual server, configuring services, and binding the
services to the virtual server, see Configure a DNS zone.
You must create a zone entity on the ADC for each DNS zone whose DNSSEC operations you want to
offload. For each DNS zone, you must enable the Proxy Mode and DNSSEC Offload parameters. You
can optionally configure NSEC record generation for an offloaded zone. To create a DNS zone entity
for DNSSEC offloading, follow the instructions in this topic.
To complete the configuration, you must generate DNS keys for the zone, add the keys to the zone,
and then sign the zone with the keys. This process is the same as for normal DNSSEC. For information
about creating keys, adding keys to a zone, and signing the zone, see Domain name system security
extensions.
After you configure DNS offloading, you must flush the DNS cache on the NetScaler. Flushing the DNS
cache ensures that any unsigned records in the cache are removed and subsequently replaced by
signed records. For information about flushing the DNS cache, see Flush DNS records.
At the command line, type the following commands to enable DNSSEC offloading for a zone and verify
the configuration:
Example:
1 > add dns zone example.com -proxyMode YES -dnssecOffload ENABLED nsec
ENABLED
2 Done
3 > show dns zone example.com
4 Zone Name : example.com
5 Proxy Mode : YES
6 DNSSEC Offload: ENABLED NSEC: ENABLED
7 Done
In a partitioned NetScaler appliance, the DNS keys that are generated are stored in the following loca-
tions:
You can now add a password to the DNS key. To add a password to the DNS key, you must first add
the password in the create dns key command and then provide the same password in the add dns
key command when adding the DNS key to the NetScaler appliance. For example:
create dns key -zoneName com -keytype ksK -algorithm rsASHA1 -keysize 4096
- fileNamePrefix com.ksk.rsasha1.4096 -password 1jsfd3Wa
Note:
• For default partitioned environment, the keys are read from default location/nsconfig/dns/.
However, if the keys are stored in a different location, the path name has to be provided in the
add dns key –private command. Example, add dns key –private <path name>.
• For non-default partitioned environment, the keys are read from the default location/nsconfig/-
partitions/<partitionname>/dns/.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Wildcard DNS domains are used to handle requests for a nonexistent domains and subdomains. In a
zone, if you want to redirect queries for all nonexistent domains or subdomains to a particular server,
you can use wildcard domains rather than creating a separate Resource Record (RR) for each such
domain. The most common use of a wildcard DNS domain is to create a zone that can be used to
forward mail from the internet to some other mail system.
In DNS resolution, the wildcard domain is supported by wildcard RRs. The wildcard RRs are used
to synthesize the responses to queries for a nonexistent domain name. For example, if you queried
http://image.example.com, and the subdomain “image” did not exist, you could be redirected to ex-
ample.com.
A wildcard record has an asterisk (*) character as the leftmost label of a domain name. For example,
*.example.com. An asterisk at any other place in the domain name does signify a wildcard DNS record.
For example, new.*.example.com is not a valid wildcard DNS record.
Note
• Wildcard domain is supported only when the NetScaler appliance is authoritative for the
zone and is configured as an ADNS or a DNS proxy server.
• Wildcard domain is not supported for NS and SOA records.
• Wildcard domain cannot be applied when the query is in another zone.
• Wildcard domain cannot be applied when the QNAME or a name between the wildcard do-
main and the QNAME is known to exist.
Example configuration
In the example, wildcard domain name is added for A and AAAA record.
When a query is received for a domain name that exists in the zone, say www.example.com, the
NetScaler appliance responds with the corresponding response; that is 2.2.2.2 in the example.
For a nonexistent domain name that matches with a wildcard type, a synthesized response is deliv-
ered.
In the example, the NetScaler appliance responds with 10.10.10.10 and 10.10.10.11 for domain name
nonexist.example.com or xyz.example.com.
Wildcard synthesize is not applicable for a domain name that exists in the zone.
For example, for the query www.example.com and type AAAA, the NetScaler appliance does not syn-
thesize with wildcard, because www.example.com exists with type A. In the example, the NetScaler
appliance responds with a NODATA response.
For a query say abc.example.com and type AAAA, the NetScaler appliance responds with a synthesized
response; that is 2001::1 in the example.
1.
2. Citrix ADC
3. NetScaler 12.0
A DNS attack fills the cache with negative records (NXDOMAIN and NODATA). As a result, responses to
legitimate requests are not cached, so new requests are sent to a back-end server for DNS resolution.
Responses are therefore delayed.
You can now flush the negative DNS records from the NetScaler appliance’s DNS cache.
Example:
flush dns proxyrecords ‒negRecType NODATA
To prevent random subdomain and NXDOMAIN attacks, you can restrict the DNS cache memory, and
you can adjust the TTL values for negative records.
To limit the amount of memory consumed by the DNS cache, you can specify the maximum cache size
(in MB), and also the cache size (in MB) for storing negative responses. When either limit is reached,
no more entries are added to the cache. Also, syslog messages are logged and, if you have configured
SNMP traps, SNMP traps are generated. If these limits are not set, caching continues until the system
memory is exhausted.
A higher TTL value for negative records can result in storing records that are not valuable for a long
period of time. A lower TTL value results in sending more requests to the back-end server.
The TTL of the negative record is set to a value that can be lesser of the TTL value or the ”Expires”
value of the SOA record.
Note:
• This limitation is added per packet engine. For example, if the maxCacheSize is set to 5 MB and
the appliance has 3 packet engines, the total cache size is 15 MB.
• The cache size for the negative records must be less than or equal to the maximum cache size.
• If you reduce the DNS cache memory limit to a value lower than the amount of data already
cached, the cache size remains above the limit until data ages out (exceeds its TTL0 or is flushed
(flush dns proxyrecords command, or Flush Proxy Records in the NetScaler GUI).
• To configure SNMP traps, see Configuring the NetScaler to Generate SNMP Traps.
Limit the memory consumed by the DNS Cache by using the CLI
Example:
Limit the memory consumed by the DNS Cache by using the GUI
Navigate to Configuration > Traffic Management > DNS, click Change DNS Settings, and set the
following parameters:
Example:
An attack can flood the DNS cache with entries that are not valuable but can cause flushing of the
already cached legitimate records to make room for the new entries. To prevent attacks from filling
the cache with invalid data, you can retain the legitimate records even after they exceed their TTL
values.
If you enable the cacheNoExpire parameter, the records currently in the cache are retained until you
disable the parameter.
Note:
• This option can be used only when the maximum cache size is specified (maxCacheSize param-
eter).
• If maxnegcacheTTL is configured and cacheNoExpire is enabled, cacheNoExpire takes priority.
Example:
1. Navigate to Configuration > Traffic Management > DNS and click Change DNS Settings.
2. Select Cache No Expire.
For greater visibility and control of DNS requests arriving at the NetScaler appliance, you can set the
cacheHitBypass parameter to forward all requests to the back-end servers and allow cache to be built
but not used. After the cache is built, you can disable the parameter so that requests are served from
the cache.
Example:
1. Navigate to Configuration > Traffic Management > DNS and click Change DNS Settings.
2. Select Cache Hit Bypass.
A DNS query spanning multiple packets presents the potential threat of a Slowloris attack. The
NetScaler appliance can silently drop DNS queries that are split into multiple packets.
You can set the splitPktQueryProcessing parameter to ALLOW or DROP a DNS query if the query is split
into multiple packets.
Example:
1. Navigate to Configuration > Traffic Management > DNS and click Change DNS Settings.
2. In the Split Packet Query Processing box, choose ALLOW or DROP.
You can collect statistics of the DNS responses served from cache and use these statistics to create
a threshold beyond which additional DNS traffic is dropped, and enforce this threshold with a band-
width based policy. Previously, bandwidth calculation for a DNS load balancing virtual server was not
accurate, because the number of cache hits was not reported.
In proxy mode, the statistics for Request bytes, Response bytes, Total Packets rcvd, and Total Packets
sent statistics are continuously updated. Previously, these statistics were not always updated, partic-
ularly for a DNS load balancing virtual server.
Proxy mode also now enables you to determine the number of DNS responses served from the
cache. To help collect these statistics, the following options have been added to the stat lb vserver
<DNSvirtualServerName> command:
• Requests – Total number of requests received by the DNS or DNS_TCP vserver. Includes the
requests forwarded to the back end and the requests answered from the cache.
• Vserver hits –Total number of requests forwarded to the back end. The total number of cache
hits is the difference between Requests and Vserver hits.
• Responses – Total number of responses sent by this vserver. For example, if a DNS LB virtual
server received 5 DNS requests, forwarded 3 of them to the back end, and served 2 of them
from the cache, the corresponding value of each of these statistics would be as follows:
– Vserver hits: 3
– Requests: 5
– Responses: 5
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Firewall load balancing distributes traffic across multiple firewalls, providing fault tolerance and in-
creased throughput. Firewall load balancing protects your network by:
• Dividing the load between the firewalls, which eliminates a single point of failure and allows the
network to scale.
• Increasing high availability.
Configuring a NetScaler appliance for firewall load balancing is similar to configuring load balancing,
with the exception that the recommended service type is ANY, recommended monitor type is PING,
and the load balancing virtual server mode is set to MAC.
You can set up firewall load balancing in a sandwich, an enterprise, or multiple-firewall environment
configuration. The sandwich environment is used for load balancing traffic entering the network from
outside and traffic leaving the network to the internet and involves configuring two NetScaler appli-
ances, one on each side of a set of firewalls. You configure an enterprise environment for load bal-
ancing traffic leaving the network to the internet. The enterprise environment involves configuring a
single NetScaler appliance between the internal network and the firewalls that provide access to the
Internet. The multiple-firewall environment is used for load balance traffic coming from another fire-
wall. Having firewall load balancing enabled on both the sides of NetScaler appliance improves the
traffic flow in both the egress and ingress direction and ensures faster processing of the traffic. The
multiple-firewall environment involves configuring a NetScaler appliance sandwiched between two
firewalls.
Important: If you configure static routes on the NetScaler appliance for the destination IP address and
enable L3 mode, the NetScaler appliance uses its routing table to route the traffic instead of sending
the traffic to the load balancing vserver.
Note: For FTP to work, an additional virtual server or service should be configured on the NetScaler
appliance with IP address and port as * and 21 respectively, and the service type specified as FTP. In
this case, the NetScaler appliance manages the FTP protocol by accepting the FTP control connection,
modifying the payload, and managing the data connection, all through the same firewall.
Firewall Load Balancing supports only some of the load balancing methods supported on the
NetScaler appliance. Also, you can configure only a few types of persistence and monitors.
The following load balancing methods are supported for firewall load balancing.
• Least Connections
• Round Robin
• Least Packets
• Least Bandwidth
• Source IP Hash
• Destination IP Hash
• Source IP Destination IP Hash
• Source IP Source Port hash
• Least Response Time Method (LRTM)
• Custom Load
Firewall Persistence
Only SOURCEIP, DESTIP, and SOURCEIPDESTIP based persistence are supported for firewall load bal-
ancing.
Only PING and transparent monitors are supported in firewall load balancing. You can bind a PING
monitor (default) to the backend service that represents the firewall. If a firewall is configured not to
respond to ping packets, you can configure transparent monitors to monitor hosts on the trusted side
through individual firewalls.
1.
2. Citrix ADC
3. NetScaler 12.0
Sandwich Environment
January 6, 2019
Contributed by:
C
A NetScaler deployment in a sandwich mode is capable of load balancing network traffic through fire-
walls in both directions: ingress (traffic entering the network from the outside, such as the internet)
and egress (traffic leaving the network to the internet).
In this setup, a NetScaler is located on each side of a set of firewalls. The NetScaler placed between
the firewalls and the Internet, called the external NetScaler that handles ingress traffic selects the
best firewall, based on the configured method. The NetScaler between the firewalls and the private
network, called the internal NetScaler tracks the firewall from which the initial packet for a session is
received. It then makes sure that all subsequent packets for that session are sent to the same firewall.
The internal NetScaler can be configured as a regular traffic manager to load balance traffic across the
private network servers. This configuration also allows traffic originating from the private network
(egress) to be load balanced across the firewalls.
The following diagram shows the sandwich firewall load balancing environment.
The service type ANY configures the NetScaler to accept all traffic.
To avail benefits related to HTTP and TCP, configure the service and virtual server with type HTTP or
TCP. For FTP to work, configure the service with type FTP.
Perform the following tasks to configure the external NetScaler in a sandwich environment
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
1 enable ns feature LB
2 show ns feature
Example:
Navigate to System > Settings and, in Configure Basic Features, select Load Balancing.
To configure a wildcard service for each firewall by using the command line interface
Example:
To configure a wildcard service for each firewall by using the configuration utility
Navigate to Traffic Management > Load Balancing > Services and add a service. Specify ANY in the
Protocol field and * in the Port field.
A PING monitor is bound by default to the service. You will need to configure a transparent monitor
to monitor hosts on the trusted side through individual firewalls. You can then bind the transparent
monitor to services. The default PING monitor monitors the connectivity only between the NetScaler
appliance and the upstream device. The transparent monitor monitors all the devices existing in the
path from the appliance to the device that owns the destination IP address specified in the monitor.
If a transparent monitor is not configured and the status of the firewall is UP but one of the next hop
devices from that firewall is down, the appliance includes the firewall while performing load balancing
and forwards the packet to the firewall. However, the packet is not delivered to the final destination
because one of the next hop devices is down. By binding a transparent monitor, if any of the devices
(including the firewall) are down, the service is marked as DOWN and the firewall is not included when
the appliance performs firewall load balancing.
Binding a transparent monitor will override the PING monitor. To configure a PING monitor in addition
to a transparent monitor, after you create and bind a transparent monitor, you need to bind a PING
monitor to the service.
Example:
Configure a wildcard virtual server for traffic coming from the Internet
To configure a wildcard virtual server for traffic coming from the Internet by using the command
line interface
At the command prompt, type:
Example:
To configure a wildcard virtual server for traffic coming from the Internet by using the configu-
ration utility
Navigate to Traffic Management > Load Balancing > Virtual Servers and create a wildcard virtual server.
Specify ANY in the Protocol field and * in the Port field.
To configure the virtual server in MAC rewrite mode by using the command line interface
Example:
To configure the virtual server in MAC rewrite mode by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and select the virtual server
for which you want to configure the redirection mode (for example, Vserver-LB-1).
2. Edit the Basic Settings section and. click more.
3. From the Redirection Mode drop-down list, select MAC Based.
To bind a service to the wildcard virtual server by using the command line interface
Example:
To bind a service to the wildcard virtual server by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and select the virtual server
for which you want to bind the service.
2. Click in the Services section and select a service to bind.
When you’ve finished the configuration tasks, be sure to save the configuration. You should also check
to make sure that the settings are correct.
To save and verify the configuration by using the command line interface
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
1 save ns config
2 show vserver
Example:
1 save config
2 sh lb vserver FWLBVIP1
3 FWLBVIP1 (*:*) - ANY Type: ADDRESS
4 State: UP
5 Last state change was at Mon Jun 14 06:40:14 2010
6 Time since last state change: 0 days, 00:00:11.240
7 Effective State: UP ARP:DISABLED
8 Client Idle Timeout: 120 sec
9 Down state flush: ENABLED
10 Disable Primary Vserver On Down : DISABLED
11 No. of Bound Services : 2 (Total) 2 (Active)
12 Configured Method: SRCIPDESTIPHASH
13 Mode: MAC
14 Persistence: NONE
15 Connection Failover: DISABLED
16
17 1) fw_svc_1 (10.102.29.251: *) - ANY State: UP Weight: 1
18 2) fw_svc_2 (10.102.29.18: *) - ANY State: UP Weight: 1
19 Done
20 show service fw-svc1
21 fw-svc1 (10.102.29.251:*) - ANY
22 State: DOWN
23 Last state change was at Thu Jul 8 10:04:50 2010
Perform the following tasks to configure the internal NetScaler in a sandwich environment
For traffic from the server (egress)
• Enable the load balancing feature.
• Configure a wildcard service for each firewall.
• Configure a monitor for each wildcard service.
• Configure a wildcard virtual server to load balance the traffic sent to the firewalls.
• Configure the virtual server in MAC rewrite mode.
• Bind firewall services to the wildcard virtual server.
For traffic across private network servers
• Configure a service for each virtual server.
You can configure load balancing entities such as services and virtual servers when the load balancing
feature is disabled, but they will not function until you enable the feature.
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
1 enable ns feature LB
2 show ns feature
Example:
Navigate to System > Settings and, in Configure Basic Features, select Load Balancing.
To configure a wildcard service for each firewall by using the command line interface
Example:
To configure a wildcard service for each firewall by using the configuration utility
Navigate to Traffic Management > Load Balancing > Services and add a service. Specify ANY in the
Protocol field and * in the Port field.
A PING monitor is bound by default to the service. You will need to configure a transparent monitor
to monitor hosts on the trusted side through individual firewalls. You can then bind the transparent
monitor to services. The default PING monitor monitors the connectivity only between the NetScaler
appliance and the upstream device. The transparent monitor monitors all the devices existing in the
path from the appliance to the device that owns the destination IP address specified in the monitor.
If a transparent monitor is not configured and the status of the firewall is UP but one of the next hop
devices from that firewall is down, the appliance includes the firewall while performing load balancing
and forwards the packet to the firewall. However, the packet is not delivered to the final destination
because one of the next hop devices is down. By binding a transparent monitor, if any of the devices
(including the firewall) are down, the service is marked as DOWN and the firewall is not included when
the appliance performs firewall load balancing.
Binding a transparent monitor will override the PING monitor. To configure a PING monitor in addition
to a transparent monitor, after you create and bind a transparent monitor, you need to bind a PING
monitor to the service.
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
Example:
1. Navigate to Traffic Management > Load Balancing > Monitors and create a monitor.
2. In the Create Monitor dialog box, enter the required parameters and select Transparent.
Configure a wildcard virtual server to load balance the traffic sent to the firewalls
To configure a wildcard virtual server to load balance the traffic sent to the firewalls by using
the command line interface
Example:
To configure a wildcard virtual server for traffic coming from the Internet by using the configu-
ration utility
Navigate to
Traffic Management > Load Balancing > Virtual Servers and create a wildcard virtual server. Specify
ANY in the Protocol field and * in the Port field.
To configure a wildcard virtual server to load balance the traffic sent to the firewalls by using
the configuration utility
To configure the virtual server in MAC rewrite mode by using the command line interface
Example:
To configure the virtual server in MAC rewrite mode by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and select the virtual server
for which you want to configure the redirection mode (for example, Vserver-LB-1).
2. Edit the Basic Settings section and. click more.
3. From the Redirection Mode drop-down list, select MAC Based.
To configure the virtual server in MAC rewrite mode by using the configuration utility
To bind firewall services to the wildcard virtual server by using the command line interface
Example:
To bind firewall services to the wildcard virtual server by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and select a virtual server.
To configure a service for each virtual server by using the command line interface
Example:
To configure a service for each virtual server by using the configuration utility
Navigate to Traffic Management > Load Balancing > Services and configure a service for each virtual
server. Specify HTTP in the Protocol field and select HTTP under Available Monitors.
To configure a service for each virtual server by using the configuration utility
Example:
Navigate to
Traffic Management > Load Balancing > Services, double-click a service and add a monitor.
To configure an HTTP virtual server to balance traffic sent to the servers by using the command
line interface
Example:
To configure an HTTP virtual server to balance traffic sent to the servers by using the configura-
tion utility
Navigate to Traffic Management > Load Balancing > Virtual Services and configure an HTTP virtual
server. Specify HTTP in the Protocol field.
To configure an HTTP virtual server to balance traffic sent to the servers by using the configura-
tion utility
When you’ve finished the configuration tasks, be sure to save the configuration. You should also check
to make sure that the settings are correct.
To save and verify the configuration by using the command line interface
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
• save ns config
• show vserver
Example:
1 save config
2 show lb vserver FWLBVIP2
3 FWLBVIP2 (*:*) - ANY Type: ADDRESS
4 State: UP
5 Last state change was at Mon Jun 14 07:22:54 2010
6 Time since last state change: 0 days, 00:00:32.760
7 Effective State: UP
8 Client Idle Timeout: 120 sec
9 Down state flush: ENABLED
10 Disable Primary Vserver On Down : DISABLED
11 No. of Bound Services : 2 (Total) 2 (Active)
12 Configured Method: LEASTCONNECTION
13 Current Method: Round Robin, Reason: A new service is bound
14 Mode: MAC
15 Persistence: NONE
16 Connection Failover: DISABLED
17
18 1) fw-int-svc1 (10.102.29.5: *) - ANY State: UP Weight: 1
19 2) fw-int-svc2 (10.102.29.9: *) - ANY State: UP Weight: 1
20 Done
21 show service fw-int-svc1
22 fw-int-svc1 (10.102.29.5:*) - ANY
23 State: DOWN
24 Last state change was at Thu Jul 8 14:44:51 2010
25 Time since last state change: 0 days, 00:01:50.240
After the configuration is up and running, you should view the statistics for each service and virtual
server to check for possible problems.
To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of
the virtual servers configured on the NetScaler appliance. You can display a summary of statistics for
all the virtual servers, or you can specify the name of a virtual server to display the statistics only for
that virtual server. You can display the following details:
• Name
• IP address
• Port
• Protocol
• State of the virtual server
• Rate of requests received
• Rate of hits
To display a summary of the statistics for all the virtual servers currently configured on the NetScaler,
or for a single virtual server, at the command prompt, type:
Example:
1. Navigate to Traffic Management > Load Balancing > Virtual Servers > Statistics.
2. If you want to display the statistics for only one virtual server, in the details pane, select the
virtual server, and click Statistics.
You can view the rate of requests, responses, request bytes, response bytes, current client connec-
tions, requests in surge queue, current server connections, and so forth using the service statistics.
Example:
1. Navigate to Traffic Management > Load Balancing > Services > Statistics.
2. If you want to display the statistics for only one service, select the service, and click Statistics.
1.
2. Citrix ADC
3. NetScaler 12.0
Enterprise Environment
January 6, 2019
Contributed by:
C
In the enterprise setup, the NetScaler is placed between the firewalls connecting to the public Internet
and the internal private network and handles egress traffic. The NetScaler selects the best firewall
based on the configured load balancing policy.
The following diagram shows the enterprise firewall load balancing environment
The service type ANY configures the NetScaler to accept all traffic.
To avail benefits related to HTTP and TCP, configure the service and vserver with type HTTP or TCP.
For FTP to work, configure the service with type FTP.
You can configure load balancing entities such as services and virtual servers when the load balancing
feature is disabled, but they will not function until you enable the feature.
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
• enable ns feature LB
• show ns feature
Example:
To configure a wildcard service for each firewall by using the command line interface
At the command prompt, type:
Example:
To configure a wildcard service for each firewall by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Services.
2. In the details pane, click Add.
3. In the Create Service dialog box, specify values for the following parameters as shown:
• Service Name—name
• Server—serverName
4. In Protocol, select ANY, and in Port, select *.
5. Click Create, and then click Close. The service you created appears in the Services pane.
A PING monitor is bound by default to the service. You will need to configure a transparent monitor
to monitor hosts on the trusted side through individual firewalls. You can then bind the transparent
monitor to services. The default PING monitor monitors the connectivity only between the NetScaler
appliance and the upstream device. The transparent monitor monitors all the devices existing in the
path from the appliance to the device that owns the destination IP address specified in the monitor.
If a transparent monitor is not configured and the status of the firewall is UP but one of the next hop
devices from that firewall is down, the appliance includes the firewall while performing load balancing
and forwards the packet to the firewall. However, the packet is not delivered to the final destination
because one of the next hop devices is down. By binding a transparent monitor, if any of the devices
(including the firewall) are down, the service is marked as DOWN and the firewall is not included when
the appliance performs firewall load balancing.
Binding a transparent monitor will override the PING monitor. To configure a PING monitor in addition
to a transparent monitor, after you create and bind a transparent monitor, you need to bind a PING
monitor to the service.
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
Example:
• Name*
• Type*—type
• Destination IP
• Transparent
-* A required parameter
4. Click Create, and then click Close. In the Monitors pane, select the monitor that you just config-
ured and verify that the settings displayed at the bottom of the screen are correct.
Configure a wildcard virtual server to load balance the traffic sent to the firewalls
To configure a wildcard virtual server to load balance the traffic sent to the firewalls by using
the command line interface
Example:
To configure a wildcard virtual server to load balance the traffic sent to the firewalls by using
the configuration utility
To configure the virtual server in MAC rewrite mode by using the command line interface
Example:
To configure the virtual server in MAC rewrite mode by using the configuration utility
To bind firewall services to the wildcard virtual server by using the command line interface
Example:
To bind firewall services to the wildcard virtual server by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and select a virtual server.
2. Click in the Service section, and select a service to bind.
To configure a service for each virtual server by using the command line interface
Example:
To configure a service for each virtual server by using the configuration utility
3. In the Create Service dialog box, specify values for the following parameters as shown:
• Service Name—name
• Server—serverName
• Port—port
4. In Protocol, specify HTTP. Under Available Monitors, select HTTP.
5. Click Create, and then click Close. The service you created appears in the Services pane.
Example:
To configure an HTTP virtual server to balance traffic sent to the servers by using the command
line interface
Example:
To configure an HTTP virtual server to balance traffic sent to the servers by using the configura-
tion utility
3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the following param-
eters as shown:
• Name—name
• IP Address—IPAddress
Note: If the virtual server uses IPv6, select the
IPv6 check box and enter the address in IPv6 format (for example,
1000:0000:0000:0000:0005:0600:700a:888b).
• Port—port
4. Under Protocol, select HTTP.
5. Click Create, and then click Close. The virtual server you created appears in the Load Balancing
Virtual Servers pane.
To bind HTTP services to the wildcard virtual server by using the command line interface
Example:
To bind HTTP services to the wildcard virtual server by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and select a virtual server.
2. Click in the Service section, and select a service to bind.
When you’ve finished the configuration tasks, be sure to save the configuration. You should also check
to make sure that the settings are correct.
To save and verify the configuration by using the command line interface
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
• save ns config
• show vserver
Example:
1 save config
2 show lb vserver FWLBVIP2
3 FWLBVIP2 (*:*) - ANY Type: ADDRESS
4 State: UP
5 Last state change was at Mon Jun 14 07:22:54 2010
6 Time since last state change: 0 days, 00:00:32.760
7 Effective State: UP
8 Client Idle Timeout: 120 sec
9 Down state flush: ENABLED
10 Disable Primary Vserver On Down : DISABLED
11 No. of Bound Services : 2 (Total) 2 (Active)
12 Configured Method: LEASTCONNECTION
13 Current Method: Round Robin, Reason: A new service is bound
14 Mode: MAC
15 Persistence: NONE
16 Connection Failover: DISABLED
17
18 1) fw-int-svc1 (10.102.29.5: *) - ANY State: UP Weight: 1
19 2) fw-int-svc2 (10.102.29.9: *) - ANY State: UP Weight: 1
20 Done
21 show service fw-int-svc1
22 fw-int-svc1 (10.102.29.5:*) - ANY
23 State: DOWN
24 Last state change was at Thu Jul 8 14:44:51 2010
25 Time since last state change: 0 days, 00:01:50.240
26 Server Name: 10.102.29.5
27 Server ID : 0 Monitor Threshold : 0
28 Max Conn: 0 Max Req: 0 Max Bandwidth: 0 kbits
29 Use Source IP: NO
30 Client Keepalive(CKA): NO
31 Access Down Service: NO
32 TCP Buffering(TCPB): NO
33 HTTP Compression(CMP): NO
34 Idle timeout: Client: 120 sec Server: 120 sec
35 Client IP: DISABLED
36 Cacheable: NO
37 SC: OFF
38 SP: OFF
39 Down state flush: ENABLED
40
41 1) Monitor Name: monitor-HTTP-1
After the configuration is up and running, you should view the statistics for each service and virtual
server to check for possible problems.
To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of
the virtual servers configured on the NetScaler appliance. You can display a summary of statistics for
all the virtual servers, or you can specify the name of a virtual server to display the statistics only for
that virtual server. You can display the following details:
• Name
• IP address
• Port
• Protocol
• State of the virtual server
To display a summary of the statistics for all the virtual servers currently configured on the NetScaler
appliance, or for a single virtual server, at the command prompt, type:
Example:
1. Navigate to Traffic Management > Load Balancing > Virtual Servers > Statistics.
2. If you want to display the statistics for only one virtual server, in the details pane, select the
virtual server, and click Statistics.
Updated: 2013-08-28
You can view the rate of requests, responses, request bytes, response bytes, current client connec-
tions, requests in surge queue, current server connections, and so forth using the service statistics.
Example:
1. Navigate to Traffic Management > Load Balancing > Services > Statistics.
2. If you want to display the statistics for only one service, select the service, and click Statistics.
1.
2. Citrix ADC
3. NetScaler 12.0
Multiple-Firewall Environment
January 6, 2019
Contributed by:
C
In a multiple-firewall environment, the NetScaler appliance is placed between two sets of firewalls,
the external set connecting to the public Internet, and the internal set connecting to the internal pri-
vate network. The external set typically handles the egress traffic. These firewalls mainly implement
access control lists to allow or deny access to external resources. The internal set typically handles
the ingress traffic. These firewalls implement security to safeguard the intranet from malicious at-
tacks apart from load-balancing the ingress traffic. The multiple-firewall environment allows you to
load-balance traffic coming from another firewall. By default, the traffic coming from a firewall is not
load balanced on the other firewall across a NetScaler appliance. Having firewall load balancing en-
abled on both the sides of NetScaler improves the traffic flow in both the egress and ingress direction
and ensures faster processing of the traffic.
With a configuration like the one shown in Figure 1, you can configure the NetScaler to load balance the
traffic through the an internal firewall even if it is load balanced by an external firewall. For example,
with this feature configured, the traffic coming from the external firewalls (firewalls 1, 2, and 3) is load
balanced on the internal firewalls (firewalls 4, 5, and 6) and vice versa.
Firewall load balancing is supported only for MAC mode LB virtual server.
The service type ANY configures the NetScaler to accept all traffic.
To avail benefits related to HTTP and TCP, configure the service and virtual server with type HTTP or
TCP. For FTP to work, configure the service with type FTP.
To configure a NetScaler appliance in a multiple-firewall environment, you have to enable the load
balancing feature, configure a virtual server to load balance the egress traffic across the external fire-
walls, configure a virtual server to load balance the ingress traffic across the internal firewalls, and
enable firewall load balancing on the NetScaler appliance. To configure a virtual server to load bal-
ance traffic across a firewall in the multiple-firewall environment, you need to:
To configure and implement load balancing entities such as services and virtual servers, you need to
enable the load balancing feature on the NetScaler device.
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
Example:
7 2) Surge Protection SP ON
8 3) Load Balancing LB ON
9 .
10 .
11 .
12 24) NetScaler Push push OFF
13 Done
To accept traffic from all the protocols, you need to configure wildcard service for each firewall by
specifying support for all the protocols and ports.
At the command prompt, type the following command to configure support for all the protocols and
ports:
Example:
3. In the Create Services dialog box, specify values for the following parameters as shown:
• Service Name—name
• Server—serverName
-* A required parameter
5. Click Create, and then click Close. The service you created appears in the Services pane.
A PING monitor is bound by default to the service. You will need to configure a transparent monitor
to monitor hosts on the trusted side through individual firewalls. You can then bind the transparent
monitor to services. The default PING monitor monitors the connectivity only between the NetScaler
appliance and the upstream device. The transparent monitor monitors all the devices existing in the
path from the appliance to the device that owns the destination IP address specified in the monitor.
If a transparent monitor is not configured and the status of the firewall is UP but one of the next hop
devices from that firewall is down, the appliance includes the firewall while performing load balancing
and forwards the packet to the firewall. However, the packet is not delivered to the final destination
because one of the next hop devices is down. By binding a transparent monitor, if any of the devices
(including the firewall) are down, the service is marked as DOWN and the firewall is not included when
the appliance performs firewall load balancing.
Binding a transparent monitor will override the PING monitor. To configure a PING monitor in addition
to a transparent monitor, after you create and bind a transparent monitor, you need to bind a PING
monitor to the service.
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
Example:
3. In the Create Monitor dialog box, specify values for the following parameters as shown:
• Name*
• Type*—type
• Destination IP
• Transparent
-* A required parameter
4. Click Create, and then click Close. In the Monitors pane, select the monitor that you just config-
ured and verify that the settings displayed at the bottom of the screen are correct.
Configuring a virtual server to load balance the traffic sent to the firewalls
To load balance any kind of traffic, you need to configure a wildcard virtual server specifying the pro-
tocol and port as any value.
To configure a virtual server to load balance the traffic sent to the firewalls by using the CLI:
Example:
To configure a virtual server to load balance the traffic sent to the firewalls by using the GUI:
To configure the virtual server to use MAC address for forwarding the incoming traffic, you need to
enable the MAC rewrite mode.
To configure the virtual server in MAC rewrite mode by using the CLI:
Example:
To configure the virtual server in MAC rewrite mode by using the GUI:
2. In the details pane, select the virtual server for which you want to configure the redirection
mode (for example, Vserver-LB1), and then click Open.
3. On the Advanced tab, under the Redirection Mode mode, click Open.
4. Click Ok.
To access a service on NetScaler appliance, you need to bind it to a wildcard virtual server.
Example:
To load balance traffic on both the sides of a NetScaler using firewall load balancing, you need to
enable mulitpl-firewall load balancing by using the vServerSpecificMac parameter.
Example:
When you’ve finished the configuration tasks, be sure to save the configuration. You should also check
to make sure that the settings are correct.
At the command prompt, type the following commands to configure a transparent monitor and verify
the configuration:
• save ns config
• show vserver
Example:
1 save config
2 show lb vserver FWLBVIP2
3 FWLBVIP2 (*:*) - ANY Type: ADDRESS
4 State: UP
5 Last state change was at Mon Jun 14 07:22:54 2010
6 Time since last state change: 0 days, 00:00:32.760
7 Effective State: UP
8 Client Idle Timeout: 120 sec
9 Down state flush: ENABLED
10 Disable Primary Vserver On Down : DISABLED
11 No. of Bound Services : 2 (Total) 2 (Active)
12 Configured Method: LEASTCONNECTION
13 Current Method: Round Robin, Reason: A new service is bound
14 Mode: MAC
15 Persistence: NONE
16 Connection Failover: DISABLED
17
18 1) fw-int-svc1 (10.102.29.5: *) - ANY State: UP Weight: 1
19 2) fw-int-svc2 (10.102.29.9: *) - ANY State: UP Weight: 1
20 Done
21 show service fw-int-svc1
22 fw-int-svc1 (10.102.29.5:*) - ANY
23 State: DOWN
After the configuration is up and running, you should view the statistics for each service and virtual
server to check for possible problems.
To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of
the virtual servers configured on the NetScaler appliance. You can display a summary of statistics for
all the virtual servers, or you can specify the name of a virtual server to display the statistics only for
that virtual server. You can display the following details:
• Name
• IP address
• Port
• Protocol
• State of the virtual server
• Rate of requests received
• Rate of hits
To display virtual server statistics by using the CLI:
To display a summary of the statistics for all the virtual servers currently configured on the NetScaler
appliance, or for a single virtual server, at the command prompt, type:
Example:
10 Done
1. Navigate to Traffic Management > Load Balancing > Virtual Servers > Statistics.
2. If you want to display the statistics for only one virtual server, in the details pane, select the
virtual server, and click Statistics.
You can view the rate of requests, responses, request bytes, response bytes, current client connec-
tions, requests in surge queue, current server connections, and so forth using the service statistics.
Example:
1. Navigate to Traffic Management > Load Balancing > Services > Statistics.
2. If you want to display the statistics for only one service, select the service, and click Statistics.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Note
This feature is available as an option with a NetScaler standard edition license, but is included
with the enterprise and platinum edition licenses.
NetScaler appliances configured for global server load balancing (GSLB) provide for disaster recovery
and ensure continuous availability of applications by protecting against points of failure in a wide
area network (WAN). GSLB can balance the load across data centers by directing client requests to the
closest or best performing data center, or to surviving data centers in case of an outage.
In a typical configuration, a local DNS server sends client requests to a GSLB virtual server, to which are
bound GSLB services. A GSLB service identifies a load balancing or content switching virtual server,
which can be at the local site or a remote site. If the GSLB virtual server selects a load balancing or
content switching virtual server at a remote site, it sends the virtual server’s IP address to the DNS
server, which sends it to the client. The client then resends the request to the new virtual server at
the new IP.
The GSLB entities that you must configure are the GSLB sites, the GSLB services, the GSLB virtual
servers, load balancing or content switching virtual servers, and authoritative DNS (ADNS) services.
You must also configure MEP. You can also configure DNS views to expose different parts of your net-
work to clients accessing the network from different locations.
Note
To take full advantage of the NetScaler GSLB features, you should use NetScaler appliances for
load balancing or content switching at each data center, so that your GSLB configuration can use
the proprietary Metric Exchange Protocol (MEP) to exchange site metrics.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
NetScaler appliances configured for global server load balancing (GSLB) provide for disaster recovery
and ensure continuous availability of applications by protecting against points of failure in a wide
area network (WAN). GSLB can balance the load across data centers by directing client requests to the
closest or best performing data center, or to surviving data centers in the event of an outage.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
An active-active site consists of multiple active data centers. Client requests are load balanced across
active data centers. This deployment type can be used when you have a need for global distribution
of traffic in a distributed environment.
All the sites in an active-active deployment are active, and all the services for a particular application/-
domain are bound to the same GSLB vserver. Sites exchange metrics through the Metrics Exchange
Protocol (MEP). Site metrics exchanged between the sites include the status of each load balancing
and content switching virtual server, current number of connections, current packet rate, and current
bandwidth usage. The NetScaler appliance needs this information to perform load balancing across
the sites.
An active-active deployment can include a maximum of 32 GSLB sites, because MEP cannot synchro-
nize more than 32 sites. No backup sites are configured in this deployment type.
The NetScaler appliance sends client requests to the appropriate GSLB site as determined by the GSLB
method specified in the GSLB configuration.
For an active-active deployment, you can configure the following GSLB methods.
• Round Robin
• Least Connections
• Least Response Time
• Least Bandwidth
• Least Packets
• Source IP Hash
• Custom Load
• Round Trip Time (RTT)
• Static Proximity
Note:
When the client sends a DNS request, it lands in one of the active sites.
If Site 1 receives the client request, the GSLB virtual server in Site 1 selects a load balancing or content
switching virtual server and sends the virtual server’s IP address to the DNS server, which sends it to
the client. The client then resends the request to the new virtual server at the new IP address.
As both sites are active, the GSLB algorithm evaluates the services at both sites when making a selec-
tion as determined by the configured GSLB method.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
An active-passive site consists of an active and a passive data center. This deployment type is ideal for
disaster recovery.
In this type of deployment, some of the sites (remote sites) are reserved only for disaster recovery.
These sites do not participate in any decision making until all the active sites are DOWN. A passive site
does not become operational unless a disaster event triggers a failover.
Once you have configured the primary data center, replicate the configuration for the backup data
center and designate it as the passive GSLB site by designating a GSLB virtual server at that site as the
backup virtual server.
An active-passive deployment can include a maximum of 32 GSLB sites, because MEP cannot synchro-
nize more than 32 sites.
For an active-passive deployment, you can configure the following GSLB methods.
• Round Robin
• Least Connections
• Least Response Time
• Least Bandwidth
• Least Packets
• Source IP Hash
• Custom Load
• Round Trip Time (RTT)
• Static Proximity
Note:
In the diagram, Site 1 is an active site and Site 2 is a passive site, which has the same configuration as
that of Site 1.
When the client sends a DNS request, the request can land in any of the sites. However, the services
are selected only from the active site (Site1) as long as it is UP.
Services from the passive site (Site 2) are selected only if the active site (Site 1) is DOWN.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
NetScaler GSLB provides global server load balancing and disaster recovery by creating mesh con-
nections between all the involved sites and making intelligent load balancing decisions. Each site
communicates with the others to exchange server and network metrics through Metric Exchange Pro-
tocol (MEP), at regular intervals. However, with the increase in number of peer sites, the volume of
MEP traffic increases exponentially because of the mesh topology. To overcome this, you can use a
parent-child topology. The parent-child topology also supports larger deployments. In addition to
the 32 parent sites, you can configure 1024 child sites.
The GSLB parent-child topology is a two-level hierarchical design with the following characteristics:
• At the top level are parent sites, which have peer relationships with other parents.
• Each parent can have multiple child sites.
• Each parent site exchanges health information with its child sites and with other parent sites.
• A child site communicates only with its parent site.
• In a parent-child relationship for GSLB, only the parent site responds to ADNS queries. The child
sites act as normal load balancing sites.
• An ADNS service or DNS load balancing virtual servers should be configured only in the parent
site.
• A parent site can have a normal GSLB configuration, that is, services from local and all remote
sites, but a child site can have local services only. Also, only the parent sites have GSLB virtual
servers configured.
Note
• In a parent-child topology, the exchange of site metrics is initiated from the lower of two IP
addresses. However, from NetScaler release 11.1 build 51.x, the parent sites initiate connec-
tions to the child sites, and not vice versa, because the parent sites have information about
all the child sites in the GSLB setup.
• In a parent-parent connection, the exchange of site metrics is still initiated from the lower IP of
two IP addresses.
• In a parent-child topology, GSLB services are not always required to be configured on a child site.
However, if you have additional configuration such as client authentication, client IP address
insertion, or other SSL-specific requirement, you must add an explicit GSLB service on the child
site and configure it accordingly.
• In a parent-child topology, the parent site and the child site can be on differentNetScaler soft-
ware versions. However, to use the GSLB automaticConfigSync option to synchronize the con-
figuration across the parent sites, all parent sites must be on the sameNetScaler software ver-
sions. If you are not using the automaticConfigSync option, then the parent site and the child
site can be on differentNetScaler software versions but make sure that you are not using any of
the new features in the latest release. This is also applicable, in general, to two NetScaler nodes
participating in GSLB.
In the diagram, Site P1 and Site P2 are parent sites in a peer relationship. Site P1C1 and P2C1 are the
child sites of P1 and P2 respectively.
If you have a firewall configured at a GSLB site, make sure that port 3011 is open.
• The configuration of a child site includes the child site and its parent site, but no other parent
or child sites.
• Network metrics, such as RTT and persistence session information, are synchronized only
across the parent sites. Therefore, parameters such as nwMetricExchange and sessionEx-
change are disabled by default on all the child sites.
• To verify correct parent-child configuration, check the states of all the GSLB services bound to
the parent sites.
Example:
Example:
For a complete example of a parent-child configuration, using the command line interface, see Exam-
ple of a Complete Parent-Child Configuration, Using the CLI
Note
If the load balancing virtual server IP address is a private IP address and the public IP address is
different from this IP address, you need to configure a GSLB service for the local load balancing
virtual server on the child site. This is required for statistics collection between the parent and
the child site.
add gslb service <name> <private IP/lb vserver IP> http 80 ‒sitename <
childsite name> -publicip <public IP of LB vserver>
Example:
add gslb service Service-GSLB 192.168.1.3 http 80 -GSLB_Site11 site 11_lb1 172.16.1.1
Where 192.168.1.3 is a private IP address of the load balancing virtual server and 172.16.1.1 is a
public IP address of the load balancing virtual server.
Note: This feature was introduced in NetScaler release 11.1 build 51.x. To use the backup parent site
topology, make sure that the parent site and the child sites are on NetScaler 11.1 build 51.x and later.
The backup parent site topology is useful in scenarios wherein a large number of child sites are asso-
ciated with a parent site. If this parent site goes DOWN, all of its child sites become unavailable. To
prevent this, you can now configure a backup parent site to which the child sites can connect if the
original parent site is DOWN. The parent site sends the backup parent list to the child sites through
the MEP messages.
When a parent site is DOWN, the other parent sites in the GSLB get to know that a particular parent site
is DOWN through MEP because MEP to that parent site is DOWN. The other parent sites in the GSLB
setup look up the backup chain of the peer parent. The parent site with the highest preference adopts
the child sites of the parent that went DOWN. The new parent then initiates a connection with the
child site. A child site can accept or reject the connection after evaluating its existing connections and
the information in the backup list.
When the original parent site is back UP, it tries to establish connections with its child sites that have
migrated to a different parent. When a connection attempt is successful, the child site is reassigned
to its original parent site.
Note:
• Only parent sites can be configured as backups, and this configuration can only be done at the
parent site.
• All child sites use the backup parent set.
• Synchronization is done only on the parent sites. GSLB child sites’ configuration is not affected
by synchronization. This is because the parent site and the child site configurations are not
identical. The child sites configuration consists only of its own and its parent site’s details. Also,
GSLB services are not always required to be configured in the child sites.
Note: For illustration purposes, the figure shows only one backup parent for each parent site.
The following list summarizes the behavior of the parent and child sites under various scenarios:
– SiteP2 and SiteP3 detect that SiteP1’s MEP connection is DOWN. SiteP2 is higher in the
preference list of backup parents for SiteP1, so it tries to initiate a connection to Child_site1.
SiteP3 assumes that Child_site1 is now the child site of parent SiteP2.
– SiteP2 sends Child_Site1 the list of SiteP1’s backup parents (SiteP2 and SiteP3) to
Child_site1. Child_site1 uses the list to decide whether to accept or reject the connection
from SiteP2. It accepts the connection and becomes a child of SiteP2.
– When SiteP1 is back UP, it sends Child_site1 a connection request. The new request takes
precedence and Child_site 1 migrates to SiteP1.
• Scenario 2: Only the MEP connection between SiteP1 and SiteP2 has gone DOWN. Child_site1
rejects SiteP2’s connection request, because its parent, SiteP1, is still UP.
• Scenario 3: SiteP3 and Child_Site1 detect that SiteP1 is DOWN, and the MEP connection between
SiteP3 and SiteP2 is also DOWN. However, Site P2 detects that SiteP1 is UP, and the MEP con-
nection between SiteP1 and SiteP2 is UP.
– SiteP2 does not take any action.
– SiteP3 checks SiteP1’s backup list and finds that SiteP2 has a higher preference than
SiteP3. But SiteP2 is DOWN, so SiteP3 tries to establish a connection with Child_site1.
Child_site1 has detected that SiteP1 is DOWN, so it accepts SiteP3’s connection request.
– Now the connection between SiteP1 and SiteP2 goes DOWN. SiteP2 checks SiteP1’s backup
list and finds itself as the most preferred backup, so it tries to connect to Child_site1.
Child_site1 evaluates the new connection request based on SiteP1’s list and finds SiteP2
as the most preferred backup, so it migrates to SiteP2 from SiteP3.
Note:
• You cannot add a new site as a backup parent. You must first add all the sites, and then configure
the site as a backup parent.
• To remove a backup parent, you must use the unset command, which unsets all the sites that
were previously configured as backup parent sites.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A GSLB configuration consists of a group of GSLB entities on each appliance in the configuration.
These entities include the following:
• GSLB Sites
• GSLB Services
• GSLB Virtual Servers
• Load Balancing or Content Switching Virtual Servers
• ADNS Services
• DNS VIPs
GSLB Sites
A typical GSLB setup consists of data centers, each of which has various network appliances that may
or may not be NetScaler appliances. The data centers are called GSLB sites. Each GSLB site is managed
by a NetScaler appliance that is local to that site. Each of these appliances treats its own site as the
local site and all other sites, managed by other appliances, as remote sites.
If the appliance that manages a site is the only NetScaler appliance in that data center, the GSLB site
hosted on that appliance acts as a bookkeeping placeholder for auditing purposes, because no met-
rics can be collected. Typically, this happens when the appliance is used only for GSLB, and other
products in the data center are used for load balancing or content switching.
The concept of sites is central to NetScaler GSLB implementations. Unless otherwise specified, sites
form a peer relationship among themselves. This relationship is used first to exchange health infor-
mation and then to distribute load as determined by the selected algorithm. In many situations, how-
ever, a peer relationship among all GSLB sites is not desirable. Reasons for not having an all-peer
implementation could be;
• To clearly separate GSLB sites. For example, to separate sites that participate in resolving DNS
queries from the traffic management sites.
• To reduce the volume of Metric Exchange Protocol (MEP) traffic, which increases exponentially
with an increasing number of peer sites.
These goals can be achieved by using parent and child GSLB sites.
GSLB Services
A GSLB service is usually a representation of a load balancing or content switching virtual server, al-
though it can represent any type of virtual server. The GSLB service identifies the virtual server’s
IP address, port number, and service type. GSLB services are bound to GSLB virtual servers on the
NetScaler appliances managing the GSLB sites. A GSLB service bound to a GSLB virtual server in the
same data center is local to the GSLB virtual server. A GSLB service bound to a GSLB virtual server in
a different data center is remote from that GSLB virtual server.
Note
Sites and services are inherently linked to indicate proximity between the two. That is, all ser-
vices must belong to a site, and are assumed to be in the same location as the GSLB site for
proximity purposes. Likewise, services and virtual servers are linked, so that the logic is linked
to the resources that are available.
A GSLB virtual server has one or more GSLB services bound to it, and load balances traffic among those
services. It evaluates the configured GSLB methods (algorithms) to select the appropriate service to
which to send a client request. Because the GSLB services can represent either local or remote servers,
selecting the optimal GSLB service for a request has the effect of selecting the data center that should
serve the client request.
The domain for which global server load balancing is configured must be bound to the GSLB virtual
server, because one or more services bound to the virtual server will serve requests made for that
domain.
Unlike other virtual servers configured on a NetScaler appliance, a GSLB virtual server does not have
its own virtual IP address (VIP).
A load balancing or content switching virtual server represents one or many physical servers on the
local network. Clients send their requests to the load balancing or content switching virtual server’s
virtual IP (VIP) address, and the virtual server balances the load across the physical servers. After a
GSLB virtual server selects a GSLB service representing either a local or a remote load balancing or
content switching virtual server, the client sends the request to that virtual server’s VIP address.
For more information about load balancing or content switching virtual servers and services, see Load
Balancing or Content Switching.
ADNS Services
An ADNS service is a special kind of service that responds only to DNS requests for domains for which
the NetScaler appliance is authoritative. When an ADNS service is configured, the appliance owns
that IP address and advertises it. Upon reception of a DNS request by an ADNS service, the appliance
checks for a GSLB virtual server bound to that domain. If a GSLB virtual server is bound to the domain,
it is queried for the best IP address to which to send the DNS response.
DNS VIPs
A DNS virtual IP is a virtual IP (VIP) address that represents a load balancing DNS virtual server on the
NetScaler appliance. DNS requests for domains for which the NetScaler appliance is authoritative can
be sent to a DNS VIP.
1.
2. Citrix ADC
3. NetScaler 12.0
GSLB methods
Contributed by:
C
Unlike traditional DNS servers that simply respond with the IP addresses of the configured servers,
a NetScaler appliance configured for GSLB responds with the IP addresses of the services, as deter-
mined by the configured GSLB method. By default, the GSLB virtual server is set to the least connec-
tion method. If all GSLB services are down, the appliance responds with the IP addresses of all the
configured GSLB services.
GSLB methods are algorithms that the GSLB virtual server uses to select the best-performing GSLB
service. After the host name in the Web address is resolved, the client sends traffic directly to the
resolved service IP address.
• Round Robin
• Least Connections
• Least Response Time
• Least Bandwidth
• Least Packets
• Source IP Hash
• Custom Load
• Round Trip Time (RTT)
• Static Proximity
For GSLB methods to work with a remote site, either MEP must be enabled or explicit monitors must
be bound to the remote services. If MEP is disabled, RTT, Least Connections, Least Bandwidth, Least
Packets and Least Response Time methods default to Round Robin.
The Static Proximity and RTT load balancing methods are specific to GSLB.
For information about the Round Robin, Least Connections, Least Response Time, Least Bandwidth,
Least Packets, Source IP Hash, or Custom Load method, see “
Load Balancing.”
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
GSLB algorithms
Contributed by:
C
• Round Robin: When a GSLB virtual server is configured to use the round robin method, it con-
tinuously rotates a list of the services that are bound to it. When the virtual server receives a
request, it assigns the connection to the first service in the list, and then moves that service to
the bottom of the list.
• Least Response Time: When the GSLB virtual server is configured to use the least response
time method, it selects the service with the fewest active connections and the lowest average
response time. You can configure this method for HTTP and Secure Sockets Layer (SSL) services
only. The response time (also called Time to First Byte, or TTFB) is the time interval between
sending a request packet to a service and receiving the first response packet from the service.
The NetScaler appliance uses response code 200 to calculate TTFB.
• Least Connections: When a GSLB virtual server is configured to use the least connection GSLB
algorithm (or method), it selects the service with the fewest active connections. This is the de-
fault method, because, in most circumstances, it provides the best performance.
• Least Bandwidth: A GSLB virtual server configured to use the least bandwidth method selects
the service that is currently serving the least amount of traffic, measured in megabits per second
(Mbps).
• Least Packets: A GSLB virtual server configured to use the least packets method selects the
service that has received the fewest packets in the last 14 seconds.
• Source IP Hash: A GSLB virtual server configured to use the source IP hash method uses the
hashed value of the client IPv4 or IPv6 address to select a service. To direct all requests from
source IP addresses that belong to a particular network to a specific destination server, you
must mask the source IP address. For IPv4 addresses, use the netMask parameter. For IPv6
addresses, use the v6NetMaskLength parameter.
• Custom Load: Custom load balancing is performed on server parameters such as CPU usage,
memory, and response time. When using the custom load method, the NetScaler appliance
usually selects a service that is not handling any active transactions. If all of the services in the
GSLB setup are handling active transactions, the appliance selects the service with the smallest
load. A special type of monitor, known as a load monitor, calculates the load on each service in
the network. The load monitors do not mark the state of a service, but they do take services out
of the GSLB decision when those services are not UP.
1.
2. Citrix ADC
3. NetScaler 12.0
Static proximity
Contributed by:
C
The static proximity method for GSLB uses an IP-address based static proximity database to deter-
mine the proximity between the client’s local DNS server and the GSLB sites. The NetScaler appliance
responds with the IP address of a site that best matches the proximity criteria.
If two or more GSLB sites at different geographic locations serve the same content, the NetScaler
appliance maintains a database of IP address ranges and uses the database for decisions about the
GSLB sites to which to direct incoming client requests.
For the static proximity method to work, you must either configure the NetScaler appliance to use
an existing static proximity database populated through a location file or add custom entries to the
static proximity database. After adding custom entries, you can set their location qualifiers. After
configuring the database, you are ready to specify static proximity as the GSLB method.
For details about configuring static proximity, see Configuring Static Proximity.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Dynamic round trip time (RTT) is a measure of time or delay in the network between the client’s local
DNS server and a data resource. To measure dynamic RTT, the NetScaler appliance probes the client’s
local DNS server and gathers RTT metric information. The appliance then uses this metric to make its
load balancing decision. Global server load balancing monitors the real-time status of the network
and dynamically directs the client request to the data center with the lowest RTT value.
When a client’s DNS request for a domain comes to the NetScaler appliance configured as the author-
itative DNS for that domain, the appliance uses the RTT value to select the IP address of the best
performing site to send it as a response to the DNS request.
The NetScaler appliance uses different mechanisms, such as ICMP echo request / reply (PING), UDP,
and TCP to gather the RTT metrics for connections between the local DNS server and participating
sites. The appliance first sends a ping probe to determine the RTT. If the ping probe fails, a DNS UDP
probe is used. If that probe also fails, the appliance uses a DNS TCP probe.
These mechanisms are represented on the NetScaler appliance as Load Balancing Monitors and are
easily identified due to their use of the “ldns” prefix. The three monitors, in their default order, are:
• ldns-ping
• ldns-dns
• ldns-tcp
These monitors are built in to the appliance and are set to safe defaults, but may be customized just
like any other monitor on the appliance.
The default order may also be changed by setting it explicitly as a GSLB parameter. For example, to set
the order to be the DNS UDP query followed by the PING and then TCP, type the following command:
Unless they have been customized, the NetScaler appliance performs UDP and TCP probing on port
53, however unlike regular load balancing monitors the probes need not be successful in order to
provide valid RTT information. ICMP port unavailable messages, TCP Resets and DNS error responses,
which would usually constitute a failure are all acceptable for calculating the RTT value.
Once the RTT data has been compiled, the appliance uses the proprietary metrics exchange protocol
(MEP) to exchange RTT values between participating sites. After calculating RTT metrics, the appliance
sorts the RTT values to identify the data center with the best (smallest) RTT metric.”
If RTT information is not available (for example, when a client’s local DNS server accesses the site for
the first time), the NetScaler appliance selects a site by using the round robin method and directs the
client to the site.
To configure the dynamic method, you configure the site’s GSLB virtual server for dynamic RTT. You
can also set the interval at which local DNS servers are probed to a value other than the default.
To configure a GSLB virtual server for dynamic RTT, you specify the RTT load balancing method.
The NetScaler appliance regularly validates the timing information for a given local server. If a change
in latency exceeds the configured tolerance factor, the appliance updates its database with the new
timing information and sends the new value to other GSLB sites by performing a MEP exchange. The
default tolerance factor is 5 milliseconds (ms).
The RTT tolerance factor must be the same throughout the GSLB domain. If you change it for a site,
you must configure identical RTT tolerance factors on all NetScaler appliances deployed in the GSLB
domain.
To configure a GSLB virtual server for dynamic RTT by using the command line interface
Example:
To configure a GSLB virtual server for dynamic RTT by using the configuration utility
Navigate to Traffic Management > GSLB > Virtual Servers and double-click the virtual server.
The NetScaler appliance uses different mechanisms, such as ICMP echo request / reply (PING), TCP,
and UDP to obtain RTT metrics for connections between the local DNS server and participating GSLB
sites. By default, the appliance uses a ping monitor and probes the local DNS server every 5 seconds.
The appliance then waits 2 seconds for the response and, if a response is not received in that time, it
uses the TCP DNS monitor for probing.
However, you can modify the time interval for probing the local DNS server to accommodate your
configuration.
Example:
Navigate to Traffic Management > Load Balancing > Monitors, and double-click the monitor that
you want to modify (for example, PING).
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
For the static proximity method to work, you must either configure the NetScaler appliance to use
an existing static proximity database populated through a location file or add custom entries to the
static proximity database. After adding custom entries, you can set their location qualifiers. After
configuring the database, you are ready to specify static proximity as the GSLB method.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A static proximity database is a UNIX-based ASCII file. Entries added to this database from a location
file are called static entries. Only one location file can be loaded on a NetScaler appliance. Adding a
new location file overrides the existing file. The number of entries in the static proximity database is
limited by the configured memory in the NetScaler appliance.
The static proximity database can be created in the default format or in a format derived from com-
mercially configured third party databases (such as www.maxmind.com and www.ip2location.com).
The NetScaler appliance includes the following two IP geolocation database files. These are GeoLite2
files, published by MaxMind.
• Citrix_Netscaler_InBuilt_GeoIP_DB_IPv4
• Citrix_Netscaler_InBuilt_GeoIP_DB_IPv6
These database files are available in a format supported by the NetScaler appliance in the directory
/var/netscaler/inbuilt_db.
You can use these IP geolocation databases as the location file for the static proximity based GSLB
method, or in location based policies.
These databases vary in the details they provide. There is no strict enforcement of the database file
format, except that the default file has format tags. The database files are ASCII files that use a comma
as the field delimiter. There are differences in the structure of fields and the representation of IP ad-
dresses in the locations.
The format parameter describes the structure of the file to the NetScaler appliance. Specifying an
incorrect value for the format option can corrupt the internal data.
Note
• After an upgrade, if the /var/netscaler/inbuilt_db/ directory contains the da tabase file (Cit-
rix_Netscaler_InBuilt_GeoIP_DB.csv) from the earlierNetScaler software versions, the file
is retained.
• The default location of the database file is /var/netscaler/locdb, and on a high availabil-
ity (HA) setup, an identical copy of the file must be present in the same location on both
NetScaler appliances.
CSHN. Short name of a country based on the country code standard of ISO-3166.
RC. Region code based on ISO-3166-2 (for US and Canada). The region code “FIPS-10-4” is used
for the other regions.
• Some databases provide short country names according to ISO-3166 and long country
names as well. The NetScaler uses short names when storing and matching qualifiers.
• To create a static proximity database, log on to the UNIX shell of the NetScaler appliance
and use an editor to create a file with the location details in one of the NetScaler-supported
formats.
Example:
You can view an imported location file database by using the View Database dialog box in the config-
uration utility. There is no CLI equivalent.
By default, when you add a location file, it is saved in the NetScaler format. You can convert a location
file of other formats into the NetScaler format.
Note: The nsmap option can be accessed only from the command line interface. The conversion is
possible only into the NetScaler format.
To convert the static database format, At the CLI prompt, type the following command:
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Custom entries take precedence over static entries in the proximity database. You can add a maximum
of 500 custom entries. For a custom entry, denote all omitted qualifiers with an asterisk (*) and, if
qualifiers have a period or space in the name, enclose the parameter in double quotation marks. The
first 31 characters are evaluated for each qualifier. You can also provide the longitude and latitude of
the geographical location of the IP address-range for selecting a service with the static proximity GSLB
method.
At the command prompt, type the following commands to add a custom entry to the static proximity
database and verify the configuration:
Example:
1 >show location
• IPfrom
First IP address in the range, in dotted decimal notation. This is a mandatory argument.
• IPto
Last IP address in the range, in dotted decimal notation. This is a mandatory argument.
• preferredLocation
• longitude
Numerical value, in degrees, specifying the longitude of the geographical location of the IP
address-range.
Note: Longitude and latitude parameters are used for selecting a service with the static proxim-
ity GSLB method. If they are not specified, selection is based on the qualifiers specified for the
location.
Maximum value: 180
• latitude
Numerical value, in degrees, specifying the latitude of the geographical location of the IP
address-range.
Note: Longitude and latitude parameters are used for selecting a service with the static
proximity GSLB method. If they are not specified, selection is based on the qualifiers specified
for the location.
Maximum value: 180
Navigate to AppExpert > Location, click the Custom Entries tab, and add the custom entries.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The database used to implement static proximity contains the location of the GSLB sites. Each location
contains an IP address range and up to six qualifiers for that range. The qualifiers are literal strings and
are compared in a prescribed order at run time. Every location must have at least one qualifier. The
meaning of the qualifiers (context) is defined by the qualifier labels, which are user defined. NetScaler
has two built-in contexts:
• Qualifier 1 – “Continent”
• Qualifier 2 – “Country”
• Qualifier 3 – “State”
• Qualifier 4 – “City”
• Qualifier 5 – “ISP”
• Qualifier 6 – “Organization”
• Qualifier 1 – “Qualifier 1”
• Qualifier 2 – “Qualifier 2”
• Qualifier 3 – “Qualifier 3”
• Qualifier 4 – “Qualifier 4”
• Qualifier 5 – “Qualifier 5”
• Qualifier 6 – “Qualifier 6”
If the geographic context is set with no Continent qualifier, Continent is derived from Country. Even
the built-in qualifier labels are based on the context, and the labels can be changed. These qualifier
labels specify the locations mapped with the IP addresses used to make static proximity decisions.
To perform a static proximity-based decision, the NetScaler appliance compares the location at-
tributes (qualifiers) derived from the IP address of the local DNS server resolver with the location
attributes of the participating sites. If only one site matches, the appliance returns the IP address of
that site. If there are multiple matches, the site selected is the result of a round robin on the matching
GSLB sites. If there is no match, the site selected is a result of a round robin on all configured sites. A
site that does not have any qualifiers is considered a match.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
When you have configured the static proximity database, you are ready to specify static proximity as
the GLSB method.
At the command prompt, type the following commands to configure static proximity and verify the
configuration:
Example:
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the virtual server.
2. Click the Method section and from the Choose Method drop-down list, select STATICPROXIM-
ITY.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Synchronizing a global server load balancing (GSLB) static proximity database requires that one of the
sites be identified as the master GSLB node. Any site in the topology can be designated as the master
node. The rest of the GSLB nodes are automatically designated as slave nodes.
Synchronizing GSLB static proximity databases synchronizes the files in the /var/netscaler/locdb direc-
tory across the slave nodes. During the synchronization process, the master node fetches the running
configuration from each of the slave nodes and compares it to the configuration on the master node.
The master GSLB node uses the rsync program to synchronize the static proximity database across
the slave nodes. To speed up the synchronization process, the rsync program makes only enough
changes to eliminate the differences between the two files. The synchronization process cannot be
rolled back.
The following example synchronizes Site2, which is a slave site, to master site Site1. The administrator
enters the sync gslb config command on Site1:
1.
2. Citrix ADC
3. NetScaler 12.0
May 9, 2019
Contributed by:
C
GSLB site-to-site communication is between the remote procedure call (RPC) nodes that are associ-
ated with the communicating sites. A master GSLB site establishes connections with slave sites to
An RPC node is created automatically when a GSLB site is created, and is assigned an internally gen-
erated user name and password. The NetScaler appliance uses this user name and password to au-
thenticate itself to remote GSLB sites during connection establishment. No configuration steps are
necessary for an RPC node, but you can specify a password of your choice, enhance security by en-
crypting the information that GSLB sites exchange, and specify a source IP address for the RPC node.
The appliance needs a NetScaler owned IP address to use as the source IP address when communi-
cating with other GSLB sites. By default, the RPC nodes use a subnet IP (SNIP) address, but you might
want to specify an IP address of your choice.
The following topics describe the behavior and configuration of RPC nodes on the NetScaler appli-
ance:
You can secure the communication between sites in your GSLB setup by changing the password of
each RPC node. After you change the password for the RPC node of the local site, you must manually
propagate the change to the RPC node at each of the remote sites.
The password is stored in encrypted form. You can verify that the password has changed by using the
show rpcNode command to compare the encrypted form of the password before and after the change.
To change the password of an RPC node by using the command line interface
At the command line, type the following commands to change the password of an RPC node:
Example:
10 >
To unset the password of an RPC node by using the command line interface
To unset the password of an RPC node by using the CLI, type the unset rpcNode command, the IP
address of the RPC node, and the password parameter, without a value.
Navigate to System > Network > RPC, select the RPC node, and change the password.
You can secure the information that is exchanged between GSLB sites by setting the secure option for
the RPC nodes in the GSLB setup. With the secure option set, the NetScaler appliance encrypts all
communication sent from the node to other RPC nodes.
To encrypt the exchange of site metrics by using the command line interface
At the command prompt, type the following commands to encrypt the exchange of site metrics and
verify the configuration:
Example:
To unset the secure parameter by using the CLI, type the unset rpcNode command, the IP address of
the RPC node, and the secure parameter, without a value.
To encrypt the exchange of site metrics by using the NetScaler configuration utility
1. Navigate to System > Network > RPC and double-click a RPC node.
2. Select the Secure option, and click OK.
By default, the NetScaler appliance uses a NetScaler owned subnet IP (SNIP) address as the source
IP address for an RPC node, but you can configure the appliance to use a specific SNIP address. If a
SNIP address is not available, the GSLB site cannot communicate with other sites. In such a scenario,
you must configure either the NSIP address or a virtual IP (VIP) address as the source IP address for
an RPC node. A VIP address can be used as the source IP address of an RPC node only if the RPC node
is a remote node. If you configure a VIP address as the source IP address and remove the VIP address,
the appliance uses a SNIP address.
Note
From NetScaler 11.0.64.x release onwards, you can configure the appliance to use GSLB Site IP
address as the source IP address for an RPC node.
To specify a source IP address for an RPC node by using the command line interface
At the command prompt, type the following commands to change the source IP address for an RPC
node and verify the configuration:
Example:
To unset the source IP address parameter by using the command line interface
To unset the source IP address parameter by using the CLI, type the unset rpcNodecommand, the IP
address of the RPC node, and the srcIP parameter, without a value.
To specify a source IP address for an RPC node by using the NetScaler configuration utility
1. Navigate to System > Network > RPC and double-click a RPC node.
2. In the Source IP Address field, enter the IP address that you want the RPC node to use as the
source IP address and click OK.
Important
The source IP address cannot be synchronized across the sites participating in GSLB because
the source IP address for a RPC node is specific to each NetScaler appliance. Therefore, after
you force a synchronization (using the sync gslb config –forceSync command or by selecting the
ForceSync option in the GUI), you have to manually change the source IP addresses on the other
NetScaler appliances.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The data centers in a GSLB setup exchange metrics with each other through the metrics exchange
protocol (MEP), which is a proprietary protocol for NetScaler appliance. The exchange of the metric
information begins when you create a GSLB site. These metrics comprise load, network, and persis-
tence information.
MEP is required for health checking of data centers to ensure their availability. A connection for ex-
changing network metric (round-trip time) can be initiated by either of the data centers involved in
the exchange, but a connection for exchanging site metrics is always initiated by the data center with
the lower IP address. By default, the data center uses a subnet IP address (SNIP) to establish a connec-
tion to the IP address of a different data center. However, you can configure a specific SNIP, virtual IP
(VIP) address, or the NSIP address, as the source IP address for metrics exchange. The communication
process between GSLB sites uses TCP port 3011 or 3009, so this port must be open on firewalls that
are between the NetScaler appliances.
Note: You cannot configure a GSLB site IP address as the source IP address for site metrics exchange.
If the source and target sites (the site that initiates a MEP connection and the site that receives the
connection request, respectively) have both private and public IP addresses configured, the sites ex-
change MEP information by using the public IP addresses.
You can also bind monitors to check the health of remote services as described in “Monitoring GSLB
Services.” When monitors are bound, metric exchange does not control the state of the remote ser-
vice. If a monitor is bound to a remote service and metric exchange is enabled, the monitor controls
the health status. Binding the monitors to the remote service enables the NetScaler appilance to inter-
act with a non NetScaler load balancing device. The NetScaler appliance can monitor non NetScaler
devices but cannot perform load balancing on them unless monitors are bound to all GSLB services
and only static load balancing methods (such as the round robin, static proximity, or hash-based meth-
ods) are used.
With NetScaler release 11.1.51.x or later, to avoid unnecessary disruption of services, you can set a time
delay for marking GSLB services as DOWN when a MEP connection goes DOWN.
Site metrics exchanged between the GSLB sites include the status of each load balancing, or con-
tent switching virtual server, the current number of connections, the current packet rate, and current
bandwidth usage information.
The NetScaler appliance needs this information to perform load balancing between the sites. The site
metric exchange interval is 1 second. A remote GSLB service must be bound to a local GSLB virtual
server to enable the exchange of site metrics with the remote service.
To enable or disable site metrics exchange by using the command line interface
At a command prompt, type the following commands to enable or disable site metric exchange and
verify the configuration:
Example:
1. Navigate to Traffic Management > GSLB > Sites, and select the site.
2. In the Configure GSLB Site dialog box, select the Metric Exchange option.
If your GSLB sites use the round-trip time (RTT) load balancing method, you can enable or disable the
exchange of RTT information about the client’s local DNS service. This information is exchanged every
5 seconds.
For details about changing the GSLB method to a method based on RTT, see “GSLB Methods.”
To enable or disable network metric information exchange by using the command line interface
At the command prompt, type the following commands to enable or disable network metric informa-
tion exchange and verify the configuration:
Example:
Configuring a time delay for the GSLB services to be marked as DOWN when a MEP
connection goes DOWN
If the status of a MEP connection to a remote site changes to DOWN, the status of every GSLB service
on that remote site is marked as DOWN, although the site might not actually be DOWN.
You can now set a delay to allow some time for reestablishment of the MEP connection before the site
is marked as DOWN. If the MEP connection is back UP before the delay expires, the services are not
affected.
For example, if you set the delay 10, the GSLB services are marked as DOWN until the MEP connection
has been DOWN for 10 seconds. If the MEP connection is back UP within 10 seconds, the GSLB services
remain in the UP state.
Note: This delay is applicable only to services not bound to a monitor. The delay does not affect the
trigger monitors.
Example:
1. Navigate to Configuration > Traffic Management > GSLB > Change GSLB Settings.
2. In the GSLB Service State Delay Time (secs) box, type the time delay in seconds.
You can configure NetScaler appliance to provide persistent connections, so that a client transmission
to any virtual server in a group can be directed to a server that has received previous transmissions
from the same client.
You can enable or disable the exchange of persistence information at each site. This information is
exchanged once every 5 seconds between NetScaler appliances participating in GSLB.
To enable or disable persistence information exchange by using the command line interface
At the command prompt, type the following commands to enable or disable persistence-information
exchange and verify the configuration:
Example:
1. Navigate to Traffic Management > GSLB > Sites, and double-click the site.
2. In the Configure GSLB Site dialog box, select or clear the Persistence Session Entry Exchange
check box.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can now use a wizard to configure the GSLB deployment types: active-active, active-passive, and
parent-child.
This wizard is available in the GUI. To access the wizard, navigate to Configuration > Traffic Manage-
ment > GSLB and click Get Started.
You can also access this wizard from the GSLB dashboard. Navigate to Configuration > Traffic Man-
agement > GSLB > Dashboard and click Configure GSLB.
Important
This feature is supported in High Availability deployment and not in Admin Partition and Cluster
deployments.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The following figure shows the workflow involved in a GSLB active-active site configuration.
Before you begin configuring an active-active site, make sure you have configured a standard load
balancing setup for each server farm or data center.
Also, for synchronizing the GSLB configuration across the GSLB sites in the deployment, make sure
that:
• Local GLSB Sites are configured on all the appliances in the GSLB configuration.
• You have enabled management access on all the GSLB Sites in the configuration.
• You have configured the firewall to accept the auto synchronization and MEP connections.
• The master and slave NetScaler appliances are running the same NetScaler software versions.
• All the NetScaler appliances participating as sites should have the same NetScaler software ver-
sion (the sites are not in a master-slave relationship).
• The RPC node password is same across all the GSLB sites in the GSLB configuration.
1. Navigate to Traffic Management > GSLB, and then click Get Started.
2. If you have not configured an ADNS service or a DNS virtual server for the site, you can do it now.
a) Click View and then click Add.
b) Enter the service name, IP address and select the protocol (ADNS/ADNS_TCP) through
which the data is exchanged with the service.
3. Select Active-Active Site.
4. Enter the fully qualified domain name and specify the time period for which the record must be
cached by DNS proxies.
5. Configure the GSLB sites. Each site must be configured with a local GSLB site, and each site’s
configuration must include all the other sites as remote GSLB sites. There can be only one local
site and all other sites are remote sites.
a) Enter the site details, such as the site name and site IP address.
> icon or add a new location by clicking + in the Select a location database box.
• If you choose the Dynamic Proximity (RTT) method, select the backup method and
specify the dynamic weight option and the round-trip time value based on which the
best-performing service is to be selected.
8. Click Done if the configuration is complete. The GSLB dashboard appears.
9. If you have modified the GSLB site configuration, click Auto Synchronize GSLB in the dash-
board to synchronize the configuration to other sites in the GSLB setup.
• Before synchronization, make sure that the local site’s configuration includes information
about the remote sites. Also, for the synchronization to be successful, the local site must
be configured on the other NetScaler appliances.
• If real-time synchronization is enabled, you do not have to click Auto Synchronize GSLB.
The synchronization happens automatically. To enable real time synchronization, do the
following:
a) Navigate to Traffic Management > GSLB > Dashboard and click Change GSLB Set-
tings.
b) Select the Automatic Config Sync check box.
10. Click Test GSLB Setup to make sure that the ADNS services or the DNS servers are responding
with the correct IP address for the domain name that is configured in the GSLB setup.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
The following figure shows the workflow involved in the active-passive site configuration.
Before you begin configuring an active-passive site, make sure you have configured a standard load
balancing setup for each server farm or data center.
Also, for synchronizing the GSLB configuration across the GSLB sites in the deployment, make sure
that:
• Local GLSB Sites are configured on all the appliances in the GSLB configuration.
• You have enabled management access on all the GSLB Sites in the configuration.
• You have configured the firewall to accept the auto synchronization and MEP connections.
• The master and slave NetScaler appliances are running the same NetScaler software versions.
• All the NetScaler appliances participating as sites should have the same NetScaler software ver-
sion (the sites are not in a master-slave relationship).
• The RPC node password is same across all the GSLB sites in the GSLB configuration.
1. Navigate to Traffic Management > GSLB, and then click Get Started.
2. If you have not configured an ADNS service or a DNS virtual server for the site, you can do it now.
a) Click View and then click Add.
b) Enter the service name, IP address and select the protocol (ADNS/ADNS_TCP) through
which the data is exchanged with the service.
3. Select Active-Passive Site.
4. Enter the fully qualified domain name and specify the time period for which the record must be
cached by DNS proxies.
5. Configure the GSLB sites. Each site must be configured with a local GSLB site, and each site’s
configuration must include all the other sites as remote GSLB sites. There can be only one local
site and all other sites are remote sites.
a) Enter the site details, such as the site name and site IP address.
b) Select either REMOTE or LOCAL site type.
c) Optionally, change the RPC password and, if necessary, secure it.
d) If a monitor is to be bound to the GSLB service, select the condition under which the mon-
itor is to monitor the service. This will be effective only after a monitor is bound to the
services. The possible conditions are:
• ALWAYS. Monitor the GSLB service at all times.
• MEP Fails. Monitor the GSLB service only when the exchange of metrics through MEP
fails.
• MEP Fails and Service ID Down. Exchange of metrics through MEP is enabled but the
status of the service, updated through metrics exchange, is DOWN.
6. Configure the GSLB services.
a) Enter the service details, such as service name, service type, and port number.
b) Associate the service with a site (local or remote) by selecting the GSLB site where the GSLB
service belongs.
c) Select the monitor that must be bound to the service when MEP fails, if required. The
service can be an existing server, or you can create a new server or a virtual server.
d) To associate an existing server, select the server name. The service IP address is automat-
ically populated.
• If the public IP address is different from the server IP, which can happen in a NAT en-
vironment, enter the public IP address and the port number of the public port.
• To associate a new server, create a server by entering the server IP details and its pub-
lic IP address and the public port number.
• To associate a virtual server, select an already existing virtual server, or click + and add
a new virtual server. This vserver is the load balancing vserver with which this GSLB
service will be associated.
7. Configure the GSLB backup virtual servers. The GSLB backup virtual servers become opera-
tional only when the primary GSLB virtual servers is inaccessible or it is marked DOWN for any
reason.
a) Enter the name of the GSLB virtual server name and select the DNS record type.
b) Click > in Service Binding, and choose the GSLB services that must be bound to the GSLB
virtual server.
c) Choose the GSLB method for selecting the best-performing GSLB service. The default val-
ues for GSLB method, backup method, and dynamic weight are auto-populated, by de-
fault. You can change them if required.
• If you choose the Algorithm based method, select the primary and backup methods.
• If you choose the Static Proximity method, select the backup method and provide
the location of the database file.
• If you choose the Dynamic Proximity (RTT) method, select the backup method and
specify the service weight and the RTT value based on which the best-performing ser-
vice is to be selected.
8. Configure the GSLB virtual servers.
a) Enter the name of the GSLB virtual server name and select the DNS record type.
b) Click > in the Select Service box and choose the GSLB services to be bound to the GSLB
virtual server.
c) Click > in the Domain Binding box to select the domain to be bound to this GSLB virtual
server.
d) Choose the GSLB method for selecting the best-performing GSLB service. The default val-
ues for GSLB method, backup method, and dynamic weight are auto-populated, by de-
fault. You can change them if required.
• If you choose the Algorithm based method, select the primary and backup methods
and also specify the dynamic weight option.
• If you choose the Static Proximity method, select the backup method and the
dynamic weight method. Also, provide the location of the database file by clicking
the > icon or add a new location by clicking + in the Select a location database box.
• If you choose the Dynamic Proximity (RTT) method, select the backup method and
specify the dynamic weight option and the round-trip time value based on which the
best-performing service is to be selected.
9. Click Done if the configuration is complete. The GSLB dashboard appears.
10. If you have modified the GSLB site configuration, click Auto Synchronize GSLB in the dash-
Note
For details about configuring GSLB entities of an active-passive GSLB setup for disaster recovery,
see Configuring GSLB for Disaster Recovery.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In a parent-child topology, at the top level are parent sites, which have peer relationships with other
parents. Each parent can have multiple child sites, and each parent site exchanges health information
with its child sites and with other parent sites. However, a child site communicates only with its parent
site.
The following figure shows the workflow involved in a GSLB parent-child topology configuration.
Before you begin configuring the parent-child topology deployment, make sure you have configured
a standard load balancing setup for each server farm or data center.
Also, for synchronizing the GSLB configuration across the GSLB sites in the deployment, make sure
that:
• Local GLSB Sites are configured on all the appliances in the GSLB configuration.
• You have enabled management access on all the GSLB Sites in the configuration.
• You have configured the firewall to accept the auto synchronization and MEP connections.
• All the NetScaler appliances participating as sites should have the sameNetScaler software ver-
sion (the sites are not in a master-slave relationship).
• The RPC node password is same across all the GSLB sites in the GSLB configuration.
1. Navigate to Traffic Management > GSLB, and then click Get Started.
2. If you have not configured an ADNS server or a DNS virtual server for the site, you can do it now.
a) Click View and then click Add.
b) Enter the service name, IP address and select the protocol (ADNS/ADNS_TCP) through
which the data is exchanged with the service.
3. Select Parent-Child Topology.
4. In the Select the site type field, choose;
• Parent – When configuring the parent site, you must configure its associated child sites
and also configure the other parent sites in the GSLB setup.
• Child – When configuring the child site, you must configure only the child site and its par-
ent site.
1. Enter the fully qualified domain name and specify the time period for which the record must be
cached by DNS proxies.
2. Configure the GSLB sites. Each site must be configured with a local GSLB site, and each site’s
configuration must include all the other sites as remote GSLB sites. There can be only one local
site. All other sites are remote sites. If the specified site IP address is owned by the appliance
(for example, a MIP address or SNIP address), the site is a local site. Otherwise, it is a remote
site.
3. Enter the site details, such as the site name and site IP address.
a) Select the site type.
b) Optionally, change the RPC password and, if necessary, secure it.
c) If a monitor is to be bound to the GSLB service, select the condition under which the mon-
itor is to monitor the service. This will be effective only after a monitor is bound to the
services. The possible conditions are:
• Always. Monitor the GSLB service at all times.
• MEP Fails. Monitor the GSLB service only when the exchange of metrics through MEP
fails.
• MEP Fails and Service is DOWN. Exchange of metrics through MEP is enabled but the
status of the service, updated through metrics exchange, is DOWN.
4. Configure the GSLB services.
a) Enter the service details such as service name, service type, and port number.
b) Associate the service with a site (local or remote) by selecting the GSLB site to which the
GSLB service belongs.
c) Select the monitor that must be bound to the service when MEP fails, if required. The
service can be an existing server, or you can create a new server or a virtual server.
• To associate an existing server, select the server name. The service IP address is auto-
populated.
• To associate a new server, create a server by entering the server IP details and its pub-
lic IP address and the public port number.
• To associate a virtual server, select an already existing virtual server or click + and
add a new virtual server. This vserver is the load balancing vserver to which this GSLB
service will be associated. If the public IP address is different from the server IP, which
can happen in a NAT environment, enter the public IP address and the public port
number.
5. Configure the GSLB virtual servers.
a) Enter the name of the GSLB virtual server name and select the DNS record type.
b) Click > in the Select Service box and choose the GSLB services to be bound to the GSLB
virtual server.
c) Click > in the Domain Binding box to view the domain name that is bound to the GSLB
virtual server.
d) Choose the GSLB method for selecting the best-performing GSLB service. The default val-
ues for GSLB method, backup method, and dynamic weight are automatically populated
by default. You can change them if required.
• If you choose the Algorithm based method, select the primary and backup methods
and also specify the dynamic weight option.
• If you choose the Static Proximity method, select the backup method and the
dynamic weight method. Also, provide the location of the database file by clicking
the > icon or add a new location by clicking + in the Select a location database box.
• If you choose the Dynamic Proximity (RTT) method, select the backup method and
specify the service weight and the RTT value based on which the best-performing ser-
vice is to be selected.
6. Click Done if the configuration is complete. The GSLB dashboard appears.
7. If you have modified the GSLB parent-site configuration, click Auto Synchronize GSLB to syn-
chronize the configuration to the other parent sites in the GSLB setup. In a parent-child topol-
ogy, synchronization for the child sites is skipped.
• Before synchronization, make sure that the local site’s configuration includes information
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Global server load balancing is used to manage traffic flow to a web site hosted on two separate
server farms that ideally are in different geographic locations. For example, consider a Web site,
www.mycompany.com, which is hosted on two geographically separated server farms or data cen-
ters. Both server farms use NetScaler appliances. The NetScaler appliances in these server farms are
set up in one-arm mode and function as authoritative DNS servers for the www.mycompany.com do-
main. The following figure illustrates this configuration.
To configure such a GSLB setup, you must first configure a standard load balancing setup for each
server farm or data center. This enables you to balance load across the different servers in each
server farm. Then, configure both NetScaler appliances as authoritative DNS (ADNS) servers. Next,
create a GSLB site for each server farm, configure GSLB virtual servers for each site, create GLSB ser-
vices, and bind the GSLB services to the GSLB virtual servers. Finally, bind the domain to the GSLB
virtual servers. The GSLB configurations on the two appliances at the two different sites are identical,
although the load-balancing configurations for each site is specific to that site.
A load balancing virtual server balances the load across different physical servers in the data center.
These servers are represented as services on the NetScaler appliance, and the services are bound to
the load balancing virtual server.
For details on configuring a basic load balancing setup, see Load Balancing.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
When you configure the NetScaler appliance as an authoritative DNS server, it accepts DNS requests
from the client and responds with the IP address of the data center to which the client should send
requests.
Note: For the NetScaler appliance to be authoritative, you must also create SOA and NS records. For
more information about SOA and NS records, see
Domain Name System.
At the command prompt, type the following commands to create an ADNS service and verify the con-
figuration:
Example:
Example:
1 rm service <name>
Example:
1 rm service Service-ADNS-1
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A GSLB site is a representation of a data center in your network and is a logical grouping of GSLB virtual
servers, services, and other network entities. Typically, in a GSLB set up, there are many GSLB sites
that are equipped to serve the same content to a client. These are usually geographically separated
to ensure that the domain is active even if one site goes down completely. All of the sites in the GSLB
configuration must be configured on every NetScaler appliance hosting a GSLB site. In other words,
at each site, you configure the local GSLB site and each remote GSLB site.
Once GSLB sites are created for a domain, the NetScaler appliance sends client requests to the appro-
priate GSLB site as determined by the GSLB algorithms configured.
At the command prompt, type the following commands to create a GSLB site and verify the configura-
tion:
Example:
• To modify a GSLB site, use the set gslb site command, which is just like using the add gslb site
command, except that you enter the name of an existing GSLB Site.
• To unset a site parameter, use the unset gslb site command, followed by the siteName value
and the name of the parameter to be reset to its default value.
• To remove a GSLB site, use the rm gslb site command, which accepts only the <name> argument.
To view the statistics of a GSLB site by using the command line interface
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
November 9, 2018
Contributed by:
C
A GSLB service is a representation of a load balancing or content switching virtual server. A local GSLB
service represents a local load balancing or content switching virtual server. A remote GSLB service
represents a load balancing or content switching virtual server configured at one of the other sites in
the GSLB setup. At each site in the GSLB setup, you can create one local GSLB service and any number
of remote GSLB services.
Important
If the load balancing virtual server is either in a GSLB node itself or is in a child node (in parent-
child deployment) and no monitors are bound to the GSLB service, then make sure the following:
The GLSB service IP address, port number, and protocol match the virtual server that the service
is representing. Else, the service state is marked as DOWN.
At the command prompt, type the following commands to create a GSLB service and verify the config-
uration:
Example:
• To modify a GSLB service, use the set gslb service <serviceName> command. For this com-
mand, specify the name of the GSLB service whose configuration you want to modify. You can
change the existing values of the parameters either specified by you or set by default. You can
change the value of more than one parameter in the same command. Refer to the add gslb
service command for details about the parameters. Example
• To reset a parameter to its default value, you can use the unset gslb service <serviceName>
command and the parameters to be unset. Example
To view the statistics of a GSLB service by using the command line interface
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
November 9, 2018
Contributed by:
C
Service group enables you to manage a group of services as easily as a single service. For example, if
you enable or disable an option, such as compression, health monitoring, or graceful shutdown, for a
service group, the option gets enabled or disabled for all the members of the service group.
After creating a service group, you can bind it to a virtual server, and you can add services to the group.
You can also bind monitors to the service groups.
Important
If the load balancing virtual server is either in a GSLB node itself or is in a child node (in parent-
child deployment) and no monitors are bound to the GSLB service, then make sure the following:
The GLSB service group IP address, port number, and protocol match the virtual server that the
service is representing. Else, the service state is marked as DOWN.
The NetScaler hybrid and multi-cloud global server load balancing (GSLB) solution enables customers
to distribute application traffic across multiple data centers in hybrid clouds, multiple clouds, and
on premises. The NetScaler GSLB solution supports various load balancing solutions, such as the
NetScaler load balancer, Elastic Load Balancing (ELB) for Amazon Web Services (AWS), and other third-
party load balancers. Also, the GSLB solution performs global load balancing even if the GSLB and
load balancing layers are independently managed.
In cloud deployments, users are given a domain name as a reference when accessing the load bal-
ancing solution for management purposes. It is recommended that external entities do not use the
IP addresses that these domain names resolve to. Also, the load balancing layers scale up or down
based on the load, and the IP addresses are not guaranteed to be static. Therefore, it is recommended
to use the domain name to refer to the load balancing endpoints instead of IP addresses. This requires
the GSLB services to be referred using the domain name instead of IP addresses and it must consume
all the IP addresses returned for the load balancing layer domain name and have a representation for
the same in GSLB.
To use domain names instead of IP addresses when referring to the load balancing endpoints, you can
use the domain name based service groups for GSLB.
The NetScaler appliance has two built-in monitors that monitor TCP-based applications; tcp-
default and ping-default. The tcp-default monitor is bound to all TCP services and the ping-default
monitor is bound to all non-TCP services. The built-in monitors are bound by default to the GSLB
service groups. However, it is recommended to bind an application specific monitor to the GSLB
service groups.
The Trigger Monitors option can be used to indicate if the GSLB site must use the monitors always, or
use monitors when metrics exchange protocol (MEP) is DOWN.
When the Trigger Monitors option is set to ALWAYS, each GSLB node triggers the monitors indepen-
dently. If each GSLB node triggers the monitors independently, then each GSLB node might operate
on different set of GSLB services. This might result in discrepancies in the DNS responses for the DNS
requests landing on these GSLB nodes. Also, if each GSLB node is monitoring independently, then the
number of monitor probes reaching the load balancer entity increases. The persistence entries also
become incompatible across the GSLB nodes.
Therefore, it is recommended that the Trigger Monitors option on GSLB site entity is set to MEPDOWN.
When the Trigger Monitors option is set to MEPDOWN, the load balancing domain resolution and mon-
itoring ownership lies with the local GSLB node. When Trigger Monitors option is set to MEPDOWN,
the load balancing domain resolution and subsequent monitoring is done by the local GSLB node of a
GSLB service group. The results are then propagated to all other nodes participating in GSLB by using
the metrics exchange protocol (MEP).
Also, whenever the set of IP addresses associated with a load balancing domain are updated, it is
notified through MEP.
• For a load balancing domain, the IP address that is returned in the DNS response is generally
the public IP address. The private IP address cannot be applied dynamically when the load
balancing domain is resolved. Therefore, public IP port and private IP port for the GSLB domain
name based autoscale service groups IP port bindings are the same. These parameters cannot
be set explicitly for the domain name based autoscale service groups.
• Site persistence, DNS views, and clustering are not supported for GSLB service groups.
To set parameters for a GSLB service group set gslb serviceGroup <
serviceGroupName>@ [(<serverName>@
<port> [-weight <positive_integer>]
[-hashId <positive_integer>] [-
publicIP <ip_addr|ipv6_addr|*>] [-
publicPort <port>])| -maxClient <
positive_integer> | -cip ( ENABLED
| DISABLED )| <cipHeader> | -
cltTimeout <secs> | -svrTimeout <
secs> | -maxBandwidth <
positive_integer> | -monThreshold <
positive_integer> | -downStateFlush
( ENABLED | DISABLED )] [-
monitorName <string> -weight <
positive_integer>] [-healthMonitor
( YES | NO )] [-comment <string>]
[-appflowLog ( ENABLED | DISABLED )
]
To unset parameters from a GSLB service group unset gslb serviceGroup <
serviceGroupName>@ [<serverName>@ <
port> [-weight] [-hashId] [-
publicIP] [-publicPort]] [-
maxClient] [-cip] [-cltTimeout] [-
svrTimeout] [-maxBandwidth] [-
monThreshold] [-appflowLog] [-
monitorName] [-weight] [-
healthMonitor] [-cipHeader] [-
downStateFlush] [-comment]
To enable a GSLB service group enable gslb serviceGroup <
serviceGroupName>@ [<serverName>@ <
port>]
Example:enable gslb serviceGroup SG1 S1 80
To disable a GSLB service group disable gslb serviceGroup <
serviceGroupName>@ [<serverName>@ <
port>] [-delay <secs>] [-graceFul (
YES /| NO )]
The following table lists some of the changes that are done to the existing GSLBs commands after the
introduction of the GSLB service groups.
bind gslb vserver The service group name is added to the bind
command.
Tip
For deployment scenario and example configuration of GSLB service groups, see the following
topics:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A GSLB virtual server is an entity that represents one or more GSLB services and balances traffic be-
tween them. It evaluates the configured GSLB methods or algorithms to select a GSLB service to which
to send the client request.
Note
A GSLB virtual server protocol requirement is mainly to create a relation between the virtual
server and the services that are bound to the virtual server. This also keeps CLI/APIs consistent
with respect to other types of virtual servers. The Service Type parameter on a service or a vir-
tual server is not leveraged while serving the DNS requests. It is instead referenced during site
persistence, monitoring, and for the purpose of doing lookups via MEP.
At the command prompt, type the following commands to add a GSLB virtual server and verify the
configuration:
Example:
To modify or remove a GSLB virtual server by using the command line interface
• To modify a GSLB virtual server, use the set gslb vserver command, which is just like using the
add gslb vserver command, except that you enter the name of an existing GSLB virtual server.
• To reset a parameter to is default value, you can use the unset gslb vserver command followed
by the vserverName value and the name of the parameter to be unset.
• To remove a GSLB virtual server, use the rm gslb vserver command, which accepts only the name
argument.
To view the statistics of a GSLB virtual server by using the command line interface
Example:
To view the statistics of a GSLB virtual server by using the configuration utility
Navigate to Traffic Management > GSLB > Virtual Servers, select the virtual server and click Statis-
tics.
When you run the stat gslb service command from the command line or click on the Statistics link from
the configuration utility, the following details of the service will be displayed:
• Request bytes. Total number of request bytes received on this service or virtual server.
• Response bytes. Number of response bytes received by this service or virtual server.
• Current client established connections. Number of client connections in ESTABLISHED state.
• Current load on the service. Load on the service (Calculated from the load monitor bound to
the service).
The data of number of requests and responses, and the number of current client and server connec-
tions may not be displayed or may not be synchronized with the data of the corresponding load bal-
ancing virtual server.
You can now clear the statistics of a GSLB virtual server and service. NetScaler provides the following
two options to clear the statistics:
• Basic: Clears the statistics that are specific to the virtual server but retains the statistics that are
contributed by the bound GLSB service.
• Full: Clears both the virtual server and the bound GSLB service statistics.
To clear the statistics of a GSLB virtual server by using the command line interface
Example:
To clear the statistics of a GSLB service by using the command line interface
Example:
To clear the statistics of a GSLB virtual server by using the configuration utility
When you create a GSLB virtual server, it is enabled by default. If you disable it, it cannot process
traffic. A disabled GSLB virtual server is not included in GSLB configuration but is not removed from
the NetScaler appliance.
To enable or disable a GSLB virtual server by using the command line interface
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Once the GSLB services and virtual server are configured, relevant GSLB services must be bound to
the GSLB virtual server to activate the configuration.
To bind a GSLB service to a GSLB virtual server by using the command line interface
At the command prompt, type the following commands to bind a GSLB service to a GSLB virtual server
and verify the configuration:
Example:
To unbind a GSLB service from a GSLB virtual server by using the command line
interface
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click a virtual server.
2. Click in the Domains section, and configure a domain and bind the domain.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
To make a NetScaler appliance the authoritative DNS server for a domain, you must bind the domain
to the GSLB virtual server. When you bind a domain to a GSLB virtual server, the NetScaler appliance
adds an address record for the domain, containing the name of the GSLB virtual server. The start of
authority (SOA) and name server (NS) records for the GSLB domain must be added manually.
For details on configuring SOA and NS records, see Domain Name System.
To bind a domain to a GSLB virtual server by using the command line interface
At the command prompt, type the following commands to bind a domain to a GSLB virtual server and
verify the configuration:
Example:
To unbind a GSLB domain from a GSLB virtual server by using the command line
interface
2. In GSLB Virtual Servers pane, select the GSLB Virtual Server to which you want to bind the do-
main (for example, Vserver-GSLB-1) and click Open.
3. In the Configure GSLB Virtual Server dialog box, on the Domains tab, do one of the following:
4. In the Create GSLB Domain or Configure GSLB Domain dialog box, specify values for the follow-
ing parameters as shown:
/* A required parameter
5. Click Create.
6. Click OK.
Example:
Note: To view statistics for a particular GSLB domain, enter the name of the domain exactly as it was
added to the NetScaler appliance. If you do not specify the domain name, or if you specify an incorrect
domain name, statistics for all configured GSLB domains are displayed.
To view the configuration details of the entities bound to a GSLB domain using the
command line
Example:
To view the configuration details of the entities bound to a GSLB domain by using the
configuration utility
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click a virtual server.
2. Click the field below the Domains pane.
3. In the GSLB Virtual Server Domain Binding dialog box, select a domain, and then click Show
Bindings.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
An organization has a geographically dispersed network and has three data centers located in the
United States, Mexico, and Colombia. In the configuration related to these locations, these are re-
ferred to as US, MX, and CO respectively. At each location, the company has a server farm, which
provides the same content and the setup is working as expected. The NetScaler appliance at each
location is configured through a virtual server with the HTTP protocol on port 80.
The organization has implemented the GSLB setup by adding a site identifier at each site. The site
identifier includes a site name and an IP address that is owned by the NetScaler appliance and is used
for the GSLB communications.
Each site has a site local to the appliance. Also, each site has two sites remote to the local appliance.
On each site, a GSLB virtual server is created with the same name. This virtual server identifies the
website of the organization globally and does not have any IP address associated with it.
The setup also has GSLB services configured that point to the load balancing virtual servers configured
on each GSLB site by specifying the IP address, protocol, and port number of the respective virtual
server. These services are bound to the GSLB virtual server.
Note: In the procedure below, the commands use private IP addresses for the GSLB sites. For public
sites and GSLB services, ensure that you use public IP addresses for these sites.
The following table lists the IP addresses and locations used in the example:
IP Address Location
When adding a GSLB site, if the site communicates over the internet only then use the “Public IP” field.
For example, when there is no site to site VPN connectivity between the GSLB sites.
To configure the GSLB setup with NetScaler appliances by using the CLI commands
5. Add the GSLB virtual server that references a service being used in the GSLB setup:
6. Add the GSLB services for each site participating in the GSLB setup:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Typically, a GSLB setup has a few data centers with a GSLB site configured for each data center. In
each NetScaler, participating in GSLB, configure one GSLB site as a local site and the others as remote
sites. When you add another GSLB site at a later point, you must ensure that the configuration across
all GSLB sites is identical. You can use the NetScaler’s GSLB configuration synchronization option to
synchronize the configuration across the GSLB sites.
The NetScaler appliance from which you use the synchronization option is referred to as the ‘master
node’ and the GSLB sites on which the configuration is copied as ‘slave nodes.’ When you synchronize
a GSLB configuration, the configurations on all the GSLB sites participating in the GSLB setup are made
similar to that on the master node.
Synchronization (may also be referred to as ‘auto sync’) is carried out in the following manner:
• The master node finds the differences between the configuration of the master node and slave
node, and changes the configuration of the slave node to make it similar to the master node.
If you force a synchronization (use the ‘force sync’ option), the appliance deletes the GSLB con-
figuration from the slave node and then configures the slave to make it similar to the master
node.
• During synchronization, if a command fails, synchronization is not aborted and the error mes-
sage are logged into a .err file in the /var/netscaler/gslb directory.
• Synchronization is done only on the parent sites. GSLB child sites’ configuration is not affected
by synchronization. This is because the parent site and the child site configurations are not
identical. The child sites configuration consists only of its own and its parent site’s details. Also,
GSLB services are not always required to be configured in the child sites.
• If you disable the internal user login, the GSLB auto sync uses the SSH keys to synchronize the
configuration. But, to use GSLB auto sync in partition environment, you need to enable the
internal user login and make sure that the partition username in the local and remote GSLB
sites is same.
Note
• On the remote GSLB site RPC node, configure the firewall to accept auto-sync connections
by specifying the remote site IP (cluster IP address for cluster setup) and port (3010 for RPC
and 3008 for secure RPC). If the default route to reach the remote sites is in management
subnet, as in most cases, then NSIP is used as the source IP address.
To configure a different source IP address, you must have the GSLB site IP address and the
SNIP in a different subnet. Also, you must have an explicit route defined to the remote site
IP address through GSLB site IP subnet.
• The source IP address cannot be synchronized across the sites participating in GSLB be-
cause the source IP address for a RPC node is specific to each NetScaler appliance. There-
fore, after you force a synchronization (using the sync gslb config -forceSync command or
by selecting the ForceSync option in the GUI), you have to manually change the source IP
addressess on the other NetScaler appliances.
• Port 22 is also required for synchronizing the database files to the remote site.
If you use the saveconfig option, the sites that participate in the synchronization process auto-
matically save their configuration, in the following way:
1. The master node saves its configuration immediately before it initiates the process of synchro-
nization.
2. After the process of synchronization is complete, the slave nodes save their configuration. A
slave node saves its configuration only if the configuration difference was applied successfully
on it. If synchronization fails on a slave node, you must manually investigate the cause of the
failure and take corrective action.
Limitations of synchronization:
• On the master node, the names of the remote GSLB sites must be identical to the names of sites
configured on the NetScaler appliances hosting those sites.
• During the synchronization, traffic disruptions may occur.
Note: To overcome the limitations due to some settings in the GSLB configuration, you can use
the force sync option. But, if you use the force sync option the GSLB entities are removed and
re-added to the configuration and the GSLB statistics are reset to zero. Hence the traffic is disrupted
during the configuration change.
Before you start the synchronization of a GSLB setup, make sure that:
• On all the GSLB sites including the master node, management access and SSH should be en-
abled for the IP address of the corresponding GSLB site. The IP address of a GSLB site must be
an IP address owned by the NetScaler appliance. For more information about adding the GSLB
site IP addresses and enabling Management Access, see “Configuring a Basic GSLB Site”.
• The GSLB configuration on the NetScaler appliance that is considered as the master node is
complete and appropriate to be copied on all the sites.
• If you are synchronizing the GSLB configuration for the first time, all the sites participating in
GSLB need to have the GSLB site entity of their respective local sites.
• You are not synchronizing sites that, by design, do not have the same configuration.
Important
The following directories are synchronized as part of the GSLB configuration synchronization.
• /var/netscaler/locdb/
• /var/netscaler/ssl/
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Important: After a GSLB configuration is synchronized, the configuration cannot be rolled back on any
of the GSLB sites. Perform the synchronization only if you are sure that the synchronization process
will not overwrite the configuration on the remote site. Site synchronization is undesirable when the
local and remote sites have different configurations by design, and can lead to site outage. If some
commands fail and some commands succeed, the successful commands cannot be rolled back.
At the command prompt, type the following commands to synchronize GSLB sites and verify the con-
figuration:
Example:
22
23 Applying changes: ok
24
25 Done
By previewing the GSLB synchronization operation, you can see the differences between the master
node and each slave node. If there are any discrepancies, you can troubleshoot before synchronizing
the GSLB configuration.
You can view the status (success or failure) of each command triggered during the synchronization
process and troubleshoot accordingly.
Attention:
Starting with NetScaler 12.1 build xx.xx, SNMP traps are generated when you synchronize the
GSLB configuration. Note that in real-time synchronization, the synchronization status in the
first SNMP trap is captured as failure. You can ignore this status because a second SNMP trap is
automatically generated immediately after the first trap with the actual synchronization status.
However, if the synchronization failed in the second attempt also, SNMP trap is not generated
because the synchronization status has not changed from the previous synchronization status.
For details on configuring NetScaler appliance to generate traps, see Configuring the NetScaler to
generate SNMP traps.
Notes:
• All logs related to real-time sync are stored in the /var/netscaler/gslb/periodic_sync.log file.
• The sync status file and default configuration file are stored in the location /var/netscaler/gslb_sync.
• Enabling AutomaticConfigSync from default partition of a partitioned appliance is not
supported. However, it can be enabled from all other partitions. The sync status file and
default configuration file are stored in the location /var/partitions/<partition name>
/netscaler/gslb_sync.
• It is recommended that all the NetScaler appliances participating as sites have the
sameNetScaler software version.
• To change the RPC node password, first change the password on the slave site and then on the
master site.
• Configure local GSLB sites on each site participating in GSLB.
• Enable automaticConfigSync on one of the sites where the configuration is performed. This site
eventually gets synchronized to other GSLB sites.
• If there is a new configuration or changes are made to the existing configuration, make sure
to check the status using the “show gslb syncStatus” command to confirm if the changes are
synchronized across all sites or if there was any error.
Example:
1. Navigate to Configuration > Traffic Management > GSLB > Change GSLB Settings.
2. Select Automatic ConfigSync.
Note: This option must be enabled only in the site where the configuration is performed.
Tip
For information on the following topics, see Manual synchronization between sites participating
in GSLB.
1.
2. Citrix ADC
3. NetScaler 12.0
GSLB dashboard
The second and third of the above settings enable the appliance to stop monitoring when MEP is UP.
For example, in a hierarchical GSLB setup, a GSLB site provides the MEP information about its child
sites to its parent site. Such an intermediate site may evaluate the state of the child site as DOWN
because of network issues, though the actual state of the site is UP. In this case, you can bind mon-
itors to the services of the parent site and disable MEP to determine the actual state of the remote
service. This option enables you to control the manner in which the states of the remote services are
determined.
To use monitors, first create them, and then bind them to GSLB services.
You can configure a GSLB site to always use monitors (the default), use monitors when MEP is down, or
use monitors when both the remote service and MEP are down. In the latter two cases, the NetScaler
appliance stops monitoring when MEP returns to the UP state.
Example:
1. Navigate to Traffic Management > GSLB > Sites, and double-click the site.
2. In the Trigger Monitors drop-down list, select an option for when to trigger monitoring.
To add a monitor, you specify the type and the port. You cannot remove a monitor that is bound to a
service. You must first unbind the monitor from the service.
At the command prompt, type the following commands to create a monitor and verify the configura-
tion:
Example:
1 rm lb monitor <monitorName>
Navigate to
Traffic Management > Load Balancing > Monitors, and add or delete a monitor.
Once you create monitors, you must bind them to GSLB services. When binding monitors to the ser-
vices, you can specify a weight for the monitor. After binding one or more weighted monitors, you can
configure a monitor threshold for the service. This threshold takes the service down if the sum of the
bound monitor weights falls below the threshold value.
Note: In the configuration utility, you can set both the weight and the monitoring threshold at the
same time that you bind the monitor. When using the command line, you must issue a separate com-
mand to set the service’s monitoring threshold.
To bind the monitor to the GSLB service by using the command line interface
Example:
To set the monitoring threshold for a GSLB service by using the command line interface
Example:
To bind the monitor to the GSLB service by using the configuration utility
To set the monitoring threshold for a GSLB service by using the configuration utility
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Tip
For information about the GSLB service groups, see Configuring a GSLB Service Group
Deployment scenario
Two datacenters are deployed in two AWS regions, one in Sydney and one in North Virginia. Another
datacenter is deployed in Azure. An AWS ELB in each AWS region is used to load balance the applica-
tion servers. ALB is used for Azure to load balancing the application server. The NetScaler appliances
are configured for GSLB for the ELBs and ALB using GSLB domain name based autoscale service group.
Important
You must configure the required security groups in AWS and attach it to the GSLB instance. Port
53 must be allowed in the security group inbound and outbound rules. Also, ports (3009 or 3011
depending on secure MEP configuration) for MEP communication must be open. For application
monitoring, the corresponding ports must be allowed in the security group outbound rules.
The configuration steps for the above deployment scenario and the corresponding CLI commands are
as follows:
2. Add a name server with the DNS gateway IP address where the GSLB node is added. This must be
done in all datacenters.
4. Add GSLB autoscale service groups for each ELB and ALB and bind each server to the respective
service group.
5. Add a GSLB virtual server and bind the application domain and the service groups to this virtual
server.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Tip
For information about the GSLB service groups, see Configuring a GSLB Service Group.
Deployment scenario
If there are multiple applications hosted on the same application server, the GSLB should probe these
applications to see if the applications are responding or not. If an application is not responding, the
user must be directed to the server on which the application is UP. Also, if one of the applications is
DOWN, then the server should not be marked DOWN, because the other applications are UP.
In the following example, multiple applications (HTTPS) are hosted on one server in each GSLB site
and hence all these applications resolve to one IP address of the respective site.
Using the GSLB service groups, you can have the same server with an IP address and port bound to
multiple service groups where each service group represents a different application.
An application specific monitor is bound to the service groups that marks the service group as DOWN
if the application is DOWN. Thus, whenever an application is DOWN, only that application is taken out
from the setup and not the server.
1.
2. Citrix ADC
3. NetScaler 12.0
How-to articles
Contributed by:
C
The GSLB how-to articles contain information about some of the important GSLB configurations such
as customizing GSLB configuration, configuring persistent connections, disaster recovery, and so on.
Configuring Global Server Load Balancing for DNS Queries with NAPTR records
Using the EDNS0 Client Subnet Option for Global Server Load Balancing
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Once your basic GSLB configuration is operational, you can customize it by modifying the bandwidth
of a GSLB service, configuring CNAME based GSLB services, static proximity, dynamic RTT, persistent
connections, or dynamic weights for services, or changing the GSLB Method.
You can also configure monitoring for GSLB services to determine their states.
These settings depend on your network deployment and the types of clients you expect to connect to
your servers.
You can restrict the number of new clients that can simultaneously connect to a load balancing or
content switching virtual server by configuring the maximum number of clients and/or the maximum
bandwidth for the GSLB service that represents the virtual server.
To modify the maximum clients or bandwidth of a GSLB service by using the command line
interface
At the command prompt, type the following command to modify the maximum number of client con-
nections or the maximum bandwidth of a GSLB service and verify the configuration:
Example:
To modify the maximum clients or bandwidth of a GSLB service by using the configuration
utility
1. Navigate to Traffic Management > GSLB > Services, and double-click a service.
2. Click in the Other Settings section and set the following parameters:
• Max Clients—maxClients
• Max Bandwidth—maxBandwidth
To configure a GSLB service, you can use the IP address of the server or a canonical name of the server.
If you want to run multiple services (like an FTP and a Web server, each running on different ports) from
a single IP address or run multiple HTTP services on the same port, with different names, on the same
physical host, you can use canonical names (CNAMES) for the services.
For example, you can have two entries in DNS as ftp.example.com and www.example.com for FTP ser-
vices and HTTP services on the same domain, example.com. CNAME-based GSLB services are useful
in a multilevel domain resolver configuration or in multilevel domain load balancing. Configuring a
CNAME-based GSLB service can also help if the IP address of the physical server is likely to change.
If you configure CNAME-based GSLB services for a GSLB domain, when a query is sent for the GSLB
domain, the NetScaler appliance provides a CNAME instead of an IP address. If the A record for this
CNAME record is not configured, the client must query the CNAME domain for the IP address. If the
A record for this CNAME record is configured, the NetScaler appliance provides the CNAME with the
corresponding A record (IP address). The NetScaler appliance handles the final resolution of the DNS
query, as determined by the GSLB method. The CNAME records can be maintained on a different
NetScaler appliance or on a third-party system.
In an IP-address-based GSLB service, the state of a service is determined by the state of the server
that it represents. However, a CNAME-based GSLB service has its state set to UP by default; the virtual
server IP (VIP) address or metric exchange protocol (MEP) are not used for determining its state. If
a desktop-based monitor is bound to a CNAME-based GSLB service, the state of the service is deter-
mined according to the result of the monitor probes.
You can bind a CNAME-based GSLB service only to a GSLB virtual server that has the DNS Record Type
as CNAME. Also, a NetScaler appliance can contain at most one GSLB service with a given CNAME entry.
The following are some of the features supported for a CNAME-based GSLB service:
• GSLB-policy based site affinity is supported, with the CNAME as the preferred location.
• Source IP persistence is supported. The persistency entry contains the CNAME information in-
stead of the IP address and port of the selected service.
• Site persistence is not supported, because the service referenced by a CNAME can be present at
any third-party location.
• Multiple-IP-address response is not supported because one domain cannot have multiple
CNAME entries.
• Source IP Hash and Round Robin are the only load balancing methods supported. The Static
Proximity method is not supported because a CNAME is not associated with an IP address and
static proximity can be maintained only according to the IP addresses.
Note: The
Empty-Down-Response feature should be enabled on the GSLB virtual server to which you bind the
CNAME-based GSLB service. If you enable the
Empty-Down-Response feature, when a GSLB virtual server is DOWN or disabled, the response to a
DNS query, for the domains bound to this virtual server, contains an empty record without any IP
addresses, instead of an error code.
Example:
When you configure persistence on a GSLB virtual server to which a service is bound, the service contin-
ues to serve requests from the client even after it is disabled, accepting new requests or connections
only to honor persistence. After a configured period of time, known as the graceful shutdown period,
no new requests or connections are directed to the service, and all of the existing connections are
closed.
When disabling a service, you can specify a graceful shutdown period, in seconds, by using the delay
argument. During the graceful shutdown period, if the service is bound to a virtual server, its state
appears as Out of Service.
In a typical network, there are servers that have a higher capacity for traffic than others. However, with
a regular load balancing configuration, the load is evenly distributed across all services even though
different services represent servers with different capacities.
To optimize your GSLB resources, you can configure dynamic weights on a GSLB virtual server. The
dynamic weights can be based on either the total number of services bound to the virtual server or the
sum of the weights of the individual services bound to the virtual server. Traffic distribution is then
based on the weights configured for the services.
When dynamic weights are configured on the GSLB virtual server, requests are distributed according
to the load balancing method, the weight of the GSLB service, and the dynamic weight. The product of
the weight of the GSLB service and the dynamic weight is known as the cumulative weight. Therefore,
when dynamic weight is configured on the GSLB virtual server, requests are distributed on the basis
of the load balancing method and the cumulative weight.
When dynamic weight for a virtual server is disabled, the numerical value is set to 1. This ensures that
the cumulative weight is a non-zero integer at all times.
Dynamic weight can be based on the total number of active services bound to load balancing virtual
servers or on the weights assigned to the services.
Consider a configuration with two GSLB sites configured for a domain and each site has two services
that can serve the client. If a service at either site goes down, the other server in that site has to handle
twice as much traffic as a service at the other site. If dynamic weight is based on the number of active
services, the site with both services active has twice the weight of the site with one service down and
therefore receives twice as much traffic.
Alternatively, consider a configuration in which the services at the first site represent servers that are
twice as powerful as servers at the second site. If dynamic weight is based on the weights assigned to
the services, twice as much traffic can be sent to the first site as to the second.
As an illustration of how dynamic weight is calculated, consider a GSLB virtual server that has a GSLB
service bound to it. The GSLB service represents a load balancing virtual server that in turn has two
services bound to it. The weight assigned to the GSLB service is 3. The weights assigned to the two
services are 1 and 2 respectively. In this example, when dynamic weight is set to:
• Disabled:The cumulative weight of the GSLB virtual server is the product of the dynamic weight
(disabled = 1) and the weight of the GSLB service (3), so the cumulative weight is 3.
• SERVICECOUNT: The count is the sum of the number of services bound to the load balancing
virtual servers corresponding to the GSLB service (2), and the cumulative weight is the product
of the dynamic weight (2) and the weight of the GSLB service (3), which is 6.
• SERVICEWEIGHT: The dynamic weight is the sum of the number of services bound to the GSLB
service (2), and the cumulative weight is the product of the dynamic weight (2) and the weight
of the GSLB service (3), which is 6.
Note: Dynamic weights are not applicable when content switching virtual servers are configured.
To configure a GSLB virtual server to use dynamic weights by using the command line interface
Example:
To set GSLB virtual server to use dynamic weights by using the configuration utility
1. Navigate to Traffic Management > GSLB > Virtual Servers, double-click the GSLB virtual server
whose method you want to change (for example, vserver-GSLB-1).
2. Click the Method section and, from the Dynamic Weight drop-down list, select SERVICECOUNT
or SERVICEWEIGHT.
1.
2. Citrix ADC
3. NetScaler 12.0
precedence over the configured GSLB method. Persistence is useful for deployments that deal with
e-commerce, such as shopping card usage, where the server needs to maintain the state of the con-
nection to track the transaction. To maintain the state of connection, you must configure persistence
on a virtual server. With persistence configured, the NetScaler appliance selects a data center to pro-
cess a client request and forwards the IP address of the selected data center for all subsequent DNS
requests. If the configured persistence applies to a site that is down, the NetScaler appliance uses a
GSLB method to select a new site, and the new site becomes persistent for subsequent requests from
the client.
The GSLB virtual server is responsible for DNS-based site persistence, and it controls the site persis-
tence for a remote GSLB service. The NetScaler appliance supports persistence based on the source
IP address or on HTTP cookies.
When you bring a physical service DOWN with a delay time, the physical service goes into the transition
out of service (TROFS) state. Site persistence is supported as long as the service is in the TROFS state.
That is, if the same client sends a request for the same service within the specified delay time after a
service is marked TROFS, the same GSLB site (data center) services the request.
Note: If connection proxy is specified as the site persistence method and if you also want to configure
persistence of the physical servers, do not configure SOURCEIP persistence. When the connection
is proxied, an IP address owned by the appliance is used, and not the actual IP address of the client.
Configure methods such as cookie persistence or rule-based persistence on the load balancing virtual
server.
With source-IP persistence, when a DNS request is received at a data center, the NetScaler appliance
first looks for an entry in the persistence table and, if an entry for the local DNS server exists and the
server mentioned in the entry is configured, the IP address of that server is sent as the DNS response.
For the first request from a particular client, the NetScaler appliance selects the best GSLB site for the
request and sends its IP address to the client. Since persistence is configured for the source IP address
of the client, all subsequent requests by that client or another local DNS server in the same IP subnet
are sent the IP address of the GSLB site that was selected for the first request.
For source-IP address based persistence, the same set of persistence identifiers must be configured
on the GSLB virtual servers in all data centers. A persistence identifier is a number used by the data
centers to identify a particular GSLB virtual server. A cookie transmits the persistence identifier, en-
abling the NetScaler appliance to identify the domain so that it can forward all appropriate requests
to the same domain. When persistence is enabled, the persistence information is also exchanged as
part of metrics exchange.
For the NetScaler appliance to support persistence across sites, persistence must be enabled on the
GSLB virtual servers of all participating sites. When you use source IP address persistence on the net-
work identifier, you must configure a subnet mask. For any domain, persistence takes precedence
over any other configured GSLB method.
To configure persistence based on source IP address by using the command line interface
Example:
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual
server whose method you want to change (for example, vserver-GSLB-1).
2. Click the Persistence section and, from the Persistence drop-down list, select SOURCEIP and
set the following parameters:
• Persistence Id—persistenceID
• Time-out—timeout
• IPv4 Netmask or IPv6 Mask length—persistMask
The NetScaler appliance provides persistence at the HTTP-request level by using connection proxy
and HTTP redirect. With these persistence methods, the appliance uses an HTTP cookie (known as a
“site cookie”) to reconnect the client to the same server. The appliance inserts the site cookie in the
first HTTP response.
The site cookie contains information about the selected GSLB service on which the client has a persis-
tent connection. The cookie expiration is based on the cookie timeout configured on the NetScaler
appliance. If the virtual server names are not identical on all the sites, you must use the persistence
identifier. Cookies inserted are compliant with RFC 2109.
When the NetScaler appliance responds to a client DNS request by sending the IP address of the se-
lected GSLB site, the client sends an HTTP request to that GSLB site. The physical server in that GSLB
site adds a site cookie to the HTTP header, and connection persistence is in effect.
If the DNS entry in the client cache expires, and then the client sends another DNS query and is di-
rected to a different GSLB site, the new GSLB site uses the site cookie present in the client request
header to implement persistence. If the GSLB configuration at the new site uses connection-proxy
persistence, the new site creates a connection to the GSLB site that inserted the site cookie, proxies
the client request to the original site, receives a response from the original GSLB site, relays that re-
sponse back to the client, and closes the connection. If the GSLB configuration uses HTTP redirect
persistence, the new site redirects the request to the site that originally inserted the cookie.
Note: Connection proxy persistence can be configured only for local services. However, connection
proxy persistence must be enabled on both local and remote GSLB services that are configured for the
GSLB virtual server.
• Requests are sent from a domain participating in GSLB. The domain is obtained from the
URL/Host header.
• Requests are sent from a local GSLB service whose public IP address matches the public IP ad-
dress of an active service bound to the GSLB virtual server.
• The local GSLB service has connection proxy enabled.
• The request includes a valid cookie that contains the IP address of an active remote GSLB ser-
vice.
If one of the conditions is not met, connection proxy does not occur, but a site cookie is added if the
local GSLB service has connection proxy enabled AND:
The following are the limitations of using connection proxy site cookies:
Note
In a GSLB parent-child configuration, connection proxy works as intended even when a GSLB
service is not configured on a child site. However, if you have additional configuration such as
client authentication, client IP address insertion, or other SSL-specific requirement, you must
add an explicit GSLB service on the site and configure it accordingly.
For more information about parent-child topology, see Parent-Child Topology Deployment Using
the MEP Protocol.
To set persistence based on HTTP cookies by using the command line interface
Example:
1. Navigate to Traffic Management > GSLB > Services and select the service that you want to
configure for site persistence (for example, service-GSLB-1).
2. Click the Site Persistence section and set persistence based on cookies.
1.
2. Citrix ADC
3. NetScaler 12.0
The state of a virtual server depends on the states of the services bound to it, and the state of each
service depends on the monitors bound to it. If a server is slow or down, the monitoring probes time
out and the service that represents the server is marked as DOWN. A virtual server is marked as DOWN
only when all services bound to it are marked as DOWN. You can configure services and virtual servers
to either terminate all connections when they go down, or allow the connections to go through. The
latter setting is for situations in which a service is marked as DOWN because of a slow server.
When you configure the down state flush option, the NetScaler appliance performs a delayed cleanup
of connections to a GSLB service that is down.
To enable delayed cleanup of virtual server connections by using the command line interface
At the command prompt, type the following commands to configure delayed connection cleanup and
verify the configuration:
Example:
To enable delayed cleanup of virtual server connections by using the configuration utility
1. Navigate to Traffic Management > GSLB > Services and double-click the service.
2. Click the Other Settings section and select the Down State Flush option.
You can use DNS policies to implement site affinity by directing traffic from the IP address of a local
DNS resolver or network to a predefined target GSLB site. This is configured by creating DNS policies
with DNS expressions and binding the policies globally on the NetScaler appliance.
DNS expressions
The NetScaler appliance provides certain predefined DNS expressions that can be used for configuring
actions specific to a domain. Such actions can, for example, drop certain requests, select a specific
view for a specific domain, or redirect certain requests to a specific location.
These DNS expressions (also called rules) are combined to create DNS policies that are then bound
globally on the NetScaler appliance.
Following is the list of predefined DNS qualifiers available on the NetScaler appliance:
• CLIENT.UDP.DNS.DOMAIN.EQ(“domainname”)
• CLIENT.UDP.DNS.IS_AREC
• CLIENT.UDP.DNS.IS_AAAAREC
• CLIENT.UDP.DNS.IS_SRVREC
• CLIENT.UDP.DNS.IS_MXREC
• CLIENT.UDP.DNS.IS_SOAREC
• CLIENT.UDP.DNS.IS_PTRREC
• CLIENT.UDP.DNS.IS_CNAME
• CLIENT.UDP.DNS.IS_NSREC
• CLIENT.UDP.DNS.IS_ANYREC
The CLIENT.UDP.DNS.DOMAIN DNS expression can be used with string expressions. If you are
using domain names as part of the expression, they must end with a period (.). For example,
CLIENT.UDP.DNS.DOMAIN.ENDSWITH(“abc.com.”)
1. Click the icon next to the Expression text box. Click Add. (Leave the Flow Type and Protocol
drop-down list boxes empty.) Follow these steps to create a rule.
2. In the Qualifier box, select a qualifier (for example, LOCATION).
3. In the Operator box, select an operator (for example, ==).
4. In the Value box, type a value (for example, Asia, Japan….).
5. Click OK. Click Create and click Close. The rule is created.
6. Click OK.
A DNS policy includes the name of a DNS action to be performed when the policy rule evaluates to
TRUE. A DNS action can do one of the following:
• Send the client an IP address for which you have configured a DNS view. For more information
about DNS views, see Adding DNS Views.
• Send the client the IP address of a GSLB service after referring to a list of preferred locations
that overrides static proximity behavior. For more information about preferred locations, see
Overriding Static Proximity Behavior by Configuring Preferred Locations.
• Send the client a specific IP address as determined by the evaluation of the DNS query or re-
sponse (DNS response rewrite).
• Forward a request to the name server without performing a lookup in the appliance’s DNS
cache.
• Drop a request.
You cannot create a DNS action for dropping a DNS request or for bypassing the DNS cache on the
appliance. If you want to drop a DNS request, use the built-in action, dns_default_act_Drop. If you
want to bypass the DNS cache, use the built-in action, dns_default_act_Cachebypass. Both actions
are available along with custom actions in the Create DNS Policy and the Configure DNS Policy dialog
boxes. These built-in actions cannot be modified or removed.
At the command prompt, type the following commands to configure a DNS action and verify the con-
figuration:
Examples
Example 1: Configuring DNS Response Rewrite. The following DNS action sends the client a precon-
figured IP address when the policy to which the action is bound evaluates to true:
Example 2: Configuring a DNS-View Based Response. The following DNS action sends the client an
IP address for which you have configured a DNS view:
Example 3: Configuring a Response Based on a Preferred Location List. The following DNS ac-
tion sends the client the IP address that corresponds to the preferred location that it selects from the
specified list of locations:
1. Navigate to Traffic Management > DNS > Actions, create or edit a DNS action.
2. In the Create DNS Action or Configure DNS Action dialog box, set the following parameters:
• Action Name (cannot be changed for an existing DNS action)
• Type (cannot be changed for an existing DNS action)
To set the
Type parameter, do one of the following:
– To create a DNS action that is associated with a DNS view, select View Name. Then,
from the View Name list, select the DNS view that you want to use in the action.
– To create a DNS action with a preferred location list, select Preferred Location List. In
Preferred Location, enter a location, and then click Add. Add as many DNS locations
as you want.
– To configure a DNS action for rewriting a DNS response on the basis of policy evalua-
tion, select Rewrite Response. In IP Address, enter an IP address, and then click Add.
Add as many IP addresses as you want.
• TTL (applicable only to the Rewrite Response action type)
DNS policies operate on a location database that uses static and custom IP addresses. The attributes
of the incoming local DNS request are defined as part of an expression, and the target site is defined
as part of a DNS policy. While defining actions and expressions, you can use a pair of single quotation
marks (‘’) as a wildcard qualifier to specify more than one location. When a DNS policy is configured
and a GSLB request is received, the custom IP address database is first queried for an entry that defines
the location attributes for the source:
• When a DNS query comes from an LDNS, the characteristics of the LDNS are evaluated against
the configured policies. If they match, an appropriate action (site affinity) is executed. If the
LDNS characteristics match more than one site, the request is load balanced between the sites
that match the LDNS characteristics.
• If the entry is not found in the custom database, the static IP address database is queried for an
entry, and if there is a match, the above policy evaluation is repeated.
• If the entry is not found in either the custom or static databases, the best site is selected and
sent in the DNS response on the basis of the configured load balancing method.
The following restrictions apply to DNS policies created on the NetScaler appliance.
• DNS policies are global to the NetScaler appliance and cannot be applied to a specific virtual
server or domain.
You can use DNS policies to direct clients that match a certain IP address range to a specific site. For
example, if you have a GSLB setup with multiple GSLB sites that are separated geographically, you can
direct all clients whose IP address is within a specific range to a particular data center.
Both TCP-based and UDP-based DNS traffic can be evaluated. Policy expressions are available for
UDP-based DNS traffic on the server and for both UDP-based DNS traffic and TCP-based DNS traffic
on the client side. Additionally, you can configure expressions to evaluate queries and responses that
involve only the following DNS question types (or QTYPE values):
• A
• AAAA
• NS
• SRV
• PTR
• CNAME
• SOA
• MX
• ANY
• NOERROR - No error
• FORMERR - Format error
• SERVFAIL - Server failure
• NXDOMAIN - Non-existent domain
• NOTIMP - Query type not implemented
• REFUSED - Query refused
You can configure expressions to evaluate DNS traffic. A DNS expression begins with the DNS.REQ or
DNS.RES prefixes. Functions are available for evaluating the queried domain, the query type, and the
carrier protocol. For more information about DNS expressions, see “Expressions for Evaluating a DNS
Message and Identifying Its Carrier Protocol” in “Policy Configuration and Reference”.
At the command prompt, type the following commands to create a DNS policy and verify the configu-
ration:
Example:
1. Navigate to Traffic Management > DNS > Policies and create a DNS policy.
2. In the Create DNS Policy or Configure DNS Policy dialog box, set the following parameters:
• Policy Name (cannot be changed for an existing policy)
• Action
• Expression
To specify an expression, do the following:
a) Click Add, and then, in the drop-down box that appears, select the expression element
with which you want to begin the expression. A second list appears. The list contains
a set of expression elements that you can use immediately after the firs expression
element.
b) In the second list, select the expression element that you want, and then enter a pe-
riod.
c) After each selection, if you enter a period, the next set of valid expression elements
appear in a list. Select expression elements and fill in arguments to functions until
you have the expression you want.
3. Click Create or OK, and then click Close.
DNS policies are bound globally on the NetScaler appliance and are available for all configured GSLB
virtual servers. Even though DNS policies are globally bound, policy execution can be limited to a
specific GSLB virtual server by specifying the domain in the expression.
At the command prompt, type the following commands to bind a DNS policy globally and verify the
configuration:
Example:
To view the global bindings of a DNS policy by using the command line interface
To view the global bindings of a DNS policy by using the configuration utility
You can configure DNS views to identify various types of clients and provide an appropriate IP address
to a group of clients who query for the same GSLB domain. DNS views are configured by using DNS
policies that select the IP addresses sent back to the client.
For example, if you have configured GSLB for your company’s domain and have the server hosted in
your company’s network, clients querying for the domain from within your company’s internal net-
work can be provided with the server’s internal IP address instead of the public IP address. Clients
that query DNS for the domain from the Internet, on the other hand, can be provided the domain’s
public IP address.
To add a DNS view, you assign it a name of up to 31 characters. The leading character must be a number
or letter. The following characters are also allowed: @ _ - . (period) : (colon) # and space ( ). After
adding the view, you configure a policy to associate it with clients and a part of the network, and you
bind the policy globally. To configure and bind a DNS policy, see Managing Local DNS Traffic by
Using DNS Policies.
At the command prompt, type the following commands to create a DNS view and verify the configura-
tion:
Example:
Navigate to Traffic Management > DNS > Views and add a DNS view.
For details on how to create a DNS policy and how to bind DNS policies globally, see Managing Local
DNS Traffic by Using DNS Policies.
1.
2. Citrix ADC
3. NetScaler 12.0
Dynamic round trip time (RTT) is a measure of time or delay in the network between the client’s local
DNS server and a data resource. To measure dynamic RTT, the NetScaler appliance probes the client’s
local DNS server and gathers RTT metric information. The appliance then uses this metric to make its
load balancing decision. Global server load balancing monitors the real-time status of the network
and dynamically directs the client request to the data center with the lowest RTT value
To configure GSLB for proximity with dynamic method, you must first configure the basic GSLB set up
and then configure dynamic RTT.
First create two GSLB sites, local and remote. Then, for the local site, create a GSLB virtual server
and GSLB services and bind the services to the virtual server. Then create ADNS services and bind the
domain for which you are configuring GSLB to the GSLB virtual server at the local site. Finally, create
a load balancing virtual server with the same virtual server IP address as the GSLB service.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
Once you have configured a basic GSLB setup, configure the dynamic RTT method.
For details on how to configure the GSLB virtual server to use the dynamic RTT method for load bal-
ancing, see Configuring Dynamic RTT.
The static proximity method for GSLB uses an IP address-based static proximity database to deter-
mine the proximity between the client’s local DNS server and the GSLB sites. The NetScaler appliance
responds with the IP address of a site that best matches the proximity criteria.
If two or more GSLB sites at different geographic locations serve the same content, the NetScaler
appliance maintains a database of IP address ranges and uses the database for decisions about the
GSLB sites to which to direct incoming client requests.
To configure GSLB for proximity with static proximity, you must first configure the basic GSLB set up
and then configure static proximity.
First create two GSLB sites, local and remote. Then, for the local site, create a GSLB virtual server
and GSLB services and bind the services to the virtual server. Then create ADNS services and bind the
domain for which you are configuring GSLB to the GSLB virtual server at the local site. Finally, create
a load balancing virtual server with the same virtual server IP address as the GSLB service.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
Once you have configured a basic GSLB setup, configure static proximity.
For details on how to configure the GSLB virtual server to use static proximity for load balancing, see
Configuring Static Proximity.
You can configure the GSLB virtual server to use a combination of static proximity and dynamic RTT
when you have some clients coming from an internal network like a branch office. You can configure
GSLB such that the clients coming from the branch office or any other internal network are directed
to a particular GSLB site that is geographically close to the client network. For all other requests, you
can use dynamic RTT.
First create two GSLB sites, local and remote. Then, for the local site, create a GSLB virtual server
and GSLB services and bind the services to the virtual server. Then create ADNS services and bind the
domain for which you are configuring GSLB to the GSLB virtual server at the local site. Finally, create
a load balancing virtual server with the same virtual server IP address as the GSLB service.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
Once you have configured a basic GSLB setup, configure the GSLB virtual server to use static proximity
for all traffic originating from an internal network and then use dynamic RTT for all other traffic.
For details on how to configure static proximity, see Configuring Static Proximity and for details on
how to configure dynamic RTT, see Configuring Dynamic RTT.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can protect your GSLB setup against failure of a GSLB site or a GSLB virtual server by configur-
ing a backup GSLB virtual server, configuring the NetScaler appliance to respond with multiple IP
addresses, or configuring a Backup IP address for a GSLB domain. You can also divert excess traffic to
a backup virtual server by using spillover.
Configuring a backup entity for a GSLB virtual server ensures that DNS traffic to a site is not interrupted
if the GSLB virtual server goes down. The backup entity can be another GSLB virtual server, or it can be
a backup IP address. With a backup entity configured, if the primary GSLB virtual server goes down,
the backup entity handles DNS requests. To specify what should happen when the primary GSLB
virtual server comes back up again, you can configure the backup entity to continue handling traffic
until you manually enable the primary virtual server to take over (using the disablePrimaryOnDown
option), or you can configure a timeout period after which the primary takes over.
Note: You can configure a single backup entity as a backup for multiple GSLB virtual server.
If you configure both the timeout and the disablePrimaryOnDown option for the backup entity, the
backup session time-out takes precedence over the disablePrimaryOnDown setting.
To configure a backup GSLB virtual server by using the command line interface
At the command prompt, type the following commands to configure a GSLB virtual server as a backup
virtual server and verify the configuration:
Example:
To set GSLB virtual server as a backup virtual server by using the configuration utility
1. Navigate to Traffic Management > GSLB > Virtual Servers, and double-click the GSLB virtual
server.
2. Click the Backup Virtual Server section and select the backup virtual server.
A typical DNS response contains the IP address of the best performing GSLB service. However, if you
enable multiple IP response (MIR), the NetScaler appliance sends the best GSLB service as the first
record in the response and adds the remaining active services as additional records. If MIR is disabled
(the default), the NetScaler appliance sends the best service as the only record in the response.
To configure a GSLB virtual server for multiple IP responses by using the command line
interface
At the command prompt, type the following commands to configure a GSLB virtual server for multiple
IP responses and verify the configuration:
Example:
To set a GSLB virtual server for multiple IP responses by using the configuration utility
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual
server for which you want to configure a backup virtual server (for example, vserver-GSLB-1).
2. On the Advanced tab, under When this VServer is “UP,” select the Send all “active” service IP in
response (MIR) check box, and click OK.
Configuring a GSLB Virtual Server to Respond with an Empty Address Record When
DOWN
A DNS response can contain either the IP address of the requested domain or an answer stating that
the IP address for the domain is not known by the DNS server, in which case the query is forwarded
to another name server. These are the only possible responses to a DNS query.
When a GSLB virtual server is disabled or in a DOWN state, the response to a DNS query for the GSLB
domain bound to that virtual server contains the IP addresses of all the services bound to the virtual
server. However, you can configure the GSLB virtual server to in this case send an empty down re-
sponse (EDR). When this option is set, a DNS response from a GSLB virtual server that is in a DOWN
state does not contain IP address records, but the response code is successful. This prevents clients
from attempting to connect to GSLB sites that are down.
Note: You must configure this setting for each virtual server to which you want it to apply.
To configure a GSLB virtual server for empty down responses by using the command line
interface
Example:
To set a GSLB virtual server for empty down responses by using the configuration utility
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual
server for which you want to configure a backup virtual server (for example, vserver-GSLB-1).
2. On the Advanced tab, under When this VServer is “Down,” select the Do not send any service’s
IP address in response (EDR) check box.
3. Click OK.
You can configure a backup site for your GSLB configuration. With this configuration in place, if all of
the primary sites go DOWN, the IP address of the backup site is provided in the DNS response.
Typically, if a GSLB virtual server is active, that virtual server sends a DNS response with one of the
active site IP addresses as selected by the configured GSLB method. If all the configured primary sites
in the GSLB virtual server are inactive (in the DOWN state), the authoritative domain name system
(ADNS) server or DNS server sends a DNS response with the backup site’s IP address.
To set a backup IP address for a domain by using the command line interface
At the command prompt, type the following commands to set a backup IP address and verify the con-
figuration:
Example:
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual
server to which you want to bind the backup domain (for example, vserver-GSLB-1).
2. Click the Domains section, configure the GSLB domain and specify the IP address of the backup
domain in the Backup IP field.
Once the number of connections to a primary GSLB virtual server exceeds the configured threshold
value, you can use the spillover option to divert new connections to a backup GSLB virtual server. This
threshold value can be calculated dynamically or set manually. Once the number of connections to
the primary virtual server drops below the threshold, the primary GSLB virtual server resumes serving
client requests.
You can configure persistence with spillover. When persistence is configured, new clients are diverted
to the backup virtual server if that client is not already connected to a primary virtual server. When
persistence is configured, connections that were diverted to the backup virtual server are not moved
back to the primary virtual server after the number of connections to the primary virtual server drops
below the threshold. Instead, the backup virtual server continues to process those connections until
they are terminated by the user. Meanwhile, the primary virtual server accepts new clients.
The threshold can be measured either by the number of connections or by the bandwidth.
If the backup virtual server reaches the configured threshold and is unable to take any additional load,
the primary virtual server diverts all requests to the designated redirect URL. If a redirect URL is not
configured on the primary virtual server, subsequent requests are dropped.
The spillover feature prevents the remote backup GSLB service (backup GSLB site) from getting
flooded with client requests when the primary GSLB virtual server fails. This occurs when a monitor
is bound to a remote GSLB service, and the service experiences a failure that causes its state to go
DOWN. The monitor continues to keep the state of the remote GSLB service UP, however, because of
the spillover feature.
As part of the resolution to this problem, two states are maintained for a GSLB service, the primary
state and effective state. The primary state is the state of the primary virtual server and the effective
state is the cumulative state of the virtual servers (primary and backup chain). The effective state is
set to UP if any of the virtual servers in the chain of virtual servers is UP. A flag that indicates that the
primary VIP has reached the threshold is also provided. The threshold can be measured by either the
number of connections or the bandwidth.
A service is considered for GSLB only if its primary state is UP. Traffic is directed to the backup GSLB
service only when all the primary virtual servers are DOWN. Typically, such deployments will have
only one backup GSLB service.
Adding primary and effective states to a GSLB service has the following effects:
• When source IP persistence is configured, the local DNS is directed to the previously selected site
only if the primary virtual server on the selected site is UP and below threshold. Persistence can
be ignored in the round robin mode.
• If cookie-based persistence is configured, client requests are redirected only when the primary
virtual server on the selected site is UP.
• If the primary virtual server has reached its saturation and the backup VIP(s) is absent or down,
the effective state is set to DOWN.
• If external monitors are bound to an HTTP-HTTPS virtual server, the monitor decides the pri-
mary state.
• If there is no backup virtual server to the primary virtual server and the primary virtual server
has reached its threshold, the effective state is set to DOWN.
To configure a backup GSLB virtual server by using the command line interface
At the command prompt, type the following commands to configure a backup GSLB virtual server and
verify the configuration:
Example:
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the virtual server
that you want to configure as a backup (for example, Vserver-LB-1).
2. Click the SpillOver section and set the following parameters:
• Method— soMethod
• Threshold— soThreshold
• Persistence Time-out (min) — soPersistenceTimeout
3. Select the Persistence option and click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Disaster recovery capability is critical, because downtime is costly. A NetScaler appliance configured
for GSLB forwards traffic to the least-loaded or the best-performing data center. This configuration,
referred to as an active-active setup, not only improves performance, but also provides immediate
disaster recovery by routing traffic to other data centers if a data center that is part of the setup goes
down. Alternatively, you can configure an active-standby GSLB setup for disaster recovery only.
A conventional disaster recovery setup includes an active data center and a standby data center. The
standby data center is a remote site. When a failover occurs as a result of a disaster event that causes
the primary active data center to be inactive, the standby data center becomes operational.
Configuring disaster recovery in an active-standby data-center setup consists of the following tasks.
Once you have configured the primary data center, replicate the configuration for the backup data
center and designate it as the standby GSLB site by designating a GSLB virtual server at that site as
the backup virtual server.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
To designate the standby GSLB site by using the command line interface
At both the active site and the remote site, at the command prompt, type:
Example:
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the GSLB virtual
server for the primary site.
2. Click the Backup Virtual Server section and select a backup virtual server.
By default, once the primary virtual server becomes active, it starts receiving traffic. However, if you
want the traffic to be directed to the backup virtual server even after the primary virtual server be-
comes active, use the
‘disable primary on down’ option.
An active-active GSLB deployment, in which both GSLB sites are active, removes any risk that may
arise in having a standby data center. With such a setup, web or application content can be mirrored in
geographically separate locations. This ensures that data is consistently available at each distributed
data center.
To configure GSLB for disaster recovery in an active-active data center set up, you must first configure
the basic GSLB setup on the first data center and then configure all other data centers.
First create at least two GSLB sites. Then, for the local site, create a GSLB virtual server and GSLB
services and bind the services to the virtual server. Then create ADNS services and bind the domain
for which you are configuring GSLB to the GSLB virtual server in the local site. Finally, at the local site,
create a load balancing virtual server with the same virtual server IP address as the GSLB service.
Once you have configured the first data center, replicate the configuration for other data centers part
of the setup.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
When you configure GSLB to use the weighted round robin method, weights are added to the GSLB
services and the configured percentage of incoming traffic is sent to each GSLB site. For example, you
can configure your GSLB setup to forward 80 percent of the traffic to one site and 20 percent of the
traffic to another. After you do this, the NetScaler appliance will send four requests to the first site for
each request that it sends to the second.
To set up the weighted round robin method, first create two GSLB sites, local and remote. Next, for the
local site create a GSLB virtual server and GSLB services, and bind the services to the virtual server.
Configure the GSLB method as round robin. Next, create ADNS services and bind the domain for which
you are configuring GSLB to the GSLB virtual server. Finally, create a load balancing virtual server with
the same virtual server IP address as the GSLB service.
Each service that represents a physical server in the network has weights associated with it. Therefore
the GSLB service is assigned a dynamic weight that is the sum of weights of all services bound to
it. Traffic is then split between the GSLB services based on the ratio of the dynamic weight of the
particular service to the total weight. You can also configure individual weights for each GSLB service
instead of the dynamic weight.
If the services do not have weights associated with them, you can configure the GSLB virtual server to
use the number of services bound to it to calculate the weight dynamically.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
Once you configure a basic GSLB setup, you must configure the weighted round robin method such
that the traffic is split between the configured GSLB sites according to the weights configured for the
individual services.
To configure a virtual server to assign weights to services by using the command line interface
At the command prompt, type one of the following commands, depending upon whether you want to
create a new load balancing virtual server or configure an existing one:
Example:
Example:
To add weights to the GSLB services by using the command line interface
Example:
To configure a virtual server to assign weights to services by using the configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and double-click the virtual
server (for example, Vserver-LB-1).
2. Click the Services section and set the weight of a service.
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the virtual server (for
example, vserver-GSLB-1)
2. Click the Services section and set the weight of the service in the Weight field.
1. Navigate to Traffic Management > GSLB > Virtual Servers and double-click the virtual server (for
example, vserver-GSLB-1).
2. Click the Method section and, from the Dynamic Weight drop-down list select SER-
VICEWEIGHT.
Data center persistence is required for web applications that require maintaining a connection with
the same server instead of having the requests load balanced. For example, in an e-commerce portal,
maintaining a connection between the client and the same server is critical. For such applications,
HTTP redirect persistence can be configured in an active-active setup.
To configure GSLB for disaster recovery with data center persistence, you must first configure the basic
GSLB set up and then configure HTTP redirect persistence.
First create two GSLB sites, local and remote. Next, for the local site, create a GSLB virtual server and
GSLB services and bind the services to the virtual server. Next, create ADNS services and bind the
domain for which you are configuring GSLB to the GSLB virtual server at the local site. Next, create
a load balancing virtual server with the same virtual server IP address as the GSLB service. Finally,
duplicate the previous steps for the remote configuration, or configure the NetScaler appliance to
autosynchronize your GSLB configuration.
For details on how to configure a basic GSLB setup, see Configuring GSLB Entities Individually.
Once you have configured a basic GSLB setup, configure HTTP redirect precedence to enable data
center persistence.
At the command prompt, type the following commands to configure HTTP redirect and verify the con-
figuration:
Example:
1. Navigate to Traffic Management > GSLB > Services and double-click the GSLB service to be con-
figured.
2. Click the Site Persistence section, select the HTTPRedirect option, and in the Site Prefix text
box, enter the site prefix (for example, vserver-GSLB-1).
Note
When site persistence is not configured and if a load balancing virtual server that is configured as
a local GSLB service is DOWN, the HTTP requests are redirected to other healthy GSLB sites using
a 302 redirect.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You might want to direct traffic from a local DNS (LDNS) server or network to a GSLB service other than
the GSLB service that the static proximity method selects for that traffic. That is, you have a
preferred location for that traffic. To override the static proximity method with preferred locations,
you can do the following:
1. Configure a DNS action that consists of a list of preferred locations. For more information about
configuring a DNS action, see Configuring a DNS Action.
2. Configure a DNS policy to identify the traffic arriving from the LDNS server or network for which
you want to override static proximity, and apply the action in the policy.
3. Bind the policy to the global request bind point.
In the DNS action, you can configure a list of up to 8 preferred locations. The locations must be pro-
vided in the dotted qualifier notation, which is the notation in which you add custom locations to the
static proximity database. The locations can include wildcards for qualifiers that you want to omit. For
information about the dotted qualifier notation for locations, see Adding Custom Entries to a Static
Proximity Database. When entering the preferred locations, you must enter them in the descending
order of priority.
• If all the non-wildcard qualifiers in a preferred location match the corresponding qualifiers in
the location of a GSLB service, the match is considered a perfect match. For example, a GSLB
service location of .UK..* or Europe.UK.. is a perfect match for the preferred location .UK..*.
• If only a subset of the non-wildcard qualifiers match, the match is considered a partial match.
For example, a GSLB service location of Europe.EG is a partial match for the preferred location
Europe.UK.
1. The appliance evaluates the preferred location that has the highest priority and moves down
the priority order until a perfect match is found between a preferred location and the location
of a GSLB service.
If a perfect match is found, the appliance checks whether the corresponding GSLB service is
up. If it is up, it returns the IP address of the GSLB service in the DNS response. If multiple per-
fect matches are found (which can happen when one or more wildcards are used in a preferred
location), the appliance checks the state of each of the corresponding GSLB services and load
balances the GSLB services that are up.
2. If a perfect match is not found for any of the preferred locations, the appliance returns to the
preferred location that has the highest priority and moves down the priority order until a partial
match is found between a preferred location and the location of a GSLB service.
If a partial match is found, the appliance checks whether the corresponding GSLB service is up.
If it is up, it returns the IP address of the GSLB service in the DNS response. If multiple partial
matches are found, the appliance checks the state of each of the corresponding GSLB services
and load balances the GSLB services that are up.
3. If none of the perfect and partial matches are up, the appliance load balances all other available
GSLB services.
In this way, the appliance implements a type of site affinity for traffic that matches the DNS
policy.
Example
Consider a GSLB configuration that consists of the following eight GSLB services:
• Asia.IN
• Asia.JPN
• Asia.HK
• Europe.UK
• Europe.RU
• Europe.EG
• Africa.SD
• Africa.ZMB
1. The appliance attempts to find a GSLB service whose location is a perfect match for Asia.HK,
which is the preferred location that has the highest priority. It finds that the GSLB service at
Asia.HK is a perfect match. If the GSLB service is up, it sends the client the IP address of the
GSLB service.
2. If the GSLB service at Asia.HK is down, the appliance attempts to find a perfect match for the
second preferred location, Europe.UK. It finds that the GSLB service at Europe.UK is a perfect
match. If the GSLB service is up, it sends the client the IP address of the service.
3. If the GSLB service at Europe.UK is down, it returns to the preferred location that has the highest
priority, Asia.HK, and looks for partial matches. For Asia.HK, it finds that Asia.IN and Asia.JPN
are partial matches. If only one of the corresponding GSLB services is up, it sends the client the
IP address of the service. If both locations are up, it load balances the two services.
4. If all partial matches for Asia.HK are down, the appliance looks for partial matches for Eu-
rope.UK. It finds that Europe.RU and Europe.EG are partial matches for the preferred location.
If only one of the corresponding GSLB services is up, it sends the client the IP address of the
service. If both locations are up, it load balances the two services.
5. If all partial matches for Europe.UK are down, the appliance load balances all other available
GSLB services. In the current example, the appliance load balances Africa.SD and Africa.ZMB
because the remaining six GSLB services have been found to be down.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
In a typical GSLB deployment, you can prioritize the selection of a set of GSLB services bound to a
GSLB virtual server, but you cannot do the following:
• Restrict the selection of a GSLB service from a subset of GSLB services bound to a GSLB virtual
server for the given domain.
• Apply different load balancing methods on the different subsets of GSLB services in the deploy-
ment.
• Apply spillover policies on a subset of GSLB services, and you cannot have a backup for a subset
of GSLB services.
• Configure a subset of GSLB services to serve different content. That is, you cannot content
switch between servers in different GSLB sites. The GSLB configuration assumes that the
servers contain the same content.
• Define a subset GSLB services with different priorities and specify an order in which the services
in the subset are applied to a request.
You can now configure a content switching (CS) policy to customize the GSLB deployment. First con-
figure a set of GSLB services and bind it to a GSLB virtual server. Then, configure a CS virtual server
of target type GSLB, define a CS policy and action with the GSLB virtual server as target virtual server,
and bind the CS policy to CS virtual server.
Important
• Only CS policies with DNS based expressions can be bound to a CS virtual server of target
type GSLB.
• If a GLSB service is bound to a CS virtual server through a GSLB virtual server, you cannot
bind another GSLB virtual server bound with the same GSLB service to the CS virtual server.
Example
Consider a GLSB deployment that includes two GSLB sites. At each site, four GSLB services (S-1, S-2,
S-3, and S-4) are bound to GSLB virtual server VS-1. You can configure a content switching (CS) virtual
server of target type GSLB and define a CS policy and action with VS-1 as the target virtual server, so
that requests for content in English are served only by S-1 and S-2, and requests for content in the
local language are served only by S-3 and S-4.
You could give S-1 priority by configuring a backup virtual server to VS-1 and binding S-2 to the backup
virtual server. Client requests would then be served by S-1 unless the server it represents went down,
in which case the requests would be served by S-2. If both S-1 and S-2 were down, clients would receive
an empty response.
1. Configure GSLB. For instructions, see Configuring Global Server Load Balancing.
2. Configure a Content Switching (CS) virtual server of target type GSLB. For more information, see
Creating Content Switching Virtual Servers..
3. Configure Content Switching (CS) policies. For more information, see Configuring Content
Switching Policies.
4. Configure CS actions that designate a GSLB virtual server as the target virtual server. For more
information, see Configuring a Content Switching Action.
5. Bind the CS policies to the CS virtual server. For more information, see Binding Policies to a
Content Switching Virtual Server.
6. Bind the domain to the CS virtual server instead of the GSLB virtual server.
Sample Configuration
The following sample configuration sends requests from the client with IP address 5.5.5.5 to SER-
VICE_GSLB1 and SERVICE_GSLB2. SERVICE_GSLB1 has a higher priority than SERVICE_GSLB2, and
SERVICE_GSLB2 serves the client requests only when SERVICE_GSLB1 is down. If both SERVICE_GSLB1
and SERVICE_GSLB2 are down, SERVICE_GSLB3 and service-GSLB4 are not considered, and a blank
response is sent to the client.
2 Done
3 add gslb vs VSERVER_GSLB1 http
4 Done
5 add gslb vs VSERVER_GSLB2 http
6 Done
7 add gslb vs VSERVER_GSLB_BACKUP1 http
8 Done
9 set gslb vs VSERVER_GSLB1 -backupvserver VSERVER_GSLB_BACKUP1
10 Done
11 add gslb service SERVICE_GSLB1 1.1.1.1 HTTP 80 -sitename site1
12 Done
13 add gslb service SERVICE_GSLB2 1.1.1.2 HTTP 80 -sitename site1
14 Done
15 add gslb service SERVICE_GSLB3 1.1.1.3 HTTP 80 -sitename site2
16 Done
17 add gslb service SERVICE_GSLB4 1.1.1.4 HTTP 80 -sitename site2
18 Done
19 bind gslb vs VSERVER_GSLB1 -servicename SERVICE_GSLB1
20 Done
21 bind gslb vs VSERVER_GSLB_BACKUP1 -servicename SERVICE_GSLB2
22 Done
23 bind gslb vs VSERVER_GSLB2 -servicename SERVICE_GSLB3
24 Done
25 bind gslb vs VSERVER_GSLB2 -servicename SERVICE_GSLB4
26 Done
27 add cs action a1 -targetvserver VSERVER_GSLB1
28 Done
29 add cs policy p1 -rule ”CLIENT.IP.SRC.EQ(5.5.5.5)” -action a1
30 Done
31 bind cs vs CSVSERVER_GSLB -domainName www.abc.com
32 Done
33 bind cs vs CSVSERVER_GSLB -policyname p1 -priority 1
34 Done
35 add cs action a2 -targetvserver VSERVER_GSLB2
36 Done
37 add cs policy p2 -rule ”CLIENT.IP.SRC.EQ(6.6.6.6)” -action a2
38 Done
39 bind cs vs CSVSERVER_GSLB -policyname p2 -priority 2
40 Done
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
In a typical Global Server Load Balancing (GSLB) deployment, the NetScaler appliance receives DNS
queries for A/AAAA records, selects the most appropriate GSLB service according to the configured
load balancing method, and returns the service’s IP address as a reply to the DNS query. You can now
configure the appliance to receive DNS queries for NAPTR records and respond with the list of services
configured for a domain. The appliance also monitors the health of the services, and in the response
it provides a list of only the services that are up.
Example:
In Telco deployments, you can configure a NetScaler appliance to receive DNS queries with NAPTR
records from clients such as mobile management entities (MMEs), which play the role of a DNS resolver
to discover all the services that are offered by the domain name. The appliance responds to the query
with NAPTR records for all the services that are up. The MME can use this NAPTR response to run the
S-NAPTR procedure to select the nodes on the basis of the service offered, colocation, topological
closeness, and so on.
If multiple nodes qualify for selection, the MME can use the preference field in the NAPTR record from
the NetScaler appliance to determine the node.
While responding to a DNS query with NAPTR record, a NetScaler appliance constructs a response
NAPTR record for each GSLB service.
Field
Field
Configuration procedure
For detailed GSLB configuration instructions, see Configuring Global Server Load Balancing (GSLB).
Make sure that you do the following:
• Set the following parameters while adding the GSLB virtual server:
– serviceType: ANY
– dnsRecordType: NAPTR
– lbMethod: CUSTOMLOAD
Example:
• While adding a GSLB site, set the naptrReplacementSuffix parameter to the domain name that
you want to embed in the NAPTR records.
Example:
– naptrreplacement
– naptrOrder
– naptrServices
– naptrDomainTTL
– naptrPreference
Sample configuration
30
31 bind gslb service sgw1 -monitorName ping
32
33 Done
34
35 bind gslb service sgw2 -monitorName ping
36
37 Done
38
39 bind gslb service sgw3 -monitorName ping
40
41 Done
42
43 bind gslb vserver gslb_vs -domainName gslb.com -TTL 5
44
45 Done
Note
DNS queries with NAPTR records are not supported in parent-child configuration.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
EDNS Client Subnet (ECS) is a DNS header extension that provides the client subnet details. You can
use these details to improve the accuracy of NetScaler Global Server Load Balancing (GSLB) by using
the client network location rather than the DNS resolver location to determine the topological close-
ness of the client.
Note
Important:
Make sure that the LDNS in your deployment supports EDNS0 Client Subnet so that the incoming
DNS queries contains the EDNS0 Client Subnet option and the NetScaler appliance uses the ECS
address while processing the DNS query.
In a typical GSLB deployment, when you use proximity-based load balancing methods like static prox-
imity or dynamic round-trip time (RTT), the NetScaler appliance uses the local DNS (LDNS) IP ad-
dress for determining the topological closeness of the client and performs GSLB accordingly. But
when a centralized DNS resolver, such as Google DNS or OpenDNS, is involved in the deployment,
the NetScaler appliance sends the DNS request to a datacenter close to the centralized DNS resolver,
which might not be close to the client. For example, in a typical NetScaler GSLB deployment using
the static proximity load balancing method, an end-user request from Japan is sent to a datacenter in
Japan and an end user request from California is sent to a datacenter in California. But if a centralized
DNS resolver is involved, the NetScaler appliance might send a request from Japan to a datacenter in
California.
You can use the ECS option in deployments that include the NetScaler appliance configured as Au-
thoritative DNS (ADNS) server for a GSLB domain. If you use static proximity as the load balancing
method, you can use the IP subnet in the EDNS header instead of the LDNS IP address to determine
the geographical proximity of the client. In the case of proxy mode deployment, the NetScaler appli-
ance forwards an ECS-enabled DNS query as-is to the back-end servers, and the appliance does not
cache ECS-enabled DNS responses.
Note
The ECS option is not applicable for all other deployment modes, such as ADNS mode for non-
GSLB domains, resolver mode, and forwarder mode. In all these modes, the ECS option is ig-
nored by the NetScaler appliance. Also, by default, ECS is disabled for GSLB deployment.
To enable EDNS0 Client Subnet option by using the command line interface:
Address validation
You can configure a GSLB virtual server to verify that the address returned by the EDNS0 Client Subnet
(ECS) option of the DNS query is not a private or an unroutable IP address. With address validation
enabled, the NetScaler appliance ignores the ECS address in the DNS query if it is listed in the following
table, and instead uses the LDNS IP address for global server load balancing.
Note
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
Consider the following parent-child topology in which the GSLB sites are distributed globally.
The following commands illustrate the complete configuration of the parent-child topology.
site1
22
23 bind gslb vserver gv1 -serviceName site1_child1_http_gsvc1
24
25 bind gslb vserver gv1 -serviceName site1_child2_http_gsvc1
26
27 bind gslb vserver gv1 -serviceName site2_child2_http_gsvc1
28
29 bind gslb vserver gv1 -serviceName site2_child1_http_gsvc1
30
31 bind gslb vserver gv1 -domainName www.gslb.com -TTL 5
site1_child1
You can add the following commands for load balancing configuration:
site1_child2
site2
site2_child1
You can add the following commands for load balancing configuration:
site2_child2
You can add the following commands for load balancing configuration:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
Link load balancing (LLB) balances outbound traffic across multiple Internet connections provided by
different service providers. LLB enables the NetScaler applianace appliance to monitor and control
traffic so that packets are transmitted seamlessly over the best possible link. Unlike with server load
balancing, where a service represents a server, with LLB, a service represents a router or the next hop.
A link is a connection between the NetScaler applianace and the router.
To configure link load balancing, many users begin by configuring a basic setup with default set-
tings. Configuring a basic setup involves configuring services, virtual servers, monitors, routes, an
LLB method, and, optionally, configuring persistence. Once a basic setup is operational, you can
customize it for your environment.
Load balancing methods that are applicable to LLB are round robin, destination IP hash, least band-
width, and least packets. You can optionally configure persistence for connections to be sustained on
a specific link. The available persistence types are source IP address-based, destination IP address-
based, and source IP and destination IP address-based. PING is the default monitor but configuring a
transparent monitor is recommended.
You can customize your setup by configuring reverse NAT (RNAT) and backup links.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
To configure LLB, you first create services representing each router to the Internet Service Providers
(ISPs). A PING monitor is bound by default to each service. Binding a transparent monitor is optional
but recommended. Then, you create a virtual server, bind the services to the virtual server, and config-
ure a route for the virtual server. The route identifies the virtual server as the gateway to the physical
routers represented by the services. The virtual server selects a router by using the load balancing
method that you specify. Optionally, you can configure persistence to make sure that all traffic for a
particular session is sent over a specific link.
• Configure services
Configure services
A default monitor (PING) is automatically bound to a service type of ANY when the service is created,
but you can replace the default monitor with a transparent monitor, as described in “
Creating and Binding a Transparent Monitor.”
Example:
Navigate to Traffic Management > Load Balancing > Services, and create a service.
3. In the Create Service dialog box, specify values for the following parameters:
• Service Name*—name
• Server—IP
• Protocol*—serviceType (Select ANY from the drop-down list.)
• Port*—port
A required parameter
1. Click Create.
3. Click Close.
4. In the Services pane, select the services that you just configured and verify that the settings
displayed at the bottom of the screen are correct.
After you create a service, create a virtual server and bind services to the virtual server. The default LB
method of least connections is not supported in LLB. For information about changing the LB method,
see “
Configuring the LLB Method and Persistence.”
To create a link load balancing virtual server and bind a service by using the command line
interface
Example:
To create a link load balancing virtual server and bind a service by using the configuration
utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers, and create a virtual server
for link load balancing. Specify ANY in the Protocol field.
Note: Make sure that
Directly Addressable is unchecked.
2. Under the Services tab, in the Active column, select the check box for the service that you want
to bind to the virtual server.
By default, the Citrix ADC appliance uses the least connections method to select the service for redi-
recting each client request, but you should set the LLB method to one of the supported methods. You
can also configure persistence, so that different transmissions from the same client are directed to
the same server.
To configure the LLB method and/or persistence by using the command line interface
Example:
To configure the link load balancing method and/or persistence by using the configuration
utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and select the virtual server
for which you want to configure the load balancing method and/or persistence settings.
2. In the Advanced Settings section, select Method and configure the load balancing method.
3. In the Advanced Settings section, select Persistence and configure the persistence parameters.
2
3 show lb route [<network> <netmask>]
Example:
Example:
1 add lb route6 ::/0 llb6_vs show lb route6 Network VIP Flags -----------
--------- -------- 1) ::/0 llb6_vs UP
Navigate to System > Network > Routes, and select LLB, and configure the LLB route.
3. In the Create LB Route or Create LB IPV6 Routedialog box, set the following parameters:
• Network*
• Netmask*—Required for IPV4 routes.
• Gateway Name*—gatewayName
A required parameter
1. Click Create, and then click Close. The route that you just created appears on the LLB or the
LLB6 tab in the Routes pane.
The following diagram shows a basic LLB setup. A service is configured for each of the two links (ISPs)
and PING monitors are bound by default to these services. A link is selected based on the LLB method
configured.
Note
If your Internet service provider has provided an IPv6 address, replace the IPv4 service with an
IPv6 service in the above figure.
You create a transparent monitor to monitor the health of upstream devices, such as routers. You can
then bind the transparent monitor to services. The default PING monitor monitors the connectivity
only between the Citrix ADC appliance and the upstream device. The transparent monitor monitors all
the devices existing in the path from the appliance to the device that owns the destination IP address
specified in the monitor. If a transparent monitor is not configured and the status of the router is
UP but one of the next hop devices from that router is down, the appliance includes the router while
performing load balancing and forwards the packet to the router. However, the packet is not delivered
to the final destination because one of the next hop devices is down. By binding a transparent monitor,
if any of the devices (including the router) are down, the service is marked as DOWN and the router is
not included when the appliance performs link load balancing.
Example:
Navigate to Traffic Management > Load Balancing > Monitors and configure a transparent monitor.
• Name*
• Type*
• Destination IP
• Transparent
A required parameter
2. In the Monitors pane, select the monitor that you just configured and verify that the settings
displayed in the Details pane are correct.
Example:
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
You can configure an LLB setup for reverse network address translation (RNAT) for outbound traffic.
This ensures that the return network traffic for a specific flow is routed through the same path. First
configure basic LLB, as described in
“Configuring a Basic LLB Setup”, and then configure RNAT. You must then enable use subnet IP (USNIP)
mode.
To add SNIPs for ISP routers by using the command line interface
Example:
Example:
Note
You can also configure RNAT by using Access Control Lists (ACLs). Refer Configuring RNAT for
details.
Example:
1. Navigate to System > Settings and, under Modes and Features, click Configure Modes.
2. In the Configure Modes dialog box, select Use Subnet IP, and then click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
To prevent disruption in services when the primary route is down, you can configure a backup route.
Once the backup route is configured, the NetScaler appliance automatically uses it when the primary
route fails. First create a primary virtual server as described in “Configuring an LLB Virtual Server and
Binding a Service.” To configure a backup route, create a secondary virtual server similar to a primary
virtual server and then designate this virtual server as a backup virtual server (route).
In the following diagram, Router-vip is the primary virtual server, and Backup_Router-vip is the sec-
ondary virtual server designated as the backup virtual server.
Note: If your Internet service provider has provided an IPv6 address, replace the IPv4 service with an
IPv6 service in the above figure.
By default, all traffic is sent through the primary route. However, when the primary route fails, all
traffic is diverted to the backup route as shown in the following diagram.
Note: If your Internet service provider has provided an IPv6 address, replace the IPv4 service with an
IPv6 service in the above figure.
To set the secondary virtual server as the backup virtual server by using the command
line interface
Example:
To set the secondary virtual server as the backup virtual server by using the
configuration utility
1. Navigate to Traffic Management > Load Balancing > Virtual Servers and select the secondary
virtual server for which you want to configure the backup virtual server.
2. In the Load Balancing Virtual Server dialog box, under Advanced, select Protection.
3. In the Backup Virtual Server drop-down list, select the secondary backup virtual server, and
then click OK.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In the following diagram, there are two networks: 30.30.30.0 and 30.30.31.0. Link load balancing is
configured based on the destination IP address. Two routes are configured with gateways Router1-vip
and Router2-vip, respectively. Router1-vip is configured as a backup to Router2-vip and vice versa.
All traffic with the destination IP specified as 30.30.30.30 is sent through Router1-vip and traffic with
the destination IP specified as 30.30.31.31 is sent through Router2-vip.
Note: If your Internet service provider has provided an IPv6 address, replace the IPv4 service with an
IPv6 service in the above figure.
However, if any one of the gateways (Router1-vip or Router2-vip) is DOWN, traffic is routed through
the backup router. In the following diagram, Router1-vip for ISP1 is DOWN, so all traffic with the des-
tination IP specified as 30.30.30.30 is also sent through ISP2.
Note: If your Internet service provider has provided an IPv6 address, replace the IPv4 service with an
IPv6 service in the above figure.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
After the configuration is up and running, you should view the statistics for each service and virtual
server to check for possible problems.
To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of
the virtual servers configured on the NetScaler appliance. You can display a summary of statistics for
all the virtual servers, or you can specify the name of a virtual server to display the statistics only for
that virtual server. You can display the following details:
• Name
• IP address
• Port
• Protocol
• State of the virtual server
• Rate of requests received
• Rate of hits
To display a summary of the statistics for all the virtual servers currently configured on the NetScaler,
or for a single virtual server, at the command prompt, type:
Example:
10 Done
1. Navigate to Traffic Management > Load Balancing > Virtual Servers > Statistics.
2. If you want to display the statistics for only one virtual server, in the details pane, select the
virtual server, and click Statistics.
You can view the rate of requests, responses, request bytes, response bytes, current client connec-
tions, requests in surge queue, current server connections, and so forth using the service statistics.
Example:
1. Navigate to Traffic Management > Load Balancing > Services > Statistics.
2. If you want to display the statistics for only one service, select the service, and click Statistics.
1.
2. Citrix ADC
3. NetScaler 12.0
Load Balancing
Contributed by:
C
The load balancing feature distributes user requests for web pages and other protected applications
across multiple servers that all host (or mirror) the same content. You use load balancing primarily
to manage user requests to heavily used applications, preventing poor performance and outages and
ensuring that users can access your protected applications. Load balancing also provides fault toler-
ance; when one server that hosts a protected application becomes unavailable, the feature distributes
user requests to the other servers that host the same application.
• Distribute all requests for a specific protected website, application, or resource between two or
more identically configured servers.
• Use any of several different algorithms to determine which server should receive each incom-
ing user request, basing the decision on different factors, such as which server has the fewest
current user connections or which server has the lightest load.
The load balancing feature is a core feature of the NetScaler appliance. Most users first set up a work-
ing basic configuration and then customize various settings, including persistence for connections. In
addition, you can configure features for protecting the configuration against failure, managing client
traffic, managing and monitoring servers, and managing a large scale deployment.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
In a basic load balancing setup, clients send their requests to the IP address of a virtual server config-
ured on the NetScaler appliance. The virtual server distributes them to the load-balanced application
servers according to a preset pattern, called the load balancing algorithm. In some cases, you might
want to assign the load balancing virtual server a wildcard address instead of a specific IP address.
For instructions about specifying a global HTTP port on the appliance, see Global HTTP Ports.
A load balancing setup includes a load-balancing virtual server and multiple load-balanced applica-
tion servers. The virtual server receives incoming client requests, uses the load balancing algorithm to
select an application server, and forwards the requests to the selected application server. The follow-
ing conceptual drawing illustrates a typical load balancing deployment. Another variation involves
assigning a global HTTP port.
The load balancing virtual server can use any of a number of algorithms (or methods) to determine
how to distribute load among the load-balanced servers that it manages. The default load balancing
method is the least connection method, in which the NetScaler appliance forwards each incoming
client connection to whichever load-balanced application server currently has the fewest active user
connections.
The entities that you configure in a typical NetScaler load balancing setup are:
• Load balancing virtual server. The IP address, port, and protocol combination to which a
client sends connection requests for a particular load-balanced website or application. If the
application is accessible from the Internet, the virtual server IP (VIP) address is a public IP ad-
dress. If the application is accessible only from the local area network (LAN) or wide area net-
work (WAN), the VIP is usually a private (ICANN non-routable) IP address.
• Service. The IP address, port, and protocol combination used to route requests to a specific
load-balanced application server. A service can be a logical representation of the application
server itself, or of an application running on a server that hosts multiple applications. After
creating a service, you bind it to a load balancing virtual server.
• Server object. A virtual entity that enables you to assign a name to a physical server instead of
identifying the server by its IP address. If you create a server object, you can specify its name
instead of the server’s IP address when you create a service. Otherwise, you must specify the
server’s IP address when you create a service, and the IP address becomes the name of the
server.
• Monitor. An entity on the NetScaler appliance that tracks a service and ensures that it is oper-
ating correctly. The monitor periodically probes (or performs a health check on) each service to
which you assign it. If the service does not respond within the time specified by the time-out,
and a specified number of health checks fail, that service is marked DOWN. The NetScaler appli-
ance then skips that service when performing load balancing, until the issues that caused the
service to quit responding are fixed.
The virtual server, services, and load balanced application servers in a load balancing setup can use
either Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6) IP addresses. You can mix
IPv4 and IPv6 addresses in a single load balancing setup.
For variations in the load balancing setup, see the following use cases:
In a load balancing setup, the load balancing server is logically located between the client and the
server farm, and manages traffic flow to the servers in the server farm. On the NetScaler appliance, the
application servers are represented by virtual entities called services. The following diagram shows
the topology of a basic load balancing configuration.
In the diagram, load balancing is used to manage traffic flow to the servers. The virtual server selects
the service and assigns it to serve client requests. Consider a scenario where the services Service-
HTTP-1 and Service-HTTP-2 are created and bound to the virtual server named Vserver-LB-1. Vserver-
LB-1 forwards the client request to either Service-HTTP-1 or Service-HTTP-2. The NetScaler appliance
uses the least connection load balancing method to select the service for each request. The following
table lists the names and values of the basic entities that must be configured on the appliance.
The following diagram shows the load balancing sample values and mandatory parameters that are
described in the preceding table.
Figure 3. Load Balancing Entity Model
In some cases you might need to use a wildcard for the IP address or the port of a virtual server or for
the port of a service. The following cases may require using a wildcard:
• If the NetScaler appliance is configured as a transparent pass through, which must accept all
traffic that is sent to it regardless of the IP or port to which it is sent.
• If one or more services listen on ports that are not well known.
• If one or more services, over time, change the ports that they listen on.
• If you reach the limit for the number of IP addresses and ports that you can configure on a single
NetScaler appliance.
• If you want to create virtual servers that listen for all traffic on a specific virtual LAN.
When a wildcard-configured virtual server or service receives traffic, the NetScaler appliance deter-
mines the actual IP address or port and creates new records for the service and associated load bal-
anced application server. These dynamically created records are called dynamically learned server
and service records.
For example, a firewall load balancing configuration can use wildcards for both the IP address and
port. If you bind a wildcard TCP service to this type of load balancing virtual server, the virtual server
receives and processes all TCP traffic that does not match any other service or virtual server.
The following table describes some of the different types of wildcard configurations and when each
should be used.
Note: If you have configured your NetScaler appliance as a transparent pass through that makes use
of global (wildcard) ports, you may want to turn on Edge mode.
For more information, see “Configuring Edge Mode.”
The NetScaler appliance attempts to locate virtual servers and services by first attempting an exact
match. If none is found, it continues to search for a match based on wildcards, in the following order:
If the appliance is unable to select a virtual server by IP address or port number, it searches for a virtual
server on the basis of the protocol used in the request, in the following order:
1. HTTP
2. TCP
3. ANY
You do not configure services or virtual servers for a global HTTP port. Instead, you configure a specific
port by using the set ns param command. After configuring this port, the NetScaler appliance accepts
all traffic that matches the port number, and processes it as HTTP traffic, dynamically learning and
creating services for that traffic.
You can configure more than one port number as a global HTTP port. If you are specifying more than
one port number in a single set ns param command, separate the port numbers by a single white
space. If one or more ports have already been specified as global HTTP ports, and you want to add
one or more ports without removing the ports that are currently configured, you must specify all the
port numbers, current and new, in the command. Before you add port numbers, use the show ns
param command to view the ports that are currently configured.
At the command prompt, type the following commands to configure a global HTTP port and verify the
configuration:
Example 2: Adding ports when one or more global HTTP ports are already configured**
In this example, port 8888 is added to the global HTTP port list. Port 80 is already configured as a
global HTTP port.
26 ...
27 ...
28 Done
29 >
1. Navigate to System > Settings > Change HTTP Parameters, and then add an HTTP port number.
1.
2. Citrix ADC
3. NetScaler 12.0
June 7, 2019
Contributed by:
C
Before configuring your initial load balancing setup, enable the load balancing feature. Then begin by
creating at least one service for each server in the load balancing group. With the services configured,
you are ready to create a load balancing virtual server, and bind each service to the virtual server. That
completes the initial setup. Before proceeding with further configuration, verify your configuration to
make sure that each element was configured properly and is operating as expected.
You can configure load balancing entities such as services and virtual servers when the load balancing
feature is disabled, but they will not function until you enable the feature.
At the command prompt, type the following command to enable load balancing and verify the config-
uration:
• enable ns feature LB
• show ns feature
Example
Navigate to System > Settings and, in Configure Basic Features, select Load Balancing.
Create an entry for your server on the NetScaler appliance. THe NetScaler appliance supports IP ad-
dress based servers and domain-based servers. If you create an IP address based server, you can
specify the name of the server instead of its IP address when you create a service. For information
about setting up DNS for a domain-based server, see Domain Name System.
Example:
Navigate to Traffic Management > Load Balancing > Servers, and add a server object.
Configuring Services
After you enable the load balancing feature, you must create at least one service for each application
server that is to be included in your load balancing setup. The services that you configure provide
the connections between the NetScaler appliance and the load balanced servers. Each service has a
name and specifies an IP address, a port, and the type of data that is served.
If you create a service without first creating a server object, the IP address of the service is also the
name of the server that hosts the service. If you prefer to identify servers by name rather than IP
address, you can create server objects and then specify a server’s name instead of its IP address when
you create a service.
When you create a service that uses UDP as the transport layer protocol, a ping monitor is automati-
cally bound to the service. A ping monitor is the most basic of the built-in monitors. When you create a
service that uses TCP as the transport layer protocol, a TCP_default monitor is automatically bound to
the service. When you develop a strategy for managing your load balancing setup, you might decide
to bind a different type of monitor, or multiple monitors, to the service.
Creating a Service
Before you create a service, you need to understand the different service types and how each is used.
The following list describes the types of services supported on the NetScaler appliance.
HTTP
Used for load-balanced servers that accept HTTP traffic, such as standard websites and web appli-
cations. The HTTP service type enables the NetScaler appliance to provide compression, content fil-
tering, caching, and client keep-alive support for your Layer 7 web servers. This service type also
supports virtual server IP port insertion, redirect port rewriting, Web 2.0 Push, and URL redirection
support.
Because HTTP is a TCP-based application protocol, you can also use the TCP service type for web
servers. If you do so, however, the NetScaler appliance is able to perform only Layer 4 load balancing.
It cannot provide any of the Layer 7 supports described earlier.
SSL
Used for servers that accept HTTPS traffic, such as ecommerce websites and shopping cart applica-
tions. The SSL service type enables the NetScaler appliance to encrypt and decrypt SSL traffic (per-
form SSL offloading) for your secure web applications. It also supports HTTP persistence, content
switching, rewrite, virtual server IP port insertion, Web 2.0 Push, and URL redirection.
You can also use the SSL_BRIDGE, SSL_TCP, or TCP service types. If you do so, however, the appliance
performs only Layer 4 load balancing. It cannot provide SSL offloading or any of the Layer 7 supports
described above.
FTP
Used for servers that accept FTP traffic. The FTP service type enables the NetScaler appliance to sup-
port specific details of the FTP protocol.
You can also use TCP or ANY service types for FTP servers.
TCP
Used for servers that accept many different types of TCP traffic, or that accept a type of TCP traffic for
which a more specific type of service is not available.
You can also use the ANY service type for these servers.
SSL_TCP
Used for servers that accept non-HTTP-based SSL traffic, to support SSL offloading.
You can also use the TCP service type for these services. If you do so, the NetScaler appliance performs
both the Layer 4 load balancing and SSL offloading.
UDP
Used for servers that accept UDP traffic. You can also use the ANY service type.
SSL_BRIDGE
Used for servers that accept SSL traffic when you do not want the NetScaler appliance to perform SSL
offloading. Alternatively, you can use the SSL_TCP service type.
NNTP
Used for servers that accept Network News Transfer Protocol (NNTP) traffic, typically Usenet sites.
DNS
Used for servers that accept DNS traffic, typically nameservers. With the DNS service type, the
NetScaler appliance validates the packet format of each DNS request and response. It can also cache
DNS responses. You can apply DNS policies to DNS services.
You can also use the UDP service type for these services. If you do, however, the NetScaler appliance
can only perform Layer 4 load balancing. It cannot provide support for DNS-specific features.
ANY
Used for servers that accept any type of TCP, UDP, or ICMP traffic. The ANY parameter is used primarily
with firewall load balancing and link load balancing.
SIP-UDP
Used for servers that accept 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).
You can also use the UDP service type for these services. If you do, however, the NetScaler appliance
performs only Layer 4 load balancing. It cannot provide support for SIP-specific features.
DNS-TCP
Used for servers that accept DNS traffic, where the NetScaler appliance acts as a proxy for TCP traffic
sent to DNS servers. With services of the DNS-TCP service type, the NetScaler appliance validates
the packet format of each DNS request and response and can cache DNS responses, as with the DNS
service type.
You can also use the TCP service type for these services. If you do, however, the NetScaler appliance
only performs Layer 4 load balancing of external DNS name servers. It cannot provide support for any
DNS-specific features.
RTSP
Used for servers that accept Real Time Streaming Protocol (RTSP) traffic. RTSP provides delivery of
multimedia and other streaming data. Select this type to support audio, video, and other types of
streamed media.
You can also use the TCP service type for these services. If you do, however, the NetScaler appliance
performs only Layer 4 load balancing. It cannot parse the RTSP stream or provide support for RTSPID
persistence or RTSP NATting.
DHCPRA
Used for servers that accept DHCP traffic. The DHCPRA service type can be used to relay DHCP requests
and responses between VLANs.
DIAMETER
Used for load balancing Diameter traffic among multiple Diameter servers. Diameter uses message-
based load balancing.
SSL_DIAMETER
Services are designated as DISABLED until the NetScaler appliance connects to the associated load-
balanced server and verifies that it is operational. At that point, the service is designated as ENABLED.
Thereafter, the NetScaler appliance periodically monitors the status of the servers, and places any
that fail to respond to monitoring probes (called health checks) back in the DISABLED state until they
respond.
Note: You can create a range of services from a single CLI command or the same dialog box. The names
in the range vary by a number used as a suffix/prefix. For example, service1, service2, and so on. From
the configuration utility, you can specify a range only in the last octet of the IP address, which is the
fourth in case of an IPv4 address and the eighth in case of an IPv6 address. From the command line,
you can specify the range in any octet of the IP address.
QUIC
Used by load balancing servers that accept UDP based QUIC video traffic. The service enables the
NetScaler appliance to optimize encrypted ABR video traffic over UDP protocol.
3. In the Create Service dialog box, specify values for the following parameters:
• Service Name—name
• Server—serverName
• Protocol—serviceType
• Port—port
4. Click Create, and then click Close. The service you created appears in the Services pane.
After you create your services, you must create a virtual server to accept traffic for the load bal-
anced websites, applications, or servers. Once load balancing is configured, users connect to the
load-balanced website, application, or server through the virtual server’s IP address or FQDN.
Note:
• Virtual server names prefixed with “app” do not appear in the GUI though they are present in
the ns.conf file and are displayed when you run the show command. However, virtual server
names prefixed with “app” are displayed in the GUI.
• The virtual server is designated as DOWN until you bind the services that you created to it, and
until the Citrix ADC appliance connects to those services and verifies that they are operational.
Only then is the virtual server designated as UP.
Navigate to Traffic Management > Load Balancing > Virtual Servers, and then create a virtual server.
After you have created services and a virtual server, you must bind the services to the virtual server.
Usually, services are bound to virtual servers of the same type, but you can bind certain types of ser-
vices to certain different types of virtual servers, as shown below.
The state of the services bound to a virtual server determines the state of the virtual server: if all of
the bound services are DOWN, the virtual server is marked DOWN, and if any of the bound services is
UP or OUT OF SERVICE, the state of the virtual server is UP.
1. Navigate to Traffic Management> Load Balancing > Virtual Servers, and select a virtual server.
2. Click in the Service section, and select a service to bind.
After finishing your basic configuration, you should view the properties of each service and load bal-
ancing virtual server in your load balancing setup to verify that each is configured correctly. After the
configuration is up and running, you should view the statistics for each service and load balancing
virtual server to check for possible problems.
You can view properties such as the name, state, and IP address of any server object in your NetScaler
appliance configuration.
Navigate to Traffic Management > Load Balancing > Servers. The parameter values of the available
servers appear in the details pane.
You can view properties such as the name, state, effective state, IP address, port, protocol, method,
and number of bound services for your virtual servers. If you have configured more than the basic
load balancing settings, you can view the persistence settings for your virtual servers, any policies
that are bound to them, and any cache redirection and content switching virtual servers that have
been bound to the virtual servers.
To view the properties of a load balancing virtual server by using the CLI
To view the properties of a load balancing virtual server by using the GUI
2. In the details pane, click a virtual server to display its properties at the bottom of the details
pane.
3. To view cache redirection and content switching virtual servers that are bound to this virtual
server, click Show CS/CR Bindings.
You can view the name, state, IP address, port, protocol, maximum client connection, maximum re-
quests per connection, and server type of the configured services, and use this information to trou-
bleshoot any mistake in the service configuration.
Navigate to Traffic Management > Load Balancing > Services. The details of the available services
appear on the Services pane.
You can view the list of virtual servers to which the service is bound. The binding information also
provides the name, IP address, port, and state of the virtual servers to which the services are bound.
You can use the binding information to troubleshoot any problem with binding the services to virtual
servers.
2. In the details pane, select the service whose binding information you want to view.
To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of
the virtual servers configured on the NetScaler appliance. You can display a summary of statistics for
all the virtual servers, or you can specify the name of a virtual server to display the statistics only for
that virtual server. You can display the following details:
• Name
• IP address
• Port
• Protocol
• State of the virtual server
• Rate of requests received
• Rate of hits
To display a summary of the statistics for all the virtual servers currently configured on the appliance,
or for a single virtual server, at the command prompt, type:
Example:
2. If you want to display the statistics for only one virtual server, in the details pane, select the
virtual server whose statistics you want to display.
You can view the rate of requests, responses, request bytes, response bytes, current client connec-
tions, requests in surge queue, current server connections, and so forth using the service statistics.
Example:
2. In the details pane, select the service whose statistics you want to view (for example, Service-
HTTP-1).
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
A load balancing virtual server that does not have a backup virtual server can take the following states,
depending on the states of the service(s) bound to it and whether it is administratively disabled:
• UP: At least one of the services bound to the virtual server is UP.
• DOWN: All the services bound to the virtual server are DOWN, or the load balancing feature is
not enabled.
• Out of Service (OFS): If you administratively disable the virtual server, it enters the OFS state
but its effective state is DOWN. Transitioning to the OFS state from the DOWN or UP state, or to
the DOWN or UP state from the OFS state, is controlled by the administrator.
The state and effective state of a virtual server are the same if a backup virtual server is not configured.
However, if a backup virtual server or a chain of backup virtual servers is configured, the effective state
is derived from the states of the services that are bound to the primary virtual server and the backup
virtual server(s). If any of the backup virtual servers in the chain is UP, the effective state of the primary
virtual server is UP, even if all the services bound to the primary virtual server are DOWN.
The following diagrams show the conditions under which a virtual server transitions from one state
to another.
• UP: If probes from all the monitors bound to the service are successful.
• DOWN: If monitoring probes to the service are not answered within the configured time limit.
• OUT OF SERVICE: If you administratively disable the service, or if you gracefully shut down the
service and there are no active transactions to the service
• GOING OUT OF SERVICE (TROFS): If you administratively disable the service with delay, or
gracefully shut down the service and there are active transactions to the service. For more in-
formation, see Graceful Shut down of Services.
• DOWN WHEN GOING OUT OF SERVICE (TROFS_DOWN)[] A monitoring probe fails while the
service is in the GOING OUT OF SERVICE state.
A service in the process of transitioning from UP to OFS is in the GOING OUT OF SERVICE state. A service
transitioning from DOWN to OFS is in the DOWN WHEN GOING OUT OF SERVICE state. For example, if
a service is DOWN and you disable it with delay, the service transitions to DOWN WHEN GOING OUT
OF SERVICE and then to the OUT OF SERVICE state. If a service is UP and you disable it with delay, the
service transitions to GOING OUT OF SERVICE. During this time, if a monitoring probe to the server
fails, the service transitions to DOWN WHEN GOING OUT OF SERVICE and, after the delay time expires,
enters the OFS state.
Note
You can configure spillover to a backup virtual server by setting the “healthThreshold” param-
eter to a non-zero positive value. Then, if a single service bound to the primary virtual server
transitions to the DOWN WHEN GOING OUT OF SERVICE state and the health threshold is not
reached, the primary virtual server is marked DOWN and new connections are directed to the
backup virtual server.
The following diagrams show the conditions under which a service transitions from one state to an-
other.
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
A load balancing configuration has a large number of parameters, so setting the same parameters on
a number of virtual servers can become tedious. From release 11.1, a load balancing (LB) profile makes
this task easier. You can now set load balancing parameters in a profile and associate this profile with
virtual servers, instead of setting these parameters on each virtual server.
You can set DBS_LB and Cl_process_local parameters on a virtual server and in the profile. If
you enable these parameters on a virtual server and then set a profile to this virtual server, the
parameters appear as disabled in the output of the “show lb vserver” command for that virtual
server. Check the profile to see the actual status of these parameters. In addition, if you set and
then unset a profile to a virtual server, the parameters will be set with default values for that
virtual server.
Example:
1 add lb profile p1
2
3 Done
4
5 show lb profile p1
6
7 LB Profile name: p1
8
9 DBS LB : DISABLED Process Local: DISABLED
10
11 Persistence Cookie HttpOnly Flag: ENABLED
12
13 Use Secured Persistence Cookie Flag: DISABLED
14
15 No of vservers bound: 0
16
17 Done
Example
1.
2. Citrix ADC
3. NetScaler 12.0
Contributed by:
C
The load balancing algorithm defines the criteria that the NetScaler appliance uses to select the ser-
vice to which to redirect each client request. Different load balancing algorithms use different criteria.
For example, the least connection algorithm selects the service with the fewest active connections,
while the round robin algorithm maintains a running queue of active services, distributes each con-
nection to the next service in the queue, and then sends that service to the end of the queue.
Some load balancing algorithms are best suited to handling traffic on websites, others to managing
traffic to DNS servers, and others to handling complex web applications used in e-commerce or on
company LANs or WANs. The following table lists each load balancing algorithm that the NetScaler
appliance supports, with a brief description of how each operates.
Depending on the protocol of the service that it is load balancing, the NetScaler appliance sets up each
connection between client and server to last for a different time interval. This is called load balancing
granularity, of which are three types: request-based, connection-based, and time-based granularity.
The following table describes each type of granularity and when each is used.
During startup of a virtual server, or whenever the state of a virtual server changes, the virtual server
can initially use the round robin method to distribute the client requests among the physical servers.
This type of distribution, referred to as startup round robin, helps prevent unnecessary load on a single
server as the initial requests are served. After using the round robin method at the startup, the virtual
server switches to the load balancing method specified on the virtual server.
The Startup RR Factor works in the following manner:
• If the Startup RR Factor is set to zero, the appliance switches to the specified load balancing
method depending on the request rate.
• If the Startup RR Factor is any number other than zero, the appliance uses the round robin
method for the specified number of requests before switching to the specified load balancing
method.
• By default, the Startup RR Factor is set to zero.
Note: You cannot set the startup RR Factor for an individual virtual server. The value you specify ap-
plies to all the virtual servers on the NetScaler appliance.
1. Navigate to Traffic Management > Load Balancing > Configure Load Balancing Parameters, and
set the Startup RR Factor.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
When a virtual server is configured to use the least connection load balancing algorithm (or method),
it selects the service with the fewest active connections. This is the default method, because, in most
circumstances, it provides the best performance.
For TCP, HTTP, HTTPS, and SSL_TCP services, the NetScaler appliance includes the following connec-
tion types in its list of existing connections:
• Active connections to a service. Connections representing requests that a client has sent to
the virtual server and that the virtual server has forwarded to a service. For HTTP and HTTPS
services, active connections represent only those HTTP or HTTPS requests that have not yet
received a response.
• Waiting connections in the surge queue. Any connections to the virtual server that are waiting
in a surge queue and have not yet been forwarded to a service. Connections can build up in the
surge queue at any time, for any of the following reasons:
– Your services have connection limits, and all services in your load balancing configuration
are at that limit.
– The surge protection feature is configured and has been activated by a surge in requests
to the virtual server.
– The load-balanced server has reached an internal limit and therefore does not open any
new connections. (For example, an Apache server’s connection limit is reached.)
When a virtual server uses the least connection method, it considers the waiting connections as be-
longing to the specific service. Therefore, it does not open new connections to those services.
For UDP services, the connections that the least connection algorithm considers include all sessions
between the client and a service. These sessions are logical, time-based entities. When the first UDP
packet in a session arrives, the NetScaler appliance creates a session between the source IP address
and port and the destination IP address and port.
For Real-Time Streaming Protocol (RTSP) connections, the NetScaler appliance uses the number of
active control connections to determine the lowest number of connections to an RTSP service.
The following example shows how a virtual server selects a service for load balancing by using the
least connection method. Consider the following three services:
The following diagram illustrates how the NetScaler appliance forwards incoming requests when us-
ing the least connection method.
In this diagram, the virtual server selects the service for each incoming connection by choosing the
server with the fewest active transactions.
• Service-HTTP-3 receives the first request, because it is not handling any active transactions.
• Service-HTTP-3 receives the second and third requests because the service has the next least
number of active transactions.
• Service-HTTP-1 receives the fourth request Because Service-HTTP-1 and Service-HTTP-3 have
same number of active transactions, the virtual server uses the round robin method to choose
between them.
• Service-HTTP-1 receives the sixth request, and so on, until both Service-HTTP-1 and Service-
HTTP-3 are handling the same number of requests as Service-HTTP-2. At that time, the
NetScaler appliance starts forwarding requests to Service-HTTP-2 when it is the least loaded
service or its turn comes up in the round robin queue.
Note: If connections to Service-HTTP-2 close, it might get new connections before each of the
other two services has 15 active transactions.
The following table explains how connections are distributed in the three-service load balancing setup
described above.
Current Number of
Incoming Connection Service Selected Active Connections Remarks
Current Number of
Incoming Connection Service Selected Active Connections Remarks
Request-6 Service-HTTP-1;(N = 5 -
4)
Request-7 Service-HTTP-3; (N = 5 -
4)
Request-8 Service-HTTP-1; (N = 6 -
5)
Service-HTTP-2 is selected for load balancing when it completes its active transactions and the current
connections to it close, or when the other services (Service-HTTP-1 and Service-HTTP-3) have 15 or
more connections each.
The NetScaler appliance can also use the least connection method when weights are assigned to ser-
vices. It selects a service by using the value (Nw) of the following expression:
The following example shows how the NetScaler appliance selects a service for load balancing by
using the least connection method when weights are assigned to services. In the preceding exam-
ple, suppose Service-HTTP-1 is assigned a weight of 2, Service-HTTP-2 is assigned a weight of 3, and
Service-HTTP-3 is assigned a weight of 4. Connections are forwarded as follows:
• Service-HTTP-3 receives the first because the service is not handling any active transactions.
Note: If services are not handling any active transactions, the NetScaler appliance uses the
round robin method regardless of the weights assigned to each of the services.
• Service-HTTP-3 receives the second, third, fourth, fifth, sixth, and seventh requests because the
service has lowest Nw value.
• Service-HTTP-1 receives the eighth request. Because Service-HTTP-1 and Service-HTTP-3 now
have same Nw value, the appliance performs load balancing in a round robin manner. There-
fore, Service-HTTP-3 receives the ninth request.
The following table explains how connections are distributed on the three-service load balancing
setup that is described above.
Current Nw (Number
of active
transactions) * (10000
Request Received Service Selected / weight) value Remarks
Service-HTTP-2 is selected for load balancing when it completes its active transactions or when the
Nw value of other services (Service-HTTP-1 and Service-HTTP-3) is equal to 50000.
The following diagram illustrates how the NetScaler appliance uses the least connection method when
weights are assigned to the services.
Figure 2. Mechanism of the Least Connections Load Balancing Method when Weights are Assigned
To configure the least connection method, see Configuring a Load Balancing Method that Does Not
Include a Policy.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
When a load balancing virtual server is configured to use the round robin method, it continuously
rotates a list of the services that are bound to it. When the virtual server receives a request, it assigns
the connection to the first service in the list, and then moves that service to the bottom of the list.
The following diagram illustrates how the NetScaler appliance uses the round robin method with a
load balancing setup that contains three load-balanced servers and their associated services.
If you assign a different weight to each service, the NetScaler appliance performs weighted round
robin distribution of incoming connections. It does this by skipping the lower-weighted services at
appropriate intervals.
For example, assume that you have a load balancing setup with three services. You set Service-HTTP-1
to a weight of 2, Service-HTTP-2 to a weight of 3, and Service-HTTP-3 to a weight of 4. The services are
bound to Vserver-LB-1, which is configured to use the round robin method. With this setup, incoming
requests are delivered as follows:
Note: You can also configure weights on services to prevent multiple services from using the same
server and overloading the server.
Figure 2. How the Round Robin Load Balancing Method Works with Weighted Services
To configure the round robin method, see Configuring a Load Balancing Method that Does Not Include
a Policy.
1.
2. Citrix ADC
3. NetScaler 12.0
January 6, 2019
Contributed by:
C
When the load balancing virtual server is configured to use the least response time method, it selects
the service with the fewest active connections and the lowest average response time. You can con-
figure this method for HTTP and Secure Sockets Layer (SSL) load balancing virtual servers only. The
response time (also called Time to First Byte, or TTFB) is the time interval between sending a request
packet to a service and receiving the first response packet from the service. The NetScaler appliance
uses response code 200 to calculate TTFB.
The following example shows how a virtual server selects a service for load balancing by using the
least response time method. Consider the following three services:
The following diagram illustrates how the NetScaler appliance uses the least response time method
to forward the connections.
Figure 1. How the Least Response Time Load Balancing Method Works
The virtual server selects a service by multiplying the number of active transactions by the TTFB for
each service and then selecting the service with the lowest result. For the example shown above, the
virtual server forwards requests as follows:
• Service-HTTP-3 receives the first request, because the service is not handling any active trans-
actions.
• Service-HTTP-3 also receives the second and third requests, because the result is lowest of the
three services.
• Service-HTTP-1 receives the fourth request. Since Service-HTTP-1 and Service-HTTP-3 have
the same result, the NetScaler appliance chooses between them by applying the Round Robin
method.
• Service-HTTP-3 receives the fifth request.
• Service-HTTP-2 receives the sixth request, because at this point it has the lowest result.
• Because Service-HTTP-1, Service-HTTP-2, and Service-HTTP-3 all have the same result at this
point, the appliance switches to the round robin method, and continues to distribute connec-
tions using that method.
The following table explains how connections are distributed in the three-service load balancing setup
described above.
Current N Value
(Number of Active
Request Received Service Selected Transactions * TTFB) Remarks
Current N Value
(Number of Active
Request Received Service Selected Transactions * TTFB) Remarks
Service-HTTP-1 is again selected for load balancing when it completes its active transactions or when
its N value is less than the other services (Service-HTTP-2 and Service-HTTP-3).
The following diagram illustrates how the NetScaler appliance uses the least response time method
when weights are assigned.
Figure 2. How the Least Response Time Load Balancing Method Works When Weights Are Assigned
The virtual server selects a service by using the value (Nw) in the following expression:
• Service-HTTP-3 receives the first request, because it is not handling any active transactions.
If services are not handling any active transactions, the appliance selects them regardless of the
weights assigned to them.
• Service-HTTP-3 receives the second, third, fourth, and fifth requests, because this service has
the lowest Nw value.
• Service-HTTP-2 receives the sixth request, because this service has the lowest Nw value.
• Service-HTTP-3 receives the seventh request, because this service has the lowest Nw value.
• Service-HTTP-2 receives the eighth request, because this service has the lowest Nw value.
Service-HTTP-1 has the lowest weight and therefore the highest Nw value, so the virtual server does
not select it for load balancing.
The following table explains how connections are distributed in the three-service load balancing setup
described above.
Current Nw Value =
Request Received Service Selected (N) * (10000 / Weight) Remarks