When analyzing IPsec IKEv2 VPN debug logs on a FortiGate, the output may indicate that PFS is disabled during the initial tunnel negotiation.
ike 0:tunnel-wuw:148:tunnel-wuw:1206: matched proposal id 1
ike 0:tunnel-wuw:148:tunnel-wuw:1206: proposal id = 1:
ike 0:tunnel-wuw:148:tunnel-wuw:1206: protocol = ESP:
ike 0:tunnel-wuw:148:tunnel-wuw:1206: encapsulation = TUNNEL
ike 0:tunnel-wuw:148:tunnel-wuw:1206: type=ENCR, val=AES_GCM_16 (key_len = 256)
ike 0:tunnel-wuw:148:tunnel-wuw:1206: type=INTEGR, val=AUTH_NONE
ike 0:tunnel-wuw:148:tunnel-wuw:1206: type=ESN, val=NO
ike 0:tunnel-wuw:148:tunnel-wuw:1206: PFS is disabled <------
ike 0:tunnel-wuw:148:tunnel-wuw:1206: lifetime=14400
ike 0:tunnel-wuw:148:tunnel-wuw:1206: replay protection enabled
ike 0:tunnel-wuw:148:tunnel-wuw:1206: set sa life soft seconds=14103.
ike 0:tunnel-wuw:148:tunnel-wuw:1206: set sa life hard seconds=14400.
This behavior is expected and conforms to RFC 7296.
Root cause:
During the initial IKEv2 exchange (IKE_AUTH), no key exchange (KEi/KEr) payloads are exchanged for the piggybacked Child SA. Without these payloads, PFS cannot be performed for the first session. PFS is only performed during the subsequent CREATE_CHILD_SA negotiation, which occurs during the rekeying process.
Verification steps:
Verify that PFS is functioning correctly, follow these steps to trigger and observe a rekey:
Reduce the Phase 2 key lifetime to a short interval (e.g., 120 seconds) to accelerate the rekeying process.
config vpn ipsec phase2-interface
edit <phase2_name>
   set keylife 120
   next
end  Â
Enable IKE debug logging to monitor the negotiation:
diagnose debug resetÂ
diagnose debug application ike -1
diagnose debug console timestamp enable
diagnose debug enable
To stop the debugging, use the command given below:
diagnose debug disable
diagnose debug reset
Wait for the tunnel to rekey and look for the CREATE_CHILD exchange in the logs. Confirm that the output shows PFS enabled along with the configured DH group.
Example output:
ike 0:WW_TEST_0:6: received create-child request
ike 0:WW_TEST_0:6: responder received CREATE_CHILD exchange <-------
ike 0:WW_TEST_0:6: processing notify type REKEY_SA <------------------
ike 0:WW_TEST_0:6:WW_TEST:344: rekeying child SA SPI a73382ab
ike 0:WW_TEST_0:6: responder creating new child
ike 0:WW_TEST_0:6:346: peer proposal:
ike 0:WW_TEST_0:6:346: TSi_0 0:0.0.0.0-255.255.255.255:0
ike 0:WW_TEST_0:6:346: TSr_0 0:0.0.0.0-255.255.255.255:0
ike 0:WW_TEST_0:6:WW_TEST:346: comparing selectors
ike 0:WW_TEST_0:6:WW_TEST:346: matched by rfc-rule-2
ike 0:WW_TEST_0:6:WW_TEST:346: phase2 matched by subset
ike 0:WW_TEST_0:6:WW_TEST:346: accepted proposal:
ike 0:WW_TEST_0:6:WW_TEST:346: TSi_0 0:0.0.0.0-255.255.255.255:0
ike 0:WW_TEST_0:6:WW_TEST:346: TSr_0 0:0.0.0.0-255.255.255.255:0
ike 0:WW_TEST_0:6:WW_TEST:346: dialup
ike 0:WW_TEST_0:6:WW_TEST:346: incoming child SA proposal:
ike 0:WW_TEST_0:6:WW_TEST:346: proposal id = 1:
ike 0:WW_TEST_0:6:WW_TEST:346: protocol = ESP:
ike 0:WW_TEST_0:6:WW_TEST:346: encapsulation = TUNNEL
ike 0:WW_TEST_0:6:WW_TEST:346: type=ENCR, val=AES_CBC (key_len = 256)
ike 0:WW_TEST_0:6:WW_TEST:346: type=INTEGR, val=SHA384
ike 0:WW_TEST_0:6:WW_TEST:346: type=DH_GROUP, val=ECP521
ike 0:WW_TEST_0:6:WW_TEST:346: type=ESN, val=NO
ike 0:WW_TEST_0:6:WW_TEST:346: matched proposal id 1
ike 0:WW_TEST_0:6:WW_TEST:346: proposal id = 1:
ike 0:WW_TEST_0:6:WW_TEST:346: protocol = ESP:
ike 0:WW_TEST_0:6:WW_TEST:346: encapsulation = TUNNEL
ike 0:WW_TEST_0:6:WW_TEST:346: type=ENCR, val=AES_CBC (key_len = 256)
ike 0:WW_TEST_0:6:WW_TEST:346: type=INTEGR, val=SHA384
ike 0:WW_TEST_0:6:WW_TEST:346: type=DH_GROUP, val=ECP521
ike 0:WW_TEST_0:6:WW_TEST:346: type=ESN, val=NO
ike 0:WW_TEST_0:6:WW_TEST:346: lifetime=120
ike 0:WW_TEST_0:6:WW_TEST:346: PFS enabled, group=21 <-------------------------
ike 0:WW_TEST_0:6:WW_TEST:346: generate DH public value request queued
ike 0:WW_TEST_0:6:WW_TEST:346: compute DH shared secret request queued
Related article:
Troubleshooting Tip: IKEv2 IPsec tunnel flaps at every IPsec rekey |