ADC

Sandwich Environment

A Citrix ADC deployment in a sandwich mode can load balance network traffic through firewalls 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 Citrix ADC is located on each side of a set of firewalls. The Citrix ADC placed between the firewalls and the Internet, called the external Citrix ADC that handles ingress traffic selects the best firewall, based on the configured method. The Citrix ADC between the firewalls and the private network, called the internal Citrix ADC 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 Citrix ADC 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.

Figure 1. Firewall Load Balancing (Sandwich)

Firewalls-sandwich

The service type ANY configures the Citrix ADC 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.

反对figuring the External Citrix ADC in a Sandwich Environment

Perform the following tasks to configure the external Citrix ADC in a sandwich environment

  • Enable the load balancing feature.
  • 反对figure a wildcard service for each firewall.
  • 反对figure a monitor for each wildcard service.
  • 反对figure a wildcard virtual server for traffic coming from the Internet.
  • 反对figure the virtual server in MAC rewrite mode.
  • Bind services to the wildcard virtual server.
  • Save and Verify the Configuration.

Enable the load balancing feature

To enable load balancing by using the command line interface

At the command prompt, type the following command to enable load balancing and verify the configuration:

enable ns feature LB show ns feature 

Example:

> enable ns feature LoadBalancing Done > show ns feature Feature Acronym Status ------- ------- ------ 1) Web Logging WL OFF 2) Surge Protection SP ON 3) Load Balancing LB ON . . . 24) NetScaler Push push OFF Done 

To enable load balancing by using the configuration utility

Navigate toSystem > Settingsand, in反对figure Basic Features, selectLoad Balancing.

反对figure a wildcard service for each firewall

To configure a wildcard service for each firewall by using the command line interface

At the command prompt, type:

add service   ANY * 

Example:

add service Service-HTTP-1 10.102.29.5 ANY * 

To configure a wildcard service for each firewall by using the configuration utility

Navigate toTraffic Management > Load Balancing > Servicesand add a service. SpecifyANYin theProtocolfield and * in the Port field.

反对figure a monitor for each wildcard service

A PING monitor is bound by default to the service. 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 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 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 overrides 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.

To configure a transparent monitor by using the command line interface

At the command prompt, type the following commands to configure a transparent monitor and verify the configuration:

add lb monitor   [-destIP ] [-transparent (YES | NO )] bind lb monitor   

Example:

add monitor monitor-HTTP-1 HTTP -destip 10.10.10.11 -transparent YES bind monitor monitor-HTTP-1 fw-svc1 To bind a PING monitor, type the following command: bind monitor PING fw-svc1 

To create and bind a transparent monitor by using the configuration utility

Navigate to交通管理>负载平衡>显示器, and then create and bind a transparent monitor.

反对figure 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:

add lb vserver  ANY * * 

Example:

add lb vserver Vserver-LB-1 ANY * * 

To configure a wildcard virtual server for traffic coming from the Internet by using the configuration utility

Navigate toTraffic Management > Load Balancing > Virtual Serversand create a wildcard virtual server. SpecifyANYin theProtocolfield and * in the Port field.

反对figure the virtual server in MAC rewrite mode

To configure the virtual server in MAC rewrite mode by using the command line interface

At the command prompt, type:

set lb vserver @ -m  

Example:

set lb vserver Vserver-LB-1 -m MAC 

To configure the virtual server in MAC rewrite mode by using the configuration utility

  1. Navigate toTraffic 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 theBasic Settingssection, and clickmore.
  3. From theRedirection Modedrop-down list, selectMAC Based.

Bind services to the wildcard virtual server

To bind a service to the wildcard virtual server by using the command line interface

At the command prompt, type:

bind lb vserver   

Example:

bind lb vserver Vserver-LB-1 Service-HTTP-1 

To bind a service to the wildcard virtual server by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Virtual Serversand select the virtual server for which you want to bind the service.
  2. Click in theServicessection and select a service to bind.

Save and verify the configuration

When you’ve finished the configuration tasks, be sure to save the configuration. You can 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:

save config sh lb vserver FWLBVIP1 FWLBVIP1 (*:*) - ANY Type: ADDRESS State: UP Last state change was at Mon Jun 14 06:40:14 2010 Time since last state change: 0 days, 00:00:11.240 Effective State: UP ARP:DISABLED Client Idle Timeout: 120 sec Down state flush: ENABLED Disable Primary Vserver On Down : DISABLED No. of Bound Services : 2 (Total) 2 (Active) Configured Method: SRCIPDESTIPHASH Mode: MAC Persistence: NONE Connection Failover: DISABLED 1) fw_svc_1 (10.102.29.251: *) - ANY State: UP Weight: 1 2) fw_svc_2 (10.102.29.18: *) - ANY State: UP Weight: 1 Done show service fw-svc1 fw-svc1 (10.102.29.251:*) - ANY State: DOWN Last state change was at Thu Jul 8 10:04:50 2010 Time since last state change: 0 days, 00:00:38.120 Server Name: 10.102.29.251 Server ID : 0 Monitor Threshold : 0 Max Conn: 0 Max Req: 0 Max Bandwidth: 0 kbits Use Source IP: NO Client Keepalive(CKA): NO Access Down Service: NO TCP Buffering(TCPB): YES HTTP Compression(CMP): NO Idle timeout: Client: 120 sec Server: 120 sec Client IP: DISABLED Cacheable: NO SC: OFF SP: OFF Down state flush: ENABLED 1) Monitor Name: monitor-HTTP-1 State: DOWN Weight: 1 Probes: 5 Failed [Total: 5 Current: 5] Last response: Failure - Time out during TCP connection establishment stage Response Time: 2000.0 millisec 2) Monitor Name: ping State: UP Weight: 1 Probes: 3 Failed [Total: 0 Current: 0] Last response: Success - ICMP echo reply received. Response Time: 1.415 millisec Done 

反对figuring the Internal Citrix ADC in a Sandwich Environment

Perform the following tasks to configure the internal Citrix ADC in a sandwich environment

For traffic from the server (egress)

  • Enable the load balancing feature.
  • 反对figure a wildcard service for each firewall.
  • 反对figure a monitor for each wildcard service.
  • 反对figure a wildcard virtual server to load balance the traffic sent to the firewalls.
  • 反对figure the virtual server in MAC rewrite mode.
  • Bind firewall services to the wildcard virtual server.

For traffic across private network servers

  • 反对figure a service for each virtual server.
  • 反对figure a monitor for each service.
  • 反对figure an HTTP virtual server to balance traffic sent to the servers.
  • Bind HTTP services to the HTTP virtual server.
  • Save and Verify the Configuration.

Enable the load balancing feature

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.

To enable load balancing by using the command line interface

At the command prompt, type the following command to enable load balancing and verify the configuration:

enable ns feature LB show ns feature 

Example:

> enable ns feature LoadBalancing Done > show ns feature Feature Acronym Status ------- ------- ------ 1) Web Logging WL OFF 2) Surge Protection SP ON 3) Load Balancing LB ON . . . 24) NetScaler Push push OFF Done 

To enable load balancing by using the configuration utility

Navigate toSystem > Settingsand, in Configure Basic Features, selectLoad Balancing.

反对figure a wildcard service for each firewall

To configure a wildcard service for each firewall by using the command line interface

At the command prompt, type:

add service   ANY * 

Example:

add service Service-HTTP-1 10.102.29.5 ANY * 

To configure a wildcard service for each firewall by using the configuration utility

Navigate toTraffic Management > Load Balancing > Servicesand add a service. SpecifyANYin theProtocolfield and * in the Port field.

反对figure a monitor for each wildcard service

A PING monitor is bound by default to the service. 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 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 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 overrides 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.

To configure a transparent monitor by using the command line interface

At the command prompt, type the following commands to configure a transparent monitor and verify the configuration:

add lb monitor   [-destIP ] [-transparent (YES | NO )] bind lb monitor   

Example:

add monitor monitor-HTTP-1 HTTP -destip 10.10.10.11 -transparent YES bind monitor monitor-HTTP-1 fw-svc1 

To create and bind a transparent monitor by using the configuration utility

  1. Navigate to交通管理>负载平衡>显示器and create a monitor.
  2. In theCreate Monitordialog box, enter the required parameters, and selectTransparent.

反对figure 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

At the command prompt, type:

add lb vserver  ANY * * 

Example:

add lb vserver Vserver-LB-1 ANY * * 

To configure a wildcard virtual server for traffic coming from the Internet by using the configuration utility

Navigate toTraffic Management > Load Balancing > Virtual Serversand create a wildcard virtual server. SpecifyANYin 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

  1. Navigate toTraffic Management > Load Balancing > Virtual Servers.
  2. In the details pane, click Add.
  3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the following parameters as shown:
    • Name—name
  4. In Protocol, select ANY, and in IP Address and Port, select *.
  5. Click Create, and then click Close. The virtual server you created appears in the Load Balancing Virtual Servers pane.

反对figure the virtual server in MAC rewrite mode

To configure the virtual server in MAC rewrite mode by using the command line interface

At the command prompt, type:

set lb vserver @ -m  

Example:

set lb vserver Vserver-LB-1 -m MAC 

To configure the virtual server in MAC rewrite mode by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Virtual Serversand select the virtual server for which you want to configure the redirection mode (for example, Vserver-LB-1).
  2. Edit theBasic Settingssection and clickmore.
  3. From theRedirection Modedrop-down list, selectMAC Based.

To configure the virtual server in MAC rewrite mode by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Virtual Servers.
  2. In the details pane, select the virtual server for which you want to configure the redirection mode (for example, Vserver-LB-1), and then clickOpen.
  3. On the Advanced tab, under Redirection Mode, clickMAC-Based.
  4. ClickOK.

Bind firewall services to the wildcard virtual server

To bind firewall services to the wildcard virtual server by using the command line interface

At the command prompt, type:

bind lb vserver   

Example:

bind lb vserver Vserver-LB-1 Service-HTTP-1 

To bind firewall services to the wildcard virtual server by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Virtual Servers, and select a virtual server.
  2. Click in the Service section, and select a service to bind.

Note: You can bind a service to multiple virtual servers.

反对figure a service for each virtual server

为每个虚拟服务器配置服务using the command line interface

At the command prompt, type:

add service   HTTP  

Example:

add service Service-HTTP-1 10.102.29.5 HTTP 80 

为每个虚拟服务器配置服务using the configuration utility

Navigate toTraffic Management > Load Balancing > Servicesand configure a service for each virtual server. SpecifyHTTPin theProtocolfield and selectHTTPunderAvailable Monitors.

为每个虚拟服务器配置服务using the configuration utility

  1. Navigate toTraffic 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
    • 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.

反对figure a monitor for each service

To bind a monitor to a service by using the command line interface

At the command prompt, type:

bind lb monitor   

Example:

bind mon monitor-HTTP-1 Service-HTTP-1 

To bind a monitor to a service by using the configuration utility

Navigate toTraffic Management > Load Balancing > Services, double-click a service, and add a monitor.

反对figure an HTTP virtual server to balance traffic sent to the servers

To configure an HTTP virtual server to balance traffic sent to the servers by using the command line interface

At the command prompt, type:

add lb vserver  HTTP   

Example:

add lb vserver Vserver-LB-1 HTTP 10.102.29.60 80 

To configure an HTTP virtual server to balance traffic sent to the servers by using the configuration utility

Navigate toTraffic Management > Load Balancing > Virtual Servicesand configure an HTTP virtual server. SpecifyHTTPin theProtocolfield.

To configure an HTTP virtual server to balance traffic sent to the servers by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Virtual Servers.
  2. In the details pane, click Add.
  3. In the Create Virtual Server (Load Balancing) dialog box, specify values for the following parameters as shown:
    • Name—name
    • IP Address—IP Address 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.

Save and Verify the Configuration

When you’ve finished the configuration tasks, be sure to save the configuration. You can 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:

save config show lb vserver FWLBVIP2 FWLBVIP2 (*:*) - ANY Type: ADDRESS State: UP Last state change was at Mon Jun 14 07:22:54 2010 Time since last state change: 0 days, 00:00:32.760 Effective State: UP Client Idle Timeout: 120 sec Down state flush: ENABLED Disable Primary Vserver On Down : DISABLED No. of Bound Services : 2 (Total) 2 (Active) Configured Method: LEASTCONNECTION Current Method: Round Robin, Reason: A new service is bound Mode: MAC Persistence: NONE Connection Failover: DISABLED 1) fw-int-svc1 (10.102.29.5: *) - ANY State: UP Weight: 1 2) fw-int-svc2 (10.102.29.9: *) - ANY State: UP Weight: 1 Done show service fw-int-svc1 fw-int-svc1 (10.102.29.5:*) - ANY State: DOWN Last state change was at Thu Jul 8 14:44:51 2010 Time since last state change: 0 days, 00:01:50.240 Server Name: 10.102.29.5 Server ID : 0 Monitor Threshold : 0 Max Conn: 0 Max Req: 0 Max Bandwidth: 0 kbits Use Source IP: NO Client Keepalive(CKA): NO Access Down Service: NO TCP Buffering(TCPB): NO HTTP Compression(CMP): NO Idle timeout: Client: 120 sec Server: 120 sec Client IP: DISABLED Cacheable: NO SC: OFF SP: OFF Down state flush: ENABLED 1) Monitor Name: monitor-HTTP-1 State: DOWN Weight: 1 Probes: 9 Failed [Total: 9 Current: 9] Last response: Failure - Time out during TCP connection establishment stage Response Time: 2000.0 millisec 2) Monitor Name: ping State: UP Weight: 1 Probes: 3 Failed [Total: 0 Current: 0] Last response: Success - ICMP echo reply received. Response Time: 1.275 millisec Done 

To save and verify the configuration by using the configuration utility

  1. In the details pane, click Save.
  2. In the Save Config dialog box, click Yes.
  3. Navigate toTraffic Management > Load Balancing > Virtual Servers.
  4. In the details pane, select the virtual server that you created in step 5, verify that the settings displayed in the Details pane are correct.
  5. Navigate toTraffic Management > Load Balancing > Services.
  6. In the details pane, select the service that you created in step 5, verify that the settings displayed in the Details pane are correct.

Monitoring a Firewall Load Balancing Setup in a Sandwich Environment

After the configuration is up and running, you can view the statistics for each service and virtual server to check for possible problems.

Viewing the Statistics of a Virtual Server

To evaluate the performance of virtual servers or to troubleshoot problems, you can display details of the virtual servers configured on the Citrix ADC 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 requests

To display virtual server statistics by using the command line interface

To display a summary of the statistics for all the virtual servers currently configured on the Citrix ADC, or for a single virtual server, at the command prompt, type:

stat lb vserver [-detail] [] 

Example:

>stat lb vserver -detail Virtual Server(s) Summary vsvrIP port Protocol State Req/s Hits/s One * 80 HTTP UP 5/s 0/s Two * 0 TCP DOWN 0/s 0/s Three * 2598 TCP DOWN 0/s 0/s dnsVirtualNS 10.102.29.90 53 DNS DOWN 0/s 0/s BRVSERV 10.10.1.1 80 HTTP DOWN 0/s 0/s LBVIP 10.102.29.66 80 HTTP UP 0/s 0/s Done 

To display virtual server statistics by using the configuration utility

  1. Navigate toTraffic 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 clickStatistics.

Viewing the Statistics of a Service

You can view the rate of requests, responses, request bytes, response bytes, current client connections, requests in the surge queue, current server connections, and so forth using the service statistics.

To view the statistics of a service by using the command line interface

At the command prompt, type:

stat service  

Example:

stat service Service-HTTP-1 

To view the statistics of a service by using the configuration utility

  1. Navigate toTraffic Management > Load Balancing > Services > Statistics.
  2. If you want to display the statistics for only one service, select the service, and clickStatistics.
Sandwich Environment