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.
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
| Option | Typical use | Phase 1 setup | Phase 2 setup | Main consideration |
|---|---|---|---|---|
| Site-to-site, route-based | Connect office networks | Match peer and authentication settings | Define protected subnets | Check routes and firewall policies |
| Site-to-site, policy-based | Match traffic to a tunnel | Match peer and authentication settings | Define traffic selectors | Suits policy-based designs |
| Remote access, dial-up | Connect individual users | Configure dial-up peer settings | Define permitted networks | Restrict access to required resources |
| Remote access, certificate-based | Authenticate users with certificates | Configure certificate authentication | Define permitted networks | Manage certificate issuance and renewal |
| Remote access, password-based | Authenticate users with credentials | Configure supported user authentication | Define permitted networks | Use strong credentials and MFA where available |
| Hub-and-spoke | Connect branches through a central site | Configure each peer relationship | Define branch and hub networks | Plan routing between spokes |
| Redundant site-to-site | Maintain connectivity across alternate paths | Configure each peer and path | Keep selectors consistent | Validate 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.
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:
- Open the IPsec VPN setup area and choose a site-to-site configuration.
- Enter the remote gateway details and select a compatible IKE version.
- Configure Phase 1 authentication and cryptographic proposals.
- Set the local and remote networks and configure Phase 2 proposals.
- Create or verify routes for traffic destined for the remote subnet.
- Add firewall policies between the internal interface and the IPsec tunnel interface.
- 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.
Compare key Phase 1 and Phase 2 configuration choices
| Setting | Phase 1 role | Phase 2 role | What to compare | Troubleshooting clue |
|---|---|---|---|---|
| Peer address | Identifies the remote gateway | Not typically set here | Both peers target the correct address | Peer mismatch can prevent negotiation |
| Authentication | Verifies the peer | Not typically set here | Shared secret or certificate configuration | Authentication errors suggest mismatched settings |
| Encryption and integrity | Protects IKE negotiation | Protects tunnel traffic | Proposals match on both peers | Proposal mismatch can block negotiation |
| Diffie-Hellman group | Supports key exchange | May be configured for rekeying | Group compatibility | Incompatible groups can prevent negotiation |
| Lifetime | Sets negotiation or rekey timing | Sets traffic-key rekey timing | Timers are compatible | Rekey issues may interrupt traffic |
| Local networks | Not the primary traffic selector | Defines protected local subnet | Subnet and mask match the peer | Selector mismatch can prevent Phase 2 |
| Remote networks | Not the primary traffic selector | Defines protected remote subnet | Subnet and mask match the peer | Check for overlapping or incorrect networks |
| NAT traversal | Helps peers cross NAT devices | Not a traffic selector | Enable when the path requires it | NAT 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
| Symptom | First check | Next check | Likely area | Maintenance action |
|---|---|---|---|---|
| Tunnel will not establish | Peer address and reachability | IKE proposal and authentication | Phase 1 | Keep peer settings documented |
| Phase 1 is up, Phase 2 is down | Phase 2 proposals | Local and remote selectors | Phase 2 | Review changes at both ends |
| Tunnel is up, traffic fails | Routes and firewall policies | NAT and address overlap | Traffic forwarding | Test permitted paths after changes |
| Only one direction works | Return route | Policies and selectors | Routing or policy | Verify both directions explicitly |
| Tunnel drops during rekey | Lifetime settings | Proposal and group compatibility | Rekey negotiation | Keep timers aligned where required |
| Remote users cannot connect | User authentication | Client and dial-up settings | Remote access configuration | Review account and certificate status |
| Intermittent connectivity | WAN stability | NAT traversal and peer reachability | Underlay network | Monitor link and tunnel events |
| Recent change caused failure | Compare configuration changes | Confirm both peers still match | Configuration drift | Record 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.
