Phase 1 configuration

Phase 1 configuration primarily defines the parameters used in IKE (Internet Key Exchange) negotiation between the ends of the IPsec tunnel. The local end is the FortiGate interface that initiates the IKE negotiations. The remote end is the remote gateway that responds and exchanges messages with the initiator. Hence, they are sometimes referred to as the initiator and responder. The purpose of phase 1 is to secure a tunnel with one bi-directional IKE SA (security association) for negotiating IKE phase 2 parameters.

The auto-negotiate and negotiation-timeout commands control how the IKE negotiation is processed when there is no traffic, and the length of time that the FortiGate waits for negotiations to occur.

IPsec tunnels can be configured in the GUI using the VPN Creation Wizard. Go to VPN > IPsec Wizard. The wizard includes several templates (site-to-site, hub and spoke, remote access), but a custom tunnel can be configured with the following settings:

Name

Phase 1 definition name.

The maximum length is 15 characters for an interface mode VPN and 35 characters for a policy-based VPN.

For a policy-based VPN, the name normally reflects where the remote connection originates. For a route-based tunnel, the FortiGate also uses the name for the virtual IPsec interface that it creates automatically.

Network

 

 

IP Version

Protocol, either IPv4 or IPv6.

 

Remote Gateway

Category of the remote connection:

  • Static IP Address: the remote peer has a static IP address.
  • Dialup User: one or more FortiClient or FortiGate dialup clients with dynamic IP addresses will connect to the FortiGate.
  • Dynamic DNS: a remote peer that has a domain name and subscribes to a dynamic DNS service will connect to the FortiGate.

 

IP Address

The IP address of the remote peer. This option is only available when the Remote Gateway is Static IP Address.

 

Dynamic DNS

The domain name of the remote peer. This option is only available when the Remote Gateway is Dynamic DNS.

 

Interface

The interface through which remote peers or dialup clients connect to the FortiGate. This option is only available in NAT mode.
By default, the local VPN gateway IP address is the IP address of the interface that was selected (Primary IP in the Local Gateway field).

 

Local Gateway

IP address for the local end of the VPN tunnel (Primary IP is used by default):

  • Secondary IP: secondary address of the interface selected in the Interface field.
  • Specify: manually enter an address.

Interface mode cannot be configured in a transparent mode VDOM.

 

Mode Config

This option is only available when the Remote Gateway is Dialup User.

Configure the client IP address range, subnet mask/prefix length, DNS server, and split tunnel capability to automate remote client addressing.

 

NAT Traversal

This option is only available when the Remote Gateway is Static IP Address or Dynamic DNS.

ESP (encapsulating security payload), the protocol for encrypting data in the VPN session, uses IP protocol 50 by default. However, it does not use any port numbers so when traversing a NAT device, the packets cannot be demultiplexed. Enabling NAT traversal encapsulates the ESP packet inside a UDP packet, thereby adding a unique source port to the packet. This allows the NAT device to map the packets to the correct session.

  • Enable: a NAT device exists between the local FortiGate and the VPN peer or client. Outbound encrypted packets are wrapped inside a UDP IP header that contains a port number. The local FortiGate and the VPN peer or client must have the same NAT traversal setting (both selected or both cleared) to connect reliably. When in doubt, enable NAT traversal.
  • Disable: disable the NAT traversal setting.
  • Forced: the FortiGate will use a port value of zero when constructing the NAT discovery hash for the peer. This causes the peer to think it is behind a NAT device, and it will use UDP encapsulation for IPsec, even if no NAT is present. This approach maintains interoperability with any IPsec implementation that supports the NAT-T RFC.
 

Keepalive Frequency

Keepalive frequency setting. This option is only available when NAT Traversal is set to Enable or Forced. The NAT device between the VPN peers may remove the session when the VPN connection remains idle for too long.

The value represents an interval in seconds where the connection will be maintained with periodic keepalive packets. The keepalive interval must be smaller than the session lifetime value used by the NAT device.

The keepalive packet is a 138-byte ISAKMP exchange.

 

Dead Peer Detection

Reestablishes VPN tunnels on idle connections and cleans up dead IKE peers if required. This feature minimizes the traffic required to check if a VPN peer is available or unavailable (dead). The available options are: 

  • Disable: disable dead peer detection (DPD).
  • On Idle: triggers DPD when IPsec is idle.
  • On Demand: Passively sends DPD to reduce load on the firewall. Only triggers DPD when IPsec outbound packets are sent, but no reply is received from the peer. When there is no traffic and the last DPD-ACK has been received, IKE will not send DPDs periodically.

Notifications are received whenever a tunnel goes up or down, or to keep the tunnel connection open when no traffic is being generated inside the tunnel. For example, in scenarios where a dialup client or dynamic DNS peer connects from an IP address that changes periodically, traffic may be suspended while the IP address changes.

When Dead Peer Detection is selected, optionally specify a retry count and a retry interval using dpd-retrycount and dpd-retryinterval. See Dead peer detection.

 

Forward Error Correction

Enable on both ends of the tunnel to correct errors in data transmission by sending redundant data across the VPN.

 

Device creation

Advanced option. When enabled, a dynamic interface (network device) is created for each dialup tunnel.

 

Aggregate member

Advanced option. When enabled, the tunnel can be used as an aggregate member candidate.

Authentication

 

 

 

Method

Either Pre-shared Key or Signature.

 

Pre-shared Key

The pre-shared key that the FortiGate will use to authenticate itself to the remote peer or dialup client during phase 1 negotiations. The same key must be defined at the remote peer or client. See Pre-shared key.

 

Certificate Name

The server certificate that the FortiGate will use to authenticate itself to the remote peer or dialup client during phase 1 negotiations. See Digital certificates.

 

IKE Version

Either 1 or 2. See Choosing IKE version 1 and 2.

 

Mode

This option is only available when IKEv1 is selected. The two available options are:

  • Aggressive: the phase 1 parameters are exchanged in a single message with unencrypted authentication information.
  • Main (ID protection): the phase 1 parameters are exchanged in multiple rounds with encrypted authentication information.

When the remote VPN peer has a dynamic IP address and is authenticated by a pre-shared key, you must select Aggressive mode if there is more than one dialup phase 1 configuration for the interface IP address.

When the remote VPN peer has a dynamic IP address and is authenticated by a certificate, you must select Aggressive mode if there is more than one phase 1 configuration for the interface IP address and these phase 1 configurations use different proposals.

 

Peer Options

Options to authenticate VPN peers or clients depending on the Remote Gateway and Authentication Method settings.

 

Any peer ID

Accepts the local ID of any remote VPN peer or client. The FortiGate does not check identifiers (local IDs). Mode can be set to Aggressive or Main.

This option can be used with digital certificate authentication, but for higher security, use Peer certificate.

 

Specific peer ID

This option is only available when Aggressive Mode is enabled. Enter the identifier that is used to authenticate the remote peer. The identifier must match the local ID configured by the remote peer’s administrator.

If the remote peer is a FortiGate, the identifier is specified in the Local ID field of the Phase 1 Proposal settings.

If the remote peer is a FortiClient user, the identifier is specified in the Local ID field.

In circumstances where multiple remote dialup VPN tunnels exist, each tunnel must have a peer ID set.

 

Peer certificate

Define the CA certificate used to authenticate the remote peer when the authentication mode is Signature.

If the FortiGate will act as a VPN client, and you are using security certificates for authentication, set the Local ID to the distinguished name (DN) of the local server certificate that the FortiGate unit will use for authentication purposes.

 

Peer ID from dialup group

Authenticate multiple FortiGate or FortiClient dialup clients that use unique identifiers and unique pre-shared keys (or unique pre‑shared keys only) through the same VPN tunnel.

You must create a dialup user group for authentication purposes. Select the group from the list next to the Peer ID from dialup group option.

You must set Mode to Aggressive when the dialup clients use unique identifiers and unique pre-shared keys. If the dialup clients use unique pre-shared keys only, you can set Mode to Main if there is only one dialup Phase 1 configuration for this interface IP address.

Phase 1 Proposal

The encryption and authentication algorithms used to generate keys for the IKE SA.

There must be a minimum of one combination. The remote peer or client must be configured to use at least one of the proposals that you define.

 

 

Encryption</