Guest

Cisco LocalDirector 400 Series

Configuring HTTP Redirection to Different Servers Using the Same Directories and Files

Document ID: 44125

Updated: Jan 31, 2006

   Print

Introduction

HTTP redirection is a reliable method used to implement persistent or sticky connections. HTTP redirection also allows LocalDirector to perform effective load balancing for secure socket layer (SSL) and non-SSL connections, as well as for connections to an Internet Service Provider (ISP) that pass through a proxy server.

This document provides a sample configuration of HTTP redirection to two servers using the same directories and files.

These paramaters are used in this configuration:

  • An "A" record created for test.testdomain.com <-> 172.18.124.216 virtual IP (VIP)

  • An "A" record created for ns-ms1-dip.testdomain.com <-> 172.18.124.208 direct IP (DIP)

  • An "A" record created for ns-ms2-dip.testdomain.com <-> 172.18.124.209 DIP

  • An "A" record created for ns-ms1.cisco.com <-> 172.18.124.207 real

  • An "A" record created for ns-ms2.cisco.com <-> 172.18.124.206 real

  • 172.18.124.209 DIP virtual address for 172.18.124.206 real (s2)

  • 172.18.124.208 DIP virtual address for 172.18.124.207 real (s1)

  • url s2 http://ns-ms2-dip.testdomain.com/%p 302

  • url s1 http://ns-ms1-dip.testdomain.com/%p 302

  • 24-bit subnet mask

There are some limitations related to port-bound VIP addresses, direct IP (DIP) addresses, and real server public IP addresses. You need two IP addresses for each real server for outbound connections to the real servers. The two IP addresses allow safe VIP addresses with resets (RSTs) sent for bad ports. They also allow other calls to the DIP addresses to pass by the true addresses using an alternate IP address for the DIP's virtual address.

Prerequisites

Requirements

There are no specific requirements for this document.

Components Used

The information in this document is based on these software and hardware versions:

  • LocalDirector 416

  • LocalDirector Software Release 4.2.1

  • Microsoft Internet Explorer 5.5

  • Netscape Communicator 4.7

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Network Diagram

This document uses this network setup:

http_red_diffserv-01.gif

Conventions

For more information on document conventions, refer to the Cisco Technical Tips Conventions.

Configure HTTP Redirection to Different Servers Using the Same Directories and Files

Use this procedure to configure HTTP redirection to different servers using the same directories and files.

  1. Create a port-bound VIP address and enter it in the Domain Name System (DNS). For example:

    virtual 172.18.124.216:80:0:tcp is
    
  2. Create a DIP address for each real server that accepts calls for this VIP address. Use an extra IP address in the first part of the statement, as shown here:

    direct-ip 172.18.124.209:80:0:tcp 172.18.124.206:80:0:tcp is
    direct-ip 172.18.124.208:80:0:tcp 172.18.124.207:80:0:tcp is
    

    The system creates this output:

    real 172.18.124.207:80:0:tcp is
    real 172.18.124.206:80:0:tcp is
    bind 172.18.124.209:80:0:tcp 172.18.124.206:80:0:tcp
    bind 172.18.124.208:80:0:tcp 172.18.124.207:80:0:tcp
    
  3. Create a URL redirect for each real server.

    These URLs are where the client is redirected when a VIP address is hit. For example:

    url s2 http://ns-ms2-dip.cisco.com/%p
    url s1 http://ns-ms1-dip.cisco.com/%p
    
  4. Create a backup command for each DIP address to the common VIP address to solve potential bookmarking problems.

    If a client bookmarks the URL of a DIP address and that DIP address (real server) is unavailable (FAILED), then the backup command is used to call the VIP address again.

    backup 172.18.124.209:80:0:tcp 172.18.124.216:80:0:tcp
    backup 172.18.124.208:80:0:tcp 172.18.124.216:80:0:tcp
    

    Note: Secure Hypertext Transfer Protocol (HTTPS) redirection uses the backup command differently.

  5. Bind the VIP address to each URL command. For example:

    bind 172.18.124.216:80:0:tcp s2
    bind 172.18.124.216:80:0:tcp s1
    
  6. Create a link command for each URL to the first part of the DIP address.

    This creates an association between the DIP address and the URLs associated with that nickname. The link ensures that LocalDirector does not redirect clients to a failed DIP address, which is mapped one-to-one with a real server. If a DIP address fails, do not redirect to the URL that sends a call to the failed DIP address.

    link s2  172.18.124.209:80:0:tcp
    link s1 172.18.124.208:80:0:tcp
    

Configuration

Cisco LocalDirector 416

!--- Configuration with syslog output 20.7 (debug level) 
!--- and syslog console enabled:

LDIR-416(config)#syslog console
LDIR-416(config)#direct-ip 172.18.124.209:80:0:tcp 172.18.124.206:80:0:tcp is
LDIR-416(config)#direct-ip 172.18.124.208:80:0:tcp 172.18.124.207:80:0:tcp is
         
May 2 12:05:04 LD-NOTICE Real machine '172.18.124.206:80:0:tcp': 
Newly created edited to In Service.
<165> May 2 12:05:04 LD-NOTICE Virtual machine '172.18.124.209:80:0:tcp': 
Edited from Newly Created to In Service.
LDIR-416(config)#url s2 http://ns-ms2-dip.testdomain.com/%p 302
LDIR-416(config)#url s1 http://ns-ms1-dip.testdomain.com/%p 302
LDIR-416(config)#backup 172.18.124.209:80:0:tcp 172.18.124.216:80:0:tcp
LDIR-416(config)#backup 172.18.124.208:80:0:tcp 172.18.124.216:80:0:tcp
 
May 2 12:05:04 LD-NOTICE Real machine '172.18.124.207:80:0:tcp': 
Newly created edited to In Service.
<165> May 2 12:05:04 LD-NOTICE Virtual machine '172.18.124.208:80:0:tcp': 
Edited from Newly Created to In Service.
<165> May 2 12:05:04 LD-NOTICE Url 's2': Newly created edited to In Service.
<165> May 2 12:05:04 LD-NOTICE Url 's1': Newly created edited to In Service.
LDIR-416(config)#bind 172.18.124.216:80:0:tcp s2
LDIR-416(config)#bind 172.18.124.216:80:0:tcp s1
LDIR-416(config)#link s2 172.18.124.209:80:0:tcp
LDIR-416(config)#link s1 172.18.124.208:80:0:tcp
LDIR-416(config)#<162>May 2 12:05:04 LD-CRIT Switching
 '172.18.124.216:80:0:tcp'from 'leastconns' to 'slowstart' show conf
: Saved
: LocalDirector 416 Version 4.2.1
syslog output 20.7
no syslog console
enable password dfeaf10390e560aea745ccba53e044 encrypted
hostname LDIR-416
no shutdown ethernet 0
no shutdown ethernet 1
shutdown ethernet 2
interface ethernet 0 auto
interface ethernet 1 auto
interface ethernet 2 auto
mtu 0 1500
mtu 1 1500
mtu 2 1500
multiring all
no secure 0
no secure 1
no secure 2
ping-allow 0
ping-allow 1
ping-allow 2
ip address 172.18.124.215 255.255.255.0
route 0.0.0.0 0.0.0.0 172.18.124.1 1
arp timeout 30
no rip passive
rip version 1
failover ip address 0.0.0.0
no failover
failover hellotime 30
password dfeaf10390e560aea745ccba53e044ed encrypted
telnet 172.18.124.0 255.255.255.0
telnet 64.0.0.0 255.0.0.0
snmp-server enable traps
snmp-server community public
no snmp-server contact
no snmp-server location
virtual 172.18.124.216:80:0:tcp is
real 172.18.124.206:80:0:tcp is
real 172.18.124.207:80:0:tcp is
direct-ip 172.18.124.208:80:0:tcp 172.18.124.207:80:0:tcp is
direct-ip 172.18.124.209:80:0:tcp 172.18.124.206:80:0:tcp is
url s1 http://ns-ms1-dip.testdomain.com/%p 302
url s2 http://ns-ms2-dip.testdomain.com/%p 302
backup 172.18.124.208:80:0:tcp 172.18.124.216:80:0:tcp
backup 172.18.124.209:80:0:tcp 172.18.124.216:80:0:tcp
bind 172.18.124.208:80:0:tcp 172.18.124.207:80:0:tcp
bind 172.18.124.209:80:0:tcp 172.18.124.206:80:0:tcp
bind 172.18.124.216:80:0:tcp s1
bind 172.18.124.216:80:0:tcp s2
link s1 172.18.124.208:80:0:tcp
link s2 172.18.124.209:80:0:tcp
LDIR-416#

Verify

There is currently no verification procedure available for this configuration.

Troubleshoot

This section provides information you can use to troubleshoot your configuration.

Troubleshooting Commands

Certain show commands are supported by the Output Interpreter Tool (registered customers only) , which allows you to view an analysis of show command output.

Note: Before issuing debug commands, please see Important Information on Debug Commands.

  • show real—Displays the real servers' statistics and states.

  • show virtual—Displays a list of virtual servers, their states, number of connections, and load-balancing algorithms.

  • show bind—Displays which real servers are bound to which virtual servers.

  • show connection—Displays the number of currently used, as well as the maximum used, proxy connection objects for content load balancing.

  • show statistics https—Displays HTTPS connection statistics.

  • show url—Displays connection information to the URLs.

This is the command output of the show real command.

LDIR-416(config)#show real 

Real    Machines: 

                                                         No Answer TCP Reset DataIn 
Machine                        Connect  State  Thresh Reassigns  Reassigns   Conns 

(DIP) 172.18.124.207:80:0:tcp     0     IS       8        0         0          0 

(DIP) 172.18.124.206:80:0:tcp     0     IS       8        0         0          0 

This is the command output of the show virtual command.

LDIR-416(config)#show virtual 

Machines:    

                Machine          Mode      State  Connect  Sticky  Predictor  Slowstart 

(DIP) 172.18.124.209:80:0:tcp   directed  local      IS      0      0         leastconns roundrobin*  

(DIP) 172.18.124.208:80:0:tcp   directed  local      IS      0      0         leastconns roundrobin*  

      172.18.124.216:80:0:tcp   directed  local      IS      0      0         leastconns roundrobin*

This is the command output of the show bind command.

LDIR-416(config)#show bind 

           Virtual Machine(s)            Real Machines/Urls 

(DIP) 172.18.124.209:80:0:tcp(IS) 

(DIP) 172.18.124.206:80:0:tcp(IS) 

(DIP) 172.18.124.208:80:0:tcp(IS) 

(DIP) 172.18.124.207:80:0:tcp(IS) 

                                        172.18.124.216:80:0:tcp(IS)  
                                                  s1(IS)  
                                                  s2(IS)

This is the command output of the show connection command.

LDIR-416(config)#show connection 

Type        Currently Used   Max Used 

----------- --------------- ---------- 
Connections       0             3  

Wildcards         6            10 

Sticky            0             0 

SSL Sticky        0             0 

IP Frags          0             0 

SSL Proxy         0             0  

FTP Proxy         0             0  

COOKIE Ins        0             0  

COOKIE Pass       0             0 

CLB Prox          0             0  

HTTP Redir

Proxy             0             1  

Total    Allocated = 40960 Total Allocatable = 135824

This is the command output of the show statistics https command.

LDIR-416(config)#show statistics https

             Real Machine(s)                 Bytes      Packets   Connections 

(DIP) 172.18.124.207:80:0:tcp                 0            0                0 
(DIP) 172.18.124.206:80:0:tcp                 0            0                0 

         Virtual Machine(s)                 Bytes      Packets   Connections 
(DIP) 172.18.124.209:80:0:tcp                 0            0                0 

(DIP) 172.18.124.208:80:0:tcp                 0            0                0 

      172.18.124.216:80:0:tcp                 17949       161               10 

LDIR-416(config)# 

This is the command output of the show url command.

LDIR-416#show url
Urls:
       
           Id  Connect    Rcode   State          Url
           s1     0          302     IS     http://ns-ms1-dip.testdomain.com/%p
           s2     0          302     IS     http://ns-ms2-dip.testdomain.com/%p

This is sample output if you browse to http://test.testdomain.com/page2.htm, which redirects to http://ns-ms2-dip.testdomain.com, and use these troubleshooting commands.

If you use debugging commands:

LDIR-416# 

<162> May 2 12:06:32 LD-CRIT   Switching '172.18.124.216:80:0:tcp' 
      from 'slowstart' to 'leastconns'
<162> May 2 12:06:32 LD-CRIT 		Switching '172.18.124.209:80:0:tcp' 
      from 'slowstart' to 'leastconns'

LDIR-416#show dip
Direct IPs:
            
Virtual                          Real           Conns  State  Predictor    Slowstart
172.18.124.208:80:0:tcp  172.18.124.207:80:0:tcp   0     IS   leastconns   roundrobin*
172.18.124.209:80:0:tcp  172.18.124.206:80:0:tcp   1     IS   leastconns*  roundrobin
          

LDIR-416#show virtual
Machines:
            
Machine                           Mode         State Connect Sticky   Predictor Slowstart
(DIP) 172.18.124.208:80:0:tcp  directed local    IS      0     0     leastconns roundrobin*
(DIP) 172.18.124.209:80:0:tcp  directed local    IS      1     0     leastconns* roundrobin
      172.18.124.216:80:0:tcp  directed local    IS      0     0     leastconns* roundrobin

These are sample outputs if you browse to http://test.testdomain.com/page2.htm, which redirects to http://ns-ms1-dip.testdomain.com, and use these troubleshooting commands.

LDIR-416# show url
Urls:
            
Id Connect Rcode State Url
s1 1                    302    IS    http://ns-ms1-dip.testdomain.com/%p
s2 0                    302    IS    http://ns-ms2-dip.testdomain.com/%p      

LDIR-416# show statistics
                                Real Machine(s) Bytes Packets Connections
(DIP) 172.18.124.206:80:0:tcp 2077     8                    2
(DIP) 172.18.124.207:80:0:tcp 2224     8                    2
            
            
                          Virtual Machine(s) Bytes Packets Connections
(DIP) 172.18.124.208:80:0:tcp 2224     8                    1
(DIP) 172.18.124.209:80:0:tcp 2077     8                    1
                      172.18.124.216:80:0:tcp     4101     42           4
 
LDIR-416# show virtual
Machines:
            
Machine                             Mode      State Connect Sticky   Predictor     Slowstart
(DIP) 172.18.124.208:80:0:tcp directed local     IS    1        0     leastconns*   roundrobin
(DIP) 172.18.124.209:80:0:tcp directed local     IS    0        0     leastconns*   roundrobin
	     172.18.124.216:80:0:tcp directed local     IS    0        0     leastconns*   roundrobin 

LDIR-416# show dip
Direct IPs:
            
Virtual                         Real               Conns State  Predictor     Slowstart
172.18.124.208:80:0:tcp  172.18.124.207:80:0:tcp     1    IS    leastconns*   roundrobin
172.18.124.209:80:0:tcp  172.18.124.206:80:0:tcp     0    IS    leastconns*   roundrobin

Related Information

Updated: Jan 31, 2006
Document ID: 44125