Showing posts with label F5. Show all posts
Showing posts with label F5. Show all posts

Friday, March 19, 2010

JSessionID-Based Persistence

Universal Persistence
BIG-IP LTM software includes the Universal Inspection Engine (UIE). The UIE is a set of functions that allows you to direct and persist load-balanced traffic using iRules. Universal persistence uses the UIE which allows you to use persistence for sessions based on content data, or based on connections to a specific pool member, by defining a sequence of bytes in the connection to use as a session identifier.

iRule Example
The following iRule example illustrates how the LTM can find a cookie called FURYNAX in the first response from the server and add a persistence record for that cookie. Subsequent client requests containing the same cookie will persist to the same pool member.

when CLIENT_ACCEPTED {
set add_persist 1
}
when HTTP_RESPONSE {
if { [HTTP::cookie exists "FURYNAX"] and $add_persist } {
persist add uie [HTTP::cookie "FURYNAX"]
set add_persist 0
}
}

when HTTP_REQUEST {
if { [HTTP::cookie exists "FURYNAX"] } {
persist uie [HTTP::cookie "FURYNAX"]
} else {
set jsess [findstr [HTTP::uri] "FURYNAX" 13 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}

Another iRules examples

when CLIENT_ACCEPTED {
set add_persist 1
}

when HTTP_RESPONSE {
if { [HTTP::cookie exists "CSPSESSIONID-SP-57772-UP-csp-sys-"] and $add_persist } {
persist add uie [HTTP::cookie "CSPSESSIONID-SP-57772-UP-csp-sys-"]
set add_persist 0
}
}

when HTTP_REQUEST {
if { [HTTP::cookie exists "CSPSESSIONID-SP-57772-UP-csp-sys-"] } {
persist uie [HTTP::cookie "CSPSESSIONID-SP-57772-UP-csp-sys-"]
} else {
set jsess [findstr [HTTP::uri] "CSPSESSIONID-SP-57772-UP-csp-sys-" 34 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}

when CLIENT_ACCEPTED {
set add_persist 1
}

when HTTP_RESPONSE {
if { [HTTP::cookie exists "JSESSIONID"] and $add_persist } {
persist add uie [HTTP::cookie "JSESSIONID"]
set add_persist 0
}
}

when HTTP_REQUEST {
if { [HTTP::cookie exists "JSESSIONID"] } {
persist uie [HTTP::cookie "JSESSIONID"]
} else {
set jsess [findstr [HTTP::uri] "JSESSIONID" 11 ";"]
if { $jsess != "" } {
persist uie $jsess
}
}
}

Validate Persistence Records

[root@ltm1:Active] config # b persist show all
PERSISTENT CONNECTIONS --
Mode: universal Value: nVTLLvHDy9GQJQ4T29LPwsLqXXCB2pTGJ3KR49WhpvvBwZyPrxQT!-167612729!-671022569
Virtual: 10.251.3.144:https Node: 10.251.44.2:any Age: 231sec

Mode: source addr Value: 10.21.33.39
Virtual: 10.251.3.145:https Node: 10.251.44.5:any Age: 12sec

Mode: universal Value: Cn18LvHQR8dyZH1S1BmnSxVGcDMvHz12JlTFnJFryvKZpgrrTBdZ!-167612729!-671022569
Virtual: 10.251.3.144:https Node: 10.251.44.2:any Age: 288sec

Mode: universal Value: G4JbLvHXFg2LrXnz71hyJWBGLgT7fQXJbw4G5nhvFThh2pDfymLY!-671022569!-167612729
Virtual: 10.251.3.144:https Node: 10.251.44.2:any Age: 188sec


Tuesday, September 01, 2009

BIG-IP Link Controller incorrectly generates an error message when creating a link object

Fresh installation of the BIG-IP Link Controller software, the BIG-IP Link Controller system's mcpd process does not receive the gtmd configuration, although a valid wideip.conf file exists. In addition, attempts to configure a link object will fail with an error message that appears similar to the following example:

010701793: Link (link_name) must have an associated data center

Reload gtmd Configuration
Force the mcpd process to reload the gtmd configuration. To do so, perform the following procedure:

- Log in to the BIG-IP GTM command line.
- Type the following command to reload the configuration: gtmparse -l

[root@furynax:Active] config # gtmparse -1
gtmparse: Initializing ...
/usr/bin/monitors/builtins/gtm_base_monitors.conf: SUCCESS
/usr/local/gtm/include/base_region.ISP: SUCCESS
/config/gtm/wideip.conf: SUCCESS
gtmparse: SUCCESS
[root@furynax:Active] config #

You should now be able to configure the link object.

Manual Configuration on wideip.conf
If you still cannot configure the link object, the BIG-IP Link Controller's auto-configuration process may not have correctly created the wideip.conf file, which contains the required default data center definition that references the box definition for the BIG-IP Link Controller. To ensure that the wideip.conf file contains the required entries, perform the following procedure:

- Log in to the BIG-IP GTM command line.
- Edit the /config/gtm/wideip.conf file in a text editor.
- Ensure that the configuration file contains stanzas that define the data center and the BIG-IP Link Controller object.

For example:

// *** Data Center Definitions (1) ***

datacenter { // 1 server(s)
name "Default DC"
server "LC-fqdn.domain.com"
}

// *** Server Definitions (1) ***

server { // datacenter=Default DC, #VS=0
name "LC-fqdn.domain.com"
type bigip
box { //gtm
address 192.168.1.2
unit_id 1
}
}

Note: Replace LC-fqdn.domain.com with the FQDN of the BIG-IP Link Controller system, and replace 192.168.1.2 with the self IP address that was configured on the BIG-IP Link Controller system during the initial configuration.
- Save and close the file.
- Load the modified configuration by typing the following command: gtmload

[root@furynax:Active] gtm # gtmload
gtmload: Initializing ...
/usr/bin/monitors/builtins/gtm_base_monitors.conf: SUCCESS
/usr/local/gtm/include/base_region.ISP: SUCCESS
/config/gtm/wideip.conf: SUCCESS
gtmload: SUCCESS
[root@furynax:Active] gtm #

Monday, August 17, 2009

Essential Task in Deployment of BIG-IP Link Controller

Create Default Gateway Pool
- Expand Local Traffic and then click Pools
- Click the Create button
- Name box, type the name of the pool (example : site_gateway_pool)
- In New Members section, add IP addresses associated with each router (example: 10.251.25.1 & 10.251.40.1)
- Configure additional options for the pool as needed.
- Click Finished

Implement Default Gateway Pool
- Expand Network and then click Routes
- Click the Add button
- From the Type list, select Default Gateway
- From the Resource section, select Use Pool
- Select the pool name that represents the group of links you want to use as the default gateway pool (site_gateway_pool)
- Click Finished

Configure Links
- Expand Link Controller and click Links
- Click the Create button
- In the Name box, type a name for the link (example: WAN_Link_1)
- In the Router Address box, type the IP address to associate with the link (Example: 10.251.25.1 - IP address assigned to the router that belongs to the LAN interface)
- In the Uplink Address box, type the IP address to associate with the ISP to which outgoing traffic is sent (Example: 202.12.23.60 - Link Controller uses this address to obtain SNMP statistics from the routers WAN interface)
- In the Service Provider box, type the name of the ISP (Example: GITN)
- Select the health monitors
- Click Finished

Configure Listeners (Node Mode or Bridge Mode)
- Expand Link Controller,and then click Listeners
- Click Create
- In the Destination box, type the IP address on which the LC will listen for network traffic (Example : Wide-IP's IP, DNS IP, Asterix)
- From the VLAN Traffic list, select a VLAN setting appropriate for this listener
- Click Finished

Adding Pools
- Expand Local Traffic and then click Pools
- Click Create
- From the Configuration list, select Advanced
- For the Name setting, type a name for the pool
- Click Finished

Adding Virtual Server
- Expand Local Traffic and then click Virtual Servers
- Click Create
- In the Name box, type the name of the virtual server
- Define the destination of the virtual server (Host/Network)
- In the Address box, type the IP address of the virtual server
- In the Service Port option, type the port number that the virtual server uses
- Click Finished

Configure Wide IPs (FQDN mapping to a set of VS that host the domain content)
- Expand Link Controller
- Click Inbound Wide IPs and then Create button
- In the Name box, type a name that identifies the wide IP
- In the TTL box, type the time-to-live value you want to associate with this wide IP
- Select the appropriate load balancing modes (Preferred, Alternate, and Fallback)
- In the Fallback IP box, type the IP address that the LC uses when it cannot load balance inbound traffic
- For the Virtual Server setting, add the virtual servers that belong to this wide IP
- Click Finished

Configure Address Translation
- Expand Local Traffic, and then click SNATs
- Click Create
- In the Name box, type a unique name for the SNAT
- In the Translation box, select IP Address
- Type an IP address in the adjacent box
- Click Finished

Thursday, June 11, 2009

Basic Deployment of BIG-IP LTM (with Persistence) for ABC Portal

Prerequisites and configuration notes
The following are prerequisites for this solution:
- For this deployment, BIG-IP LTM system must be running version 9.0 or later (in my case BIG-IP version is 9.3.1 Build 37.1)
- Assume that the BIG-IP LTM device is already installed in the network, and objects like Self IPs and VLANs have already been created.

Creating Pool
The next step is to define a load balancing pool for the ABC WWW servers. BIG-IP LTM pool is a set of devices grouped together to receive traffic according to a load balancing method.

- On the Main tab, expand Local Traffic, and then click Pools.
- In the upper right portion of the screen, click the Create button.
- From the Configuration list, select Advanced.
- In the Name box, type a name for your pool.In my example, I use abc-http-pool
- In the Slow Ramp Time box, type 300. For this pool, I use the Least Connections load balancing method. I set the Ramp Time in order to ensure that if a pool member becomes available after maintenance or a new member is added, the Least Connections load balancing algorithm does not send all new connections to that member (a newly available member will always have the least number of connections).
- In the IP ToS to Server and Link QoS to Server rows, make sure Pass Through is selected.
- From the Load Balancing Method list, choose your preferred load balancing method (different load balancing methods may yield optimal results for a particular network). In my case, I choose Least Connections (member).
- In this pool, leave the Priority Group Activation Disabled.
- In the New Members section, make sure the New Address option button is selected.
- In the Address box, add the first WWW server to the pool. Type 10.X.X.X
- In the Service Port box, type 80 or select HTTP from the list.
- Click the Add button to add the member to the list.
- Repeat these steps for the remaining servers, 10.X.X.1 and 2.

Creating an HTTP profile
- On the Main tab, expand Local Traffic, and then click Profiles.
- In the upper right portion of the screen, click the Create button.
- In the Name box, type a name for this profile. Type abc-http.
- From the Parent Profile list, select http
- Modify any of the other settings as applicable for your network.
- Click the Finished

Creating the TCP profile
- On the Main tab, expand Local Traffic, and then click Profiles.
- On the Menu bar, from the Protocol menu, click tcp.
- In the upper right portion of the screen, click the Create button.
- In the Name box, type a name for this profile.Type abc-tcp.
- From the Parent Profile list, select tcp.
- Click the Finished

Creating the persistence profile
- On the Main tab, expand Local Traffic, and then click Profiles.
- On the Menu bar, click Persistence.
- In the upper right portion of the screen, click the Create button.
- In the Name box, type a name for this profile. Type abc-cookie.
- From the Persistence Type list, select Cookie.
- Click the Finished

Creating the virtual server
- On the Main tab, expand Local Traffic, and then click Virtual Servers
- In the upper right portion of the screen, click the Create button.
- In the Name box, type a name for this virtual server.Type abc-http-vs.
- In the Destination section, select the Host option button.
- In the Address box, type the IP address of this virtual server.
- In the Service Port box, type 80, or select HTTP from the list
- From the Configuration list, select Advanced.
- Leave the Type list at the default setting: Standard.
- From the Protocol Profile (Client) list select the name of the profile created in the Creating the TCP profile section. Select abc-tcp.
- From the HTTP Profile list, select the name of the profile created in the Creating an HTTP profile section. Select abc-http.
- From the SNAT Pool list, select AutomapIn the Resources section, from the Default Pool list, select the pool created in the Creating the pool section. Select abc-http-pool.
- From the Default Persistence Profile list, select the persistence profile created in the Creating the persistence profile section. Select abc-cookie
- Click the Finished button.