summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorQuill <69414602+teslazonda@users.noreply.github.com>2026-04-09 20:07:46 +0900
committerGitHub <noreply@github.com>2026-04-09 12:07:46 +0100
commiteb46e9a02199ef35b2cb9e9273c2e2ff793b36be (patch)
treebdf152318dad6f154265d270fe0b53dcc565e411 /docs
parentbe1128aaae24bba68e2fe115b41fb4c51fe025ef (diff)
downloadvyos-documentation-eb46e9a02199ef35b2cb9e9273c2e2ff793b36be.tar.gz
vyos-documentation-eb46e9a02199ef35b2cb9e9273c2e2ff793b36be.zip
DOC: Proofread files in the /configuration/loadbalancing directory (#1821)
* Initial proofread * Fix line length lint errors
Diffstat (limited to 'docs')
-rw-r--r--docs/configuration/loadbalancing/haproxy.rst167
-rw-r--r--docs/configuration/loadbalancing/index.rst2
-rw-r--r--docs/configuration/loadbalancing/wan.rst194
3 files changed, 184 insertions, 179 deletions
diff --git a/docs/configuration/loadbalancing/haproxy.rst b/docs/configuration/loadbalancing/haproxy.rst
index 667ebb95..d742ec18 100644
--- a/docs/configuration/loadbalancing/haproxy.rst
+++ b/docs/configuration/loadbalancing/haproxy.rst
@@ -1,21 +1,22 @@
+:lastproofread: 2026-04-06
#############
-Haproxy
+HAproxy
#############
.. include:: /_include/need_improvement.txt
-Haproxy is a balancer and proxy server that provides
-high-availability, load balancing and proxying for TCP (level 4)
-and HTTP-based (level 7) applications.
+HAProxy is a load balancer and proxy server that provides
+high-availability, load balancing, and proxying for TCP (level 4) and
+HTTP-based (level 7) applications.
Configuration
=============
-Service configuration is responsible for binding to a specific port,
-while the backend configuration determines the type of load balancing
-to be applied and specifies the real servers to be utilized.
+Service configuration specifies the port to bind to. Backend
+configuration defines the load balancing method and specifies the backend
+servers.
Service
-------
@@ -23,7 +24,8 @@ Service
.. cfgcmd:: set load-balancing haproxy service <name> listen-address
<address>
- Set service to bind on IP address, by default listen on any IPv4 and IPv6
+ Set the IP address for the service to bind to. By default, the service
+ listens on all IPv4 and IPv6 addresses.
.. cfgcmd:: set load-balancing haproxy service <name> port
<port>
@@ -43,19 +45,21 @@ Service
.. cfgcmd:: set load-balancing haproxy service <name> ssl
certificate <name>
- Set SSL certificate <name> for service <name>. Multiple certificates could be defined.
+ Set the SSL certificate <name> for service <name>. You can define
+ multiple certificates.
.. cfgcmd:: set load-balancing haproxy service <name>
http-response-headers <header-name> value <header-value>
- Set custom HTTP headers to be included in all responses
+ Set custom HTTP headers to include in all responses.
.. cfgcmd:: set load-balancing haproxy service <name> logging facility
<facility> level <level>
Specify facility and level for logging.
- For an explanation on :ref:`syslog_facilities` and :ref:`syslog_severity_level`
- see tables in syslog configuration section.
+ For an explanation on :ref:`syslog_facilities` and
+ :ref:`syslog_severity_level`,
+ see tables in the syslog configuration section.
.. cfgcmd:: set load-balancing haproxy service <name> timeout client
<seconds>
@@ -76,9 +80,9 @@ Service
Rules
^^^^^
-Rules allow to control and route incoming traffic to specific backend based
-on predefined conditions. Rules allow to define matching criteria and
-perform action accordingly.
+Rules control and route incoming traffic to specific backends based on
+predefined conditions. Rules define matching criteria and specify actions
+to perform.
.. cfgcmd:: set load-balancing haproxy service <name> rule <rule>
domain-name <name>
@@ -98,15 +102,13 @@ perform action accordingly.
.. cfgcmd:: set load-balancing haproxy service <name> rule <rule>
url-path <match> <url>
- Allows to define URL path matching rules for a specific service.
-
- With this command, you can specify how the URL path should be matched
- against incoming requests.
+ Define URL path matching rules for a specific service. Use this command
+ to specify how to match the URL path against incoming requests.
The available options for <match> are:
* ``begin`` Matches the beginning of the URL path
* ``end`` Matches the end of the URL path.
- * ``exact`` Requires an exactly match of the URL path
+ * ``exact`` Matches the URL path exactly.
.. cfgcmd:: set load-balancing haproxy service <name> rule <rule>
set backend <name>
@@ -116,7 +118,7 @@ perform action accordingly.
.. cfgcmd:: set load-balancing haproxy service <name> rule <rule>
redirect-location <url>
- Redirect URL to a new location
+ Redirect URL to a new location.
Backend
@@ -125,37 +127,36 @@ Backend
.. cfgcmd:: set load-balancing haproxy backend <name> balance
<balance>
- Load-balancing algorithms to be used for distributed requests among the
- available servers
+ Specify the load balancing algorithm for distributing requests among
+ available servers.
Balance algorithms:
* ``source-address`` Distributes requests based on the source IP address
- of the client
+ of the client.
* ``round-robin`` Distributes requests in a circular manner,
- sequentially sending each request to the next server in line
+ sequentially sending each request to the next server in line.
* ``least-connection`` Distributes requests to the server with the fewest
- active connections
+ active connections.
.. cfgcmd:: set load-balancing haproxy backend <name> mode
<mode>
- Configure backend `<name>` mode TCP or HTTP
+ Configure backend `<name>` mode TCP or HTTP.
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> address <x.x.x.x>
- Set the address of the backend server to which the incoming traffic will
- be forwarded
+ Set the address of the backend server that receives incoming traffic.
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> port <port>
- Set the address of the backend port
+ Set the address of the backend port.
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> check
- Active health check backend server
+ Active health check backend server.
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> check port <port>
@@ -166,35 +167,36 @@ Backend
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> send-proxy
- Send a Proxy Protocol version 1 header (text format)
+ Send a Proxy Protocol version 1 header (text format).
.. cfgcmd:: set load-balancing haproxy backend <name> server
<name> send-proxy-v2
- Send a Proxy Protocol version 2 header (binary format)
+ Send a Proxy Protocol version 2 header (binary format).
.. cfgcmd:: set load-balancing haproxy backend <name> ssl
ca-certificate <ca-certificate>
- Configure requests to the backend server to use SSL encryption and
- authenticate backend against <ca-certificate>
+ Use SSL encryption for backend requests and authenticate the backend
+ against ``<ca-certificate>``.
.. cfgcmd:: set load-balancing haproxy backend <name> ssl no-verify
- Configure requests to the backend server to use SSL encryption without
- validating server certificate
+ Use SSL encryption for backend requests without validating the server
+ certificate.
.. cfgcmd:: set load-balancing haproxy backend <name>
http-response-headers <header-name> value <header-value>
- Set custom HTTP headers to be included in all responses using the backend
+ Set custom HTTP headers to include in all responses from the backend.
.. cfgcmd:: set load-balancing haproxy backend <name> logging facility
<facility> level <level>
Specify facility and level for logging.
- For an explanation on :ref:`syslog_facilities` and :ref:`syslog_severity_level`
- see tables in syslog configuration section.
+ For an explanation on :ref:`syslog_facilities` and
+ :ref:`syslog_severity_level`,
+ see tables in the :ref:`syslog` configuration section.
.. cfgcmd:: set load-balancing haproxy backend <name> timeout check
<seconds>
@@ -220,7 +222,7 @@ Backend
Global
-------
-Global parameters
+Global configuration parameters:
.. cfgcmd:: set load-balancing haproxy global-parameters max-connections
<num>
@@ -230,7 +232,7 @@ Global parameters
.. cfgcmd:: set load-balancing haproxy global-parameters ssl-bind-ciphers
<ciphers>
- Limit allowed cipher algorithms used during SSL/TLS handshake
+ Limit the cipher algorithms allowed during SSL/TLS handshake.
.. cfgcmd:: set load-balancing haproxy global-parameters tls-version-min
<version>
@@ -241,7 +243,8 @@ Global parameters
facility <facility> level <level>
Specify facility and level for logging.
- For an explanation on :ref:`syslog_facilities` and :ref:`syslog_severity_level`
+ For an explanation on :ref:`syslog_facilities` and
+ :ref:`syslog_severity_level`
see tables in syslog configuration section.
.. cfgcmd:: set load-balancing haproxy timeout check <seconds>
@@ -271,8 +274,8 @@ Health checks
HTTP checks
-----------
-For web application providing information about their state HTTP health
-checks can be used to determine their availability.
+Use HTTP health checks to monitor web applications that provide health status
+information and determine their availability.
.. cfgcmd:: set load-balancing haproxy backend <name> http-check
@@ -282,17 +285,17 @@ checks can be used to determine their availability.
.. cfgcmd:: set load-balancing haproxy backend <name> http-check
method <method>
- Sets the HTTP method to be used, can be either: option, get, post, put
+ Set the HTTP method: ``OPTION``, ``GET``, ``POST``, or ``PUT``.
.. cfgcmd:: set load-balancing haproxy backend <name> http-check
uri <path>
- Sets the endpoint to be used for health checks
+ Set the endpoint to use for health checks.
.. cfgcmd:: set load-balancing haproxy backend <name> http-check
expect <condition>
- Sets the expected result condition for considering a server healthy.
+ Set the expected result condition for a server to be considered healthy.
Some possible examples are:
* ``status 200`` Expecting a 200 response code
@@ -303,8 +306,8 @@ checks can be used to determine their availability.
TCP checks
----------
-Health checks can also be configured for TCP mode backends. You can configure
-protocol aware checks for a range of Layer 7 protocols:
+Configure health checks for TCP mode backends. You can configure protocol-aware
+checks for a range of Layer 7 protocols:
.. cfgcmd:: set load-balancing haproxy backend <name> health-check <protocol>
@@ -315,25 +318,23 @@ protocol aware checks for a range of Layer 7 protocols:
* ``pgsql`` PostgreSQL protocol check.
* ``smtp`` SMTP protocol check.
-.. note:: If you specify a server to be checked but do not configure a
- protocol, a basic TCP health check will be attempted. A server shall be
- deemed online if it responses to a connection attempt with a valid
- ``SYN/ACK`` packet.
+.. note:: If you specify a server to check but do not configure a
+ protocol, HAProxy performs a basic TCP health check. A server is online if
+ it responds to a connection attempt with a valid ``SYN/ACK`` packet.
Redirect HTTP to HTTPS
======================
-Configure the load-balancing haproxy service for HTTP.
-This configuration listen on port 80 and redirect incoming
-requests to HTTPS:
+Configure a HAProxy service for HTTP that listens on port 80 and redirects
+incoming requests to HTTPS:
.. code-block:: none
set load-balancing haproxy service http port '80'
set load-balancing haproxy service http redirect-http-to-https
-The name of the service can be different, in this example it is only for
+You can use a different service name; in this example, ``http`` is just for
convenience.
@@ -343,9 +344,10 @@ Examples
Level 4 balancing
-----------------
-This configuration enables the TCP reverse proxy for the "my-tcp-api" service.
-Incoming TCP connections on port 8888 will be load balanced across the backend
-servers (srv01 and srv02) using the round-robin load-balancing algorithm.
+This configuration enables the TCP reverse proxy for the ``my-tcp-api``
+service. Incoming TCP connections on port 8888 are load balanced across the
+backend servers (srv01 and srv02) using the round-robin load balancing
+algorithm.
.. code-block:: none
@@ -365,15 +367,15 @@ servers (srv01 and srv02) using the round-robin load-balancing algorithm.
Balancing based on domain name
------------------------------
The following configuration demonstrates how to use VyOS
-to achieve load balancing based on the domain name.
+to achieve load balancing based on the domain name:
-The HTTP service listen on TCP port 80.
+The HTTP service listens on TCP port 80.
-Rule 10 matches requests with the domain name ``node1.example.com`` forwards
-to the backend ``bk-api-01``
+Rule 10 matches requests with the domain name ``node1.example.com`` and
+forwards them to the backend ``bk-api-01``.
-Rule 20 matches requests with the domain name ``node2.example.com`` forwards
-to the backend ``bk-api-02``
+Rule 20 matches requests with the domain name ``node2.example.com`` and
+forwards them to the backend ``bk-api-02``.
.. code-block:: none
@@ -398,23 +400,25 @@ to the backend ``bk-api-02``
Terminate SSL
-------------
+
The following configuration terminates SSL on the router.
-The ``http`` service is listens on port 80 and force redirects from HTTP to
+The ``http`` service listens on port 80 and redirects HTTP requests to
HTTPS.
-The ``https`` service listens on port 443 with backend ``bk-default`` to
-handle HTTPS traffic. It uses certificate named ``cert`` for SSL termination.
-HSTS header is set with a 1-year expiry, to tell browsers to always use SSL for site.
+The ``https`` service listens on port 443 with the ``bk-default`` backend
+and handles HTTPS traffic using the ``cert`` certificate for SSL termination.
+The HSTS header is set with a 1-year expiry to tell browsers to always use
+SSL for the site.
-Rule 10 matches requests with the exact URL path ``/.well-known/xxx``
-and redirects to location ``/certs/``.
+Rule 10 matches requests with the exact URL path ``/.well-known/xxx`` and
+redirects them to ``/certs/``.
-Rule 20 matches requests with URL paths ending in ``/mail`` or exact
-path ``/email/bar`` redirect to location ``/postfix/``.
+Rule 20 matches requests with URL paths ending in ``/mail`` or the exact
+path ``/email/bar`` and redirects them to ``/postfix/``.
-Additional global parameters are set, including the maximum number
-connection limit of 4000 and a minimum TLS version of 1.3.
+Global parameters include a maximum connection limit of 4000 and a minimum
+TLS version of 1.3.
.. code-block:: none
@@ -447,9 +451,10 @@ connection limit of 4000 and a minimum TLS version of 1.3.
SSL Bridging
-------------
+
The following configuration terminates incoming HTTPS traffic on the router,
-then re-encrypts the traffic and sends to the backend server via HTTPS.
-This is useful if encryption is required for both legs, but you do not want to
+then re-encrypts the traffic and sends it to the backend server via HTTPS.
+Use this when encryption is required for both paths but you do not want to
install publicly trusted certificates on each backend server.
Backend service certificates are checked against the certificate authority
@@ -458,7 +463,7 @@ specified in the configuration, which could be an internal CA.
The ``https`` service listens on port 443 with backend ``bk-bridge-ssl`` to
handle HTTPS traffic. It uses certificate named ``cert`` for SSL termination.
-The ``bk-bridge-ssl`` backend connects to sr01 server on port 443 via HTTPS
+The ``bk-bridge-ssl`` backend connects to ``sr01`` server on port 443 via HTTPS
and checks backend server has a valid certificate trusted by CA ``cacert``
@@ -480,7 +485,7 @@ and checks backend server has a valid certificate trusted by CA ``cacert``
Balancing with HTTP health checks
---------------------------------
-This configuration enables HTTP health checks on backend servers.
+This configuration enables HTTP health checks for backend servers.
.. code-block:: none
diff --git a/docs/configuration/loadbalancing/index.rst b/docs/configuration/loadbalancing/index.rst
index 92dcc622..b87faed2 100644
--- a/docs/configuration/loadbalancing/index.rst
+++ b/docs/configuration/loadbalancing/index.rst
@@ -1,3 +1,5 @@
+:lastproofread: 2026-04-06
+
.. _load-balancing:
##############
diff --git a/docs/configuration/loadbalancing/wan.rst b/docs/configuration/loadbalancing/wan.rst
index 745cd8c2..3d5a3cc6 100644
--- a/docs/configuration/loadbalancing/wan.rst
+++ b/docs/configuration/loadbalancing/wan.rst
@@ -1,22 +1,21 @@
-:lastproofread: 2023-01-27
+:lastproofread: 2026-04-06
WAN load balancing
==================
-Outbound traffic can be balanced between two or more outbound interfaces.
-If a path fails, traffic is balanced across the remaining healthy paths,
-a recovered path is automatically added back to the routing table and used by
-the load balancer. The load balancer automatically adds routes for each path to
-the routing table and balances traffic across the configured interfaces,
-determined by interface health and weight.
+The load balancer distributes outbound traffic across two or more
+interfaces. If a path fails, the load balancer balances traffic across the
+remaining healthy paths. When a path recovers, it is automatically added back
+to the routing table. The load balancer adds routes for each path and
+distributes traffic based on interface health and weight.
In a minimal configuration, the following must be provided:
- * an interface with a nexthop
- * one rule with a LAN (inbound-interface) and the WAN (interface).
+ * An interface with a ``nexthop``.
+ * One rule with a LAN (inbound-interface) and the WAN (interface).
-Let's assume we have two DHCP WAN interfaces and one LAN (eth2):
+The following examples uses two DHCP WAN interfaces and one LAN (``eth2``):
.. code-block:: none
@@ -28,18 +27,18 @@ Let's assume we have two DHCP WAN interfaces and one LAN (eth2):
.. note::
- WAN Load Balacing should not be used when dynamic routing protocol is
- used/needed. This feature creates customized routing tables and firewall
- rules, that makes it incompatible to use with routing protocols.
+ Do not use WAN load balancing with dynamic routing protocols. This
+ feature creates customized routing tables and firewall rules that are
+ incompatible with routing protocols.
-Balancing Rules
----------------
+Load balancing rules
+--------------------
-Interfaces, their weight and the type of traffic to be balanced are defined in
-numbered balancing rule sets. The rule sets are executed in numerical order
-against outgoing packets. In case of a match the packet is sent through an
-interface specified in the matching rule. If a packet doesn't match any rule
-it is sent by using the system routing table. Rule numbers can't be changed.
+You define interfaces, their weight, and the traffic type to balance in
+numbered rule sets. The load balancer executes rules in numerical order
+against outgoing packets. When a packet matches a rule, it is sent through the
+specified interface. Packets that do not match any rule use the system routing
+table. You cannot change rule numbers.
Create a load balancing rule, it can be a number between 1 and 9999:
@@ -61,23 +60,25 @@ Create a load balancing rule, it can be a number between 1 and 9999:
Interface weight
****************
-Let's expand the example from above and add weight to the interfaces.
-The bandwidth from eth0 is larger than eth1. Per default, outbound traffic is
-distributed randomly across available interfaces. Weights can be assigned to
-interfaces to influence the balancing.
+By default, the load balancer distributes outbound
+traffic randomly across available interfaces. You can assign weights to
+interfaces to influence the distribution. If ``eth0`` has more bandwidth
+than ``eth1``, you can assign a higher weight to ``eth0`` to send more
+traffic through it:
.. code-block:: none
set load-balancing wan rule 1 interface eth0 weight 2
set load-balancing wan rule 1 interface eth1 weight 1
-66% of traffic is routed to eth0, eth1 gets 33% of traffic.
+In this example,``eth0`` receives 66% of traffic, and ``eth1`` receives
+33% of traffic.
Rate limit
**********
-A packet rate limit can be set for a rule to apply the rule to traffic above or
-below a specified threshold. To configure the rate limiting use:
+Set a packet rate limit for a rule to apply it to traffic above or below a
+specified threshold. To configure rate limiting, use:
.. code-block:: none
@@ -88,22 +89,20 @@ below a specified threshold. To configure the rate limiting use:
* ``period``: Time window for rate calculation. Possible values:
``second`` (one second), ``minute`` (one minute), ``hour`` (one hour).
Default is ``second``.
-* ``rate``: Number of packets. Default 5.
+* ``rate``: Number of packets. Default: ``5``.
* ``threshold``: ``below`` or ``above`` the specified rate limit.
Flow and packet-based balancing
*******************************
-Outgoing traffic is balanced in a flow-based manner.
-A connection tracking table is used to track flows by their source address,
-destination address and port. Each flow is assigned to an interface according
-to the defined balancing rules and subsequent packets are sent through the
-same interface. This has the advantage that packets always arrive in order if
-links with different speeds are in use.
+The load balancer balances outgoing traffic by flow. A connection tracking
+table tracks flows by source address, destination address, and port. Each
+flow is assigned to an interface based on the balancing rules, and subsequent
+packets use the same interface. This ensures packets arrive in order when links
+have different speeds.
-Packet-based balancing can lead to a better balance across interfaces when out
-of order packets are no issue. Per-packet-based balancing can be set for a
-balancing rule with:
+Packet-based balancing can improve balance across interfaces when packet
+order is not critical. Enable per-packet balancing for a rule with:
.. code-block:: none
@@ -112,8 +111,8 @@ balancing rule with:
Exclude traffic
***************
-To exclude traffic from load balancing, traffic matching an exclude rule is not
-balanced but routed through the system routing table instead:
+To exclude traffic from load balancing, traffic matching an exclude rule
+bypasses load balancing and uses the system routing table instead:
.. code-block:: none
@@ -123,10 +122,10 @@ balanced but routed through the system routing table instead:
Health checks
-------------
-The health of interfaces and paths assigned to the load balancer is
-periodically checked by sending ICMP packets (ping) to remote destinations,
-a TTL test or the execution of a user defined script. If an interface fails the
-health check it is removed from the load balancer's pool of interfaces.
+The load balancer periodically checks the health of interfaces and paths by
+sending ICMP packets (ping) to remote destinations, performing TTL tests, or
+executing a user-defined script. If an interface fails the health check, the
+load balancer removes it from its interface pool.
To enable health checking for an interface:
.. code-block:: none
@@ -138,26 +137,26 @@ To enable health checking for an interface:
success-count Success count
+> test Rule number
-Specify nexthop on the path to the destination, ``ipv4-address`` can be set to
-``dhcp``
+Specify the nexthop on the path to the destination. You can set
+``ipv4-address`` to ``dhcp``.
.. code-block:: none
set load-balancing wan interface-health <interface> nexthop <ipv4-address>
-Set the number of health check failures before an interface is marked as
-unavailable, range for number is 1 to 10, default 1. Or set the number of
-successful health checks before an interface is added back to the interface
-pool, range for number is 1 to 10, default 1.
+Set the number of health check failures before the load balancer marks an
+interface as unavailable (range 1-10, default 1). Or set the number of
+successful health checks before adding an interface back to the pool
+(range 1-10, default 1).
.. code-block:: none
set load-balancing wan interface-health <interface> failure-count <number>
set load-balancing wan interface-health <interface> success-count <number>
-Each health check is configured in its own test, tests are numbered and
-processed in numeric order. For multi target health checking multiple tests
-can be defined:
+Configure each health check in its own test. Tests are numbered and processed
+in numeric order. You can define multiple tests for multi-target health
+checking:
.. code-block:: none
@@ -169,46 +168,45 @@ can be defined:
ttl-limit Ttl limit (hop count)
type WLB test type
-* ``resp-time``: the maximum response time for ping in seconds.
- Range 1...30, default 5
-* ``target``: the target to be sent ICMP packets to, address can be an IPv4
- address or hostname
-* ``test-script``: A user defined script must return 0 to be considered
- successful and non-zero to fail. Scripts are located in /config/scripts,
- for different locations the full path needs to be provided
-* ``ttl-limit``: For the UDP TTL limit test the hop count limit must be
- specified. The limit must be shorter than the path length, an ICMP time
- expired message is needed to be returned for a successful test. default 1
-* ``type``: Specify the type of test. type can be ping, ttl or a user defined
- script
+* ``resp-time``: The maximum response time for ping in seconds. Range
+ 1-30, default ``5``.
+* ``target``: The target to receive ICMP packets. The address can be an IPv4
+ address or hostname.
+* ``test-script``: A user-defined script must return 0 to succeed and
+ non-zero to fail. Scripts reside in ``/config/scripts``. For other locations,
+ provide the full path.
+* ``ttl-limit``: For the UDP TTL limit test, specify the hop count limit.
+ The limit must be shorter than the path length. The test succeeds when an
+ ICMP time-expired message is returned. Default ``1``.
+* ``type``: Specify the test type: ``ping``, ``ttl``, or a user-defined
+ script.
Source NAT rules
----------------
-Per default, interfaces used in a load balancing pool replace the source IP
-of each outgoing packet with its own address to ensure that replies arrive on
-the same interface. This works through automatically generated source NAT (SNAT)
-rules, these rules are only applied to balanced traffic. In cases where this
-behaviour is not desired, the automatic generation of SNAT rules can be
-disabled:
+By default, interfaces in a load balancing pool replace the source IP of
+each outgoing packet with their own address to ensure replies arrive on the
+same interface. The load balancer handles this through automatically generated
+Source NAT (SNAT) rules applied only to balanced traffic. To disable the
+automatic generation of SNAT rules when this behavior is not desired, use:
.. code-block:: none
set load-balancing wan disable-source-nat
-Sticky Connections
+Sticky connections
------------------
-Inbound connections to a WAN interface can be improperly handled when the reply
-is sent back to the client.
+Inbound connections to a WAN interface can be improperly handled when
+replies are sent back to the client.
.. image:: /_static/images/sticky-connections.jpg
:width: 80%
:align: center
-Upon reception of an incoming packet, when a response is sent, it might be
-desired to ensure that it leaves from the same interface as the inbound one.
-This can be achieved by enabling sticky connections in the load balancing:
+When responding to an incoming packet, you may want to ensure the response
+leaves from the same interface as the incoming packet. Enable sticky
+connections in the load balancer to do this:
.. code-block:: none
@@ -217,23 +215,21 @@ This can be achieved by enabling sticky connections in the load balancing:
Failover
--------
-In failover mode, one interface is set to be the primary interface and other
-interfaces are secondary or spare. Instead of balancing traffic across all
-healthy interfaces, only the primary interface is used and in case of failure,
-a secondary interface selected from the pool of available interfaces takes over.
-The primary interface is selected based on its weight and health, others become
-secondary interfaces. Secondary interfaces to take over a failed primary
-interface are chosen from the load balancer's interface pool, depending
-on their weight and health. Interface roles can also be selected based on rule
-order by including interfaces in balancing rules and ordering those rules
-accordingly. To put the load balancer in failover mode, create a failover rule:
+In failover mode, one interface is primary and other interfaces are
+secondary or spare. The load balancer uses only the primary interface. If it
+fails, a secondary interface from the available pool takes over. The load
+balancer selects the primary interface based on its weight and health. Other
+interfaces become secondary. Secondary interfaces are chosen based on their
+weight and health. You can also select interface roles based on rule order by
+including interfaces in balancing rules and ordering those rules accordingly.
+To enable failover mode, create a failover rule:
.. code-block:: none
set load-balancing wan rule <number> failover
-Because existing sessions do not automatically fail over to a new path,
-the session table can be flushed on each connection state change:
+Existing sessions do not automatically fail over to a new path. Flush the
+session table on each connection state change to enable failover:
.. code-block:: none
@@ -241,14 +237,15 @@ the session table can be flushed on each connection state change:
.. warning::
- Flushing the session table will cause other connections to fall back from
+ Flushing the session table causes other connections to revert from
flow-based to packet-based balancing until each flow is reestablished.
Script execution
----------------
-A script can be run when an interface state change occurs. Scripts are run
-from /config/scripts, for a different location specify the full path:
+Run a script when an interface state changes. Scripts run from the
+``/config/scripts`` directory. To use a script in another location,
+specify the full path:
.. code-block:: none
@@ -261,19 +258,20 @@ Two environment variables are available:
.. warning::
- Blocking call with no timeout. System will become unresponsive if script
- does not return!
+ Blocking call with no timeout: VyOS becomes unresponsive if the
+ script does not return.
Handling and monitoring
-----------------------
-Show WAN load balancer information including test types and targets.
-A character at the start of each line depicts the state of the test
+The following command shows WAN load balancer information including test
+types and targets. The character at the start of each line indicates the test
+state:
-* ``+`` successful
-* ``-`` failed
-* a blank indicates that no test has been carried out
+* ``+`` successful.
+* ``-`` failed.
+* A blank indicates that no test has been carried out.
.. code-block:: none