遊戲連線站
VPN

FortiGate IPsec: Setup, Configuration, and Troubleshooting Guide

By 鍾晏青 · · 8 min
FortiGate IPsec: Setup, Configuration, and Troubleshooting Guide

Learn how FortiGate IPsec VPNs work, how to configure them, and how to troubleshoot common connection problems.

FortiGate IPsec is Fortinet’s implementation of IPsec VPN technology for protecting traffic across untrusted networks. It can connect two offices with a site-to-site tunnel or provide remote users with secure access to internal resources. A working setup requires compatible encryption settings, reachable peers, appropriate routes, and firewall policies that allow the intended traffic.

NordVPN — fast, secure VPN

Editor's pick: NordVPN — fast, secure VPN — Strong encryption, a no-logs policy and apps for every device. 30-day money-back guarantee. Get NordVPN →

Compare common FortiGate IPsec VPN deployment options

OptionTypical usePhase 1 setupPhase 2 setupMain consideration
Site-to-site, route-basedConnect office networksMatch peer and authentication settingsDefine protected subnetsCheck routes and firewall policies
Site-to-site, policy-basedMatch traffic to a tunnelMatch peer and authentication settingsDefine traffic selectorsSuits policy-based designs
Remote access, dial-upConnect individual usersConfigure dial-up peer settingsDefine permitted networksRestrict access to required resources
Remote access, certificate-basedAuthenticate users with certificatesConfigure certificate authenticationDefine permitted networksManage certificate issuance and renewal
Remote access, password-basedAuthenticate users with credentialsConfigure supported user authenticationDefine permitted networksUse strong credentials and MFA where available
Hub-and-spokeConnect branches through a central siteConfigure each peer relationshipDefine branch and hub networksPlan routing between spokes
Redundant site-to-siteMaintain connectivity across alternate pathsConfigure each peer and pathKeep selectors consistentValidate failover and routing behavior

Compiled November 2026; check the provider's site for current details.

What FortiGate IPsec Does

IPsec encrypts and authenticates IP traffic between VPN peers. On a FortiGate, an IPsec VPN typically uses Internet Key Exchange (IKE) to negotiate security parameters and establish the tunnel.

The two common use cases are:

  • Site-to-site VPN: Connects networks behind two FortiGate devices, or a FortiGate and another IPsec-compatible gateway.
  • Remote-access VPN: Lets individual users connect from a client device to a FortiGate. FortiClient is one option, depending on the deployment and FortiOS version.

A tunnel being “up” does not automatically mean that applications can communicate. Traffic must also match the tunnel’s selectors, have a valid route, and be permitted by firewall policy.

FortiGate IPsec: Setup, Configuration, and Troubleshooting Guide: Checklist

Understand Phase 1 and Phase 2

IPsec setup is commonly described in two negotiation stages. The settings must be compatible on both ends, though the names and available options can vary by FortiOS version and peer device. FortiGate L2TP: Setup, Limitations, and Secure Alternatives

Stage Purpose Typical settings
Phase 1 (IKE) Authenticates peers and establishes a protected control channel IKE version, peer address, authentication method, encryption, integrity, and Diffie-Hellman group
Phase 2 (IPsec) Defines the traffic protected by the tunnel Local and remote subnets, encryption, integrity, and key lifetime

Use strong, modern cryptographic settings supported by both devices. Avoid weak or deprecated algorithms when possible. For a site-to-site tunnel, confirm that each side’s local and remote network definitions are mirror images. For example, if one peer defines its local network as 10.10.0.0/16 and its remote network as 10.20.0.0/16, the other peer should define the reverse.

Authentication may use a pre-shared key or certificates. A pre-shared key should be unique, sufficiently long, and shared through a secure channel.

Configure a Basic Site-to-Site Tunnel

The FortiGate web interface provides a VPN wizard for common setups. Menu names and available fields can differ by firmware release, so check the documentation for the installed FortiOS version.

Before configuring the tunnel, gather: FortiGate VPN Client: How to Choose, Install, and Connect

  • The public IP address or hostname of the remote peer
  • The local and remote protected subnets
  • The authentication method and shared credentials or certificates
  • The IKE and IPsec proposals supported by both devices
  • Any requirements for dynamic peer addresses, NAT, or overlapping networks

A typical configuration process is:

  1. Open the IPsec VPN setup area and choose a site-to-site configuration.
  2. Enter the remote gateway details and select a compatible IKE version.
  3. Configure Phase 1 authentication and cryptographic proposals.
  4. Set the local and remote networks and configure Phase 2 proposals.
  5. Create or verify routes for traffic destined for the remote subnet.
  6. Add firewall policies between the internal interface and the IPsec tunnel interface.
  7. Enable logging as appropriate, then test traffic in both directions.

FortiGate may create some supporting routes or policies through a wizard, but verify them rather than assuming they are correct. Policies should use the relevant interfaces, source and destination networks, and services. Enable NAT only when the design requires it. Site-to-site traffic commonly does not need source NAT.

Configure Remote Access Carefully

Remote-access IPsec uses a different design from a site-to-site tunnel. The FortiGate authenticates users or devices and assigns or permits access to a defined set of internal networks. Configuration can involve an address pool, user groups, authentication services, client settings, and access policies.

Plan the allowed access before deployment: Free VPN Where You Can Choose Location: What to Use and What to Check

  • Define which internal subnets remote users need.
  • Restrict access with firewall policies and user or group controls.
  • Use strong authentication, and add multifactor authentication where available.
  • Confirm that the client’s operating system and VPN software support the chosen IKE and encryption settings.
  • Check for address conflicts between the client’s local network and the organization’s network.

Do not grant broad access simply because it makes initial testing easier. Limit access to required destinations and services, then expand only when there is a documented need.

FortiGate IPsec: Setup, Configuration, and Troubleshooting Guide: Key points

Compare key Phase 1 and Phase 2 configuration choices

SettingPhase 1 rolePhase 2 roleWhat to compareTroubleshooting clue
Peer addressIdentifies the remote gatewayNot typically set hereBoth peers target the correct addressPeer mismatch can prevent negotiation
AuthenticationVerifies the peerNot typically set hereShared secret or certificate configurationAuthentication errors suggest mismatched settings
Encryption and integrityProtects IKE negotiationProtects tunnel trafficProposals match on both peersProposal mismatch can block negotiation
Diffie-Hellman groupSupports key exchangeMay be configured for rekeyingGroup compatibilityIncompatible groups can prevent negotiation
LifetimeSets negotiation or rekey timingSets traffic-key rekey timingTimers are compatibleRekey issues may interrupt traffic
Local networksNot the primary traffic selectorDefines protected local subnetSubnet and mask match the peerSelector mismatch can prevent Phase 2
Remote networksNot the primary traffic selectorDefines protected remote subnetSubnet and mask match the peerCheck for overlapping or incorrect networks
NAT traversalHelps peers cross NAT devicesNot a traffic selectorEnable when the path requires itNAT in the path may affect tunnel establishment

Compiled November 2026; check the provider's site for current details.

Troubleshoot a FortiGate IPsec VPN

Start by determining whether the problem is with negotiation or with traffic passing through an established tunnel. Free VPN Choose Location: What to Look For and How to Pick a Server

If the tunnel will not establish

Check that the peer addresses are correct and reachable, and that upstream firewalls allow the required IPsec traffic. Depending on the design, this may include IKE on UDP port 500 and NAT Traversal on UDP port 4500. Confirm that NAT or intermediate network devices are not preventing the peers from communicating.

Then compare both sides’ Phase 1 and Phase 2 settings. Common mismatches include:

  • Different IKE versions or authentication methods
  • Incompatible encryption, integrity, or Diffie-Hellman proposals
  • Incorrect pre-shared keys or certificate problems
  • Phase 2 selectors that do not match
  • A peer ID that differs from what the other side expects

If the tunnel is up but traffic fails

Verify the routes, selectors, and firewall policies. Make sure the source and destination addresses of a test connection fall within the protected networks. Check that return traffic has a valid route and is not being blocked by a policy on either peer. Also review NAT settings and overlapping address ranges.

On the FortiGate, use the VPN status page and event logs to identify negotiation failures. Administrators can also use FortiOS CLI diagnostics, such as diagnose vpn ike gateway list and diagnose vpn tunnel list, to inspect gateway and tunnel state. Debug commands can provide more detail, but they may generate substantial output. Use them carefully, filter for the relevant peer where possible, and stop debugging after collecting the required information. What Is OVPN? A Guide to OpenVPN Files and VPN Connections

Security and Maintenance

A stable VPN needs ongoing attention as well as a correct initial setup. Keep FortiGate firmware and VPN clients current, review logs for repeated authentication failures, and remove unused tunnels and accounts. Document peer addresses, protected subnets, proposals, and ownership so that future changes can be coordinated with the other administrator.

Before changing a production tunnel, confirm the impact and arrange a maintenance window if necessary. Update both peers in a planned sequence, especially when changing proposals, selectors, or authentication methods.

Choose a troubleshooting check based on the VPN symptom

SymptomFirst checkNext checkLikely areaMaintenance action
Tunnel will not establishPeer address and reachabilityIKE proposal and authenticationPhase 1Keep peer settings documented
Phase 1 is up, Phase 2 is downPhase 2 proposalsLocal and remote selectorsPhase 2Review changes at both ends
Tunnel is up, traffic failsRoutes and firewall policiesNAT and address overlapTraffic forwardingTest permitted paths after changes
Only one direction worksReturn routePolicies and selectorsRouting or policyVerify both directions explicitly
Tunnel drops during rekeyLifetime settingsProposal and group compatibilityRekey negotiationKeep timers aligned where required
Remote users cannot connectUser authenticationClient and dial-up settingsRemote access configurationReview account and certificate status
Intermittent connectivityWAN stabilityNAT traversal and peer reachabilityUnderlay networkMonitor link and tunnel events
Recent change caused failureCompare configuration changesConfirm both peers still matchConfiguration driftRecord and review changes

Compiled November 2026; check the provider's site for current details. Proton Free VPN: Features, Limits, and Whether It’s Worth Using

Recommendation

For a reliable FortiGate IPsec deployment, document the network design first, use strong mutually supported settings, and verify routes and firewall policies on both ends. Test traffic in both directions, review logs after changes, and limit remote access to the users and resources that need it.

© 2026 Fernhollow Play Media · Fernhollow Play Media Ltd.