Configure an IPsec VPN failover with multiple connections

Created by Helpdesk, Modified on Thu, 3 Jul, 2025 at 4:08 PM by Helpdesk

This article describes how to configure multiple IPsec VPN connections for redundancy.

The following sections are covered:

  • Sophos Firewall 1
  • Sophos Firewall 2
  • Test

Product and Environment

Sophos Firewall - All supported versions


 

Configuring an IPsec VPN failover with multiple connections

Sophos Firewall 1

Local and remote LAN

1.Go to Hosts and Services > IP Host and add the local and remote LAN.


SettingLocal LANRemote LAN
NameSF1_LANSF2_LAN
IP versionIPv4IPv4
TypeNetworkNetwork
IP address192.168.1.0/24192.168.3.0/24

 

2.Save your configuration .


IPsec VPN connection

  1. Go to Site-to-site VPN > IPsec > IPsec connection.
  2. Click Add and create IPsec connections for ISP1 and ISP2
  3. Save your IPsec connections.
  4. Click the red icon to activate both of your connections.
SettingISP1ISP2
General settings
NameSF1_to_SF2_ISP1SF1_to_SF2_ISP2
IP versionIPv4IPv4
Connection typeSite-to-siteSite-to-site
Gateway typeRespond onlyRespond only
Encryption
ProfileDefaultHeadOfficeDefaultHeadOffice
Authentication typePreshared keyPreshared key
Gateway settings
Local gateway
Listening interfacePort2 - 192.168.198.128Port5 - 192.168.198.139
Local subnetSF1_LANSF1_LAN
Remote gateway
Gateway address192.168.198.130192.168.198.130
Local subnetSF2_LANSF2_LAN
Advanced
User authentication modeNoneNone


Firewall rules to allow VPN traffic

  1. Go to Rules and policies > Firewall rules.
  2. Add two new firewall rules.
  3. Save your rules.
SettingRule 1Rule 2
Rule nameOutbound_VPN_TrafficInbound_VPN_Traffic
Rule positionTopTop
Source zonesLANVPN
Source networks and devicesSF1_LANSF2_LAN
Destination zonesVPNLAN
Destination networksSF2_LANSF1_LAN


Sophos Firewall 2

Local and remote LAN

1.Go to Hosts and Services > IP Host and add the local and remote LAN.


SettingLocal LANRemote LAN
NameSF2_LANSF1_LAN
IP versionIPv4IPv4
TypeNetworkNetwork
IP address192.168.3.0/24192.168.1.0/2

 

2.Save your configuration.


IPsec VPN connection

  1. Go to Site-to-site VPN > IPsec > IPsec connection.
  2. Click Add and create IPsec connections for ISP1 and ISP2.
  3. Save your IPsec connections.
  4. Click the red icon to activate both of your connections.
  5. Click Add under Failover group.



SettingISP1ISP2
General settings
NameSF2_to_SF1_ISP1SF2_to_SF1_ISP2
IP versionIPv4IPv4
Connection typeSite-to-siteSite-to-site
Gateway typeInitiate the connectionInitiate the connection
Encryption
ProfileDefault Branch OfficeDefault Branch Office
Authentication typePreshared keyPreshared key
Gateway settings
Local gateway
Listening interfacePort-B - 192.168.198.130Port-B - 192.168.198.130
Local subnetSF2_LANSF2_LAN
Remote gateway
Gateway address192.168.198.128192.168.198.139
Local subnetSF1_LANSF1_LAN
Advanced
User authentication modeNoneNone

 

     6.Configure it as follows:


Connection group details
NameEnter a name
Available connections
  • SF2_to_SF1_ISP1
  • SF2_to_SF1_ISP2
Member connections
  • SF2_to_SF1_ISP1
  • SF2_to_SF1_ISP2
Failover condition
If not able to connect TCP Port 80
And not able to connect PING


     7.Click the red icon to activate and establish the primary connection.



Firewall rules to allow VPN traffic

  1. Go to Rules and policies > Firewall rules.
  2. Add two new firewall rules.
  3. Save your rules.
SettingRule 1Rule 2
Rule nameOutbound_VPN_TrafficInbound_VPN_Traffic
Rule positionTopTop
Source zonesLANVPN
Source networks and devicesSF2_LANSF1_LAN
Destination zonesVPNLAN
Destination networksSF1_LANSF2_LAN


Test:

A ping request from a device behind Sophos Firewall 1 to a device behind Sophos Firewall 2 and vice versa should work.


When you go to the Firewall rules tab, you should see ingress and egress traffic allowed in your inbound and outbound VPN traffic rules.


Go to Reports > VPN to verify the traffic usage.


Note:

  • Make sure that VPN firewall rules are on top of the list of rules.
  • In a head and branch office configuration, Sophos Firewall on the branch office usually acts as the tunnel initiator and Sophos Firewall on the head office as a responder due to the following reasons:
    • When the branch office device is configured with a dynamic IP address, the head office device cannot initiate the connection.
    • As the number of branch offices varies, it is recommended that each branch office retry the connection instead of the head office retrying all connections to the branch offices.
  • Failback behavior
    • During a failback event, if the failback connection is not established, Sophos Firewall will keep the secondary active connection up until the next Dead Gateway Detection event.
    • The failback connection will only be attempted once. If it fails, the behavior described above will apply.
    • Example:
      Failover Group nameFailbackIPsec Tunnel name
      Head_OfficeYes
      • SF2_to_SF1_ISP1
      • SF2_to_SF1_ISP2



If failback to SF2_to_SF1_ISP1 fails due to any connectivity issue during a failback event, the SF2_to_SF1_ISP2 connection will remain up. The connection will only shift to SF2_to_SF1_ISP1 (the primary connection of the failover group) if SF2_to_SF1_ISP2 goes down

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article