This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stale IPSEC SA verhindert IPSEC Failover, trotz DPD - Warum ?

Hallo,

ich habe mehrere Filialen über IPSEC Tunnel (Site2Site) an die Zentrale angebunden.

Sowohl die Zentrale als auch die Filialen verfügen über Backup Leitungen.

Der betroffene Tunnel soll bei Ausfall einer Hauptleitung über die Backupleitung neu aufgebaut werden.

Klappt dem Grunde nach. Allerdings vergeht bis zu eine Stunde (= SA Lifetime) bis der Ersatztunnel hochkommt.

Meines Erachtens liegt das daran, dass die SA der toten Verbindung bis zum Ablauf der Lifetime aktiv bleibt.

Im IPSEC Log läßt sich verfolgen, wie die Filiale erfolglos versucht den Ersatztunnel aufzubauen und scheitert

...

2019:06:22-19:14:31 gate pluto[19213]: "S_Filiale1"[3] 80.187.80.xxx #192: responding to Main Mode from unknown peer 80.187.80.xxx (Backupleitung Filiale)
2019:06:22-19:14:31 gate pluto[19213]: "S_Filiale1"[3] 80.187.80.xxx #192: Peer ID is ID_FQDN: 'filiale1.xxxx.de'
2019:06:22-19:14:31 gate pluto[19213]: "S_Filiale1"[3] 80.187.80.xxx #195: responding to Quick Mode
2019:06:22-19:14:43 gate pluto[19213]: "S_Filiale1"[3] 80.187.80.xxx #195: cannot route -- route already in use for "S_Filiale1"

...

2019:06:22-19:42:56 gate pluto[19213]: ERROR: asynchronous network error report on eth1 for message to 84.141.238.xxx port 500, complainant 84.141.238.xxx: No route to host [errno 113, origin ICMP type 3 code 1 (not authenticated)] (Alter Tunnel - 84.141.238.xxx = Hauptleitung in der Filiale - Stecker gezogen, da kann nichts ankommen.)

...

In der Routingtabelle findet sich:   192.168.50.0/24 dev eth1 proto ipsec scope link src 172.16.0.1 (Netz Zentrale: 172.16.0.0/16, Filiale 192.168.50.0/24)

 

Sobald die SA der ursprünglichen Verbindung abgelaufen ist, klappt der Verbindungsaufbau und Daten fliessen über den Ersatztunnel.

2019:06:22-19:42:58 gate pluto[19213]: "S_Filiale1"[1] 84.141.238.xxx #277: initiating Quick Mode PUBKEY+ENCRYPT+TUNNEL+PFS to replace #276 {using isakmp#187}
2019:06:22-19:43:01 gate pluto[19213]: "S_Filiale1"[1] 84.141.238.xxx #277: ERROR: asynchronous network error report on eth1 for message to 84.141.238.xxx port 500, complainant 84.141.238.xxx: No route to host [errno 113, origin ICMP type 3 code 1 (not authenticated)]
2019:06:22-19:43:06 gate pluto[19213]: "S_Filiale1"[2] 84.141.238.xxx #187: DPD: No response from peer - declaring peer dead
2019:06:22-19:43:06 gate pluto[19213]: "S_Filiale1"[2] 84.141.238.xxx #187: DPD: Terminating all SAs using this connection
2019:06:22-19:43:06 gate pluto[19213]: "S_Filiale1"[2] 84.141.238.xxx #187: deleting connection "S_Filiale1"[2] instance with peer 84.141.238.xxx {isakmp=#187/ipsec=#0}2019:06:22-19:43:06 gate pluto[19213]: "S_Filiale1" #187: deleting state (STATE_MAIN_R3)

...

2019:06:22-19:43:35 gate pluto[19213]: "S_Filiale1"[25] 80.187.80.xxx:8455 #278: responding to Quick Mode
2019:06:22-19:43:36 gate pluto[19213]: id="2203" severity="info" sys="SecureNet" sub="vpn" event="Site-to-site VPN up" variant="ipsec" connection="Filiale1" address="212.161.xxx.xxx" local_net="172.16.0.0/16" remote_net="192.168.50.0/24"
2019:06:22-19:43:36 gate pluto[19213]: "S_Filiale1"[25] 80.187.80.xxx:8455 #278: IPsec SA established {ESP=>0xf74dbd44 <0x22148545 NATOA=0.0.0.0 DPD}

Zurück von der Backupleitung zur Hauptleitung selbes Spiel. Die SA bleibt auch aktiv wenn ich die Filiale komplett Offline nehme (Haupt und Backupltg.)

 

Sollte DPD nicht dafür sorgen, dass die 'tote' SA schon vor dem Rekeying entfernt wird ?

Von beiden Seiten laufen Daten (Ping alle x Sekunden zur jeweils anderen Seite).

In der Filiale (Initiator wg. NAT) wird die SA nach spätestens 3 Minuten entfernt.

 

 

Zum restlichen Setup:

 

Uplink Balancing (Haupt:Active/ Backup:Active - Haupt:100/ Backup:0) in den UTM auf beiden Seiten aktiviert.

IPSEC Tunnel wird vom Filialrouter (NAT/T, DPD) via vorgelagerten Router (NAT auf Haupt und Backupleitung) zur Zentrale (RespondOnly) aufgebaut.

Ziel via Availibility Group zuerst die Hauptleitung, dann die Backupleitung der Zentrale (beides öffentliche IP, statisch)

Multipath Regeln (nach Schnittstelle), die den Traffic zwischen Zentrale und Filialen auf das primäre Uplink Interface binden.

 



This thread was automatically locked due to age.
  • Hallo,

    Herzlich willkommen hier in der Community !

    (Sorry, my German-speaking brain isn't creating thoughts at the moment. [:(])

    There are two best approaches to this issue: (1) Auto-Failover IPsec VPN Connections and (2) Sophos UTM multiple S2S IPsec VPN mit Failover – Tutorial (DE).  (1) is easier to accomplish, but failover takes time because a new tunnel has to be built.  (2) provides virtually instantaneous failover as the backup tunnel is already established.

    I would first change your approach to that described in (1).  If you continue to have problems, please show pictures of the Edits of the IPsec Connection, Remote Gateway, Availability Group and Interface Group for both sides.  Also, confirm that none of the manually-created Network/Host definitions violates #3 in Rulz (last updated 2019-04-17).

    MfG - Bob (Bitte auf Deutsch weiterhin.)

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA
  • Hallo Bob,

    danke für die beiden Anregungen.  Werde versuchen das Problem mit Interface Groups zu lösen.

    Übersetzt auf meine Situation ist die Konfiguration damit wie folgt ?

     

    Site A: (Branch Office, WAN-A-1 and WAN-A-2 both 'nated')

    VPN Group (Local Interface) = WAN-Site-A-1, WAN-Site-A-2
    Remote Gateway for Site B uses a Gateway that is an Availability Group with, in order, WAN-Site-B-1, WAN-Site-B-2

    Site B: (Head Office)

    VPN Group (Local Interface) = WAN-Site-B-1, WAN-Site-B-2
    Remote Gateway for Site A is Respond Only

     

    Kann ein paar Tage dauern bis ich dazu komme die Funktion zu testen.