Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

249

Chapter 12: WAN Load Balancing

This chapter lists the commands for setting up WAN load balancing on the Vyatta system. This chapter contains the following commands.
Command Mode Description

WAN Load Balancing Configuration Commands


load-balancing wan Configuration Enables WAN load balancing on the system. Sets the failure count for interface health checks. Sets the destination IP address for the health check message. Sets the maximum response time before declaring a ping health check message failed. Sets the number of successful health checks required for an interface to be considered healthy. Defines a WAN load balancing rule.

load-balancing wan interface-health <wanx>

Configuration

load-balancing wan interface-health <wanx> ping <ipv4> load-balancing wan interface-health <wanx> resp-time <seconds>

Configuration

Configuration

load-balancing wan interface-health <wanx> success-count <num>

Configuration

load-balancing wan rule <rule>

Configuration

Chapter 12: WAN Load Balancing

250

Command
load-balancing wan rule <rule> destination

Mode
Configuration

Description
Specifies a destination as a match criterion for a WAN load balancing rule. Adds an interface to the set of interfaces to be load balanced in a WAN load balancing rule. Specifies an IP protocol as a match criterion for a WAN load balancing rule. Specifies a source as a match criterion for a WAN load balancing rule.

load-balancing wan rule <rule> interface <wanx>

Configuration

load-balancing wan rule <rule> protocol <protocol> Configuration

load-balancing wan rule <rule> source

Configuration

Load Balancing Operational Commands


show wan-load-balance Operational Displays information about WAN load balanced interfaces. Displays information about the status of WAN load balancing.

show wan-load-balance status

Operational

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan

251

load-balancing wan
Enables WAN load balancing on the system.

Syntax
set load-balancing wan delete load-balancing wan show load-balancing wan

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan }

Parameters
None.

Default
None.

Usage Guidelines
Use this command to enable WAN load balancing on the system. The Vyatta system supports automatic load balancing for outbound traffic across two or more WAN-facing interfaces. The system can load balance outbound traffic only. Outbound packets are load balanced using a weighted random distribution load balancing algorithm. For load balancing to occur, at least two paths of equal cost need to be installed in the routing table, and these paths must egress through the interfaces being load balanced. You can see which paths of equal cost are installed in the routing table using the show ip route <param> longer-prefixes command (see page 301) or the show ip route forward command (see page 305).

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan

252

NOTE In the current release, outgoing interfaces to be load balanced must be configured using masquerade NAT for each interface used. For NAT commands, please see Chapter 18: NAT.

Note also that per-packet load balancing can mean that packets destined for a particular connection or flow arrive at their destination out of sequence. This does not cause a problem for many applications, but it can cause difficulties for streaming media applications, such as voice or video over IP. If it is important to avoid out-of-order packets, multilink Point-to-Point Protocol may be a better solution than WAN load balancing. For MLPPP commands, please see Chapter 7: Multilink Interfaces. Use the set form of this command to create the configuration node for WAN load balancing. Use the delete form of this command to remove the all WAN load balancing configuration and disable WAN load balancing on the system. Use the show form of this command to display the configuration node.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx>

253

load-balancing wan interface-health <wanx>


Sets the characteristics for health checking for a load-balanced interface.

Syntax
set load-balancing wan interface-health wanx delete load-balancing wan interface-health wanx show load-balancing wan interface-health wanx

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { interface-health wan0..wan23 } }

Parameters
wanx Mandatory. Multi-node. The name of a defined WAN-facing interface. This is the load-balanced interface whose health is to be monitored. The range is wan0 to wan23. You can define health checks for all load-balanced interfaces by creating multiple interface-health configuration nodes.

Default
None.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx>

254

Usage Guidelines
Use this command set the health-checking characteristics on a load-balanced WAN-facing interface. A load-balanced WAN interface is considered an active member of the interface pool so long as it passes health checks. The health of the interface is monitored by having it send an ICMP Echo Request (ping) message at intervals to some remote destination. This tests the ability of the interface to pass ICMP traffic to the Internet. If the interface fails the health check, it is removed from the pool of active interfaces. Health check configuration consists of the following: The remote destination to be pinged. Use the load-balancing wan interface-health <wanx> ping <ipv4> command (see page 257). The number of health check failures that can occur before the interface is considered unavailable. Use the load-balancing wan interface-health <wanx> failure-count <num> command (see page 255). The maximum response time to the ping message that can be considered a success. Use the the load-balancing wan interface-health <wanx> resp-time <seconds> command (see page 259). The number of successful pings that must occur before the interface can be added back into the pool of active interfaces.

Use the set form of this command to enable health checking on an interface. Use the delete form of this command to remove health checking on an interface. Use the show form of this command to display health checking configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> failure-count <num>

255

load-balancing wan interface-health <wanx> failure-count <num>


Sets the failure count for interface health checks.

Syntax
set load-balancing wan interface-health wanx failure-count num delete load-balancing wan interface-health wanx failure-count show load-balancing wan interface-health wanx failure-count

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { interface-health wan0..wan23 { failure-count: u32 } } }

Parameters
wanx Mandatory. The load-balanced interface being health-checked. The range is wan0 to wan23. The maximum number of failed health checks that can occur before the interface is considered unavailable. The range is 1 to 10. The default is 1.

num

Default
If an interface fails to respond to one health check, it is considered unavailable.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> failure-count <num>

256

Usage Guidelines
Use this command to set the failure count for interface health checks. The failure count is the number of consecutive failed pings required to remove an interface from the pool of active load-balanced interfaces. Use the set form of this command to specify the failure count. Use the delete form of this command to restore the default failure count. Use the show form of this command to display failure count configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> ping <ipv4>

257

load-balancing wan interface-health <wanx> ping <ipv4>


Sets the destination IP address for the health check message.

Syntax
set load-balancing wan interface-health wanx ping ipv4 delete load-balancing wan interface-health wanx ping show load-balancing wan interface-health wanx ping

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { interface-health wan0..wan23 { ping: ipv4 } } }

Parameters
wanx Mandatory. The load-balanced interface being health-checked. The range is wan0 to wan23. Mandatory. The IP address to be pinged.

ipv4

Default
None.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> ping <ipv4>

258

Usage Guidelines
Use this command to set the destination for ping messages that test the health of a load-balanced interface. The system monitors the health of a load-balanced interface by having the interface send an ICMP Echo Request (ping) message at intervals to some remote destination. Successful receipt of the ICMP Echo Reply message from the destination shows that the interface can both transmit to the Internet and receive packets from the Internet. Use the set form of this command to set the IP address of the destination for the ping message. Use the delete form of this command to remove the health check IP address. Use the show form of this command to display health check IP address.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> resp-time <seconds>

259

load-balancing wan interface-health <wanx> resp-time <seconds>


Sets the maximum response time before declaring a ping health check message failed.

Syntax
set load-balancing wan interface-health wanx resp-time seconds delete load-balancing wan interface-health wanx resp-time show load-balancing wan interface-health wanx resp-time

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { interface-health wan0..wan23 { resp-time: u32 } } }

Parameters
wanx Mandatory. The name of a defined WAN-facing interface. The range is wan0 to wan23. The number of seconds to wait for a ping response before declaring the ping to have failed. The range is 1 to 30. The default is 5.

seconds

Default
If an ICMP Echo Reply message is not received within 5 seconds, the ping is considered to have failed.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> resp-time <seconds>

260

Usage Guidelines
Use this command to configure and display the number of seconds to wait for a ping response before considering the health check to have failed. Use the set form of this command to set the maximum response time. Use the delete form of this command to restore the default response time. Use the show form of this command to display response time configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> success-count <num>

261

load-balancing wan interface-health <wanx> success-count <num>


Sets the number of successful health checks required for an interface to be considered healthy.

Syntax
set load-balancing wan interface-health wanx success-count num delete load-balancing wan interface-health wanx success-count show load-balancing wan interface-health wanx success-count

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { interface-health wan0..wan23 { success-count: u32 } } }

Parameters
wanx Mandatory. The name of a defined WAN-facing interface. The range is wan0 to wan23. The number of consecutive successful pings required for the interface to be considered healthy. The range is 1 to 10. The default is 1.

num

Default
If an interface completes one successful ping, it is added back to the pool of active load-balanced interfaces.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan interface-health <wanx> success-count <num>

262

Usage Guidelines
Use this command to set the number of consecutive successful ICMP Echo Request (ping) messages required to add an interface back into the pool of active load balanced interfaces. A ping message is considered to have succeeded when the ICMP Echo Reply is received within the interval specified by the load-balancing wan interface-health <wanx> resp-time <seconds> command (see page 259). Use the set form of this command to specify the success count. Use the delete form of this command to restore the default success count. Use the show form of this command to display success count configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule>

263

load-balancing wan rule <rule>


Defines a WAN load balancing rule.

Syntax
set load-balancing wan rule rule delete load-balancing wan rule rule show load-balancing wan rule rule

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { rule u32 { } } }

Parameters
rule Mandatory. Multi-node. A unique number identifying the rule. The range is 1 to 4294967295. You can define multiple load balancing rules by creating multiple rule configuration nodes.

Default
None.

Usage Guidelines
Use this command to define a WAN load balancing rule. A load balancing rule contains a set of match criteria and a set of interfaces with weights attached. Outgoing packets are matched against the criteria specified in the rule. If the packet is a match for the rule, the load balancing algorithm determines to which interface in the specified set the packet is sent.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule>

264

Rules are executed in numeric order until a successful match is achieved. If a match is achieved, the packet is sent to one of the interfaces specified by the rule, unless none of the interfaces is active. In this case, the next rule is executed until a matching rule has at least one active interface. Once configured, rule numbers cannot be changed. For this reason, it is good practice to configure rules at intervals (for example, Rule 5, Rule 10, Rule 15, and so on) in case a rule must be inserted later on. Use the set form of this command to create the load balancing rule. Note that you cannot use set to change the number of an existing rule. To change a rules number, delete the rule and re-create it. Use the delete form of this command to remove a load balancing rule. Use the show form of this command to display load balancing rule configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> destination

265

load-balancing wan rule <rule> destination


Specifies a destination as a match criterion for a WAN load balancing rule.

Syntax
set load-balancing wan rule rule destination {address ipv4 | network ipv4net | port port} delete load-balancing wan rule rule destination [address | network | port] show load-balancing wan rule rule destination

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { rule u32 { destination { address: ipv4 network: ipv4net port: text } } } }

Parameters
rule ipv4 Mandatory. The number of the rule being configured. The destination IP address to match for this rule. Only one of address, network, and port may be specified. The destination network to match for this rule. Only one of address, network, and port may be specified. The format is ip-address/prefix.

ipv4net

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> destination

266

port

The destination port to match for this rule. The port name can be specified either by name (for example, ssh) or by number can be specified (for example, 22). You can specify a range of ports using a colon (for example, 100:110) or a comma-separated list of ports (for example 11:110, 23). The range for port numbers is 0 to 65535. Only one of address, network, and port may be specified.

Default
If not set, or if the destination configuration node is created with no attributes, the packet matches any destination.

Usage Guidelines
Use this command to define a match criterion based on destination address for a load balancing rule. You can match packets based on a destination represented by one of IP address, network address, or destination port(s). Use the set form of this command to specify a destination to be matched. Use the delete form of this command to remove destination configuration. Use the show form of this command to display destination configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> interface <wanx>

267

load-balancing wan rule <rule> interface <wanx>


Adds an interface to the set of interfaces to be load balanced in a WAN load balancing rule.

Syntax
set load-balancing wan rule rule interface wanx [weight num] delete load-balancing wan rule rule interface wanx [weight] show load-balancing wan rule rule interface wanx [weight]

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { rule u32 { interface-health wan0..wan23 { weight: 1-255 } } }

Parameters
rule wanx Mandatory. The number of the rule being configured. Mandatory. Multi-node. The name of the WAN-facing interface to which the rule is to be applied. The range is wan0 to wan23. The weight to be associated with the interface, where weight represents the relative distribution of packets to this interface.The range is 1 to 255. The default is 1.

weight

Default
Each interface is assigned a weight of 1.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> interface <wanx>

268

Usage Guidelines
Use this command to add an interface to the set of interfaces to be load balanced in a WAN load balancing rule. When a load balancing rule is matched, the outgoing packet is sent out through one of the interfaces specified in this set, as determined by the load balancing algorithm. The system uses a weighted random distribution load balancing algorithm. If no weights are assigned, the interfaces are picked randomly, which, on average, results in each interface receiving approximately the same number of packets. If an interface has a higher weight, it will tend to be picked more often; for example, an interface with a weight of 2 will tend to be picked twice as often as an interface with a weight of 1. Use the set form of this command to add an interface to the load balancing rule or to modify an interfaces load balancing weight. Use the delete form of this command to remove the interface from the load balancing rule or to restore the default weight of an interface. Use the show form of this command to display interface configuration in a load balancing rule.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> protocol <protocol>

269

load-balancing wan rule <rule> protocol <protocol>


Specifies an IP protocol as a match criterion for a WAN load balancing rule.

Syntax
set load-balancing wan rule rule protocol protocol delete load-balancing wan rule rule protocol protocol show load-balancing wan rule rule protocol protocol

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { rule u32 { protocol: [tcp|udp|icmp|all] } } }

Parameters
rule protocol Mandatory. The number of the rule being configured. The protocol to match for this rule. Supported values are as follows: tcp: Match only the TCP protocol. udp: Match only the UDP protocol. icmp: Match only the ICMP protocol. all: Match all protocols.

Default
All protocols are matched.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> protocol <protocol>

270

Usage Guidelines
Use this command to define a match criterion based on whether the packet is a TCP, UDP, or ICMP packet. Use the set form of this command to specify a protocol to be matched. Use the delete form of this command to restore the default protocol match value. Use the show form of this command to display protocol match configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> source

271

load-balancing wan rule <rule> source


Specifies a source as a match criterion for a WAN load balancing rule.

Syntax
set load-balancing wan rule rule source {address ipv4 | network ipv4net | port port} delete load-balancing wan rule rule source {address | network | port} show load-balancing wan rule rule source

Command Mode
Configuration mode.

Configuration Statement
load-balancing { wan { rule u32 { source { address: ipv4 network: ipv4net port: text } } } }

Parameters
rule ipv4 Mandatory. The number of the rule being configured. The source IP address to match for this rule. Only one of address, network, and port may be specified. The source network to match for this rule. Only one of address, network, and port may be specified. The format is ip-address/prefix.

ipv4net

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

load-balancing wan rule <rule> source

272

port

The source port to match for this rule. The port name can be specified either by name (for example, ssh) or by number can be specified (for example, 22). You can specify a range of ports using a colon (for example, 100:110) or a comma-separated list of ports (for example 11:110, 23). The range for port numbers is 0 to 65535. Only one of address, network, and port may be specified.

Default
If not set, or if the source configuration node is created with no attributes, the packet matches any source.

Usage Guidelines
Use this command to define a match criterion based on source address for a load balancing rule. You can match packets based on a source represented by one of IP address, network address, or destination port(s). Use the set form of this command to specify a source to be matched. Use the delete form of this command to remove source configuration. Use the show form of this command to display source configuration.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

show wan-load-balance

273

show wan-load-balance
Displays information about WAN load balanced interfaces.

Syntax
show wan-load-balancing

Command Mode
Operational mode.

Parameters
None.

Default
None.

Usage Guidelines
Use this command to see information about WAN load balanced interfaces. The information shown includes the current status, last success, last failure, and the number of failures. When an interface becomes active again, the number of failures is reset.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

Chapter 12: WAN Load Balancing

show wan-load-balance status

274

show wan-load-balance status


Displays information about the status of WAN load balancing.

Syntax
show wan-load-balancing status

Command Mode
Operational mode.

Parameters
None.

Default
None.

Usage Guidelines
Use this command to see information about status of WAN load balancing.

Vyatta System Command Reference

Rel VC4 v. 01

Vyatta

You might also like