Guest

Cisco IOS Software Releases 12.1 E

IOS Server Load Balancing, 12.1(3a)E

Table Of Contents

IOS Server Load Balancing

Overview of the IOS SLB Feature

Functions and Capabilities

Algorithms for Server Load Balancing

Weighted Round Robin

Weighted Least Connections

Alternate IP Addresses

Automatic Server Failure Detection

Automatic Unfail

Client-Assigned Load Balancing

Content Flow Monitor Support

Delayed Removal of TCP Connection Context

Dynamic Feedback Protocol for IOS SLB

Firewall Load Balancing

Maximum Connections

Network Address Translation (NAT) and Session Redirection

Port-Bound Servers

Probes

Protocol Support

Redundancy Enhancements

Slow Start

Sticky Connections

SynGuard

TCP Session Reassignment

Transparent Web Caches Balancing

Wireless Application Protocol (WAP) Load Balancing

Benefits

Restrictions

Supported Platforms

Supported Standards, MIBs, and RFCs

Required Configuration Tasks

Configuring the Server Farms

Verifying the Server Farms

Configuring the Virtual Servers

Verifying the Virtual Servers

Configuring the Restricted Clients

Verifying the Restricted Clients

Verifying IOS SLB Connectivity

Optional Configuration Tasks

Specifying a Server Load Balancing Algorithm

Specifying a Bind ID

Configuring Real Server Attributes

Adjusting Virtual Server Values

Configuring IOS SLB Firewall Load Balancing

Configuring Probes and the Firewall Farm

Verifying the Firewall Farm

Verifying Firewall Connectivity

Enhancing Firewall Security

Configuring HTTP Probes

Configuring Ping Probes

Configuring IOS SLB Dynamic Feedback Protocol

Configuring IOS SLB NAT

Implementing IOS SLB Stateless Backup

How IOS SLB Stateless Backup Works

Configuring IOS SLB Stateless Backup

Enabling HSRP

Customizing Group Attributes

Verifying the IOS SLB Stateless Backup Configuration

Sample IOS SLB Stateless Backup Configuration

Configuring IOS SLB Stateful Backup

Configuring Stateful Backup for Server Load Balancing

Configuring Stateful Backup for Firewall Load Balancing

Monitoring and Maintaining the IOS SLB Feature

Configuration Examples

Complete Example Configuration

Example of a Layer 3 Switch with ISL, VLAN, and BVI with GEC

Example of IOS SLB with Firewall Load Balancing

Internal Firewall Load-Balancing Device

External Firewall Load-Balancing Device

Example of IOS SLB with Probes

Example of a Layer 3 Switch Configured with IOS SLB

Example of IOS SLB with NAT

Switch A Configuration Statements

Switch B Configuration Statements

Switch C Configuration Statements

Example of an IOS Layer 3 Switch with HSRP

Device A (Active) Configuration Statements

Device B (Standby) Configuration Statements

Description of Configuration

Examples of IOS SLB with Stateless Backup

Example with Dynamic Routing and Trunking

Example with Dynamic Routing and No Trunking

Example with Static Routing and Trunking

Example with Static Routing and No Trunking

Example of IOS SLB with Stateful Backup

Switch SLB1 Configuration Statements

Switch SLB2 Configuration Statements

Example of IOS SLB with Active Standby

SLB 1 Configuration Statements

SLB 2 Configuration Statements

Access Router Configuration Statements

Example of IOS SLB with Redistribution of Static Routes

Routing Information Protocol (RIP)

Open Shortest Path First (OSPF)

Interior Gateway Routing Protocol (IGRP)

Enhanced Interior Gateway Routing Protocol (Enhanced IGRP)

Example of IOS SLB with WAP Load Balancing

IOS SLB Device Configuration Statements

Command Reference

address (HTTP probe)

address (ping probe)

advertise

agent

bindid

clear ip slb

client

credentials

delay (firewall farm TCP protocol)

delay (virtual server)

expect

faildetect (ping probe)

faildetect (real server)

header

idle (firewall farm TCP protocol)

idle (firewall farm UDP protocol)

idle (virtual server)

inservice (firewall farm)

inservice (firewall farm real server)

inservice (server farm real server)

inservice (server farm virtual server)

interval (HTTP probe)

interval (ping probe)

ip slb dfp

ip slb entries

ip slb firewallfarm

ip slb natpool

ip slb probe (HTTP probe)

ip slb probe (ping probe)

ip slb serverfarm

ip slb vserver

maxconns (firewall farm TCP protocol)

maxconns (firewall farm UDP protocol)

maxconns (server farm)

nat

port

predictor (server farm)

predictor hash address (firewall farm)

probe (firewall farm real server)

probe (server farm)

real (firewall farm)

real (server farm)

reassign

replicate casa (firewall farm)

replicate casa (virtual server)

request method, request url

retry

serverfarm

show ip slb conns

show ip slb dfp

show ip slb firewallfarm

show ip slb natpool

show ip slb probe

show ip slb reals

show ip slb replicate

show ip slb serverfarms

show ip slb stats

show ip slb sticky

show ip slb vservers

standby authentication

standby name

standby priority, standby preempt

standby timers

standby track

sticky (firewall farm TCP protocol)

sticky (firewall farm UDP protocol)

sticky (virtual server)

synguard

tcp

udp

virtual

weight (firewall farm real server)

weight (server farm)

Debug Commands

debug ip slb

FAQ (Frequently Asked Questions)

Glossary


IOS Server Load Balancing


This feature module describes the Cisco IOS Server Load Balancing (SLB) feature for Cisco IOS Release 12.1(3a)E. It includes the following sections:

Overview of the IOS SLB Feature

Functions and Capabilities

Benefits

Restrictions

Supported Platforms

Supported Standards, MIBs, and RFCs

Required Configuration Tasks

Optional Configuration Tasks

Monitoring and Maintaining the IOS SLB Feature

Configuration Examples

Command Reference

Debug Commands

FAQ (Frequently Asked Questions)

Glossary

Overview of the IOS SLB Feature

The IOS SLB feature is an IOS-based solution that provides IP server load balancing. Using the IOS SLB feature, you can define a virtual server that represents a group of real servers in a cluster of network servers known as a server farm. In this environment, the clients connect to the IP address of the virtual server. When a client initiates a connection to the virtual server, the IOS SLB function chooses a real server for the connection based on a configured load-balancing algorithm.


Note IOS SLB does not support load balancing of flows between clients and real servers that are on the same local area network (LAN) or virtual LAN (VLAN). The packets being load balanced cannot enter and leave the load-balancing device on the same interface.


IOS SLB also provides firewall load balancing, which balances flows across a group of firewalls called a firewall farm.

Figure 1 illustrates a logical view of a simple IOS SLB network.

Figure 1 Logical View of IOS SLB

Functions and Capabilities

This section describes the following functions and capabilities provided by IOS SLB:

Algorithms for Server Load Balancing

Alternate IP Addresses

Automatic Server Failure Detection

Automatic Unfail

Client-Assigned Load Balancing

Content Flow Monitor Support

Delayed Removal of TCP Connection Context

Dynamic Feedback Protocol for IOS SLB

Firewall Load Balancing

Maximum Connections

Network Address Translation (NAT) and Session Redirection

Port-Bound Servers

Probes

Protocol Support

Redundancy Enhancements

Slow Start

Sticky Connections

SynGuard

TCP Session Reassignment

Transparent Web Caches Balancing

Wireless Application Protocol (WAP) Load Balancing

Algorithms for Server Load Balancing

IOS SLB provides two load-balancing algorithms: weighted round robin and weighted least connections. You can specify either algorithm as the basis for choosing a real server for each new connection request that arrives at the virtual server.

Weighted Round Robin

The weighted round robin algorithm specifies that the real server used for a new connection to the virtual server is chosen from the server farm in a circular fashion. Each real server is assigned a weight, n, that represents its capacity to handle connections, as compared to the other real servers associated with the virtual server. That is, new connections are assigned to a given real server n times before the next real server in the server farm is chosen.

For example, assume a server farm comprised of real server ServerA with = 3, ServerB with = 1, and ServerC with = 2. The first three connections to the virtual server are assigned to ServerA, the fourth connection to ServerB, and the fifth and sixth connections to ServerC.


Note Assigning a weight of n=1 to all of the servers in the server farm configures the IOS SLB switch to use a simple round robin algorithm.


Weighted Least Connections

The weighted least connections algorithm specifies that the next real server chosen from a server farm for a new connection to the virtual server is the server with the fewest active connections. Each real server is assigned a weight for this algorithm, also. When weights are assigned, the server with the fewest connections is based on the number of active connections on each server, and on the relative capacity of each server. The capacity of a given real server is calculated as the assigned weight of that server divided by the sum of the assigned weights of all of the real servers associated with that virtual server, or n1/(n1+n2+n3...).

For example, assume a server farm comprised of real server ServerA with = 3, ServerB with = 1, and ServerC with = 2. ServerA would have a calculated capacity of 3/(3+1+2), or half of all active connections on the virtual server, ServerB one-sixth of all active connections, and ServerC one-third of all active connections. At any point in time, the next connection to the virtual server would be assigned to the real server whose number of active connections is farthest below its calculated capacity.


Note Assigning a weight of n=1 to all of the servers in the server farm configures the IOS SLB switch to use a simple least-connection algorithm.


Alternate IP Addresses

IOS SLB enables you to telnet to the load-balancing device using an alternate IP address. To do so, use either of the following methods:

Use any of the interface addresses to telnet to the load-balancing device.

Define a secondary IP address to telnet to the load-balancing device.

This function is similar to that provided by the LocalDirector (LD) Alias command.

Automatic Server Failure Detection

IOS SLB automatically detects each failed Transmission Control Protocol (TCP) connection attempt to a real server, and increments a failure counter for that server. (The failure counter is not incremented if a failed TCP connection from the same client has already been counted.) If a server's failure counter exceeds a configurable failure threshold, the server is considered out of service and is removed from the list of active real servers.

Automatic Unfail

When a real server fails and is removed from the list of active servers, it is assigned no new connections for a length of time specified by a configurable retry timer. After that timer expires, the server is again eligible for new virtual server connections and IOS SLB sends the server the next qualifying connection. If the connection is successful, the failed server is placed back on the list of active real servers. If the connection is unsuccessful, the server remains out of service and the retry timer is reset.

Client-Assigned Load Balancing

Client-assigned load balancing allows you to limit access to a virtual server by specifying the list of client IP subnets that are permitted to use that virtual server. With this feature, you can assign a set of client IP subnets (such as internal subnets) connecting to a virtual IP address to one serverfarm, and assign another set of clients (such as external clients) to a different serverfarm.

Content Flow Monitor Support

IOS SLB supports the Cisco Content Flow Monitor (CFM), a Web-based status monitoring application within the CiscoWorks2000 product family. You can use CFM to manage Cisco server load-balancing devices. CFM runs on Windows NT and Solaris workstations, and is accessed using a Web browser.

Delayed Removal of TCP Connection Context

Because of IP packet ordering anomalies, IOS SLB might "see" the termination of a TCP connection (a finish [FIN] or reset [RST]) followed by other packets for the connection. This problem usually occurs when there are multiple paths that the TCP connection packets can follow. To correctly redirect the packets that arrive after the connection is terminated, IOS SLB retains the TCP connection information, or context, for a specified length of time. The length of time the context is retained after the connection is terminated is controlled by a configurable delay timer.

Dynamic Feedback Protocol for IOS SLB

The Dynamic Feedback Protocol (DFP) is a mechanism that allows host agents in load-balanced environments to dynamically report the change in status of the host systems that provide a virtual service. The status reported is a relative weight that specifies a host server's capacity to perform work.

When a DFP agent is defined to IOS SLB, a TCP connection is initiated from the manager to the DFP agent. Once this connection is established, the agent periodically sends update information across the connection to IOS SLB. This information is used by IOS SLB as an aid in load balancing the real servers, as well as acting as an application-level keep-alive for the connection. If an agent on the real server has no information to send, and an inactivity timeout was specified for this DFP agent, the agent must send an empty report to prevent removal of the connection. In the event of a failure, IOS SLB uses the weight specified by the user when the real server was configured, or a default weight if a weight was not specified.

The DFP agent can be either software running on the real server or a separate unit that collects information from one or more real servers. The DFP agent consolidates the information, formats it into the DFP, and reports the information to IOS SLB at periodic intervals. If a need arises, such as a sudden change in a real server's ability to handle flows, the DFP agent can send an early report.

Firewall Load Balancing

As its name implies, firewall load balancing enables IOS SLB to balance flows to firewalls regardless of whether server load balancing is used. Firewall load balancing uses a load-balancing device on each side of a group of firewalls (called a firewall farm) to ensure that the traffic for each flow travels to the same firewall, ensuring that the security policy is not compromised.

Layer 3 firewalls, which have IP-addressable interfaces, are supported by IOS SLB firewall load balancing if they are subnet-adjacent to the firewall load-balancing device and have unique MAC addresses. The device does not modify the IP addresses in the user packet. To send the packet to the chosen firewall, the device determines which interface to use and changes the Layer 2 headers accordingly. This is the standard dispatched routing used by IOS SLB.

Layer 2 firewalls, which do not have IP addresses, are transparent to IOS SLB firewall load balancing. IOS SLB supports Layer 2 firewalls by placing them between two IP-addressable interfaces.

Whereas many Layer 3 firewalls might exist off a single Layer 3 interface on the load-balancing device (for example, a single LAN), only one Layer 2 firewall can exist off each interface.

When configuring the load-balancing device, you configure a Layer 3 firewall using its IP address, and a Layer 2 firewall using the IP address of the interface of the device on the "other side" of the firewall.

IOS SLB firewall load balancing uses a hash algorithm to balance flows across the firewalls in a firewall farm. The hash algorithm uses the source and destination IP addresses of incoming flows (and optionally the source and destination TCP or User Datagram Protocol [UDP] port numbers) to select a firewall to handle the connection request.

To maximize availability and resilience in a network with multiple firewalls, configure a separate equal-cost route to each firewall, rather than a single route to only one of the firewalls.

IOS SLB firewall load balancing provides the following capabilities:

Connections initiated from either side of the firewall farm are load-balanced.

The load is balanced among a set of firewalls—the firewall farm.

All packets for a connection travel through the same firewall. Subsequent connections can be "sticky," ensuring that they are assigned to the same firewall.

Probes are used to detect and recover from firewall failures.

Redundancy is provided. Hot Standby Router Protocol (HSRP), stateless backup, and stateful backup are all supported.

Multiple interface types and routing protocols are supported, enabling the external (Internet side) load-balancing device to act as an access router.

Proxy firewalls are supported.

Maximum Connections

IOS SLB allows you to configure maximum connections for server and firewall load balancing.

For server load balancing, you can configure a limit on the number of active connections that a real server is assigned. If the maximum number of connections is reached for a real server, IOS SLB automatically switches all further connection requests to another server until the connection number drops below the specified limit.

For firewall load balancing, you can configure a limit on the number of active TCP or UDP connections that a firewall farm is assigned. If the maximum number of connections is reached for the firewall farm, new connections are dropped until the connection number drops below the specified limit.

Network Address Translation (NAT) and Session Redirection

Cisco IOS NAT, RFC 1631, allows unregistered "private" IP addresses to connect to the Internet by translating them into globally registered IP addresses. Cisco IOS NAT also increases network privacy by hiding internal IP addresses from external networks.

IOS SLB can operate in one of two session redirection modes:

Dispatched mode—the virtual server address is known to the real servers; you must configure the virtual server IP address as a loopback address, or secondary IP address, on each of the real servers. IOS SLB redirects packets to the real servers at the media access control (MAC) layer. Since the virtual server IP address is not modified in dispatched mode, the real servers must be Layer 2-adjacent to IOS SLB, or intervening routers might not be able to route to the chosen real server.


Note IOS SLB supports FTP and firewall load balancing only in dispatched mode. Therefore, neither FTP not firewall load balancing can use NAT.


Directed mode—the virtual server can be assigned an IP address that is not known to any of the real servers. IOS SLB translates packets exchanged between a client and real server, translating the virtual server IP address to a real server address through NAT.

IOS SLB supports the following types of NAT:

Server NAT—By replacing the virtual server IP address with the real server IP address (and vice versa):

Servers can be many hops away from the load-balancing device.

Intervening routers can route to them without requiring tunnelling.

Loopback and secondary interfaces are not required on the real server.

The real server need not be Layer 2-adjacent to IOS SLB.

A less common form of server NAT is server port translation, which involves replacement of a virtual server port. Server port translation does not require server IP address translation, but the two translations can be used together.


Note If an IP address is configured as a real IP address for a NAT virtual server, you cannot balance connection requests from that address to a different virtual server (whether NAT or dispatched) on the same load-balancing device.


Client NAT—If multiple load-balancing devices are used, replacing the client IP address with an IP address associated with one of the devices results in proper routing of outbound flows to the correct device. Client NAT also requires that the ephemeral client port be modified since many clients can use the same ephemeral port. This is important so that server NAT can be performed on the packet, and important protocol events (such as TCP SYN, FIN, or RST) are seen by the load-balancing device connection finite state machine. Even in cases where multiple load-balancing devices are not used, client NAT can be useful to ensure that packets from load-balanced connections are not routed around the device.

In both dispatched and directed modes, IOS SLB must track connections. Therefore, you must design your network so that there is no alternate network path from the real servers to the client that bypasses the load-balancing device.


Note Both server NAT and client NAT are supported for the same connection.


Port-Bound Servers

When you define a virtual server, you must specify the TCP or UDP port handled by that virtual server. However, if you configure NAT on the server farm, you can also configure port-bound servers. Port-bound servers allow one virtual server IP address to represent one set of real servers for one service, such as Hypertext Transfer Protocol (HTTP), and a different set of real servers for another service, such as Telnet.

Packets destined for a virtual server address for a port that is not specified in the virtual server definition are not redirected.

IOS SLB supports both port-bound and non-port-bound servers, but port-bound servers are recommended.


Note You cannot configure NAT on a firewall farm, therefore you cannot configure port-bound servers for IOS SLB firewall load balancing.


Probes

IOS SLB supports both HTTP probes and ping probes. Probes are a simple way to verify connectivity for devices being server load-balanced, and for firewalls being firewall load-balanced (even devices on the other side of a firewall).

HTTP probes also enable you to monitor applications being server load-balanced. With frequent probes, the operation of each application is verified, not just connectivity to the application.

You can configure more than one probe for each server farm, or for each firewall in a firewall farm.

Server Load Balancing

Probes determine the status of each real server in a server farm. All real servers associated with all virtual servers tied to that server farm are probed.

If a real server fails for one probe, it is failed for all probes. After the real server recovers, all probes must acknowledge its recovery before it is restored to service.

Firewall Load Balancing

Probes detect firewall failures. All firewalls associated with the firewall farm are probed.

If a firewall fails for one probe, it is failed for all probes. After the firewall recovers, all probes must acknowledge its recovery before it is restored to service.

HTTP Probes

Make sure you configure the HTTP probe to expect status code 401, to eliminate password problems. See the expect command for more details.

Use the ip http server command to configure an HTTP server on the switch. See the description of the ip http server command in the Cisco IOS Configuration Fundamentals Command Reference for more details.

Protocol Support

IOS SLB supports the following protocols:

Domain Name System (DNS)

File Transfer Protocol (FTP)

Hypertext Transfer Protocol (HTTP)

Hypertext Transfer Protocol over Secure Socket Layer (HTTP-S)

Internet Message Access Protocol (IMAP)

Mapping of Airline Traffic over IP, Type A (MATIP-A)

Network News Transport Protocol (NNTP)

Post Office Protocol, version 2 (POP2)

Post Office Protocol, version 3 (POP3)

RealAudio/RealVideo via HTTP

Remote Authentication Dial-In User Service (RADIUS)

Simple Mail Transport Protocol (SMTP)

Telnet

X.25 over TCP (XOT)

Redundancy Enhancements

An IOS SLB device can represent a single point of failure, and the servers can lose their connections to the backbone, if either of the following occurs:

The IOS SLB device fails.

A link from a switch to the distribution-layer switch becomes disconnected.

To reduce that risk, IOS SLB supports two redundancy options, both based on HSRP:

Stateless backup—provides high network availability by routing IP flows from hosts on Ethernet networks without relying on the availability of a single Layer 3 switch.

Stateful backup—enables IOS SLB to incrementally backup its load-balancing decisions, or "keep state," between primary and backup switches.

IOS SLB also supports active standby, in which two IOS SLBs can load-balance the same virtual IP address while at the same time acting as backups for each other. If a site has only one virtual IP address to load balance, an access router is used to direct a subset of the flows to each IOS SLB using policy-based routing.


Note IOS SLB firewall load balancing does not support active standby. That is, you cannot configure two pairs of firewall load balancing devices (one pair on each side of the firewalls), with each device in each pair handling traffic and backing up its partner.


Slow Start

In an environment that uses weighted least connections load balancing, a real server that is placed in service initially has no connections, and could therefore be assigned so many new connections that it becomes overloaded. To prevent such an overload, slow start controls the number of new connections that are directed to a real server that has just been placed in service.

Sticky Connections

When you use sticky connections, new connections from a client IP address or subnet are assigned to the same real server (for server load balancing) or firewall (for firewall load balancing) as were previous connections from that address or subnet.

IOS SLB creates sticky objects to track client assignments. The sticky objects remain in the IOS SLB database after the last sticky connection is deleted, for a period defined by a configurable sticky timer. If the timer is configured on a virtual server or on a firewall farm, new connections from a client are sent to the same real server that handled the previous client connection, provided one of the following is true:

A connection for the same client already exists.

The amount of time between the end of a previous connection from the client and the start of the new connection is within the timer duration.

Sticky connections allow you to create a sticky object for a subnet, ensuring that all flows from the subnet are sent to the same real server. (Make sure the volume of flows is not so large that it overwhelms the real server.)

Sticky connections also permit the coupling of services that are handled by more than one virtual server or firewall farm. This allows connection requests for related services to use the same real server. For example, Web server (HTTP) typically uses TCP port 80, and HTTP over Secure Socket Layer (HTTPS) uses port 443. If HTTP virtual servers and HTTPS virtual servers are coupled, connections for ports 80 and 443 from the same client IP address or subnet are assigned to the same real server.

SynGuard

SynGuard limits the rate of TCP start-of-connection packets (SYNchronize sequence numbers, or SYNs) handled by a virtual server to prevent a type of network problem known as a SYN flood denial-of-service attack. A user might send a large number of SYNs to a server, which could overwhelm or crash the server, denying service to other users. SynGuard prevents such an attack from bringing down IOS SLB or a real server. SynGuard monitors the number of SYNs to a virtual server over a specific time interval and does not allow the number to exceed a configured SYN threshold. If the threshold is reached, any new SYNs are dropped.

TCP Session Reassignment

IOS SLB tracks each TCP SYN sent to a real server by a client attempting to open a new connection. If several consecutive SYNs are not answered, or if a SYN is replied to with an RST, the TCP session is reassigned to a new real server. The number of SYN attempts is controlled by a configurable reassign threshold.

IOS SLB firewall load balancing does not support TCP session reassignment.

Transparent Web Caches Balancing

You can use IOS SLB to balance transparent Web caches if you know the IP addresses they are serving. Simply configure the IP addresses, or some common subset of them, as virtual servers.


Note A Web cache can start its own connections to real Web sites if pages are not available in its cache. Those connections cannot be load-balanced back to the same set of Web caches. IOS SLB addresses this by allowing you to configure "client exclude" statements, so that IOS SLB does not load balance connections initiated by the Web caches.


Wireless Application Protocol (WAP) Load Balancing

You can use IOS SLB to load balance a group of WAP gateways or content servers. WAP load balancing requires a UDP virtual server configured on one of the WAP ports (9200, 9201, 9202, or 9203).

IOS SLB uses ping probes, which you can configure to verify the presence of each real server, to detect WAP server failures. If a server's WAP stack fails but its Internet Control Message Protocol (ICMP) stack does not fail, IOS SLB cannot detect the WAP server failure.

Benefits

IOS SLB shares the same software code base as Cisco IOS and has all the software features sets of Cisco IOS software. IOS SLB is recommended for customers desiring complete integration of SLB technology into traditional Cisco switches and routers.

On the Cisco Catalyst 6500 switch, IOS SLB takes advantage of hardware acceleration to forward data packets at very high speed when running in dispatched mode.

IOS SLB assures continuous, high availability of content and applications with proven techniques for actively managing servers and connections in a distributed environment. By distributing user requests across a cluster of servers, IOS SLB optimizes responsiveness and system capacity, and dramatically reduces the cost of providing Internet, database, and application services for large-scale as well as small- and medium- sized sites.

IOS SLB facilitates scalability, availability, and ease of maintenance:

The addition of new physical (real) servers, and the removal or failure of existing servers, can occur at any time, transparently, without affecting the availability of the virtual server.

IOS SLB's slow start capability allows a new server to increase its load gradually, preventing failures caused by assigning the server too many new connections too quickly.

IOS SLB supports fragmented packets and packets with IP options, buffering your servers from client or network vagaries that are beyond your control.

IOS SLB firewall load balancing enables you to scale access to your Internet site. You can add firewalls without affecting existing connections, enabling your site to grow without impacting customers.

Administration of server applications is easier. Clients know only about virtual servers; no administration is required for real server changes.

Security of the real server is provided because its address is never announced to the external network. Users are familiar only with the virtual IP address. You can filter unwanted flows based on both IP address and TCP or UDP port numbers. Additionally, though it does not eliminate the need for a firewall, IOS SLB can help protect against some denial-of-service attacks.

In a branch office, IOS SLB allows balancing of multiple sites and disaster recovery in the event of full-site failure, and distributes the work of load balancing.

Restrictions

IOS SLB has the following restrictions:

Does not support load balancing of flows between clients and real servers that are on the same local area network (LAN) or virtual LAN (VLAN). The packets being load balanced cannot enter and leave the load-balancing device on the same interface.

Operates in a standalone mode and currently does not operate as a MultiNode Load Balancing (MNLB) Services Manager. The presence of IOS SLB does not preclude the use of the existing MNLB Forwarding Agent with an external Services Manager in an MNLB environment.

Does not support coordinating server load-balancing statistics among different IOS SLB instances for backup capability.

Supports FTP only in dispatched mode.

Does not support IOS SLB and Cisco Applications and Services Architecture (CASA) configured with the same virtual IP address, even if they are for different services.

Does not support both server load balancing and firewall load balancing for the same connection by the same load-balancing device. You can configure both server load balancing and firewall load balancing on the same device at the same time, but they must apply to different flows (different client-server pairs). Load-balancing the server farm after a packet exits the load-balanced firewall farm requires a separate load-balancing device.

For firewall load balancing:

Limited to a single firewall farm in each load-balancing device.

Limited to a single active firewall load-balancing device on each side of the firewall farm. Each firewall must have its own unique MAC address and must be Layer 2-adjacent to each device. The firewalls can be connected to individual interfaces on the device, or they can all share a VLAN and connect using a single interface.

Requires Ethernet between each firewall load-balancing device and each firewall.

Requires route lookup on every incoming packet. Therefore, to minimize the impact on performance, the load-balancing device on the internal (secure) side of the firewalls should not route intranet-to-intranet flows.

On each firewall load-balancing device, requires that each Layer 2 firewall be connected to a single Layer 3 (IP) interface.

Flows with a destination IP address on the same subnet as the configured firewall IP addresses are not load-balanced. (Such flows could be a firewall console session or other flows on the firewall LAN.)

Does not support the following IOS SLB functions:

- Active standby

- Client-assigned load balancing

- Network Address Translation (NAT)

- Post-bound servers

- SynGuard

- TCP session reassignment

- Transparent Web caches balancing

For the Catalyst 6000 Family Switches:

Requires the MSFC and the PFC. When using redundant MSFCs in the same Catalyst 6000, stateful backup between the two MSFCs is not supported, but stateless backup between the two MSFCs is supported.

Requires that the Multilayer Switching (MLS) flow mode be set to full. For more information about how to set the MLS flow, refer to the "Configuring IP Multilayer Switching" section in the Catalyst 6000 Family MSFC (12.0) & PFC Configuration Guide, Release 5.4.

When operating in dispatched mode, requires that all real servers that can be reached by a single IOS SLB device be on the same VLAN. The loopback address must be configured in the real servers.

Requires that all firewall interfaces be on the same VLAN.

When operating in dispatched mode, real servers must be Layer 2-adjacent to IOS SLB (that is, not beyond an additional router), with hardware data packet acceleration performed by the PFC.

When operating in directed mode with server NAT, real servers need not be Layer 2-adjacent to IOS SLB. This allows for more flexible network design, since servers can be placed several Layer 3 hops away from the IOS SLB switch.

Provides no hardware data packet acceleration in directed mode. (Hardware data packet acceleration is performed by the Policy Feature Card (PFC), and in directed mode the data packets are handled by the Multilayer Switched Feature Card (MSFC), not the PFC.)

Supports NativeIOS only.

For the Cisco 7200 Series Routers:

Provides no hardware acceleration for the IOS SLB function for either dispatched mode or directed mode.

In dispatched mode, the servers must be Layer 2-adjacent or tag-switched. In directed mode, the servers can be one or more IP hops away.

Supports Cisco IOS NAT in directed mode with no hardware data packet acceleration.

Supported Platforms

Catalyst 6000 Family Switches

Cisco 7200 Series Routers

Supported Standards, MIBs, and RFCs

Standards

No new or modified standards

MIBs

CISCO-SLB-MIB


Note Although the objects in this MIB are defined as read-create, you cannot use the SNMP SET command to modify them. Instead, you must use the command line to set the associated command line keywords, after which the new values are reflected in SNMP.


RFCs

Cisco IOS NAT, RFC 1631

Required Configuration Tasks

This section describes the tasks required to configure a basic IOS SLB network.

Configuring IOS SLB involves identifying server farms, configuring groups of real servers in server farms, and configuring the virtual servers that represent the real servers to the clients. See the following sections for required configuration tasks for the IOS SLB feature.

Configuring the Server Farms

Verifying the Server Farms

Configuring the Virtual Servers

Verifying the Virtual Servers

Configuring the Restricted Clients

Verifying the Restricted Clients

Verifying IOS SLB Connectivity

Figure 2 shows a sample IOS SLB network with the following components:

Two server farms—one configured to allow access by the public and named PUBLIC, one configured to allow limited access and named RESTRICTED.

Five real servers configured as follows:

Three real servers in the PUBLIC server farm with IP addresses 10.1.1.1, 10.1.1.2, and 10.1.1.3

Two real servers in the restricted server farm with IP addresses 10.1.1.20 and 10.1.1.21

Two virtual servers—one configured to allow access by the public and named PUBLIC_HTTP and one configured to allow limited access and named RESTRICTED_HTTP.

Virtual server PUBLIC_HTTP is configured with IP address 10.0.0.1 load balancing TCP connections on the WWW port (80).

Virtual server RESTRICTED_HTTP is configured with IP address 10.0.0.2 load balancing TCP connections on the WWW port (80) and allows access only from clients from network 10.4.4.0 255.255.255.0.

Figure 2 Example IOS SLB Network

To configure the IOS SLB network shown in Figure 2, use the following commands beginning in global configuration mode:

Command
Purpose
Router(config)# ip slb serverfarm serverfarm-name
Router(config-slb-sfarm)#

Adds a server farm definition to the IOS SLB configuration and initiates server farm configuration mode. See the ip slb serverfarm command for more details.

Router(config-slb-sfarm)# real ip-address

Identifies a real server as a member of a server farm and initiates real server configuration mode. See the real (server farm) command for more details.

Router(config-slb-real)# inservice

Enables the real server for use by IOS SLB. See the inservice (server farm real server) command for more details.

Router(config-slb-real)# exit

Return to server farm configuration mode.

Router(config-slb-sfarm)# end

Return to global configuration mode.

Router(config)# ip slb vserver virtserver-name

Identifies a virtual server and initiates virtual server configuration mode. See the ip slb vserver command for more details.

Router(config-slb-vserver)# virtual ip-address {tcp | udp} 
port-number [service service-name]

Specifies the virtual server IP address, type of connection, TCP or UDP port number, and optional service coupling. See the virtual command for more details.

Router(config-slb-vserver)# serverfarm serverfarm-name

Associates a real server farm with a virtual server. See the serverfarm command for more details.

Router(config-slb-vserver)# inservice

Enables the virtual server for use by IOS SLB. See the inservice (server farm virtual server) command for more details.

Router(config-slb-vserver)# client ip-address network-mask

Specifies which clients are allowed to use the virtual server. See the client command for more details.


The following sections include examples of the configuration commands used to configure and verify the IOS SLB network shown in Figure 2:

Configuring the Server Farms

Verifying the Server Farms

Configuring the Virtual Servers

Verifying the Virtual Servers

Configuring the Restricted Clients

Verifying the Restricted Clients

Verifying IOS SLB Connectivity

Configuring the Server Farms

The following commands configure the server farm PUBLIC and associate the three real servers:

Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip slb serverfarm PUBLIC
Router(config-slb-sfarm)# real 10.1.1.1
Router(config-slb-real)# reassign 2
Router(config-slb-real)# faildetect numconns 4 numclients 2
Router(config-slb-real)# retry 20
Router(config-slb-real)# inservice
Router(config-slb-real)# exit
Router(config-slb-sfarm)# real 10.1.1.2
Router(config-slb-real)# reassign 2
Router(config-slb-real)# faildetect numconns 4
Router(config-slb-real)# retry 20
Router(config-slb-real)# inservice
Router(config-slb-real)# exit
Router(config-slb-sfarm)# real 10.1.1.3
Router(config-slb-real)# reassign 2
Router(config-slb-real)# faildetect numconns 4
Router(config-slb-real)# retry 20
Router(config-slb-real)# inservice
Router(config-slb-real)# end

The following commands configure the server farm RESTRICTED and associate the two real servers:

Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip slb serverfarm RESTRICTED
Router(config-slb-sfarm)# real 10.1.1.20
Router(config-slb-real)# reassign 2
Router(config-slb-real)# faildetect numconns 4
Router(config-slb-real)# retry 20
Router(config-slb-real)# inservice
Router(config-slb-real)# exit
Router(config-slb-sfarm)# real 10.1.1.21
Router(config-slb-real)# reassign 2
Router(config-slb-real)# faildetect numconns 4
Router(config-slb-real)# retry 20
Router(config-slb-real)# inservice
Router(config-slb-real)# end
Router#

Verifying the Server Farms

The following show ip slb reals command displays the status of server farms PUBLIC and RESTRICTED, the associated real servers, and their status:

Router# show ip slb real
real                    farm name        weight   state          conns
---------------------------------------------------------------------
10.1.1.1                 PUBLIC           8       OPERATIONAL      0
10.1.1.2                 PUBLIC           8       OPERATIONAL      0
10.1.1.3                 PUBLIC           8       OPERATIONAL      0
10.1.1.20                RESTRICTED       8       OPERATIONAL      0
10.1.1.21                RESTRICTED       8       OPERATIONAL      0
Router#

The following show ip slb serverfarm command displays the configuration and status of server farms PUBLIC and RESTRICTED:

Router# show ip slb serverfarm
server farm      predictor    nat   reals   bind id
---------------------------------------------------
PUBLIC           ROUNDROBIN   none  3       0
RESTRICTED       ROUNDROBIN   none  2       0
Router#

Configuring the Virtual Servers

The following commands configure the virtual servers PUBLIC_HTTP and RESTRICTED_HTTP:

Router#
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip slb vserver PUBLIC_HTTP
Router(config-slb-vserver)# virtual 10.0.0.1 tcp www
Router(config-slb-vserver)# serverfarm PUBLIC
Router(config-slb-vserver)# idle 120
Router(config-slb-vserver)# delay 5
Router(config-slb-vserver)# inservice
Router(config-slb-vserver)#
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# exit
Router(config)# ip slb vserver RESTRICTED_HTTP
Router(config-slb-vserver)# virtual 10.0.0.2 tcp www
Router(config-slb-vserver)# serverfarm RESTRICTED
Router(config-slb-vserver)# idle 120
Router(config-slb-vserver)# delay 5
Router(config-slb-vserver)# inservice
Router(config-slb-vserver)#
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# end
Router#

Verifying the Virtual Servers

The following show ip slb vservers command verifies the configuration of the virtual servers PUBLIC_HTTP and RESTRICTED_HTTP:

Router# show ip slb vservers
slb vserver      prot  virtual               state         conns
-------------------------------------------------------------------
PUBLIC_HTTP      TCP   10.0.0.1:80           OPERATIONAL     0
RESTRICTED_HTTP  TCP   10.0.0.2:80           OPERATIONAL     0
Router#

Router#

Configuring the Restricted Clients

The following commands remove the virtual server RESTRICTED_HTTP from service, configure the restricted client access to the virtual server, then enable the virtual server again:

Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# ip slb vserver RESTRICTED_HTTP
Router(config-slb-vserver)# no inservice
Router(config-slb-vserver)#
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# client 10.4.4.0 255.255.255.0
Router(config-slb-vserver)# inservice
Router(config-slb-vserver)#
src = 0 - 0
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# end
Router#

Verifying the Restricted Clients

The following show ip slb conns command verifies the restricted client access and status:

Router# show ip slb conns
vserver         prot client                real                  state     nat
-------------------------------------------------------------------------------
RESTRICTED_HTTP TCP  10.4.4.0:80           10.1.1.20             CLOSING   none
Router#

The following show ip slb conns command displays detailed information about the restricted client access status:

Router# show ip slb conns client 10.4.4.0 detail
VSTEST_UDP, client = 10.4.4.0:80
  state = CLOSING, real = 10.1.1.20, nat = none
  v_ip = 10.0.0.2:80, TCP, service = NONE
  client_syns = 0, sticky = FALSE, flows attached = 0
Router#

Verifying IOS SLB Connectivity

To verify that the IOS SLB feature has been installed and is operating correctly, ping the real servers from the IOS SLB switch, then ping the virtual servers from the clients.

The following show ip slb stats command displays detailed information about the IOS SLB network 
status:
Router# show ip slb stats
Pkts via normal switching:  0
Pkts via special switching: 6
Connections Created:        1
Connections Established:    1
Connections Destroyed:      0
Connections Reassigned:     0
Zombie Count:               0
Connections Reused:         0
Router#

Normal switching is when IOS SLB packets are handled on normal IOS switching paths (CEF, FastSwitching, and Process Level). Special switching is when IOS SLB packets are handled on hardware-assisted switching paths.

See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB networks and connections.

Optional Configuration Tasks

This section describes the following optional tasks you can use to fine tune the IOS SLB configuration:

Specifying a Server Load Balancing Algorithm

Specifying a Bind ID

Configuring Real Server Attributes

Adjusting Virtual Server Values

Configuring IOS SLB Firewall Load Balancing

Configuring HTTP Probes

Configuring Ping Probes

Configuring IOS SLB Dynamic Feedback Protocol

Configuring IOS SLB NAT

Implementing IOS SLB Stateless Backup

Configuring IOS SLB Stateful Backup

Specifying a Server Load Balancing Algorithm

To determine which real server to use for each new connection request, the IOS SLB feature uses one of two load-balancing algorithms: weighted round robin (the default) or weighted least connections. See the "Weighted Round Robin" section or the "Weighted Least Connections" section for detailed descriptions of these algorithms.


Note You can configure a real server with a weight relative to other real servers in the server farm, using the weight (server farm) real server configuration command.


To specify the load-balancing algorithm, use the following command in server farm configuration mode:

Command
Purpose
Router(config-slb-sfarm)# predictor [roundrobin | leastconns]

Specifies whether the weighted round robin algorithm or the weighted least connections algorithm is to be used to determine how a real server is selected. See the predictor (server farm) command for more details.


The following example shows how to configure weighted least-connections algorithm:

Router(config)# ip slb serverfarm RESTRICTED
Router(config-slb-sfarm)# predictor leastconns

See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB network connections and the "Complete Example Configuration" section for an example of an IOS SLB network configuration.

Specifying a Bind ID

The bind ID allows a single physical server to be bound to multiple virtual servers and report a different weight for each one. Thus, the single real server is represented as multiple instances of itself, each having a different bind ID. DFP uses the bind ID to identify for which instance of the real server a given weight is specified. The bind ID is needed only if you are using DFP.

To configure a bind ID on the server farm for use by DFP, use the following command in server farm configuration mode:

Command
Purpose
Router(config-slb-sfarm)# bindid [bind_id]

Specifies a bind ID on the server farm for use by DFP. See the bindid command for more details.


The following example shows how to configure a bind ID of 309 on server farm RESTRICTED:

Router(config)# ip slb serverfarm RESTRICTED
Router(config-slb-sfarm)# bindid 309

See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB network connections and the "Complete Example Configuration" section for an example of an IOS SLB network configuration.

Configuring Real Server Attributes

You can configure any of the following real server attributes, by using the following real server commands beginning in global configuration mode:

Command
Purpose
Router(config)# ip slb serverfarm serverfarm-name
Router(config-slb-sfarm)#

Adds a server farm definition to the IOS SLB configuration and initiates server farm configuration mode. See the ip slb serverfarm command for more details.

Router(config-slb-sfarm)# real ip-address

Identifies a real server as a member of a server farm and initiates real server configuration mode. See the real (server farm) command for more details.

Router(config-slb-real)# faildetect numconns number-conns 
[numclients number-clients]

Specifies the number of consecutive connection failures and, optionally, the number of unique client connection failures, that constitute failure of the real server. See the faildetect (real server) command for more details.

Router(config-slb-real)# maxconns number-conns

Specifies the maximum number of active connections allowed on the real server at one time. See the maxconns (server farm) command for more details.

Router(config-slb-real)# reassign threshold

Specifies the number of consecutive unanswered SYNs that initiates assignment of the connection to a different real server. See the reassign command for more details.

Router(config-slb-real)# retry retry-value

Specifies the interval, in seconds, to wait between the detection of a server failure and the next attempt to connect to the failed server. See the retry command for more details.

Router(config-slb-real)# weight weighting-value

Specifies the real server's workload capacity relative to other servers in the server farm. See the weight (server farm) command for more details.

Router(config-slb-real)# inservice

Enables the real server for use by IOS SLB. See the inservice (server farm real server) command for more details.


The following example shows how to configure the consecutive connection failures to 16 that constitute the failure of real server 10.1.1.1:

Router(config)# ip slb serverfarm RESTRICTED
Router(config-slb-sfarm)# real 10.1.1.1
Router(config-slb-real)# faildetect numconns 16 

The following example shows how to configure maximum number of connections to 1000:

Router(config-slb-real)# maxconns 1000

The following example shows how to configure the number of consecutive unanswered SYNs to 4 that initiates assignment of the connection to a different real server:

Router(config-slb-real)# reassign 4 

The following example shows how to configure the retry interval to 120 seconds between the detection of a server failure and the next attempt to connect on real server 10.1.1.1:

Router(config-slb-real)# retry 120 

The following example shows how to configure workload capacity to 16, relative to other servers in the server farm:

Router(config-slb-real)# weight 16 

The following example shows how to enable the real server back into service after making changes to its configuration:

Router(config-slb-real)# inservice 

See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB network connections and the "Complete Example Configuration" section for an example of an IOS SLB network configuration.

Adjusting Virtual Server Values

To change the default settings of the virtual server values, use the related virtual server command beginning in global configuration mode:

Command
Purpose
Router(config)# ip slb vserver virtserver-name

Identifies a virtual server and initiates virtual server configuration mode. See the ip slb vserver command for more details.

Router(config-slb-vserver)# no advertise

Omits the virtual server IP address from the routing protocol updates. See the advertise command for more details.

Router(config-slb-vserver)# client ip-address network-mask

Specifies which clients are allowed to use the virtual server. See the client command for more details.

Router(config-slb-vserver)# delay duration

Specifies the amount of time IOS SLB maintains TCP connection context after a connection has terminated. The default value is 10 seconds. See the delay (virtual server) command for more details.

Router(config-slb-vserver)# idle duration

Specifies the minimum amount of time IOS SLB maintains connection context in the absence of packet activity. The default value is 3600 seconds (60 minutes). See the idle (virtual server) command for more details.

Router(config-slb-vserver)# sticky duration [group group-id] 
[netmask netmask]

Specifies that connections from the same client use the same real server, as long as the interval between client connections does not exceed the specified duration. See the sticky (virtual server) command for more details.

Router(config-slb-vserver)# synguard syn-count interval

Specifies the rate of TCP SYNs handled by a virtual server in order to prevent a SYN flood denial-of-service attack. See the synguard command for more details.

Router(config-slb-vserver)# inservice

Enables the virtual server for use by IOS SLB. See the inservice (server farm virtual server) command for more details.


The following commands remove the virtual server RESTRICTED_HTTP from service and then configure the restricted client access to the virtual server:

Router(config)# ip slb vserver RESTRICTED_HTTP
Router(config-slb-vserver)# no inservice
Router(config-slb-vserver)#
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# client 10.4.4.0 255.255.255.0

By default, virtual server addresses are advertised. That is, static routes to the Null0 interface are installed for the virtual server addresses. To advertise these static routes using the routing protocol, you must configure redistribution of static routes for the routing protocol. To prevent the installation of a static route, use the no form of the advertise command:

Router(config-slb-vserver)# no advertise

The following command configures the delay timer to 20 seconds after the termination of the TCP connection to the virtual server:

Router(config-slb-vserver)# delay 20

The following command configures the idle time to 180 seconds (3 minutes) that the IOS SLB maintains connectivity to the virtual server in the absence of packet activity:

Router(config-slb-vserver)# idle 180

The following command configures the time to 60 seconds for connections from the same client to use the same real server:

Router(config-slb-vserver)# sticky 60 group 1

The following command configures the rate of TCP SYNs to 3600000 handled by the virtual server:

Router(config-slb-vserver)# synguard 3600000

The following example enables the virtual server again after modification:

Router(config-slb-vserver)# inservice
Router(config-slb-vserver)#
src = 0 - 0
.
(Information Deleted)
.
index = 1
Router(config-slb-vserver)# 

See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB network connections and the "Complete Example Configuration" section for an example of an IOS SLB network configuration.

Configuring IOS SLB Firewall Load Balancing

This section describes the tasks required to configure a basic IOS SLB firewall load-balancing network.

IOS SLB firewall load balancing uses probes to detect and recover from failures. You must configure a probe on each real server in the firewall farm. Ping probes are recommended; see the "Configuring Ping Probes" section for more details. If a firewall does not allow ping probes to be forwarded, use HTTP probes instead. See the "Configuring HTTP Probes" section for more details.

This section describes the following IOS SLB firewall load-balancing configuration tasks:

Configuring Probes and the Firewall Farm

Verifying the Firewall Farm

Verifying Firewall Connectivity

Enhancing Firewall Security

Configuring Probes and the Firewall Farm

To configure an IOS SLB firewall load-balancing network, use the following commands beginning in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip slb firewallfarm 
firewallfarm-name
Router(config-slb-fw)#

Adds a firewall farm definition to the IOS SLB configuration and initiates firewall farm configuration mode. See the ip slb firewallfarm command for more details.

Step 2 

Router(config-slb-fw)# real ip-address

Identifies a firewall as a member of a firewall farm and initiates real server configuration mode. See the real (firewall farm) command for more details.

Step 3 

Router(config-slb-fw-real)# probe name

Associates a probe with the real server. See the probe (firewall farm real server) command for more details.

Step 4 

Router(config-slb-fw-real)# weight weighting-value

(Optional) Specifies the real server's workload capacity relative to other servers in the firewall farm. See the weight (firewall farm real server) command for more details.

Step 5 

Router(config-slb-fw-real)# inservice

Enables the real server for use by the firewall farm and by IOS SLB. See the inservice (firewall farm real server) command for more details.

Step 6 

Router(config-slb-fw)# predictor hash address [port]

(Optional) Specifies whether the source and destination TCP or UDP port numbers, as well as the source and destination IP addresses, are to be used in the hash algorithm used to determine how a real server is selected. See the predictor hash address (firewall farm) command for more details.

Step 7 

Router(config-slb-fw)# replicate casa listening-ip 
remote-ip port-number [interval] [password [0|7] 
password [timeout]]

(Optional) Configures a stateful backup of IOS SLB decision tables to a backup switch. See the replicate casa (firewall farm) command for more details.

Step 8 

Router(config-slb-fw)# tcp

(Optional) Initiates TCP protocol configuration mode. See the tcp command for more details.

Step 9 

Router(config-slb-fw-tcp)# delay duration

(Optional) For firewall farm TCP protocol configuration mode, specifies the amount of time IOS SLB maintains TCP connection context after a connection has terminated. See the delay (firewall farm TCP protocol) command for more details.

Step 10 

Router(config-slb-fw-tcp)# idle duration

(Optional) For firewall farm TCP protocol configuration mode, specifies the minimum amount of time IOS SLB maintains connection context in the absence of packet activity. See the idle (firewall farm TCP protocol) command for more details.

Step 11 

Router(config-slb-fw-tcp)# maxconns number-conns

(Optional) For firewall farm TCP protocol configuration mode, specifies the maximum number of active connections allowed on the real server at one time. See the maxconns (firewall farm TCP protocol) command for more details.

Step 12 

Router(config-slb-fw-tcp)# sticky duration [netmask 
netmask]

(Optional) For firewall farm TCP protocol configuration mode, specifies that connections from the same IP address use the same firewall if both of the following conditions are met:

As long as any connection from that IP address exists.

For a period, defined by duration, after the last connection is destroyed.

See the sticky (firewall farm TCP protocol) command for more details.

Step 13 

Router(config-slb-fw)# udp

(Optional) Initiates UDP protocol configuration mode. See the udp command for more details.

Step 14 

Router(config-slb-fw-udp)# idle duration

(Optional) For firewall farm UDP protocol configuration mode, specifies the minimum amount of time IOS SLB maintains connection context in the absence of packet activity. See the idle (firewall farm TCP protocol) command for more details.

Step 15 

Router(config-slb-fw-udp)# maxconns number-conns

(Optional) For firewall farm UDP protocol configuration mode, specifies the maximum number of active connections allowed on the real server at one time. See the maxconns (firewall farm TCP protocol) command for more details.

Step 16 

Router(config-slb-fw-udp)# sticky duration [netmask 
netmask]

(Optional) For firewall farm UDP protocol configuration mode, specifies that connections from the same IP address use the same firewall if both of the following conditions are met:

As long as any connection from that IP address exists.

For a period, defined by duration, after the last connection is destroyed.

See the sticky (firewall farm UDP protocol) command for more details.

Step 17 

Router(config-slb-fw)# inservice

Enables the firewall farm for use by IOS SLB. See the inservice (firewall farm) command for more details.

Step 18 

Router(config-slb-fw-real)# exit

Return to firewall farm configuration mode.

Step 19 

Router(config-slb-fw)# end

Return to global configuration mode.

When you configure IOS SLB firewall load balancing, the load-balancing devices use route lookup to recognize flows destined for the firewalls. To enable route lookup, you must configure each device with the IP address of each firewall that will route flows to that device. See the "Example of IOS SLB with Firewall Load Balancing" section for more details.

Verifying the Firewall Farm

The following show ip slb reals command displays the status of firewall farm FIRE1, the associated real servers, and their status:

Router# show ip slb real

real                  farm name        weight   state          conns
--------------------------------------------------------------------
10.1.1.2              FIRE1            8        OPERATIONAL    0
10.1.2.2              FIRE1            8        OPERATIONAL    0

The following show ip slb firewallfarm command displays the configuration and status of firewall farm FIRE1:

Router# show ip slb firewallfarm
firewall farm    hash        state         reals
------------------------------------------------
FIRE1            IPADDR      INSERVICE     2

Verifying Firewall Connectivity

To verify that IOS SLB firewall load balancing has been configured and is operating correctly:


Step 1 Ping the external real servers (the ones outside the firewall) from the IOS SLB firewall load-balancing switch.

Step 2 Ping the internal real servers (the ones inside the firewall) from the clients.

Step 3 Use the show ip slb stats command to display detailed information about the IOS SLB firewall load-balancing network status:

Router# show ip slb stats
Pkts via normal switching:  0
Pkts via special switching: 0
Connections Created:        1911871
Connections Established:    1967754
Connections Destroyed:      1313251
Connections Reassigned:     0
Zombie Count:               0
Connections Reused:         59752
Connection Flowcache Purges:1776582
Failed Connection Allocs:   17945
Failed Real Assignments:    0
Router#

Normal switching is when IOS SLB packets are handled on normal IOS switching paths (CEF, FastSwitching, and Process Level). Special switching is when IOS SLB packets are handled on hardware-assisted switching paths.

Step 4 Use the show ip slb real detail command to display detailed information about the IOS SLB firewall load-balancing real server status:

Router# show ip slb real detail
10.1.1.3, FIRE1, state = OPERATIONAL, type = firewall
  conns = 299310, dummy_conns = 0, maxconns = 4294967295
  weight = 10, weight(admin) = 10, metric = 104, remainder = 2
  total conns established = 1074779, hash count = 4646
  server failures = 0
  interface FastEthernet1/0, MAC 0010.f68f.7020
Router#

Step 5 Use the show ip slb conns command to display detailed information about the active IOS SLB firewall load-balancing connections:

Router# show ip slb conns

vserver         prot client                real                  state     nat 
-------------------------------------------------------------------------------
FirewallTCP     TCP  80.80.50.187:40000    10.1.1.4              ESTAB     none
FirewallTCP     TCP  80.80.50.187:40000    10.1.1.4              ESTAB     none
FirewallTCP     TCP  80.80.50.187:40000    10.1.1.4              ESTAB     none
FirewallTCP     TCP  80.80.50.187:40000    10.1.1.4              ESTAB     none
FirewallTCP     TCP  80.80.50.187:40000    10.1.1.4              ESTAB     none
Router#sh ip slb conn

Step 6 See the "Monitoring and Maintaining the IOS SLB Feature" section for additional commands used to verify IOS SLB networks and connections.


Enhancing Firewall Security

IOS SLB relies on a site's firewalls to protect the site from attacks. In general, IOS SLB is no more susceptible to direct attack than is any switch or router. However, a highly secure site can take the following steps to enhance its security:

To protect against attackers trying to direct flows to real or nonexistent IP addresses in the firewall subnet, configure the firewalls in a private network.

Configure input access lists on the access router or on the IOS SLB device to deny flows from the outside network aimed directly at the interfaces on the IOS SLB device. That is, deny all direct flows from unexpected addresses.

Configure firewalls to deny all unexpected flows targeted at the firewalls, especially flows originating from the external network.

Configuring HTTP Probes

HTTP probes verify connectivity for devices being server load-balanced, and for firewalls being firewall load-balanced. For a detailed description of HTTP probes, see the "Probes" section.

To configure an HTTP probe, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb probe name http

Configures the IOS SLB probe name and changes to HTTP configuration submode. See the ip slb probe (HTTP probe) command for more details.

Step 2 

Router(config-slb-probe)# address [ip-address]

(Optional) Configures the HTTP probe to receive responses from an IP address. See the address (HTTP probe) command for more details.

Step 3 

Router(config-slb-probe)# credentials {username 
[password]}

(Optional) Configures header values for the HTTP probe. See the credentials command for more details.

Step 4 

Router(config-slb-probe)# expect [status number] 
[regex regular-expression]

(Optional) Configures the expected HTTP status code or regular expression. See the expect command for more details.

Step 5 

Router(config-slb-probe)# header {name field-name 
[field-value]}

(Optional) Configures header values for the HTTP probe. See the header command for more details.

Step 6 

Router(config-slb-probe)# interval seconds

(Optional) Configures the HTTP probe transmit timers. See the interval (HTTP probe) command for more details.

Step 7 

Router(config-slb-probe)# port port-number

(Optional) Configures the port to which the HTTP probe is to connect. See the port command for more details.

Step 8 

Router(config-slb-probe)# request [method {get | 
post | head | name name}] [url path]

(Optional) Configures the URL path to request from the server, and the method used to perform the request to the server. See the request method, request url command for more details.


Note HTTP probes require a route to the virtual server. The route is not used, but it must exist in order for HTTP probes to function correctly. The route can be either a host route (advertised by the virtual server) or a default route (specified using the ip route 0.0.0.0 0.0.0.0 command, for example).


To verify that the HTTP probe is configured correctly, use the following show ip slb probe command:

Router# show ip slb probe

Server:Port            State        Outages  Current  Cumulative
----------------------------------------------------------------
10.1.1.1:80            OPERATIONAL        0  never    00:00:00
10.1.1.2:80            OPERATIONAL        0  never    00:00:00
10.1.1.3:80            OPERATIONAL        0  never    00:00:00

Configuring Ping Probes

Ping probes verify connectivity for devices being server load-balanced, and for firewalls being firewall load-balanced. For a detailed description of ping probes, see the "Probes" section.

To configure a ping probe, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb probe name ping

Configures the IOS SLB probe name and changes to ping configuration submode. See the ip slb probe (ping probe) command for more details.

Step 2 

Router(config-slb-probe)# address [ip-address]

(Optional) Configures the ping probe to receive responses from an IP address. See the address (ping probe) command for more details.

Step 3 

Router(config-slb-probe)# faildetect number-of-pings

(Optional) Specifies the number of consecutive unanswered pings that constitute failure of the real server. See the faildetect (ping probe) command for more details.

Step 4 

Router(config-slb-probe)# interval seconds

(Optional) Configures the ping probe transmit timers. See the interval (ping probe) command for more details.

To verify that the ping probe is configured correctly, use the following show ip slb probe command:

Router# show ip slb probe

Server:Port            State        Outages  Current  Cumulative
----------------------------------------------------------------
13.13.13.13:80         OPERATIONAL        0  never    00:00:00

Configuring IOS SLB Dynamic Feedback Protocol

The IOS SLB Dynamic Feedback Protocol (DFP) is a mechanism that allows host agents in load-balanced environments to dynamically report the change in status of the host systems providing a virtual service. The status reported is a relative weight that specifies a host server's capacity to perform work.

To configure a DFP agent on a DFP manager (such as DistributedDirector), enter the following commands in order, beginning in global configuration mode:

 
Command
Purpose

Step 1 

Router(config)# ip slb dfp [password [0|7] password 
[timeout]]

Configures DFP and initiates DFP configuration mode, and optionally sets a password. See the ip slb dfp command for more details.

Step 2 

Router(config-slb-dfp)# agent ip_address port-number 
[timeout [retry_count [retry_interval]]]

Configures a DFP agent. See the agent command for more details.

On the DFP manager, use the following commands to:

Set the DFP password to Cookies and the timeout to 360 seconds, and then change the CLI to DFP configuration mode.

Sets the IP address of the DFP agent to 10.1.1.1 and the port number of the DFP agent to 2221 (FTP).

Router(config)# ip slb dfp password Cookies 360
Router(config-slb-dfp)# agent 10.1.1.1 2221

Configuring IOS SLB NAT

Cisco Network Address Translation (NAT), RFC 1631, allows unregistered "private" IP addresses to connect to the Internet by translating them into globally registered IP addresses. NAT also increases network privacy by hiding internal IP addresses from external networks. For a detailed description of NAT and the difference between "client" and "server" mode, see the "Network Address Translation (NAT) and Session Redirection" section.

To configure IOS SLB NAT for client mode, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb natpool pool-name start-ip 
end-ip [netmask netmask | prefix-length 
leading_1_bits] [entries init-addr [max-addr]]

Configures the client address pool.

Step 2 

Router(config-slb-sfarm)# nat {server | client 
pool-name}

Configures which NAT mode to use. See the nat command for more details.

The following commands configure a NAT server on server farm PUBLIC:

Router(config)# ip slb serverfarm PUBLIC
Router(config-slb-sfarm)# nat server

To configure IOS SLB NAT client mode for a specific server farm, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb natpool pool-name start-ip 
end-ip [netmask netmask | prefix-length 
leading_1_bits] [entries init-addr [max-addr]]

Configures the client address pool.

Step 2 

Router(config)# ip slb serverfarm serverfarm-name

Adds a server farm definition to the IOS SLB configuration and initiates server farm configuration mode. See the ip slb serverfarm command for more details.

Step 3 

Router(config-slb-sfarm)# nat {server | client 
pool-name}

Configures which NAT mode to use. See the nat command for more details.

Step 4 

Router(config-slb-sfarm)# real ip-address 
[port_number]

Identifies a real server as a member of a server farm and initiates real server configuration mode. See the real (server farm) command for more details.

Step 5 

Router(config-slb-real)# inservice

Enables the real server for use by IOS SLB. See the inservice (server farm real server) command for more details.

Step 6 

Router(config-slb-real)# exit

Return to server farm configuration mode.

Step 7 

Router(config-slb-real)# end

Return to global configuration mode.

Step 8 

Router(config)# ip slb vserver virtserver-name

Identifies a virtual server and initiates virtual server configuration mode. See the ip slb vserver command for more details.

Implementing IOS SLB Stateless Backup

Stateless backup, based on the Hot Standby Router Protocol (HSRP), provides high network availability by routing IP flows from hosts on Ethernet networks without relying on the availability of any single Layer 3 switch. Stateless backup is particularly useful for hosts that do not support a router discovery protocol (such as the Intermediate System-to-Intermediate System [IS-IS] Interdomain Routing Protocol [IDRP]) and do not have the functionality to shift to a new Layer 3 switch when their selected Layer 3 switch reloads or loses power.

This section discusses the following topics in detail:

How IOS SLB Stateless Backup Works

Configuring IOS SLB Stateless Backup

Enabling HSRP

Customizing Group Attributes

Verifying the IOS SLB Stateless Backup Configuration

Sample IOS SLB Stateless Backup Configuration

How IOS SLB Stateless Backup Works

A Layer 3 switch running the HSRP detects a failure by sending and receiving multicast User Datagram Protocol (UDP) "hello" packets. When the IOS SLB switch running HSRP detects that the designated active Layer 3 switch has failed, the selected backup Layer 3 switch assumes control of the HSRP group MAC and IP addresses. (You can also select a new standby Layer 3 switch at that time.) Both the primary and the backup Layer 3 switch must be on the same subnet.

The chosen MAC and IP addresses must be unique and must not conflict with any others on the same network segment. The MAC address is selected from a pool of Cisco MAC addresses. Configure the last byte of the MAC address by using the HSRP group number. When the HSRP is running, it selects an active Layer 3 switch and instructs its device layer to listen on an additional (dummy) MAC address.

IOS SLB switching software supports HSRP over 10/100 Ethernet, Gigabit Ethernet, FEC, GEC, and BVI (Bridge-Group Virtual Interface) connections.

HSRP uses a priority scheme to determine which HSRP-configured Layer 3 switch is to be the default active Layer 3 switch. To configure a Layer 3 switch as active, you assign it a priority higher than that of all other HSRP-configured Layer 3 switches. The default priority is 100, so if you configure just one Layer 3 switch to have a higher priority, that switch becomes the default active switch.

HSRP works by the exchange of multicast messages that advertise priority among HSRP-configured Layer 3 switches. When the active switch fails to send a hello message within a configurable period, the standby switch with the highest priority becomes the active switch. The transition of packet-forwarding functions between Layer 3 switches is completely transparent to all hosts accessing the network.

HSRP-configured Layer 3 switches exchange the following types of multicast messages:

Hello—The hello message conveys the switch's HSRP priority and state information. By default, an HSRP switch sends hello messages every three seconds.

Coup—When a standby Layer 3 switch assumes the function of the active switch, it sends a coup message.

Resign—The active Layer 3 switch, sends this message when it is about to shut down or when a switch that has a higher priority sends a hello message.

At any time, HSRP-configured Layer 3 switches are in one of the following states:

Active—The switch is performing packet-transfer functions.

Standby—The switch is prepared to assume packet-transfer functions if the active router fails.

Speaking and listening—The switch is sending and receiving hello messages.

Listening—The switch is receiving hello messages.

Configuring IOS SLB Stateless Backup

Configuring stateless backup requires the following:

You must configure IOS SLB switches to run HSRP between interfaces on the server or firewall side.

You can configure multiple IOS SLB switches that share a virtual IP address as long as the client ranges are exclusive and you use policy routing to forward the flows to the correct IOS SLB switch.

To configure stateless backup over VLANs between IOS SLB switches, perform the following tasks in order:


Step 1 For server load balancing, configure the server farms, real servers, and virtual servers—See the "Required Configuration Tasks" section.


Note When you use the inservice (server farm virtual server) command to configure the virtual server as "in-service" you must use the optional standby command and configure an HSRP group name.


For firewall load balancing, configure the firewall farms—See the "Configuring IOS SLB Firewall Load Balancing" section.


Note When you use the inservice (firewall farm) command to configure the firewall farm as "in-service" you must use the optional standby command and configure an HSRP group name.


Step 2 Configure the IP routing protocol—See the "IP Routing Protocols" chapter of the Cisco IOS IP and IP Routing Configuration Guide.

Step 3 Configure the VLAN between the switches—See the "Virtual LANs" chapter of the Cisco IOS Switching Services Configuration Guide.

Step 4 Enable HSRP—See the "Enabling HSRP" section.

Step 5 Customize group attributes—See the "Customizing Group Attributes" section.

Step 6 Verify the IOS SLB HSRP configuration—See the "Verifying the IOS SLB Stateless Backup Configuration" section.


A sample stateless backup configuration is shown in the "Sample IOS SLB Stateless Backup Configuration" section.

Enabling HSRP

To enable HSRP on an IOS SLB interface, enable the protocol, then customize it for the interface. Enter the following command in interface configuration mode:

Command
Purpose
Router(config-if)# standby [group-number] ip [ip-address 
[secondary]]

Enables HSRP.


Customizing Group Attributes

To customize "hot standby" group attributes, use one or more of the following commands in interface configuration mode:

Command
Purpose
Router(config-if)# standby [group-number] authentication 
string

Selects an authentication string to be carried in all HSRP messages.

Router(config-if)# standby [group-number] name group-name

Specifies an HSRP group name with which to associate an IOS SLB interface.

Router(config-if)# standby [group-number] preempt

Specifies that if the local router has priority over the current active router, the local router should attempt to take its place as the active router.

Router(config-if)# standby [group-number] priority priority

Sets the hot standby priority used to choose the active router.

Router(config-if)# standby [group-number] timers hellotime 
holdtime

Configures the time between hello packets and the hold time before other routers declare the active router to be down.

Router(config-if)# standby [group-number] track type-number 
[interface-priority]

Configures the interface to track other interfaces, so that if one of the other interfaces goes down, the hot standby priority for the device is lowered.


Verifying the IOS SLB Stateless Backup Configuration

For server load balancing, to verify that stateless backup has been configured and is operating correctly, use the following show ip slb vservers commands to display information about the IOS SLB virtual server status:

Router# show ip slb vservers

slb vserver      prot  virtual               state         conns   
-------------------------------------------------------------------
VS1              TCP   10.10.10.12:23        OPERATIONAL     2 
VS2              TCP   10.10.10.18:23        OPERATIONAL     2 

Router# show ip slb vservers detail
VS1, state = OPERATIONAL, v_index = 10
  virtual = 10.10.10.12:23, TCP, service = NONE, advertise = TRUE
  server farm = SERVERGROUP1, delay = 10, idle = 3600
  sticky timer = 0, sticky subnet = 255.255.255.255
  sticky group id = 0 
  synguard counter = 0, synguard period = 0
  conns = 0, total conns = 0, syns = 0, syn drops = 0
  standby group = None
VS2, state = INOFSERVICE, v_index = 11
  virtual = 10.10.10.18:23, TCP, service = NONE, advertise = TRUE
  server farm = SERVERGROUP2, delay = 10, idle = 3600
  sticky timer = 0, sticky subnet = 255.255.255.255
  sticky group id = 0 
  synguard counter = 0, synguard period = 0
  conns = 0, total conns = 0, syns = 0, syn drops = 0
  standby group = None

For firewall load balancing, to verify that stateless backup has been configured and is operating correctly, use the following show ip slb firewallfarm commands to display information about the IOS SLB firewall farm status:

Router# show ip slb firewallfarm
firewall farm    hash        state         reals
------------------------------------------------
FIRE1            IPADDR      INSERVICE     2

Router# show ip slb firewallfarm details
FIRE1, hash = IPADDRPORT, state = INSERVICE, reals = 2
  FirewallTCP:
   sticky timer = 0, sticky subnet = 255.255.255.255
   idle = 3600, delay = 10, syns = 1965732, syn drop = 0 
   maxconns = 4294967295, conns = 597445, total conns = 1909512
  FirewallUDP:
   sticky timer = 0, sticky subnet = 255.255.255.255
   idle = 3600
   maxconns = 1, conns = 0, total conns = 1
  Real firewalls:
    10.1.1.3, weight = 10, OPERATIONAL, conns = 298823
    10.1.1.4, weight = 10, OPERATIONAL, conns = 298622
  Total connections = 597445

Sample IOS SLB Stateless Backup Configuration

The following commands enable the HSRP standby group 100 IP address, priority, preempt, timers, configure a name and authentication for Device A in Figure 7:

Router(config-if)# standby 100 ip 172.20.100.10
Router(config-if)# standby 100 priority 110
Router(config-if)# standby 100 preempt delay 910
Router(config-if)# standby 100 timers 5 15
Router(config-if)# standby 100 name Web-Group1
Router(config-if)# standby 100 authentication Secret
Router(config-if)# exit
Router# 

Configuring IOS SLB Stateful Backup

Stateful backup enables IOS SLB to incrementally back up its load-balancing decisions, or "keep state," between primary and backup switches. The backup switch has its virtual servers in a dormant state until HSRP detects failover; then the backup (now primary) switch begins advertising virtual addresses and filtering flows. You can use HSRP to configure how quickly the failover is detected.

This enhancement provides IOS SLB with a one-to-one stateful or idle backup scheme. This means that only one instance of IOS SLB is handling client or server flows at a given time, and that there is at most one backup platform for each active IOS SLB switch.

To configure stateful backup to keep state across primary and backup Layer 3 switches, enter the following commands in order, beginning in global configuration mode:

Configuring Stateful Backup for Server Load Balancing

To configure stateful backup to keep state across primary and backup Layer 3 switches in a server load-balancing environment, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb vserver virtserver-name

Configures a virtual server and enters virtual server configuration mode.

Step 2 

Router(config-slb-vserver)# replicate casa 
listening-ip remote-ip port-number [interval] 
[password [0|7] password timeout]

Configures a stateful backup of IOS SLB decision tables to a backup switch. See the replicate casa (virtual server) command for more details.

The following commands configure stateful backup for virtual server RESTRICTED_HTTP using listening IP 10.10.3.132 and remote IP 10.10.99.3 over port 1032 and configures the password as PASS for Device A in Figure 12:

Router(config)# ip slb vserver RESTRICTED_HTTP
Router(config-slb-vserver)# virtual 10.10.10.12 tcp telnet
Router(config-slb-vserver)# replicate casa 10.10.3.132 10.10.99.3 1032 password PASS
Router(config-slb-vserver)# inservice standby virt 
Router(config-slb-vserver)#
.
(Information Deleted)

Configuring Stateful Backup for Firewall Load Balancing

To configure stateful backup to keep state across primary and backup Layer 3 switches in a firewall load-balancing environment, enter the following commands in order, beginning in global configuration mode:

 
Command
Description

Step 1 

Router(config)# ip slb firewallfarm 
firewallfarm-name

Configures a firewall farm and enters firewall farm configuration mode.

Step 2 

Router(config-slb-fw)# replicate casa listening-ip 
remote-ip port-number [interval] [password [0|7] 
password timeout]

Configures a stateful backup of IOS SLB decision tables to a backup switch. See the replicate casa (firewall farm) command for more details.

Monitoring and Maintaining the IOS SLB Feature

To obtain and display runtime information about IOS SLB, use the following commands in EXEC mode:

Command
Purpose
Router# show ip slb conns [vserver virtserver-name] [client 
ip-address] [detail]

Displays all connections handled by IOS SLB, or, optionally, only those connections associated with a particular virtual server or client. See the show ip slb conns command for more details.

Router# show ip slb dfp [agent ip_address port-number] 
[detail] [weights]

Displays information about DFP and DFP agents, and about the weights assigned to real servers. See the show ip slb dfp command for more details.

Router# show ip slb firewallfarm [detail]

Displays information about firewall farms. See the show ip slb firewallfarm command for more details.

Router# show ip slb probe [name probe_name] [detail]

Displays information about HTTP and ping probes defined to IOS SLB. See the show ip slb probe command for more details.

Router# show ip slb reals [vserver virtserver-name] [detail]

Displays information about the real servers defined to IOS SLB. See the show ip slb reals command for more details.

Router# show ip slb replicate

Displays information about the IOS SLB replication configuration. See the show ip slb replicate command for more details.

Router# show ip slb serverfarms [name serverfarm-name] 
[detail]

Displays information about the server farms defined to IOS SLB. See the show ip slb serverfarms command for more details.

Router# show ip slb stats

Displays IOS SLB statistics. See the show ip slb stats command for more details.

Router# show ip slb sticky [client ip-address]

Displays information about the sticky connections defined to IOS SLB. See the show ip slb sticky command for more details.

Router# show ip slb vservers [name virtserver-name] [detail]

Displays information about the virtual servers defined to IOS SLB. See the show ip slb vservers command for more details.


Configuration Examples

This section provides real-world examples of IOS SLB configurations and includes the following sections:

Complete Example Configuration

Example of a Layer 3 Switch with ISL, VLAN, and BVI with GEC

Example of IOS SLB with Firewall Load Balancing

Example of IOS SLB with Probes

Example of a Layer 3 Switch Configured with IOS SLB

Example of IOS SLB with NAT

Example of an IOS Layer 3 Switch with HSRP

Examples of IOS SLB with Stateless Backup

Example of IOS SLB with Stateful Backup

Example of IOS SLB with Active Standby

Example of IOS SLB with Redistribution of Static Routes

Example of IOS SLB with WAP Load Balancing


Note The IP and network addresses in these examples are generic, so you must replace them with the actual addresses for your network.


Complete Example Configuration

The following example provides a complete configuration using the commands described in this feature module:

Router# show running-config
Building configuration...

Current configuration:
!
.
(Information Deleted)
.
ip slb probe PROBE2 http
 request method POST url /probe.cgi?all
 header Cookie Monster
 header Authorization Basic U2VtaXN3ZWV0OmNoaXBz
! 
ip slb serverfarm PUBLIC
 nat server
 real 10.1.1.1
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
 real 10.1.1.2
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
 real 10.1.1.3
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
 probe PROBE2
!
ip slb serverfarm RESTRICTED
 predictor leastconns
 bindid 309
 real 10.1.1.1
  weight 32
  maxconns 1000
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
 real 10.1.1.20
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
 real 10.1.1.21
  reassign 4
  faildetect numconns 16
  retry 120
  inservice
!
ip slb vserver PUBLIC_HTTP
 virtual 10.0.0.1 tcp www
 serverfarm PUBLIC
 no inservice
!
ip slb vserver RESTRICTED_HTTP
 virtual 10.0.0.2 tcp www
 serverfarm RESTRICTED
 no advertise
 sticky 60 group 1
 idle 120
 delay 5
 client 10.4.4.0 255.255.255.0
 synguard 3600000
 inservice
!

Example of a Layer 3 Switch with ISL, VLAN, and BVI with GEC

This example configuration focuses on both the Inter-Switch Link (ISL) and virtual LANs (VLANs), as well as integrated routing and bridging (IRB) using a bridge-group virtual interface (BVI) over Gigabit EtherChannel (GEC). The Cisco proprietary ISL allows any Fast Ethernet port to be configured as a trunk. The Spanning-Tree Protocol detects and breaks loops on all the VLANs carried across the trunk.

The Gigabit Ethernet interface information applies to both two-port and eight-port Gigabit Ethernet interfaces for a Catalyst 8540 campus Layer 3 switch. This example also includes port snooping and Network Time Protocol (NTP) configurations.

!
ip subnet-zero
no ip domain-lookup
ip name-server 171.69.2.132
ip name-server 198.92.30.32
ip multicast-routing
ip dvmrp route-limit 20000
bridge irb
!
interface FastEthernet1
no ip address
no ip directed-broadcast
no keepalive
!
interface FastEthernet1.128
ip address 172.68.16.10 255.255.255.0
ip helper-address 172.68.16.15
no ip redirects
no ip directed-broadcast
ip pim dense-mode
ip multicast ttl-threshold 1
encapsulation isl 128
!
interface FastEthernet1.199
ip address 172.68.17.15 255.255.255.0
ip helper-address 172.68.16.16
ip helper-address 172.68.16.17
ip helper-address 172.68.16.18
no ip redirects
no ip directed-broadcast
ip pim dense-mode
ip multicast ttl-threshold 1
encapsulation isl 199
!
interface FastEthernet1.201
ip address 172.68.18.10 255.255.255.0
ip helper-address 172.68.16.16
ip helper-address 172.68.16.17
ip helper-address 172.68.16.18
no ip redirects
no ip directed-broadcast
ip pim dense-mode
ip multicast ttl-threshold 1
encapsulation isl 201
!
interface FastEthernet2
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet3
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet4
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet5
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet6
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet7
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet8
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet9
ip address 172.68.19.10 255.255.255.0
ip helper-address 172.68.16.16
ip helper-address 172.68.16.17
ip helper-address 172.68.16.18
no ip redirects
no ip directed-broadcast
ip pim dense-mode
ip multicast ttl-threshold 1
ip sdr listen
no keepalive
!
interface FastEthernet10
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
interface FastEthernet11
no ip address
no ip directed-broadcast
no keepalive
shutdown
!
.
(Information Deleted)
.
interface GigabitEthernet41
 snoop interface FastEthernet3 direction both
 snoop interface FastEthernet5 direction both
 snoop interface FastEthernet6 direction both
ip address 172.68.21.10 255.255.255.0
ip helper-address 172.68.16.19
ip helper-address 172.68.16.20
ip helper-address 172.68.16.21
!
interface GigabitEthernet42
    ip address 172.68.1.1 255.255.255.0
    no ip directed-broadcast
    ip pim sparse-dense-mode
!
interface BVI1
    ip address 171.201.1.2 255.255.255.0
    no ip directed-broadcast
    ip pim dense-mode
    no ip route-cache cef
!
interface Ethernet0
ip address 172.68.20.10 255.255.255.0
no ip directed-broadcast
!
router eigrp 170
 network 171.200.0.0
 network 171.201.0.0
 network 172.68.0.0
 network 172.69.0.0
 no auto-summary
!
router bgp 180
 network 172.68.1.0
 network 172.69.1.0
 no auto-summary
!
ip classless
!
bridge 1 protocol ieee
bridge 1 route ip
!
ip http server
!
line con 0
line aux 0
line vty 0 4
login
!
ntp clock-period 17181168
ntp update-calendar
ntp server 171.71.150.52
ntp server 171.69.4.143
ntp server 171.69.5.10
end

Example of IOS SLB with Firewall Load Balancing

Figure 3 shows a sample IOS SLB firewall load-balancing network with the following components:

Two firewalls with IP addresses as shown

An internal firewall load-balancing device on the secure side of the firewalls

An external firewall load-balancing device on the Internet side of the firewalls

One firewall farm named FIRE1, containing both firewalls

Figure 3 IOS SLB with Layer 3 Firewalls in Different Subnets

When you configure IOS SLB firewall load balancing, the load-balancing devices use route lookup to recognize flows destined for the firewalls. To enable route lookup, you must configure each device with the IP address of each firewall that will route flows to that device.

In the following farm configuration samples:

The internal (secure side) firewall load-balancing device is configured with firewall IP addresses 10.1.3.1 and 10.1.4.1.

The external (Internet side) firewall load-balancing device is configured with firewall IP addresses 10.1.1.2 and 10.1.2.2.

Internal Firewall Load-Balancing Device

The following commands configure ping probe PROBE1, HTTP probe PROBE2, and firewall farm FIRE1, and associate the two real servers for the load-balancing device on the internal (secure) side of the firewall:

router(config)# ip slb probe PROBE1 ping	; Ping probe
router(config-slb-probe)# address 10.1.1.1	; IP address of other load-balancing device
router(config-slb-probe)# faildetect 4
router(config-slb-probe)# ip slb probe PROBE2 http	; HTTP probe
router(config-slb-probe)# address 10.1.2.1	; IP address of other load-balancing device
router(config-slb-probe)# expect status 401
router(config-slb-probe)# ip slb firewallfarm FIRE1	; Firewall farm FIRE1
router(config-slb-fw)# real 10.1.4.1	; First firewall
router(config-slb-fw-real)# probe PROBE1
router(config-slb-fw-real)# inservice	; Enable first firewall
router(config-slb-fw-real)# real 10.1.3.1	; Second firewall
router(config-slb-fw-real)# probe PROBE2
router(config-slb-fw-real)# inservice	; Enable second firewall
router(config-slb-fw-real)# exit
router(config-slb-fw)# inservice	; Turn on firewall load-balancing device

External Firewall Load-Balancing Device

The following commands configure ping probe PROBE1, HTTP probe PROBE2, and firewall farm FIRE1, and associate the two real servers for the load-balancing device on the external (Internet) side of the firewall:

router(config)# ip slb probe PROBE1 ping	; Ping probe
router(config-slb-probe)# address 10.1.4.2	; IP address of other load-balancing device
router(config-slb-probe)# faildetect 4
router(config-slb-probe)# ip slb probe PROBE2 http	; HTTP probe
router(config-slb-probe)# address 10.1.3.2	; IP address of other load-balancing device
router(config-slb-probe)# expect status 401
router(config-slb-probe)# ip slb firewallfarm FIRE1	; Firewall farm FIRE1
router(config-slb-fw)# real 10.1.1.2	; First firewall
router(config-slb-fw-real)# probe PROBE1
router(config-slb-fw-real)# inservice	; Enable first firewall
router(config-slb-fw-real)# real 10.1.2.2	; Second firewall
router(config-slb-fw-real)# probe PROBE2
router(config-slb-fw-real)# inservice	; Enable second firewall
router(config-slb-fw-real)# exit
router(config-slb-fw)# inservice	; Turn on firewall load-balancing device

Example of IOS SLB with Probes

Figure 4 shows an example configuration with IOS SLB real server connections configured as part of a server farm, focusing on using ping and HTTP probe to monitor applications being server load-balanced.

Figure 4 Sample Ping and HTTP Probe Topology

:

The topology shown in Figure 4 is a heterogeneous server farm servicing a single virtual server. Following are the configuration statements for this topology, including a ping probe named PROBE1 and an HTTP probe named PROBE2:

! Configure ping probe PROBE1, change CLI to IOS SLB probe configuration mode
Router(config)# ip slb probe PROBE1 ping
! Configure probe to receive responses from IP address 13.13.13.13
Router(config-slb-probe)# address 13.13.13.13
! Configure unanswered ping threshold to 16
Router(config-slb-probe)# faildetect 16
! Configure ping probe timer interval to transmit every 11 seconds
Router(config-slb-probe)# interval 11
! Configure HTTP probe PROBE2
Router(config-slb-probe)# ip slb probe PROBE2 http
! Configure request method as POST, set URL as /probe.cgi?all
Router(config-slb-probe)# request method post url /probe.cgi?all
! Configure header Cookie
Router(config-slb-probe)# header Cookie Monster
! Configure basic authentication username and password
Router(config-slb-probe)# credentials Semisweet chips
! Exit to global configuration mode
Router(config-slb-probe)# exit
! Enter IOS SLB server farm configuration mode for server farm PUBLIC
Router(config)# ip slb serverfarm PUBLIC
! Configure NAT server and real servers on the server farm
Router(config-slb-sfarm)# nat server
Router(config-slb-sfarm)# real 10.1.1.1
Router(config-slb-sfarm)#  inservice
Router(config-slb-sfarm)# real 10.1.1.2
Router(config-slb-sfarm)#  inservice
Router(config-slb-sfarm)# real 10.1.1.3
Router(config-slb-sfarm)#  inservice
Router(config-slb-sfarm)# real 10.1.1.4
Router(config-slb-sfarm)#  inservice
Router(config-slb-sfarm)# real 10.1.1.5
Router(config-slb-sfarm)#  inservice
! Configure ping probe on the server farm
Router(config-slb-sfarm)# probe PROBE1
! Configure HTTP probe on the server farm
Router(config-slb-sfarm)# probe PROBE2
Router(config-slb-sfarm)# end

Example of a Layer 3 Switch Configured with IOS SLB

Figure 5 shows an example configuration with IOS SLB server connections configured as part of a server farm, using real and virtual servers over Fast Ethernet interfaces.

Figure 5 Network Configuration for IOS SLB

As shown in the following sample configuration, the example topology has three public Web servers and two restricted Web servers for privileged clients in subnet 10.4.4.x. The public Web servers are weighted according to their capacity, with server 10.1.1.2 having the lowest capacity and having a connection limit imposed on it. The restricted Web servers are configured as members of the same sticky group, so that HTTP connections and Secure Socket Layer (SSL) connections from the same client use the same real server.

The network configuration to provide the previously described IOS SLB functionality follows:

! Unrestricted Web server farm
ip slb serverfarm PUBLIC
! Use weighted least connections algorithm
  predictor leastconns
! First real server
  real 10.1.1.1
    weight 16
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Second real server
  real 10.1.1.2
    weight 4
!  Restrict maximum number of connections
    maxconns 1000
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Third real server
  real 10.1.1.3
    weight 24
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Restricted Web server farm
ip slb serverfarm RESTRICTED
! Use weighted least connections algorithm
  predictor leastconns
! First real server
  real 10.1.1.20
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Second real server
  real 10.1.1.21
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
!
! Unrestricted Web virtual server
ip slb vserver PUBLIC_HTTP
! Handle HTTP requests
  virtual 10.0.0.1 tcp www
! Use public Web server farm
  serverfarm PUBLIC
  idle 120
  delay 5
  inservice
!
! Restricted HTTP virtual server
ip slb vserver RESTRICTED_HTTP
! Handle HTTP requests
  virtual 10.0.0.1 tcp www
! Use restricted Web server farm
  serverfarm RESTRICTED
! Only allow clients from 10.4.4.x
  client 10.4.4.0 255.255.255.0
! Couple connections with RESTRICTED_SSL
  sticky 60 group 1
  idle 120
  delay 5
  inservice
!
! Restricted SSL virtual server
ip slb vserver RESTRICTED_SSL
! Handle SSL requests
  virtual 10.0.0.1 tcp https
! Use restricted Web server farm
  serverfarm RESTRICTED
! Only allow clients from 10.4.4.x
  client 10.4.4.0 255.255.255.0
! Couple connections with RESTRICTED_WEB
  sticky 60 group 1
  idle 120
  delay 5
  inservice

Example of IOS SLB with NAT

Figure 6 shows an example configuration with IOS SLB real server connections configured as part of a server farm, focusing on the configuration of the NAT server and address pool of clients.

Figure 6 Sample IOS SLB NAT Topology

The topology in Figure 6 has four Web servers, configured as follows:

Servers 1, 2, and 3 are running single HTTP server applications listening on port 80.

Server 4 has multiple HTTP server applications listening on ports 8080, 8081, and 8082.

Server 1 and Server 2 are load-balanced using Switch A, which is performing server address translation.

Server 3 and Server 4 are load-balanced using Switch B and Switch C. These two switches are performing both server and client address translation since there are multiple paths between the clients and the servers. These switches also must perform server port translation for HTTP packets to and from Server 4.

Switch A Configuration Statements

ip slb serverfarm FARM1
! Translate server addresses
  nat server
! Server 1 port 80
  real 10.1.1.1
    reassign 2
    faildetect numconns 4 numclients 2
    retry 20
    inservice
! Server 2 port 80
  real 10.2.1.1
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
!
ip slb vserver HTTP1
! Handle HTTP (port 80) requests
  virtual 128.1.0.1 tcp www
  serverfarm FARM1
  idle 120
  delay 5
  inservice

Switch B Configuration Statements

ip slb natpool web-clients 128.3.0.1 128.3.0.254
! NAT address pool for clients
ip slb serverfarm FARM2
! Translate server addresses
  nat server
! Translate client addresses
  nat client web-clients
! Server 3 port 80
  real 10.3.1.1
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8080
  real 10.4.1.1 port 8080
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8081
  real 10.4.1.1 port 8081
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8082
  real 10.4.1.1 port 8082
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
!
ip slb vserver HTTP2
! Handle HTTP (port 80) requests
  virtual 128.2.0.1 tcp www
  serverfarm FARM2
  idle 120
  delay 5
  inservice

Switch C Configuration Statements

ip slb natpool web-clients 128.5.0.1 128.5.0.254
! NAT address pool for clients
ip slb serverfarm FARM2
! Translate server addresses
  nat server
! Translate client addresses
  nat client web-clients 
! Server 3 port 80
  real 10.3.1.1
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8080
  real 10.4.1.1 port 8080
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8081
  real 10.4.1.1 port 8081
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
! Server 4 port 8082
  real 10.4.1.1 port 8082
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
!
ip slb vserver HTTP2
! Handle HTTP (port 80) requests
  virtual 128.4.0.1 tcp www
  serverfarm FARM2
  idle 120
  delay 5
  inservice

Example of an IOS Layer 3 Switch with HSRP

This example configuration for an IOS Layer 3 switch focuses on the HSRP, which provides high network availability. HSRP makes network topology changes transparent to the host. The active router is monitored by other standby routers, and as soon as an active router becomes unavailable, the standby router takes its place. Helper addresses facilitate connectivity by forwarding certain broadcasts to a target server.

Figure 7 shows the topology of an IP network with two Layer 3 switches configured for HSRP.

Figure 7 HSRP Example Network Topology

In this network:

An IP helper address identifies the Dynamic Host Configuration Protocol (DHCP) server IP address. This configuration also includes configuration for IP multicast, Distance Vector Multicast Routing Protocol (DVMRP), tunneling, and Protocol Independent Multicast (PIM) in sparse mode.

Device A is the active HSRP Layer 3 switch.

All hosts accessing the network use the IP address of the virtual servers (in this case, 10.10.10.12 or 10.10.10.18).

The configurations shown use the RIP routing protocol, but HSRP can be used with any other routing protocol supported by the Cisco IOS software, such as Open Shortest Path First (OSPF).


Note Some configurations that use HSRP still require a routing protocol for convergence when a topology change occurs. The standby Layer 3 switch becomes active, but connectivity does not occur until convergence occurs.


If the connection between Device A and the client accessing virtual server IP address 10.10.10.12 tcp 23 or 10.10.10.18 tcp 23 fails, fast converging routing protocols, such as OSPF and the Enhanced Interior Gateway Routing Protocol (Enhanced IGRP), can respond within seconds, ensuring that Device B is prepared to transfer packets that would have gone through Device A.

Device A (Active) Configuration Statements

hostname Device A
!
ip slb serverfarm ServerGroup1
   real 172.20.100.3
   inservice
   real 172.20.100.4
   inservice
!
ip slb serverfarm ServerGroup2
   real 172.20.200.3
   inservice
   real 172.20.200.4
   inservice
!
ip slb vserver VS1
   virtual 10.10.10.12 tcp 23
   serverfarm ServerGroup1
   in-service standby Web-Group1
!
ip slb vserver VS2
   virtual 10.10.10.18 tcp 23
   serverfarm ServerGroup2
   in-service standby Web-Group2
!
ip routing
router rip
network 172.20.0.0
!
interface vlan100
ip address 172.20.100.1 255.255.255.0
standby 100 ip 172.20.100.10
standby 100 priority 110
standby 100 preempt delay 910
standby 100 timers 5 15
standby 100 name Web-Group1
standby 100 authentication Secret
!
interface vlan200
ip address 172.20.200.1 255.255.255.0
standby 200 ip 172.20.200.10
standby 200 priority 110
standby 200 preempt delay 910
standby 200 timers 5 15
standby 200 name Web-Group2
standby 200 authentication Covert
!

Device B (Standby) Configuration Statements

hostname Device B
!
ip slb serverfarm ServerGroup1
   real 172.20.100.3
   inservice
   real 172.20.100.4
   inservice
!
ip slb serverfarm ServerGroup2
   real 172.20.200.3
   inservice
   real 172.20.200.4
   inservice
!
ip slb vserver VS1
   virtual 10.10.10.12 tcp 23
   serverfarm ServerGroup1
   in-service standby Web-Group1
!
ip slb vserver VS2
   virtual 10.10.10.18 tcp 23
   serverfarm ServerGroup2
   in-service standby Web-Group2
!
ip routing
router rip
network 172.20.0.0
!
interface vlan100
ip address 172.20.100.2 255.255.255.0
standby 100 ip 172.20.100.10
standby 100 preempt delay 910
standby 100 timers 5 15
standby 100 name Web-Group1
standby 100 authentication Secret
!
interface vlan200
ip address 172.20.200.2 255.255.255.0
standby 200 ip 172.20.200.10
standby 200 preempt delay 910
standby 200 timers 5 15
standby 200 name Web-Group2
standby 200 authentication Covert

Description of Configuration

The standby ip interface configuration command enables HSRP and establishes 10.10.10.12 and 10.10.10.18 as the IP addresses of the virtual servers. The configurations of both Layer 3 switches include this command so that both switches share the same virtual IP address. The numbers 100 and 200 establish Hot Standby groups 100 and 200. (If you do not specify a group number, the default is group 0.) The numbers 100 and 200 in the following commands indicate that they apply to Hot Standby groups 100 and 200, respectively. The configuration for at least one of the Layer 3 switches in the Hot Standby group must specify the IP address of the virtual server; specifying the IP address of the virtual router is optional for other routers in the same Hot Standby group.

The standby preempt interface configuration command allows the Layer 3 switch to become the active switch when its priority is higher than all other HSRP-configured switches in this Hot Standby group. The configurations of both switches include this command so that each can be the standby Layer 3 switch for the other switch. If you do not use the standby preempt command in the configuration for a Layer 3 switch, that switch cannot become the active Layer 3 switch.

The standby priority interface configuration command sets the Layer 3 switch's HSRP priority to 110, which is higher than the default priority of 100. Only the configuration of Device A includes this command, which makes Device A the default active Layer 3 switch.

The standby timers interface configuration command sets the interval (in seconds) between hello messages (called the hello time) to five seconds, and sets the interval (in seconds) that a Layer 3 switch waits before it declares the active Layer 3 switch to be down (called the hold time) to eight seconds. (The defaults are three and 10 seconds, respectively.) To modify the default values, you must configure each Layer 3 switch to use the same hello time and hold time.

The standby name interface configuration command associates the IOS SLB interface with an HSRP group name (in this case, Web-Group1 and Web-Group2), previously specified on an inservice (server farm virtual server) command.

The standby authentication interface configuration command establishes an authentication string whose value is an unencrypted eight-character string that is incorporated in each HSRP multicast message. This command is optional. If you choose to use it, each HSRP-configured Layer 3 switch in the group should use the same string so that each switch can authenticate the source of the HSRP messages that it receives.

Examples of IOS SLB with Stateless Backup

There are several different ways in which you can configure IOS SLB stateless backup. The differences between the configurations depend on the networking capabilities of your load balancing devices, and on the capabilities of the distribution devices that direct client traffic to those load balancing devices.

If a load balancing device is capable of Layer 2 switching and VLAN trunking (such as the Catalyst 6000 Family Switches), you can wire the device directly to its real servers, and it can handle outbound flows from the real servers while acting as a standby for IOS SLB. HSRP is used on the server-side VLANs of the load balancing device, with the real servers routing to the HSRP address.

If a load balancing device is not capable of both Layer 2 switching and VLAN trunking, you must connect it and its real servers to a Layer 2 switch. This configuration is required in order to use HSRP on the server-side VLANs.

If a distribution device is capable of Layer 3 switching, it can use route redistribution to direct flows to the active load balancing device.

If a distribution device is capable of Layer 2 switching, it can use client-side HSRP on the load balancing device to direct flows to the active load balancing device.

While HSRP offers faster failover times, routing converges quickly enough for most configurations. If you use both client-side and server-side HSRP on the load balancing devices, you must use HSRP interface tracking and priorities to synchronize the client-side and server-side HSRP groups.

This section contains the following examples, illustrating several different IOS SLB stateless backup configurations:

Example with Dynamic Routing and Trunking

Example with Dynamic Routing and No Trunking

Example with Static Routing and Trunking

Example with Static Routing and No Trunking


Note Stateful backup is omitted from these examples in the interest of simplicity. To see an example that uses stateful backup, see the "Example of IOS SLB with Stateful Backup" section.


Example with Dynamic Routing and Trunking

Figure 8 shows a sample IOS SLB stateless backup configuration with the following characteristics:

The IP address for real server 1 is 10.10.1.3, and for real server 2 is 10.10.1.4, routed to clients through 10.10.1.100.

The IP address for the virtual server is 10.10.14.1.

The IP address for VLAN 1 is 10.10.1.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 2 is 10.10.2.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 3 is 10.10.3.0, with a subnet mask of 255.255.255.0.

The distribution device uses EIGRP to learn the route to 10.10.14.1 via either 10.10.2.1 or 10.10.3.1, depending on which IOS SLB is active.

Figure 8 Stateless Backup with Layer 3 and Trunking

SLB 1 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4 numclients 2
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  switchport
  switchport vlan 1
int Eth2
  ip address 10.10.2.1 255.255.255.0
int vlan 1
  ip address 10.10.1.1 255.255.255.0
  standby ip 10.10.1.100
  standby priority 10 preempt delay 910
  standby name SERVER
  standby track Eth2
router eigrp 666
  redistribute static
  network 10.0.0.0

SLB 2 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Gig1
  no ip address
  switchport
  switchport trunk encapsulation isl
int Eth1
  switchport
  switchport vlan 1
int Eth2
  ip address 10.10.3.1 255.255.255.0
int vlan 1
  ip address 10.10.1.2 255.255.255.0
  standby ip 10.10.1.100
  standby priority 5 preempt delay 910
  standby name SERVER
router eigrp 666
  redistribute static
  network 10.0.0.0

Example with Dynamic Routing and No Trunking

Figure 9 shows a sample IOS SLB stateless backup configuration with the following characteristics:

The IP address for real server 1 is 10.10.1.3, and for real server 2 is 10.10.1.4, routed to clients through 10.10.1.100.

The IP address for the virtual server is 10.10.14.1.

The IP address for Subnet 2 is 10.10.2.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 3 is 10.10.3.0, with a subnet mask of 255.255.255.0.

The distribution device uses EIGRP to learn the route to 10.10.14.1 via either 10.10.2.2 or 10.10.3.2, depending on which IOS SLB is active.

Figure 9 Stateless Backup with Layer 3 and No Trunking

SLB 1 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  ip address 10.10.1.1 255.255.255.0
  standby ip 10.10.1.100
  standby priority 10 preempt delay 910
  standby name SERVER
  standby track Eth2
int Eth2
  ip address 10.10.2.1 255.255.255.0
router eigrp 666
  redistribute static
  network 10.0.0.0

SLB 2 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  ip address 10.10.1.2 255.255.255.0
  standby ip 10.10.1.100
  standby priority 5 preempt delay 910
  standby name SERVER
int Eth2
  ip address 10.10.3.1 255.255.255.0
router eigrp 666
  redistribute static
  network 10.0.0.0

Example with Static Routing and Trunking

Figure 10 shows a sample IOS SLB stateless backup configuration with the following characteristics:

The IP address for real server 1 is 10.10.1.3, and for real server 2 is 10.10.1.4, routed to clients through 10.10.1.100.

The IP address for the virtual server is 10.10.14.1.

The IP address for VLAN 1 is 10.10.1.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 2 is 10.10.2.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 3 is 10.10.3.0, with a subnet mask of 255.255.255.0.

The configuration uses static routing to the HSRP route on the distribution device.

Figure 10 Stateless Backup with Layer 2 and Trunking

SLB 1 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  switchport
  switchport vlan 1
int Eth2
  ip address 10.10.2.1 255.255.255.0
  standby ip 10.10.2.100
  standby priority 10 preempt delay 910
  standby track vlan1
int vlan 1
  ip address 10.10.1.1 255.255.255.0
  standby ip 10.10.1.100
  standby priority 10 preempt delay 910
  standby name SERVER
  standby track Eth2

SLB 2 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Gig1
  no ip address
  switchport
  switchport trunk encapsulation isl
int Eth1
  switchport
  switchport vlan 1
int Eth2
  ip address 10.10.2.2 255.255.255.0
  standby ip 10.10.2.100
  standby priority 5 preempt delay 910
int vlan 1
  ip address 10.10.1.2 255.255.255.0
  standby ip 10.10.1.100
  standby priority 5 preempt delay 910
  standby name SERVER

Distribution Device Configuration Statements

int Eth1
  switchport
  switchport distribution vlan 2
int Eth2
  switchport
  switchport distribution vlan 2
int vlan2
  ip address 10.10.2.3 255.255.255.0
  no shut
ip route 10.10.14.1 255.255.255.255 10.10.2.100

Example with Static Routing and No Trunking

Figure 11 shows a sample IOS SLB stateless backup configuration with the following characteristics:

The IP address for real server 1 is 10.10.1.3, and for real server 2 is 10.10.1.4, routed to clients through 10.10.1.100.

The IP address for the virtual server is 10.10.14.1.

The IP address for Subnet 2 is 10.10.2.0, with a subnet mask of 255.255.255.0.

The IP address for Subnet 3 is 10.10.3.0, with a subnet mask of 255.255.255.0.

The configuration uses static routing to the HSRP route on the distribution device.

Figure 11 Stateless Backup with Layer 2 and No Trunking

SLB 1 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  ip address 10.10.1.1 255.255.255.0
  standby ip 10.10.1.100
  standby priority 10 preempt delay 910
  standby name SERVER
  standby track eth2
int Eth2
  ip address 10.10.2.1 255.255.255.0
  standby ip 10.10.2.100
  standby priority 10 preempt delay 910
  standby track eth1

SLB 2 Configuration Statements

ip slb serverfarm SF1
  real 10.10.1.3
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
  real 10.10.1.4
    reassign 2
    faildetect numconns 4
    retry 20
    inservice
ip slb vserver VS1
  virtual 10.10.14.1 tcp www
  serverfarm SF1
  idle 120
  delay 5
  inservice standby SERVER
...
int Eth1
  ip address 10.10.1.2 255.255.255.0
  standby ip 10.10.1.100
  standby priority 5 preempt delay 910
  standby name SERVER
int Eth2
  ip address 10.10.2.2 255.255.255.0
  standby ip 10.10.2.100
  standby priority 5 preempt delay 910

Distribution Device Configuration Statements

int Eth1
  switchport
  switchport distribution vlan 2
int Eth2
  switchport
  switchport distribution vlan 2
int vlan2
  ip address 10.10.2.3 255.255.255.0
  no shut
ip route 10.10.14.1 255.255.255.255 10.10.2.100

Example of IOS SLB with Stateful Backup

This example configuration focuses on the IOS SLB real server connections configured as part of a server farm, with real and virtual servers over Fast Ethernet interfaces configured with stateful backup standby connections.

Figure 12 is an example of a stateful backup configuration, using HSRP on both the client and server sides to handle failover. The real servers route outbound flows to 10.10.3.100, which is the HSRP address on the server side interfaces. The client (or access router), routes to the virtual IP address (10.10.10.12) through 10.10.2.100, HSRP address on the client side.

Notice the loopback interfaces configured on both boxes for the exchange of these messages. Each IOS SLB should also be given duplicate routes to the other switch loopback address. This allows replication messages to flow despite an interface failure.


Note To allow HSRP to function properly, set spantree portfast must be configured on any Layer 2 device between the IOS SLB switches.


Figure 12 IOS SLB Stateful Environment

Switch SLB1 Configuration Statements

ip slb serverfarm SF1
  nat server
  real 10.10.3.1
   inservice
  real 10.10.3.2
   inservice
  real 10.10.3.3
   inservice
!
ip slb vserver VS1
  virtual 10.10.10.12 tcp telnet
  serverfarm SF1
  replicate casa 10.10.99.132 10.10.99.99 1024 password PASS
  inservice standby virt
 !
interface Loopback1
  ip address 10.10.99.132 255.255.255.255
!
interface FastEthernet1
  ip address 10.10.3.132 255.255.255.0
  no ip redirects
  no ip mroute-cache
  standby priority 5 preempt delay 910
  standby name out
  standby ip 10.10.3.100
  standby track FastEthernet2
 !
interface FastEthernet2
  ip address 10.10.2.132 255.255.255.0
  no ip redirects
  standby priority 5 preempt delay 910
  standby name virt
  standby ip 10.10.2.100
  standby track FastEthernet1

Switch SLB2 Configuration Statements

ip slb serverfarm SF1
  nat server
  real 10.10.3.1
   inservice
  real 10.10.3.2
   inservice
  real 10.10.3.3
   inservice
 !
ip slb vserver VS1
  virtual 10.10.10.12 tcp telnet
  serverfarm SF1
  replicate casa 10.10.99.99 10.10.99.132 1024 password PASS
  inservice standby virt
 !
interface Loopback1
  ip address 10.10.99.99 255.255.255.255
 !
interface FastEthernet2
  ip address 10.10.2.99 255.255.255.0
  no ip redirects
  no ip route-cache
  no ip mroute-cache
  standby priority 10 preempt delay 910
  standby name virt
  standby ip 10.10.2.100
  standby track FastEthernet3
 !
interface FastEthernet3
  ip address 10.10.3.99 255.255.255.0
  no ip redirects
  no ip route-cache
  no ip mroute-cache
  standby priority 10 preempt delay 910
  standby name out
  standby ip 10.10.3.100
  standby track FastEthernet2

Example of IOS SLB with Active Standby

Figure 13 shows an IOS SLB network configured for active standby, with two IOS SLB devices load-balancing the same virtual IP address while backing up each other. If either device fails, the other takes over its load via normal HSRP failover and IOS SLB stateless redundancy.

Figure 13 IOS SLB Active Standby

The sample network configuration in Figure 13 has the following characteristics:

SLB 1 balances servers 1A and 1B and SLB 2 balances 2A and 2B.

A single virtual IP address (10.10.10.12 for Web) is supported across the two IOS SLB devices.

Client traffic is divided in an access router, sending clients with even IP addresses to HSRP1 (10.10.5.100) and clients with odd IP addresses to HSRP2 (10.10.2.100). SLB 1 is configured as primary for clients with odd IP addresses, and SLB 2 is primary for clients with even IP addresses.

The IOS SLB devices balance the traffic to disjoint sets of real servers. (If client NAT was used in this example, this would not be a requirement).

Each set of real servers has a default gateway configured to its IOS SLB device.

The HSRP address on VLAN 105 is 10.10.5.100. The HSRP address on VLAN 102 is 10.10.2.100.

SLB 1 Configuration Statements

ip slb serverfarm EVEN
 nat server
 real 10.10.3.2
  reassign 2
  faildetect numconns 4 numclients 2
  retry 20
  inservice
 real 10.10.3.3
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
!
ip slb serverfarm ODD
 nat server
 real 10.10.3.2
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
 real 10.10.3.3
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
!
ip slb vserver EVEN	; Same EVEN virtual server as in SLB 2
 virtual 10.10.10.12 tcp www
 serverfarm EVEN
 client 0.0.0.0 0.0.0.1
 idle 120
 delay 5
 inservice standby STANDBY_EVEN	; See standby name in Ethernet 3/3 below
!
ip slb vserver ODD	; Same ODD virtual server as in SLB 2
 virtual 10.10.10.12 tcp www
 serverfarm ODD
 client 0.0.0.1 0.0.0.1
 idle 120
 delay 5
 inservice standby STANDBY_ODD	; See standby name in Ethernet 3/2 below
!
interface Ethernet3/2
 ip address 10.10.5.132 255.255.255.0
 standby priority 20 preempt delay 910
 standby name STANDBY_ODD	; See standby name in SLB 2, Ethernet 3/5
 standby ip 10.10.5.100
!
interface Ethernet3/3
 ip address 10.10.2.132 255.255.255.0
 standby priority 10
 standby name STANDBY_EVEN	; See standby name in SLB 2, Ethernet 3/1
 standby ip 10.10.2.100

SLB 2 Configuration Statements

ip slb serverfarm EVEN
 nat server
 real 10.10.3.4
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
 real 10.10.3.5
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
!
ip slb serverfarm ODD
 nat server
 real 10.10.3.4
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
 real 10.10.3.5
  reassign 2
  faildetect numconns 4
  retry 20
  inservice
!
ip slb vserver EVEN	; Same EVEN virtual server as in SLB 1
 virtual 10.10.10.12 tcp www
 serverfarm EVEN
 client 0.0.0.0 0.0.0.1
 idle 120
 delay 5
 inservice standby STANDBY_EVEN	; See standby name in Ethernet 3/1 below
!
ip slb vserver ODD	; Same ODD virtual server as in SLB 1
 virtual 10.10.10.12 tcp www
 serverfarm ODD
 client 0.0.0.1 0.0.0.1
 idle 120
 delay 5
 inservice standby STANDBY_ODD	; See standby name in Ethernet 3/5 below
!
interface Ethernet3/1
 ip address 10.10.2.128 255.255.255.0
 standby priority 20 preempt delay 910
 standby name STANDBY_EVEN	; See standby name in SLB 1, Ethernet 3/3
 standby ip 10.10.2.100
!
interface Ethernet3/5
 ip address 10.10.5.128 255.255.255.0
 standby priority 10 preempt delay 910
 standby name STANDBY_ODD	; See standby name in SLB 1, Ethernet 3/2
 standby ip 10.10.5.100

Access Router Configuration Statements

interface Ethernet0/0
 ip address 10.10.5.183 255.255.255.0
 no ip directed-broadcast
 no ip route-cache
 no ip mroute-cache
!
interface Ethernet0/1
 ip address 10.10.2.183 255.255.255.0
 no ip directed-broadcast
 no ip route-cache
 no ip mroute-cache
!
interface Ethernet0/2
 ip address 10.10.6.183 255.255.255.0
 no ip directed-broadcast
 no ip route-cache
 no ip mroute-cache
 ip policy route-map virts
!
access-list 100 permit ip 0.0.0.1 255.255.255.254 host 10.10.10.12
access-list 101 permit ip 0.0.0.0 255.255.255.254 host 10.10.10.12
route-map virts permit 10
match ip address 100
set ip next-hop 10.10.5.100
!
route-map virts permit 15
match ip address 101
set ip next-hop 10.10.2.100
!

Example of IOS SLB with Redistribution of Static Routes

Figure 14 shows an IOS SLB network configured to distribute static routes to a virtual server's IP address. The route to the address is added to the routing table as static if you advertise the address when you bring the virtual server into service (using the inservice command). See the advertise command for more details about advertising virtual server IP addresses.

Because the routing configuration varies from protocol to protocol, sample configurations for several different routing protocols are given.

Figure 14 IOS SLB Redistribution of Static Routes

Routing Information Protocol (RIP)

Following is the RIP static route redistribution configuration for the IOS SLB switch shown in Figure 14:

router rip
 redistribute static
 network 10.0.0.0
 network 8.0.0.0

Following is the RIP static route redistribution configuration for the access router that is listening for routing updates shown in Figure 14:

router rip
 network 10.0.0.0
 network 8.0.0.0

Open Shortest Path First (OSPF)

Following is the OSPF static route redistribution configuration for the IOS SLB switch shown in Figure 14:

router ospf 1
 redistribute static subnets
 network 10.10.6.217 0.0.0.0 area 0
 network 8.8.8.0 0.0.0.255 area 0

Following is the OSPF static route redistribution configuration for the access router that is listening for routing updates shown in Figure 14:

router ospf 1
 network 10.10.6.2 0.0.0.0 area 0
 network 8.8.8.0 0.0.0.255 area 0

Interior Gateway Routing Protocol (IGRP)

Following is the IGRP static route redistribution configuration for the IOS SLB switch shown in Figure 14:

router igrp 1
 redistribute connected
 redistribute static
 network 8.0.0.0
 network 10.0.0.0

Following is the IGRP static route redistribution configuration for the access router that is listening for routing updates shown in Figure 14:

router igrp 1
 network 8.0.0.0
 network 10.0.0.0

Enhanced Interior Gateway Routing Protocol (Enhanced IGRP)

Following is the Enhanced IGRP static route redistribution configuration for the IOS SLB switch shown in Figure 14:

router eigrp 666
 redistribute static
 network 10.0.0.0
 network 8.0.0.0

Following is the Enhanced IGRP static route redistribution configuration for the access router that is listening for routing updates shown in Figure 14:

router eigrp 666
 network 10.0.0.0
 network 8.0.0.0

Example of IOS SLB with WAP Load Balancing

Figure 15 shows an IOS SLB network configured to balance WAP flows on UDP port 9203 (WSP/WTP/WTLS/UDP). In this example:

WAP flows are balanced between WAP gateways 10.10.2.1 and 10.10.2.2.

The clients connect to 10.10.1.1, the IOS SLB virtual server address.

For a given session, load-balancing decisions change if the connection idles longer than the virtual server's idle connection timer (3000 seconds in this example).

Figure 15 IOS SLB with WAP Load Balancing

IOS SLB Device Configuration Statements

ip slb probe PROBE1 ping
!
ip slb serverfarm WAPFARM
 nat server
 real 10.10.2.1
  inservice
 real 10.10.2.2
  inservice
 probe PROBE1
!
ip slb vserver VSERVER
 virtual 10.10.1.1 udp 9203
 serverfarm WAPFARM
 idle 3000
 inservice

Command Reference

This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.1 and 12.1(3)T command reference publications.

address (HTTP probe)

address (ping probe)

advertise

agent

bindid

clear ip slb

client

credentials

delay (firewall farm TCP protocol)

delay (virtual server)

expect

faildetect (ping probe)

faildetect (real server)

header

idle (firewall farm TCP protocol)

idle (firewall farm UDP protocol)

idle (virtual server)

inservice (firewall farm)

inservice (firewall farm real server)

inservice (server farm real server)

inservice (server farm virtual server)

interval (HTTP probe)

interval (ping probe)

ip slb dfp

ip slb entries

ip slb firewallfarm

ip slb natpool

ip slb probe (HTTP probe)

ip slb probe (ping probe)

ip slb serverfarm

ip slb vserver

maxconns (firewall farm TCP protocol)

maxconns (firewall farm UDP protocol)

maxconns (server farm)

nat

port

predictor (server farm)

predictor hash address (firewall farm)

probe (firewall farm real server)

probe (server farm)

real (firewall farm)

real (server farm)

reassign

replicate casa (firewall farm)

replicate casa (virtual server)

request method, request url

retry

serverfarm

show ip slb conns

show ip slb dfp

show ip slb firewallfarm

show ip slb natpool

show ip slb probe

show ip slb reals

show ip slb replicate

show ip slb serverfarms

show ip slb stats

show ip slb sticky

show ip slb vservers

standby authentication

standby name

standby priority, standby preempt

standby timers

standby track

sticky (firewall farm TCP protocol)

sticky (firewall farm UDP protocol)

sticky (virtual server)

synguard

tcp

udp

virtual

weight (firewall farm real server)

weight (server farm)

address (HTTP probe)

To specify that an HTTP probe is to receive responses from an IP address, use the address HTTP probe configuration command. To restore the default settings, use the no form of this command.

address [ip-address]

no address [ip-address]

Syntax Description

ip-address

(Optional) Configures the destination IP address that is to respond to the HTTP probe.


Defaults

If the HTTP probe is associated with a firewall farm, you must specify an ip-address.

If the HTTP probe is associated with a server farm, and you do not specify an ip-address, the address is inherited from the server farm real servers.

Command Modes

HTTP probe configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Examples

The following example configures an HTTP probe named PROBE2, changes the CLI to IOS SLB HTTP probe submode, and configures the probe to receive responses from IP address 13.13.13.13:

Router(config)# ip slb probe PROBE2 http
Router(config-slb-probe)# address 13.13.13.13

Related Commands

Command
Description

ip slb probe (HTTP probe)

Configures the IP IOS SLB probe name.

show ip slb probe

Displays an IOS SLB HTTP or ping probe configuration.


address (ping probe)

To specify that a ping probe is to receive responses from an IP address, use the address ping probe configuration command. To restore the default settings, use the no form of this command.

address [ip-address]

no address [ip-address]

Syntax Description

ip-address

(Optional) Configures the destination IP address that is to respond to the ping probe.


Defaults

If the ping probe is associated with a firewall farm, you must specify an ip-address.

If the ping probe is associated with a server farm, and you do not specify an ip-address, the address is inherited from the server farm real servers.

Command Modes

Ping probe configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Examples

The following example configures a ping probe named PROBE1, changes the CLI to IOS SLB HTTP probe submode, and configures the probe to receive responses from IP address 13.13.13.13:

Router(config)# ip slb probe PROBE1 ping
Router(config-slb-probe)# address 13.13.13.13

Related Commands

Command
Description

ip slb probe (ping probe)

Configures the IP IOS SLB probe name.

show ip slb probe

Displays an IOS SLB HTTP or ping probe configuration.


advertise

By default, virtual server addresses are advertised. That is, static routes to the Null0 interface are installed for the virtual server addresses.

To control the installation of a static route to the Null0 interface for a virtual server address, use the advertise virtual server configuration command. Advertisement of this static route using the routing protocol requires that you configure redistribution of static routes for the routing protocol. To prevent the installation of a static route for the virtual server IP address, use the no form of this command.

advertise

no advertise

Syntax Description

This command has no arguments or keywords.

Defaults

The virtual server IP address is added to the routing table.

Command Modes

Virtual server configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

HTTP probes require a route to the virtual server. The route is not used, but it must exist in order for HTTP probes to function correctly. The route can be either a host route (advertised by the virtual server) or a default route (specified using the ip route 0.0.0.0 0.0.0.0 command, for example). If you specify no advertise, you must specify a default route.

Examples

The following example prevents advertisement of the virtual server's IP address in routing protocol updates:

Router(config)# ip slb vserver PUBLIC_HTTP
Router(config-slb-vserver)# no advertise

Related Commands

Command
Description

show ip slb vservers

Displays information about the virtual servers.



agent

To configure a DFP agent on the DFP manager, use the agent DFP configuration command. To remove an agent definition from the DFP configuration, use the no form of this command.

agent ip-address port-number [timeout [retry_count [retry_interval]]]

no agent ip-address port

Syntax Description

ip-address

Agent IP address

port-number

Agent TCP or UDP port number

timeout

(Optional) Time period, in seconds, during which the DFP manager must receive an update from the DFP agent. The default is 0 seconds, which means there is no timeout.

retry_count

(Optional) Number of times the DFP manager attempts to establish the TCP connection to the DFP agent. The default is 0 retries, which means there are infinite retries.

retry_interval

(Optional) Interval, in seconds, between retries. The default is 180 seconds.


Defaults

Timeout default: 0 seconds (no timeout)

Retry_count default: 0 (infinite retries)

Retry_interval default: 180 seconds

Command Modes

DFP configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

You can configure up to 1024 agents.

A DFP agent collects status information about a server's load capability and reports that information to a load manager. The DFP agent can reside on the server, or it can be a separate device that collects and consolidates the information from several servers before reporting to the load manager.

Examples

The following example configures a DFP agent on the DFP manager, sets the DFP password to Cookies and the timeout to 360 seconds, changes the CLI to DFP configuration mode, sets the IP address of the DFP agent to 10.1.1.1, and sets the port number of the DFP agent to 2221 (FTP):

Router(config)# ip slb dfp password Cookies 360
Router(config-slb-dfp)# agent 10.1.1.1 2221

Related Commands

Command
Description

ip slb dfp

Configures DFP and initiates DFP configuration mode, and optionally sets a password.



bindid

To configure a bind ID, use the bindid server farm configuration command. To remove a bind ID from the server farm configuration, use the no form of this command.

bindid [bind_id]

no bindid [bind_id]

Syntax Description

bind_id

(Optional) Bind ID number. The default bind ID is 0.


Defaults

Bind_id default: 0

Command Modes

Server farm configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

You can configure one bind ID on each bindid command.

The bind ID allows a single physical server to be bound to multiple virtual servers and report a different weight for each one. Thus, the single real server is represented as multiple instances of itself, each having a different bind ID. DFP uses the bind ID to identify for which instance of the real server a given weight is specified.

Examples

The following example configures bind ID 309:

Router(config)# ip slb serverfarm PUBLIC
Router(config-slb-sfarm)# bindid 309

Related Commands

Command
Description

ip slb dfp

Configures DFP and initiates DFP configuration mode, and optionally sets a password.

show ip slb serverfarms

Displays information about the IOS SLB server farms.


clear ip slb

To clear IP IOS SLB connections or counters, use the clear ip slb command.

clear ip slb {connections [serverfarm farm_name | vserver server_name] | counters}

Syntax Description

connections

Clears the IOS SLB connection database.

serverfarm

(Optional) Clears the connection database for the serverfarm named.

farm_name

(Optional) Character string used to identify the serverfarm.

vserver

(Optional) Clears the connection database for the virtual server named.

server_name

(Optional) Character string used to identify the virtual server.

counters

Clears the IOS SLB counters.


Defaults

No default behavior or values.

Command Modes

Privileged EXEC

Command History

Release
Modification

12.1(1)E

This command was introduced.


Examples

The following example clears the connection database of server farm FARM1:

Router# clear ip slb connections serverfarm FARM1

The following example clears the connection database of virtual server VSERVER1:

Router# clear ip slb connections vserver VSERVER1

The following example clears the IOS SLB counters:

Router# clear ip slb counters

Related Commands

Command
Description

show ip slb conns

Displays information about the IOS SLB connections.

show ip slb firewallfarm

Displays information about the firewall farm configuration.

show ip slb serverfarms

Displays information about the IOS SLB server farms.

show ip slb stats

Displays IOS SLB statistics.

show ip slb vservers

Displays information about the IOS SLB virtual servers.


client

To define which clients are allowed to use the virtual server, use the client virtual server configuration command. You can use more than one client command to define more than one client. To remove a client definition from the IOS SLB configuration, use the no form of this command.

client ip-address network-mask

no client ip-address network-mask

Syntax Description

ip-address

Client IP address. The default is 0.0.0.0 (all clients).

network-mask

Client IP network mask. The default is 0.0.0.0 (all subnets).


Defaults

Ip_address default: 0.0.0.0 (all clients)

Network_mask default: 0.0.0.0 (all subnets)

Taken together, the default is client 0.0.0.0 0.0.0.0 (allows all clients on all subnets to use the virtual server).

Command Modes

Virtual server configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

The network-mask value is applied to the source IP address of incoming connections. The result must match the ip-address value for the client to be allowed to use the virtual server.

Examples

The following example allows only clients from 10.4.4.x access to the virtual server:

Router(config)# ip slb vserver PUBLIC_HTTP
Router(config-slb-vserver)# client 10.4.4.0 255.255.255.0

Related Commands

Command
Description

show ip slb vservers

Displays information about the virtual servers.

virtual

Configures the virtual server attributes.


credentials

To configure basic authentication values for the HTTP IOS SLB probe, use the credentials HTTP probe configuration command. To remove a credentials configuration, use the no form of this command.

credentials username [password]

no credentials username [password]

Syntax Description

username

Configures the authentication username of the HTTP probe header. The character string is limited to 15 characters.

password

(Optional) Configures the authentication password of the HTTP probe header. The character string is limited to 15 characters.


Defaults

No default behavior or values.

Command Modes

HTTP probe configuration

Command History

Release
Modification

12.1(2)E

This command was introduced.


Examples

The following example configures an HTTP probe named PROBE2, changes the CLI to IOS SLB HTTP probe submode, sets the HTTP authentication to username lauren, and sets the password to develop:

Router(config)# ip slb probe PROBE2 http
Router(config-slb-probe)# credentials lauren develop

Related Commands

Command
Description

show ip slb probe

Displays an IOS SLB HTTP or ping probe configuration.


delay (firewall farm TCP protocol)

To change the amount of time IOS SLB maintains TCP connection context after a connection has terminated, use the delay firewall farm TCP protocol configuration command. To restore the default delay timer, use the no form of this command.

delay duration

no delay

Syntax Description

duration

Delay timer duration in seconds. The valid range is 1 to 600 seconds. The default value is 10 seconds.


Defaults

Duration default: 10 seconds

Command Modes

Firewall farm TCP protocol configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Usage Guidelines

The delay timer allows out-of-sequence packets and final acknowledgments (ACKs) to be delivered after a TCP connection ends.

Do not set this value to zero (0).

If you are configuring a delay timer for HTTP flows, choose a low number such as 5 seconds as a starting point.

Examples

The following example specifies that IOS SLB maintains TCP connection context for 30 seconds after a connection has terminated:

Router(config)# ip slb firewallfarm FIRE1
Router(config-slb-fw)# tcp
Router(config-slb-fw-tcp)# delay 30

Related Commands

Command
Description

show ip slb firewallfarm

Displays information about the firewall farm configuration.

tcp

Initiates TCP protocol configuration mode.


delay (virtual server)

To change the amount of time IOS SLB maintains TCP connection context after a connection has terminated, use the delay virtual server configuration command. To restore the default delay timer, use the no form of this command.

delay duration

no delay

Syntax Description

duration

Delay timer duration in seconds. The valid range is 1 to 600 seconds. The default value is 10 seconds.


Defaults

Duration default: 10 seconds

Command Modes

Virtual server configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

The delay timer allows out-of-sequence packets and final acknowledgments (ACKs) to be delivered after a TCP connection ends.

Do not set this value to zero (0).

If you are configuring a delay timer for HTTP flows, choose a low number such as 5 seconds as a starting point.

Examples

The following example specifies that IOS SLB maintains TCP connection context for 30 seconds after a connection has terminated:

Router(config)# ip slb vserver PUBLIC_HTTP
Router(config-slb-vserver)# delay 30

Related Commands

Command
Description

show ip slb vservers

Displays information about the virtual servers.

virtual

Configures the virtual server attributes.


expect

To configure a status code or regular expression to expect from the HTTP probe, use the expect HTTP probe configuration command. To restore the default settings, use the no form of this command.

expect [status status-code] [regex regular-expression]

no expect [status status-code] [regex regular-expression]

Syntax Description

status

(Optional) Specifies that a status code is to be expected.

status-code

(Optional) Configures the expected HTTP status code. The valid range is 100 to 599. The default expected status code is 200.

regex

(Optional) Specifies that a regular expression is to be expected.

regular-expression

(Optional) Configures the regular expression expected in the HTTP response.


Defaults

The default expected status code is 200.

There is no default expected regular expression.

Command Modes

HTTP probe configuration

Command History

Release
Modification

12.1(2)E

This command was introduced.

12.1(3a)E

The regex keyword and regular-expression variable were added.


Usage Guidelines

The expect command configures the expected status code or regular expression to be received from the servers. A real server is considered to have failed and is taken out of service if any of the following events occurs:

A status number other than the expected one is received.

The expected regular expression is not received in the first 2920 bytes of probe output. (IOS SLB searches only the first 2920 bytes for the expected status code or regular expression.)

The server fails to respond.

For IOS SLB firewall load balancing, configure the HTTP probe to expect status code 40l.

Examples

The following example configures an HTTP probe named PROBE2 changes the CLI to HTTP submode, and configures the HTTP probe to expect the status code 40l and the regular expression Copyright:

Router(config)# ip slb probe PROBE2 http
Router(config-slb-probe)# expect status 401 regex Copyright

Related Commands

Command
Description

ip slb probe (HTTP probe)

Configures the IP IOS SLB probe name.

show ip slb probe

Displays an IOS SLB HTTP or ping probe configuration.


faildetect (ping probe)

To specify the conditions that indicate a server failure, use the faildetect ping probe configuration command. To restore the default values that indicate a server failure, use the no form of this command.

faildetect number-of-pings

no faildetect

Syntax Description

number-of-pings

Number of consecutive unanswered pings allowed before a real server is considered to have failed. Valid range is 1 to 255. The default is 10 unanswered pings.


Defaults

The default value is 10 unanswered pings.

Command Modes

Ping probe configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Examples

In the following example the unanswered ping threshold is set to 16:

Router(config)# ip slb probe PROBE1 ping
Router(config-slb-probe)# faildetect 16

Related Commands

Command
Description

real (firewall farm)

Identifies a firewall as a member of a firewall farm and initiates real server configuration mode.

show ip slb firewallfarm

Displays information about the firewall farm configuration.

show ip slb reals

Displays information about the real servers.


faildetect (real server)

To specify the conditions that indicate a server failure, use the faildetect real server configuration command. To restore the default values that indicate a server failure, use the no form of this command.

faildetect numconns number-conns [numclients number-clients]

no faildetect

Syntax Description

numconns

Number of consecutive TCP connection reassignments allowed before a real server is considered to have failed.

number-conns

Connection reassignment threshold value in the range from 1 to 255. The default is 8 connection failures.

numclients

(Optional) Number of unique client connection failures allowed before a real server is considered to have failed.

number-clients

(Optional) Client connection reassignment threshold value in the range from 1 to 8. The default is 2 client connection failures.


Defaults

If you do not specify the faildetect command, the default value of the connection reassignment threshold is 8.

If you do not specify the numclients keyword, the default value of the unique client failure threshold is 2.

Command Modes

Real server configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Examples

In the following example the connection reassignment threshold is set to 16 and, because the number-clients keyword is not configured, the threshold for unique client connection failure is set to the default value 8. The real server is considered to have failed when 8 unique clients have had connection failures and there have been 16 connection reassignments.

Router(config)# ip slb serverfarm PUBLIC
Router(config-slb-sfarm)# real 10.10.1.1
Router(config-slb-real)# faildetect numconns 16

Related Commands

Command
Description

real (server farm)

Identifies a real server as a member of a server farm and initiates real server configuration mode.

show ip slb serverfarms

Displays information about the server farm configuration.

show ip slb reals

Displays information about the real servers.


header

To configure the basic authentication values for the HTTP probe, use the header HTTP probe configuration command. To remove a header HTTP probe configuration, use the no form of this command.

header field-name [field-value]

no header field-name [field-value]

Syntax Description

field-name

Configures the name of the HTTP probe header. The character string is limited to 15 characters.

field-value

(Optional) Configures the value of the HTTP probe header.


Defaults

No default behavior or values, although the following headers are inserted in the request by default:

Accept: */*
Connection: close
User-Agent: cisco-slb-probe/1.0
Host: virtual IP address

Command Modes

HTTP probe configuration

Command History

Release
Modification

12.1(2)E

This command was introduced.


Usage Guidelines

The header HTTP probe configuration command configures the name and value parameters of the header.


Note The colon ( : ) separating the field-name and field-value is automatically inserted if not provided. Multiple headers with the same name are not allowed.


Examples

The following example configures an HTTP probe named PROBE2, changes the CLI to HTTP submode, and configures the HTTP probe header name as Cookie and value as Monster:

Router(config)# ip slb probe PROBE2 http
Router(config-slb-probe)# header Cookie Monster

Related Commands

Command
Description

ip slb probe (HTTP probe)

Configures the IP IOS SLB probe name.

show ip slb probe

Displays an IOS SLB HTTP or ping probe configuration.


idle (firewall farm TCP protocol)

To specify the minimum amount of time IOS SLB maintains connection information in the absence of packet activity, use the idle firewall farm TCP protocol configuration command. To restore the default idle duration value, use the no form of this command.

idle duration

no idle

Syntax Description

duration

Idle connection timer duration in seconds. Valid values range from 10 to 65535. The default is 3600 seconds (1 hour).


Defaults

Duration default: 3600 seconds

Command Modes

Firewall farm TCP protocol configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Usage Guidelines

TCP connections that do not send flows or keepalives before the idle timer expires are assumed to be inactive and are reset (RST).

If you are configuring an idle timer for HTTP flows, choose a low number such as 120 seconds as a starting point. A low number ensures that the IOS SLB connection database maintains a manageable size if problems at the server, client, or network result in a large number of connections. However, do not choose a value under 60 seconds; such a low value can reduce the efficiency of IOS SLB.

Examples

The following example instructs IOS SLB to maintain connection information for an idle connection for 120 seconds.

Router(config)# ip slb firewallfarm FIRE1
Router(config-slb-fw)# tcp
Router(config-slb-fw-tcp)# idle 120

Related Commands

Command
Description

show ip slb firewallfarm

Displays information about the firewall farm configuration.

tcp

Initiates TCP protocol configuration mode.


idle (firewall farm UDP protocol)

To specify the minimum amount of time IOS SLB maintains connection information in the absence of packet activity, use the idle firewall farm UDP protocol configuration command. To restore the default idle duration value, use the no form of this command.

idle duration

no idle

Syntax Description

duration

Idle connection timer duration in seconds. Valid values range from 10 to 65535. The default is 3600 seconds (1 hour).


Defaults

Duration default: 3600 seconds

Command Modes

Firewall farm UDP protocol configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Examples

The following example instructs IOS SLB to maintain connection information for an idle connection for 120 seconds.

Router(config)# ip slb firewallfarm FIRE1
Router(config-slb-fw)# udp
Router(config-slb-fw-udp)# idle 120

Related Commands

Command
Description

show ip slb firewallfarm

Displays information about the firewall farm configuration.

udp

Initiates UDP protocol configuration mode.


idle (virtual server)

To specify the minimum amount of time IOS SLB maintains connection information in the absence of packet activity, use the idle virtual server configuration command. To restore the default idle duration value, use the no form of this command.

idle duration

no idle

Syntax Description

duration

Idle connection timer duration in seconds. Valid values range from 10 to 65535. The default is 3600 seconds (1 hour).


Defaults

Duration default: 3600 seconds

Command Modes

Virtual server configuration

Command History

Release
Modification

12.0(7)XE

This command was introduced.


Usage Guidelines

TCP connections that do not send flows or keepalives before the idle timer expires are assumed to be inactive and are reset (RST).

If you are configuring an idle timer for HTTP flows, choose a low number such as 120 seconds as a starting point. A low number ensures that the IOS SLB connection database maintains a manageable size if problems at the server, client, or network result in a large number of connections. However, do not choose a value under 60 seconds; such a low value can reduce the efficiency of IOS SLB.

Examples

The following example instructs IOS SLB to maintain connection information for an idle connection for 120 seconds.

Router(config)# ip slb vserver PUBLIC_HTTP
Router(config-slb-vserver)# idle 120

Related Commands

Command
Description

show ip slb vservers

Displays information about the virtual servers.

virtual

Configures the virtual server attributes.


inservice (firewall farm)

To enable the firewall farm for use by IOS SLB, use the inservice firewall farm configuration command. To remove the firewall farm from service, use the no form of this command.

inservice [standby group-name]

no inservice [standby group-name]

Syntax Description

standby

(Optional) Configures the HSRP standby firewall farm for use with stateless and stateful backup.

group-name

(Optional) Specifies the HSRP group name with which the IOS SLB firewall farm is associated.


Defaults

If the inservice command is not specified, the firewall farm is defined to IOS SLB but is not used.

Command Modes

Firewall farm configuration

Command History

Release
Modification

12.1(3a)E

This command was introduced.


Examples

The following example enables the firewall farm for use by the IOS SLB feature:

Router(config)# ip slb firewallfarm FIRE1
Router(config-slb-fw)# inservice