S2S VPN Connection Custom IPsec policy with client disconnects and never re-establishes

David Boorman 0 Reputation points
2025-03-10T14:22:51.39+00:00

We have a customer that is still using IKEv1 protocol and we are doing our best to accommodate. It is an old connection from years back and we've always had intermittent disconnects. The connection went down recently and we tried to get them to move to IKEv2 and the challenge is that they are still supporting legacy connections with other partners. We decided to at least upgrade our Azure resources from Basic Gateway SKU and more modern technology still following Microsoft documentation regarding Phase 1 and Phase 2 options for IKEv1. Worked with the client and we were able to establish a connection and data was flowing again (one-way data flow. the client sends us public health, clinical data. we process and report required data to state and federal registries on their behalf). The connection up time lasted about 24 hours and down again. See below a small section of the IKEDiagnosticLog - IPs, etc. redacted.

{

"resourceid": "/SUBSCRIPTIONS/0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-TEMP-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2158680Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Remote 209.0.0.0:500: Local 52.0.0.0:500: [SEND] Sending QM Packet for tunnel Id 0x5 and tsId 0xEBF: Policy1:Integrity=SHA1 Cipher=AES-CBC-256 LifeTimeSeconds=27000 LifeTimeKB=102400000 ",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0BE0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2159708Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Remote 209.0.0.0:500: Local 52.0.0.0:500: [LCOAL_MSG] DPD is turned off for tunnelId 0x5, iCookie 0xD3BC0EC90F7486AC and rCookie 0x73316A583408D9DB",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0B4E0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2218257Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Peer sent INVALID_ID_INFORMATION notify",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0BE0/RESOURCEGROUPS/SOLANOPHL-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/SOLANOPHL-TEMP-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2218298Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} IkeCleanupQMNegotiation called with error 13825 and flags 1",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0B4E0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2218370Z",

"level": "Error",

"properties": {

"message": "(Error)[Remote] 209.0.0.0:500 [Local] 52.0.0.0:500 [SESSION_ID] {fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} [ConnType] IKEv1-S2S [ICookie] 0xD3BC0EC90F7486AC [RCookie] 0x73316A583408D9DB [TunnelId] 5 [TSId] 3775 [InboundSPI] 0x0 [OutboundSPI] 0x0 [IkeEvent] SA_NEGOTIATION_FAILED For [SA_type] QM_SA [FailureDirection] Inbound [SAEstablished] false [ErrorCode]13825 [ErrorMessage] No policy configured\r\n",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0BE0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2218571Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Remote 209.0.0.0:500: Local 52.0.0.0:500: tunnelId 0x5, iCookie 0xD3BC0EC90F7486AC and rCookie 0x73316A583408D9DB No Phase2 qms left on active connection",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0BE0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2240097Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Remote 209.0.0.0:500: Local 52.0.0.0:500: [RECEIVED][SA_DELETE] Received IKE SA delete message for tunnelid 0x5 ",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0B0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2240141Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} IkeCleanupMMNegotiation called with error 13885 and flags 0",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/00/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2240338Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Remote 209.0.0.0:500: Local 52.0.0.0:500: [LOCAL_MSG] IKE Tunnel closed for tunnelId 0x5 with status Main mode SA lifetime expired or peer sent a main mode delete.",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

} {

"resourceid": "/SUBSCRIPTIONS/0BE0/RESOURCEGROUPS/My-RG/PROVIDERS/MICROSOFT.NETWORK/VIRTUALNETWORKGATEWAYS/My-GW",

"category": "IKEDiagnosticLog",

"operationName": "IKELogEvent",

"time": "2025-03-10T12:02:58.2240514Z",

"level": "Informational",

"properties": {

"message": "SESSION_ID :{fdbcd6ae-6f2a-4b6e-82a4-0c2d2c07ec7a} Not closing tunnel for mm, MM Owns Tunnel = 262144",

"instance": "GatewayTenantWorker_IN_1"

},

"ClientOperationId": "00000000-0000-0000-0000-000000000000",

"CorrelationRequestId": "00000000-0000-0000-0000-000000000000",

"GatewayManagerVersion": "24.10.0.115"

}

Any help would be greatly appreciated.

Thank you,

DAB

Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,679 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Venkat V 780 Reputation points Microsoft External Staff
    2025-03-12T06:31:14.49+00:00

    Hi @@David Boorman

    I'm glad that you were able to identify your issue.

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.

    As I can see, Rohith Vinnakota has provided an approach for the issue you are facing. Kindly review the suggested approach below.

    If the VPN tunnel experiences intermittent disconnections due to Phase 2 mismatches, encryption errors, local ID issues, or DPD problems, it is essential to ensure that the configurations on both ends are aligned.

    To resolve the issue, make sure the Security Association Lifetime is configured consistently. For policy-based VPNs, the SA lifetime should be set to 3,600 seconds, while for route-based VPNs, it should be 27,000 seconds. If there is a mismatch, the customer firewall settings must be updated accordingly. Follow the Microsoft's IPsec/IKE Parameters for more details

    Another reason for the issue is the encryption and hash algorithm match. Only supported cryptographic combinations should be used, such as AES256 with SHA256, AES256 with SHA1, AES128 with SHA1, or 3DES with SHA1. Any deviation from these configurations may result in failed negotiations and disconnections. More information can be found in Supported IKEv1 Algorithms.

    Furthermore, Dead Peer Detection plays a crucial role in maintaining a stable connection. Route-Based VPNs support DPD, and it should be enabled on the customer firewall to ensure the connection remains active. However, policy-based VPNs do not support DPD, meaning that the tunnel must rely on manual reconnection settings to recover from interruptions. More information on this limitation can be found in Microsoft's Policy-Based VPN Documentation.

    Lastly, VPN tunnels can disconnect due to Security Association expiry if the IKE rekey settings are not properly synchronized. Both sides should be configured with the same rekey intervals: IKEv1 Phase 1 Lifetime should be 28,800 seconds (8 hours), while IKEv1 Phase 2 Lifetime should be 27,000 seconds (7.5 hours). Ensuring consistency in these values will prevent unexpected tunnel terminations. More details on IKE/IPsec rekeying can be found in Microsoft's documentation.


    Please click "Accept my answer" if the provided information is helpful. This will assist other community members facing similar issues in finding the correct solution.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.