05-17-2007 08:06 AM
I want to do a simple load balance whereby anyone connecting to a VIP on Port X will be load balanced to a real server on Port X. The only exception is one port where I want for instance VIP:80 to balance to FARM:8080. How can I accomplish this? I created the following but it doesn't seem to work:
rserver host SERVER1
ip address 10.20.51.21
inservice
rserver host SERVER2
ip address 10.20.51.22
inservice
serverfarm host FARM
predictor leastconns
rserver SERVER1
inservice
rserver SERVER2
inservice
serverfarm host FARM80_8250
rserver SERVER1 8250
inservice
rserver SERVER2 8250
inservice
class-map match-any L4_VIP
2 match virtual-address 10.36.150.11 any
class-map match-all L4_VIP_80_8250
2 match virtual-address 10.36.150.11 tcp eq www
policy-map type loadbalance first-match L7_VIP_LB
class class-default
serverfarm FARM
policy-map type loadbalance first-match L7_VIP_LB_80_8250
class class-default
serverfarm FARM80_8250
policy-map multi-match L4_LB_VIP
class L4_VIP
loadbalance vip inservice
loadbalance policy L7_VIP_LB
loadbalance vip icmp-reply active
loadbalance vip advertise active
class L4_VIP_80_8250
loadbalance vip inservice
loadbalance policy L7_VIP_LB_80_8250
loadbalance vip icmp-reply active
loadbalance vip advertise active
Then I applied the policy to the appropriate interfaces. I then issue this command:
ACE/C1# sh service-policy L4_LB_VIP detail
Status : ACTIVE
Description: -
-----------------------------------------
Interface: vlan 1250 1261
service-policy: L4_LB_VIP
class: L4_VIP
VIP Address: Port:
10.36.150.11 any
loadbalance:
L7 loadbalance policy: L7_VIP_LB
VIP Route Metric : 77
VIP Route Advertise : ENABLED-WHEN-ACTIVE
VIP ICMP Reply : ENABLED-WHEN-ACTIVE
VIP State: INSERVICE
curr conns : 0 , hit count : 189
dropped conns : 10
client pkt count : 814 , client byte count: 134831
server pkt count : 984 , server byte count: 714693
L7 Loadbalance policy : L7_VIP_LB
class/match : class-default
LB action :
serverfarm: FARM
hit count : 179
dropped conns : 0
class: L4_VIP_80_8250
VIP Address: Port:
10.36.150.11 eq 80
loadbalance:
L7 loadbalance policy: L7_VIP_LB_80_8250
VIP Route Metric : 77
VIP Route Advertise : ENABLED-WHEN-ACTIVE
VIP ICMP Reply : ENABLED-WHEN-ACTIVE
VIP State: INSERVICE
curr conns : 0 , hit count : 0
dropped conns : 0
client pkt count : 0 , client byte count: 0
server pkt count : 0 , server byte count: 0
L7 Loadbalance policy : L7_VIP_LB_80_8250
class/match : class-default
LB action :
serverfarm: FARM80_8250
hit count : 0
dropped conns : 0
ACE/C1#
I can telnet to 10.36.150.11 to any port (except 80) and will get load balanced to SERVER1 or 2 (provided the port is listening of course). However, when I attempt to telnet to 10.36.150.11 on port 80 I get an immediate connection refused message.
I would greatly appreciate any input on this.
Casey
05-22-2007 02:36 AM
This makes perfectly sense imho. If the ace gets traffic and the rule witch matches any port is first it will result in a match even for port 80.
So putting the port 80 rule in front of the general rule is the way to go. Works the same way as acl's then. Specific before general.
Roble
PS: Those type of problems are nasty i watched this thread and wondered why this happens. Couldn't find it either, but now you found the solution yourself.
05-22-2007 06:38 AM
I think part of the problem on my end is a lack of a good understanding of the policy-map multi-match rules. Once I figured out to treat them like ACLs the light bulb went on.
Thanks for everyone's suggestions.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide