Skip to main content
akileshc
Staff
Staff
Nov 4, 2026 9:49 AM UTC

Understanding IPsec DH-group compatibility and default changes in FortiOS 7.6.5

Description

FortiOS 7.6.5 introduces changes to the default Diffie-Hellman (DH) groups used in IPsec Phase 1 and Phase 2 configurations. These changes can affect IPsec tunnel negotiation when the remote VPN peer does not support the updated DH groups.

This article explains the default DH-group changes, their impact on existing configurations, and how to verify DH-group compatibility between VPN peers.

Scope

FortiGate devices running FortiOS 7.6.5 and later.

Solution

  1. Understand the default DH-group changes.


Starting with FortiOS 7.6.5, the default DH groups for newly created IPsec configurations are changed from groups 14 and 5 to groups 20 and 21.

The upgrade behavior depends on whether the existing DH groups were explicitly configured or were using the legacy default values.

The following table summarizes the behavior.

Configuration scenario

DH groups after upgrade or creation

Newly created IPsec configuration

20, 21

Existing configuration using the legacy default 14, 5

20, 21, 14

Existing configuration with explicitly configured DH groups

Existing configured values are retained


This change applies to both Phase 1 and Phase 2 IPsec configurations.

For example:

  • An existing configuration using the legacy default 14 5 is updated to include 20 21 14.

  • An existing configuration explicitly using 5 remains 5.

  • Existing configurations with other DH-group combinations, such as 20 5, retain their configured values.


The distinction between default and explicitly configured values is important when assessing the impact of a firmware upgrade.

  1. Understand Phase 1 and Phase 2 DH-group negotiation.


Phase 1 and Phase 2 use DH groups for different key exchange operations.

Phase 1:

During Phase 1, the VPN peers negotiate the IKE SA parameters, including the encryption algorithm, integrity algorithm, PRF, and DH group.

The configured Phase 1 DH-group lists must have at least one mutually supported group for the peers to establish the IKE SA.

Phase 2:

Phase 2 establishes the IPsec SA used to protect user traffic.

When Perfect Forward Secrecy (PFS) is enabled, an additional DH exchange is performed for the Phase 2 key material. The configured Phase 2 DH-group lists must therefore have at least one mutually supported group.

When PFS is disabled, there is no separate Phase 2 DH exchange.

Important: Phase 1 and Phase 2 DH groups do not need to be identical. Each phase has its own DH-group negotiation requirements.

For example, Phase 1 can use DH group 20 while Phase 2 uses DH group 14, provided the corresponding VPN peers have compatible configurations.

  1. Verify DH-group compatibility between VPN peers


After upgrading FortiOS, verify the DH-group configuration on both VPN peers.


Run the following commands to inspect the Phase 1 and Phase 2 configurations.


show full-configuration vpn ipsec phase1-interface
show full-configuration vpn ipsec phase2-interface


Check the following parameters:

  • Phase 1 DH groups on both peers.

  • Phase 2 DH groups on both peers.

  • Whether PFS is enabled or disabled.

  • Whether the configured DH groups are supported by the remote VPN device.

  • Whether at least one mutually supported DH group exists for each applicable negotiation.


The DH-group lists on both peers do not necessarily need to be identical. They must have at least one common supported group for the relevant exchange.


Compatible DH-group configuration:


Local FortiGate:

config vpn ipsec phase1-interface
    edit "VPN-TUNNEL"
        set dhgrp 20 14
    next
end


Remote VPN peer:

config vpn ipsec phase1-interface
    edit "VPN-TUNNEL"
        set dhgrp 14 5
    next
end


In this example, both peers support DH group 14. Therefore, the Phase 1 DH-group configuration has a common supported group even though the configured lists are different.

The same compatibility principle applies to Phase 2 when PFS is enabled.

  1. Consider the impact of PFS on Phase 2.


Phase 2 DH-group compatibility must be evaluated separately from Phase 1. For example, the following configuration uses different DH groups for the two phases.

Local FortiGate:

config vpn ipsec phase1-interface
    edit "VPN-TUNNEL"
        set dhgrp 20 14
    next
end

config vpn ipsec phase2-interface
    edit "VPN-TUNNEL-P2"
        set phase1name "VPN-TUNNEL"
        set pfs enable
        set dhgrp 21 20
    next
end


Remote VPN peer:

config vpn ipsec phase1-interface
    edit "VPN-TUNNEL"
        set dhgrp 14 5
    next
end

config vpn ipsec phase2-interface
    edit "VPN-TUNNEL-P2"
        set phase1name "VPN-TUNNEL"
        set pfs enable
        set dhgrp 20 14
    next
end


In this example:

  •  Phase 1 has DH group 14 in common.

  •  Phase 2 has DH group 20 in common.

  •  The Phase 1 and Phase 2 DH-group lists are different.

  •  Both phases have a mutually supported group for their respective exchanges

  • If PFS is disabled, no separate Phase 2 DH-group negotiation is required.

  1. Recommended checks before and after upgrading:


Before upgrading FortiOS:

  1. Review the Phase 1 and Phase 2 DH-group configurations.

  2. Identify tunnels using the legacy default DH groups 14 and 5.

  3. Identify tunnels with explicitly configured DH groups.

  4. Verify that the remote VPN peers support the DH groups that will be offered after the upgrade.

  5. Review VPN configurations on third-party devices and VPN clients that may have limited DH-group support.


After upgrading FortiOS:

  1. Recheck the Phase 1 and Phase 2 DH-group configurations.

  2. Compare the updated configurations with the remote VPN peers.

  3. Confirm that at least one mutually supported DH group exists for Phase 1 and, when PFS is enabled, Phase 2.

  4. Verify that the IKE SA and IPsec SA are successfully established.

  5. If a tunnel fails to establish, review the IKE negotiation logs to identify the proposal mismatch.


It is not recommended to change the DH-group configuration without verifying the capabilities and configuration of the remote VPN peer. Select compatible groups that also meet the applicable security requirements.

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024