Guest

Cisco LocalDirector 400 Series

Configuring HTTP Redirection on LocalDirector While Checking Server Availability

Document ID: 46222

Updated: Jan 31, 2006

   Print


Cisco has announced the end-of-sale for the Cisco LocalDirector. For more information, refer to the LocalDirector 400 Series End-of-Life and End-of-Sale Notices and Product Bulletins.


Contents


Introduction

This document describes how to configure Hypertext Transfer Protocol (HTTP) redirection that allows you to check server availability on the Cisco LocalDirector. HTTP redirection also requires additional IP addresses for direct IP (DIP) addresses to allow for direct calling/browsing.

This configuration was developed and tested using the software and hardware versions below.

  • LocalDirector 416 in a lab environment with cleared configurations.
  • LocalDirector Software Release 4.2.1
  • Microsoft Internet Explorer 5.5
  • Netscape Communicator 4.7

The information presented in this document was created from devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If you are working in a live network, ensure that you understand the potential impact of any command on before using it.

Network Diagram

How to Configure HTTP Redirection to Check Server Availability

Use the following steps to configure your LocalDirector:

  1. Create an "A" record for the following:
    test.testdomain.com <-> 172.18.124.209 VIP
    ns-ms1-dip.testdomain.com <-> 172.18.124.212 DIP 
    ns-ms2-dip.testdomain.com <-> 172.18.124.211 DIP
    ns-ms1.cisco.com <-> 172.18.124.207 REAL 
    ns-ms2.cisco.com <-> 172.18.124.206 REAL
    172.18.124.211 DIP virtual for 172.18.124.206 REAL (aka s2)
    172.18.124.212 DIP virtual for 172.18.124.207 REAL (aka s1)
    

    Note: You need port-bound Virtual IP (VIP), DIP, and real addresses, but you also need two IP addresses for each real address for outbound connections to the real server to still be allowed. This allows for safe VIPs with a reset sent for bad ports. It also allows for other calls to the DIPs to come directly through the true address while using alternate IP addresses for the DIP's virtual address.

  2. Create a (port-bound) VIP address. There should be an "A" record entry in Domain Name System (DNS).
    virtual 172.18.124.209:80:0:tcp is 
    
  3. Create a DIP for each "real server" that will be accepting calls for this VIP address. Use an "extra IP number" in the first part of the statement.
    direct-ip 172.18.124.211:80:0:tcp 172.18.124.206:80:0:tcp is
    direct-ip 172.18.124.212:80:0:tcp 172.18.124.207:80:0:tcp is
    
    The system will create the following for you:
    real 172.18.124.207:80:0:tcp is
    real 172.18.124.206:80:0:tcp is
    bind 172.18.124.211:80:0:tcp 172.18.124.206:80:0:tcp
    bind 172.18.124.212:80:0:tcp 172.18.124.207:80:0:tcp
    
  4. Create a Uniform Resource Locator (URL) redirection for each real server. This is where the client will be redirected when they hit the VIP.
    url s2 http://ns-ms2-dip.testdomain.com/%p 302
    url s1 http://ns-ms1-dip.testdomain.com/%p 302
    

    Note: The "%p" denotes the page.

  5. Create a backup command for each DIP to the common VIP. This solves the bookmarking problem. If a client bookmarks a URL of a DIP, and if that DIP (real server) is not available (it comes up as FAILED), then it will use the backup command to have the client call the VIP again.
    backup 172.18.124.211:80:0:tcp 172.18.124.209:80:0:tcp
    backup 172.18.124.212:80:0:tcp 172.18.124.209:80:0:tcp
    

    Note: HTTPS redirection uses backup differently.

  6. Bind the VIP to each URL command.

    bind 172.18.124.209:80:0:tcp s2
    bind 172.18.124.209:80:0:tcp s1
    
  7. Create a link command for each URL to the first part of the DIP. This creates an association between the DIP and the URLs associated with that nickname (for example, s1). The link command ensures that if a DIP is failed, then the LocalDirector will not redirect clients to URL that would call that failed DIP (which is mapped one-to-one with a real IP address).
    link s2 172.18.124.211:80:0:tcp
    link s1 172.18.124.212:80:0:tcp
    

show Commands and Sample Output

show version Command

The show version command displays the software version running on the LocalDirector.

localdirector# show version
LocalDirector 416 Version 4.2.1

show configuration Command

The show configuration command displays the current running configuration on the LocalDirector.

localdirector# show configuration
: Saved
: LocalDirector 416 Version 4.2.1
syslog output 20.7
no syslog console
enable password 000000000000000000000000000000 encrypted
hostname localdirector
no shutdown ethernet 0
no shutdown ethernet 1
no 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
no ping-allow 2
ip address 172.18.124.210 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.105.0.0 255.255.0.0
snmp-server enable traps
snmp-server community public
no snmp-server contact
no snmp-server location
virtual 172.18.124.209:80:0:tcp is
predictor 172.18.124.209:80:0:tcp roundrobin
real 172.18.124.207:80:0:tcp is
real 172.18.124.206:80:0:tcp is
direct-ip 172.18.124.211:80:0:tcp   172.18.124.206:80:0:tcp is
direct-ip 172.18.124.212:80:0:tcp   172.18.124.207:80:0:tcp is
url s2 http://ns-ms2-dip.testdomain.com/%p 302
url s1 http://ns-ms1-dip.testdomain.com/%p 302
backup 172.18.124.211:80:0:tcp 172.18.124.209:80:0:tcp
backup 172.18.124.212:80:0:tcp 172.18.124.209:80:0:tcp
bind 172.18.124.211:80:0:tcp 172.18.124.206:80:0:tcp
bind 172.18.124.212:80:0:tcp 172.18.124.207:80:0:tcp
bind 172.18.124.209:80:0:tcp s2
bind 172.18.124.209:80:0:tcp s1
link s2 172.18.124.211:80:0:tcp
link s1 172.18.124.212:80:0:tcp

show statistics Command

The show statistics command displays the real and virtual server statistics.

localdirector(config)# show statistics
          Real Machine(s)              Bytes      Packets   Connections
(DIP) 172.18.124.207:80:0:tcp           1092            8             2
(DIP) 172.18.124.206:80:0:tcp            960            7             1


       Virtual Machine(s)              Bytes      Packets   Connections
(DIP) 172.18.124.211:80:0:tcp            960            7             1
(DIP) 172.18.124.212:80:0:tcp           1092            8             1
  172.18.124.209:80:0:tcp               3296           26             2
localdirector(config)#

show url Command

The show url command displays connection information to the URLs.

localdirector(config)# show url
Urls:

             Id  Connect    Rcode   State                     Url
             s2        1      302     IS http://ns-ms2-dip.testdomain.com/%p
             s1        0      302     IS http://ns-ms1-dip.testdomain.com/%p
localdirector(config)#

show syslog Command

The show syslog command displays the logging information (such as the date, time, level, and output):

<165> May 30 11:35:14 LD-NOTICE Virtual machine '172.18.124.209:80:0:tcp': 
Edited from In Service to Out Of Service.
<165> May 30 11:35:24 LD-NOTICE Real machine '172.18.124.207:80:0:tcp': 
Edited from In Service to Out Of Service.
<165> May 30 11:35:24 LD-NOTICE Real machine '172.18.124.206:80:0:tcp': 
Edited from In Service to Out Of Service.
<165> May 30 11:35:28 LD-NOTICE Real machine '172.18.124.207:80:0:tcp': 
Edited from Out Of Service to In Service.
<162> May 30 11:35:28 LD-CRIT Switching '172.18.124.212:80:0:tcp' 
from 'leastconns' to 'slowstart'
<165> May 30 11:35:28 LD-NOTICE Real machine '172.18.124.206:80:0:tcp': 
Edited from Out Of Service to In Service.
<162> May 30 11:35:28 LD-CRIT Switching '172.18.124.211:80:0:tcp' 
from 'leastconns' to 'slowstart'
<165> May 30 11:35:34 LD-NOTICE Virtual machine '172.18.124.209:80:0:tcp': 
Edited from Out Of Service to In Service.
<162> May 30 11:36:23 LD-CRIT Switching '172.18.124.212:80:0:tcp' 
from 'slowstart' to 'leastconns'
<162> May 30 11:41:24 LD-CRIT Switching '172.18.124.211:80:0:tcp' 
from 'slowstart' to 'leastconns'
  

Verify the Configuration

Use the following commands to verify the configuration:

  • 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 statistics - See above.

Troubleshoot the Configuration

syslog Command

The syslog [host ip | console | output facility.level] command can be used for debugging or troubleshooting.

In this example, http://test.testdomain.com is redirected to http://ns-ms2-dip.testdomain.com/.

The following is sample output from syslog console and syslog output 20.7:

localdirector(config)# syslog console
localdirector(config)# <162> May 30 11:36:23 LD-CRIT Switching '172.18.124.212:80:0:tcp'
 from 'slowstart' to 'leastconns'
localdirector(config)# <162> May 30 11:41:24 LD-CRIT Switching '172.18.124.211:80:0:tcp'
 from 'slowstart' to 'leastconns'


Related Information


Updated: Jan 31, 2006
Document ID: 46222