2019-08-27 13:11:08 +00:00
==================================
Gateway groups / Multi WAN
==================================
2018-11-08 19:59:18 +00:00
Multi WAN scenarios are commonly used for failover or load balancing, but combinations
2018-01-30 10:40:13 +00:00
are also possible with OPNsense.
.. blockdiag ::
:desctable:
blockdiag {
OPNsense -- WAN_backup;
2023-11-05 10:43:40 +00:00
OPNsense -- WAN_primary;
WAN_primary -- internet;
2018-01-30 10:40:13 +00:00
WAN_backup -- internet;
internet [shape="cloud"];
WAN_primary [shape="cisco.modem",label=""];
WAN_backup [shape="cisco.modem",label=""];
}
2023-11-05 10:43:40 +00:00
The technology used to offer multiwan is called "policy based routing" or "source routing" and depends on the :doc: `firewall </manual/firewall>` functionality of OPNsense.
.. Note ::
Currently it's not possible to use gateways without an address (Interface option "Dynamic gateway policy") inside a group.
This is due to the fact that the firewall requires an address of the right family (IPv4 / IPv6) to be present on the
interface, which can not be guranteed based on its configuration at the moment.
------------------------
Terminology
------------------------
When configuring gatew groups, there is a limited number of options and terms being used. Besides the name
of the group, one can find the following terms on the page:
=====================================================================================================================
==================================== ===============================================================================
Gateway Priority If a gateway is configured for a group, the 'when' part is divided into
'tiers,' with lower numbers (starting at 1) indicating higher importance.
When no usable gateways are present within a peer, the next one is
considered.
Trigger Level When a gateway inside the tier is considered offline, either when its
fully down, has loss or increased latency.
Pool Options Usually left to default, but can influence stickyness for sources on
a per group basis.
==================================== ===============================================================================
------------------------
Roles
------------------------
Using 'tiers', multiple scenarios can be constructed, by grouping gateways inside the same tier or choosing
to move them to different ones. Below the most common scenarios.
........................................
2018-01-30 10:40:13 +00:00
WAN Failover
2023-11-05 10:43:40 +00:00
........................................
2018-01-30 10:40:13 +00:00
WAN failover automatically switches between WAN connections in case of connectivity
loss (or high latency) of your primary ISP. As long as the connection is not good
all traffic will be routed of the next available ISP/WAN connection and when
connectivity is fully restored so will the routing switch back to the primary ISP.
2023-11-05 10:43:40 +00:00
........................................
2018-01-30 10:40:13 +00:00
WAN Load Balancing
2023-11-05 10:43:40 +00:00
........................................
2018-11-08 19:59:18 +00:00
Load balancing can be used to split the load between two (or more) ISPs. This
2018-01-30 10:40:13 +00:00
enhances the total available bandwidth and/or lowers the load on each ISP.
The principle is simple: Each WAN connection (gateway) gets a portion of the traffic.
The traffic can be divided equally or weighted.
2023-11-05 10:43:40 +00:00
........................................
2018-01-30 10:40:13 +00:00
Combining Balancing & Failover
2023-11-05 10:43:40 +00:00
........................................
2018-11-08 19:59:18 +00:00
It is also possible to combine Load Balancing with Failover in such scenarios
2018-01-30 10:40:13 +00:00
you will have 2 or more WAN connections for Balancing purposes and 1 or more for
Failover. OPNsense offers 5 tiers (Failover groups) each tier can hold multiple
2018-11-08 19:59:18 +00:00
ISPs/WAN gateways.
2018-01-30 10:40:13 +00:00
-------------
Configuration
-------------
2019-08-27 13:11:08 +00:00
For a how to configure read:
.. toctree ::
:maxdepth: 2
:titlesonly:
how-tos/multiwan