Skip to main content
pathik_mehta
Staff
Staff
March 17, 2025

Troubleshooting Tip: IPSec tunnel with certificate-based authentication between two FortiGates

Description This article demonstrates an example IPSec tunnel configuration with certificate-based authentication using a default certificate.
Scope FortiGate.
Solution

When certificate-based authentication is used for IKE, the default FortiGate built-in certificate can be used for testing.

 

Warning: The following configuration cannot be considered secure for production environments, since any peer certificate signed by the same internal Fortinet_Sub_CA would be accepted, including other FortiGate devices using their own Fortinet_Factory certificates. Use trusted, privately or publicly signed certificates for production environments.

 

image.png

 

In the above configuration, the local certificate used is Fortinet_Factory, and the Peer CA certificate is built-in Fortinet_Sub_CA.

 

Since the keys and dependencies for these built-in certificates are available with the firewall, there is no need to import additional key files here.

 

Screenshot 2025-03-17 160519.png

 

Once the configuration is done, phase1 status will be up. 

 

LAB # diagnose vpn ike gateway list name S2S

 

vd: root/0
name: S2S
version: 1
interface: port1 3
addr: 10.5.24.44:500 -> 10.5.27.81:500
tun_id: 2.3.4.5/::2.3.4.5
remote_location: 0.0.0.0
network-id: 0
created: 104s ago
peer-id: C = US, ST = California, L = Sunnyvale, O = Fortinet, OU = FortiGate, CN = FGVM080000031546, emailAddress = support@fortinet.com
peer-id-auth: yes
IKE SA: created 1/2  established 1/2  time 10/15/20 ms
IPsec SA: created 0/1

 

  id/spi: 4 7f307ee05619b343/e0329706744c1643
  direction: initiator
  status: established 104-104s ago = 20ms
  proposal: aes128-sha256
  key: 9e62ea4eb199660f-2874ee2b8c3f8861
  lifetime/rekey: 86400/85995
  DPD sent/recv: 00000000/00000000
  peer-id: C = US, ST = California, L = Sunnyvale, O = Fortinet, OU = FortiGate, CN = FGVM080000031546, emailAddress = support@fortinet.com

 

It is recommended to use a certificate signed by a trusted private or public CA for IPsec signature authentication. See Import a Certificate for steps to import a third-party CA-signed certificate.

 

Screenshot 2025-03-17 160829.png

 

It is also necessary to import the CA certificate on both the VPN endpoints.

 

Note: The Fortinet_Factory certificate cannot be used in configuration on FortiGate-200G devices and any other FortiGate devices where the private key of this certificate is stored in the Trusted Platform Module (TPM), see FortiGate identity stored in TMP. If a default certificate is required in this case, the new 'Fortinet_Default_SSL' certificate can be used.

 

Related article:
Technical Tip: Explanation on Fortinet_Factory certificate

    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT