Web example: Configuring basic Layer 7 server load balancing

Network configuration

As shown in Figure 1, an enterprise uses Server A, Server B, and Server C to provide HTTP services. Configure server load balancing to load balance HTTP requests from Host. The device assigns requests whose URLs contain sports, government, and news to Server A; assigns requests whose URLs contain finance, technology, and shopping to Server B; and assigns other requests to Server C.

Figure 1 Network diagram

 

Software versions used

This configuration example was created and verified on F9900 of the F5000-AI120 device.

Procedure

  1. Assign IP addresses to interfaces and add the interfaces to security zones.

# On the top navigation bar, click Network.

# From the navigation pane, select Interface Configuration > Interfaces.

# Click the Edit icon for GE 1/0/1.

# In the dialog box that opens, configure the interface:

# Add GE 1/0/2 to the Trust security zone and set its IP address to 192.168.1.100/24 in the same way you configure GE 1/0/1.

  1. Configure security policies.

# On the top navigation bar, click Policies.

# From the navigation pane, select Security Policies > Security Policies.

# Click Create.

# In the dialog box that opens, configure a security policy named Untrust-to-Local:

# Configure a security policy named Local-to-Trust:

  1. Create an ICMP-type probe template.

# On the top navigation bar, click Objects.

# From the navigation pane, select Load Balancing > Health Monitoring.

# Click Create to configure the probe template t1 as shown in Figure 2.

Figure 2 Creating probe template t1

 

 

# Click Apply.

  1. Create an HTTP cookie sticky group.

# On the top navigation bar, click Objects.

# From the navigation pane, select Load Balancing > Sticky Groups.

# Click Create to configure the sticky group sticky_group as shown in Figure 3.

Figure 3 Creating sticky group sticky_group

 

# Click Apply.

  1. Create real servers.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Real Servers.

# Click Create to configure the real server rs_a as shown in Figure 4.

Figure 4 Creating real server rs_a

 

# Click Apply.

# Configure real server rs_b and set its IP address to 192.168.1.2 in the same way you configure real server rs_a.

# Configure real server rs_c and set its IP address to 192.168.1.3 in the same way you configure real server rs_a.

# Display the configured real servers as shown in Figure 5.

Figure 5 Displaying the configured real servers

 

  1. Create server farms.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Server Farms.

# Click Create to configure the server farm sf1 as shown in Figure 6 and Figure 7.

Figure 6 Creating server farm sf1 (I)

 

Figure 7 Creating server farm sf1 (II)

 

# Click OK.

# Configure server farm sf2 and specify real server rs_b in the same way you configure server farm sf1.

# Configure server farm sf3 and specify real server rs_c in the same way you configure server farm sf1.

# Display the configured server farms as shown in Figure 8.

Figure 8 Displaying the configured server farms

 

  1. Create classes.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Advanced Policies.

# Click the Class tab.

# Click Create to configure the class cls_1 as shown in Figure 9.

Figure 9 Creating class cls_1

 

# Click Apply.

# Click Create to configure the class cls_2 as shown in Figure 10.

Figure 10 Creating class cls_2

 

# Click Apply.

  1. Create actions.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Advanced Policies.

# Click the Action tab.

# Click Create to configure the action act_1 as shown in Figure 11.

Figure 11 Creating action act_1

 

# Click Apply.

# Configure action act_2 and specify primary server farm sf2 in the same way you configure action act_1.

# Configure action act_3 and specify primary server farm sf3 in the same way you configure action act_1.

# Display the configured actions as shown in Figure 12.

Figure 12 Displaying the configured actions

 

  1. Create a load balancing policy.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Advanced Policies.

# Click the Load Balancing Policy tab.

# Click Create to configure the load balancing policy loadbalance_policy as shown in Figure 13.

Figure 13 Creating load balancing policy loadbalance_policy

 

# Click Apply.

  1. Create an HTTP-type parameter profile.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Parameter Profiles.

# Click Create to configure the parameter profile loadbalance_profile as shown in Figure 14.

Figure 14 Creating parameter profile loadbalance_profile

 

# Click OK.

  1. Create a virtual server.

# On the top navigation bar, click Policies.

# From the navigation pane, select LB Policy > Server Load Balancing > Virtual Servers.

# Click Create to configure the virtual server vs as shown in Figure 15 and Figure 17.

Figure 15 Creating virtual server vs

 

Figure 16 Creating virtual server vs (advanced configuration)

 

# Click Apply.

Verifying the configuration

  1. Verify that the device assigns Sever A the HTTP request with URL http://61.159.4.200/sports/.

# Access http://61.159.4.200/sports/ on Host.

Figure 17 Accessing the HTTP service

 

# On the top navigation bar, click Monitor.

# From the navigation pane, select LB Monitor > Server LB Statistics > Virtual Servers.

Figure 18 Displaying virtual server statistics

 

# On the top navigation bar, click Monitor.

# From the navigation pane, select LB Monitor > Server LB Statistics > Servers Farms. You can see that the device assigns the HTTP request containing URL http://61.159.4.200/sports/ to server farm sf1.

Figure 19 Displaying server farm statistics

 

  1. Verify that the device assigns Sever B the HTTP request with URL http://61.159.4.200/finance/.

  1. Verify that the device assigns Sever C the HTTP request with URL http://61.159.4.200/education/.