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.
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.
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.
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.
Recommended checks before and after upgrading:
Before upgrading FortiOS:
Review the Phase 1 and Phase 2 DH-group configurations. Identify tunnels using the legacy default DH groups 14 and 5. Identify tunnels with explicitly configured DH groups. Verify that the remote VPN peers support the DH groups that will be offered after the upgrade. Review VPN configurations on third-party devices and VPN clients that may have limited DH-group support.
After upgrading FortiOS:
Recheck the Phase 1 and Phase 2 DH-group configurations. Compare the updated configurations with the remote VPN peers. Confirm that at least one mutually supported DH group exists for Phase 1 and, when PFS is enabled, Phase 2. Verify that the IKE SA and IPsec SA are successfully established. 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.
|