Configure gateway load balancing and failover
Configure Sophos Firewall for load balancing and failover for multiple ISP uplinks based on the number of WAN ports available on the appliance.
If you have more than one ISP link, you can terminate each link on a physical WAN interface. The firewall sends traffic to the ISP link through the gateway configured for the link.
You can configure a gateway as active or backup.
- Active-active: Sophos Firewall balances traffic among the active gateways. By default, it adds a new gateway as an active gateway. So, load balancing automatically occurs between the existing and newly added ISP links. Sophos Firewall uses a weighted round-robin algorithm for load balancing, distributing traffic among the ISP links based on the weight specified for the links.
- Active-backup: You configure one or more gateways as backup gateways. When an active gateway goes down, traffic fails over to an available backup gateway.
Load balancing and failover are supported both for IPv4 and IPv6 traffic. You can use two IPv4 gateways or two IPv6 gateways.
The network diagram shows that one ISP link is terminated on Port B, and Port D is an unbound port. The following instructions show how to terminate another ISP uplink on Port D.
Add a new gateway
You need to configure an unbound physical port. This example uses PortD throughout.
To add a new gateway, do as follows:
- Go to Network > Interface.
Select an unbound port and click it to edit its settings.
Enter the following information for your new interface:
- Network zone: Select WAN.
- IPv4 configuration: Turn on if appropriate.
- IP assignment
- IPv4/Network mask
- Gateway name
- Gateway ID
Example settings for PortD:
The gateway is added to the list of gateways.
Configure load balancing
You need to configure the load balancing for your new gateway.
Sophos Firewall adds a new gateway as an active gateway. Load balancing is automatically enabled between existing and new links.
Sophos Firewall uses a weighted round-robin algorithm for load balancing. This assigns a weight to a link. Sophos Firewall distributes traffic among the links in proportion to the weight assigned to them.
To assign a weight to a link:
Go to Network > WAN link manager. Edit the gateway.
Edit PortD gateway:
Enter a weight.
Example weight for PortD:
Configure gateway failover
You can set up gateway failover in both active-active and active-backup configurations.
In an active-active setup, if any of the active gateways fail, the traffic is redirected to the other active gateway. You can specify failover conditions to indicate how the failed gateway should be detected. When you add a gateway, Sophos Firewall adds a default failover rule: If Sophos Firewall can't ping the recently added gateway IP address, the gateway is considered down.
During a link failure incident, Sophos Firewall regularly checks the health of the connection so that it can restore the connection faster when the internet service is restored. When the connection is restored and the gateway is up again, the traffic is rerouted through the active gateway automatically.
Sophos Firewall notifies administrators by email about all changes in gateway status. You can also see this in the log viewer.
In an active-backup setup, if an active gateway fails, you must redirect the traffic to a backup gateway.
To set up gateway failover, choose whether to configure failover conditions or redirect to a backup gateway.
To configure failover conditions, do as follows:
- Click Add to add a new failover rule. You can also edit an existing rule.
Enter the details for the rule.
This screenshot shows an example rule. The rule states that if Sophos Firewall can't ping the gateway IP address, 172.16.16.15, or establish a TCP connection on port 80 to 18.104.22.168, the gateway is considered down.
To redirect the traffic to a backup gateway, do as follows:
- Go to Network > WAN link manager.
Edit the gateway.
Edit the PortD gateway:
Select Backup as the type.
- Set the gateway to start if any active gateway fails.
Set it to inherit the weight from the failed gateway.
Example backup settings for Port D:
Click Save. If an active gateway fails, the backup gateway is activated and inherits the weight of the failed gateway.