Fortigate Ipsec VPN 50 PDF
Fortigate Ipsec VPN 50 PDF
Fortigate Ipsec VPN 50 PDF
Introduction..................................................................................................... 10
How this guide is organized................................................................................... 10
IPsec VPN concepts....................................................................................... 12
VPN tunnels ........................................................................................................... 12
VPN gateways........................................................................................................ 13
Clients, servers, and peers .................................................................................... 14
Encryption.............................................................................................................. 15
Authentication........................................................................................................ 15
Preshared keys ................................................................................................ 15
Additional authentication ................................................................................. 16
Phase 1 and Phase 2 settings ............................................................................... 16
Phase 1 ............................................................................................................ 16
Phase 2 ............................................................................................................ 16
Security Association .............................................................................................. 17
IPsec VPN Overview....................................................................................... 18
Types of VPNs ....................................................................................................... 18
Route-based VPNs .......................................................................................... 18
Policy-based VPNs .......................................................................................... 19
Comparing policy-based or route-based VPNs............................................... 19
Planning your VPN ................................................................................................ 19
Network topologies ......................................................................................... 20
General preparation steps .................................................................................... 21
How to use this guide to configure an IPsec VPN................................................. 21
IPsec VPN in the web-based manager ......................................................... 22
Auto Key (IKE) ........................................................................................................ 22
Phase 1 configuration ...................................................................................... 23
Phase 1 advanced configuration settings........................................................ 24
Phase 2 configuration ...................................................................................... 27
Phase 2 advanced configuration settings........................................................ 27
FortiClient VPN ................................................................................................ 30
Manual Key ............................................................................................................ 31
Manual key configuration settings ................................................................... 31
Concentrator ......................................................................................................... 33
IPsec Monitor......................................................................................................... 33
Auto Key phase 1 parameters ...................................................................... 35
Overview ................................................................................................................ 35
Defining the tunnel ends ........................................................................................ 36
Page 3
Choosing main mode or aggressive mode............................................................ 36
Choosing the IKE version ...................................................................................... 37
Authenticating the FortiGate unit........................................................................... 37
Authenticating the FortiGate unit with digital certificates ................................ 37
Authenticating the FortiGate unit with a pre-shared key ................................. 38
Authenticating remote peers and clients .............................................................. 40
Enabling VPN access for specific certificate holders ..................................... 40
Enabling VPN access by peer identifier........................................................... 42
Enabling VPN access with user accounts and pre-shared keys ..................... 43
Defining IKE negotiation parameters ..................................................................... 44
Generating keys to authenticate an exchange ............................................... 45
Defining IKE negotiation parameters ............................................................... 45
Using XAuth authentication ................................................................................... 48
Using the FortiGate unit as an XAuth server.................................................... 49
Using the FortiGate unit as an XAuth client ..................................................... 49
Phase 2 parameters ...................................................................................... 51
Basic phase 2 settings........................................................................................... 51
Advanced phase 2 settings ................................................................................... 51
P2 Proposals.................................................................................................... 51
Replay detection .............................................................................................. 52
Perfect forward secrecy (PFS) ......................................................................... 52
Keylife .............................................................................................................. 52
Auto-negotiate ................................................................................................. 52
Autokey Keep Alive .......................................................................................... 52
DHCP-IPsec .................................................................................................... 53
Quick mode selectors ..................................................................................... 53
Configure the phase 2 parameters ........................................................................ 54
Specifying the phase 2 parameters ................................................................ 54
Defining VPN security policies ...................................................................... 57
Defining policy addresses...................................................................................... 57
Defining VPN security policies............................................................................... 58
Defining an IPsec security policy for a policy-based VPN............................... 59
Defining security policies for a route-based VPN ............................................ 61
Gateway-to-gateway configurations ........................................................... 63
Configuration overview .......................................................................................... 63
General configuration steps................................................................................... 65
Using auto-ipsec.............................................................................................. 65
Configuring the two VPN peers ............................................................................. 65
Configuring Phase 1 and Phase 2 for both peers............................................ 65
Creating security policies................................................................................. 66
How to work with overlapping subnets ................................................................. 70
Solution for route-based VPN.......................................................................... 71
Solution for policy-based VPN......................................................................... 72
Welcome and thank you for selecting Fortinet products for your network protection. This guide
provides an overview of the IPsec VPN functionality within FortiOS on your FortiGate unit. The
first few chapters introduce you to the standards of VPN. The remainder of the guide provides
various configuration steps and options in different situations using various FortiOS features.
Page 10
Transparent mode VPNs describes two FortiGate units that create a VPN tunnel between two
separate private networks transparently. In transparent mode, all FortiGate unit interfaces
except the management interface are invisible at the network layer.
IPv6 IPsec VPNs describes FortiGate unit VPN capabilities for networks based on IPv6
addressing. This includes IPv4-over-IPv6 and IPv6-over-IPv4 tunnelling configurations. IPv6
IPsec VPNs are available in FortiOS 3.0 MR5 and later.
L2TP and IPsec (Microsoft VPN) explains how to support Microsoft Windows native VPN
clients.
GRE over IPsec (Cisco VPN) explains how to interoperate with Cisco VPNs that use Generic
Routing Encapsulation (GRE) protocol with IPsec.
Protecting OSPF with IPsec provides an example of protecting OSPF links with IPsec.
Auto Key phase 1 parameters provides detailed step-by-step procedures for configuring a
FortiGate unit to accept a connection from a remote peer or dialup client. The basic phase 1
parameters identify the remote peer or clients and support authentication through preshared
keys or digital certificates. You can increase VPN connection security further using methods
such as extended authentication (XAuth).
Phase 2 parameters provides detailed step-by-step procedures for configuring an IPsec VPN
tunnel. During phase 2, the specific IPsec security associations needed to implement security
services are selected and a tunnel is established.
Defining VPN security policies explains how to specify the source and destination IP addresses
of traffic transmitted through an IPsec VPN tunnel, and how to define a security encryption
policy. Security policies control all IP traffic passing between a source address and a
destination address.
Monitoring and troubleshooting provides VPN monitoring and testing procedures
Where possible, this document explains how to configure VPNs using the web-based manager.
A few options can be configured only through the CLI. You can also configure VPNs entirely
through the CLI. For detailed information about CLI commands, see the FortiGate CLI
Reference.
Virtual Private Network (VPN) technology enables remote users to connect to private computer
networks to gain access to their resources in a secure way. For example, an employee traveling
or working from home can use a VPN to securely access the office network through the Internet.
Instead of remotely logging on to a private network using an unencrypted and unsecure Internet
connection, the use of a VPN ensures that unauthorized parties cannot access the office
network and cannot intercept any of the information that is exchanged between the employee
and the office. It is also common to use a VPN to connect the private networks of two or more
offices.
Fortinet offers VPN capabilities in the FortiGate Unified Threat Management (UTM) appliance
and in the FortiClient Endpoint Security suite of applications. A FortiGate unit can be installed
on a private network, and FortiClient software can be installed on the users computer. It is also
possible to use a FortiGate unit to connect to the private network instead of using FortiClient
software.
This chapter discusses VPN terms and concepts including:
VPN tunnels
VPN gateways
Clients, servers, and peers
Encryption
Authentication
Phase 1 and Phase 2 settings
Security Association
VPN tunnels
The data path between a users computer and a private network through a VPN is referred to as
a tunnel. Like a physical tunnel, the data path is accessible only at both ends. In the
telecommuting scenario, the tunnel runs between the FortiClient application on the users PC,
or a FortiGate unit or other network device and the FortiGate unit on the office private network.
Encapsulation makes this possible. IPsec packets pass from one end of the tunnel to the other
and contain data packets that are exchanged between the local user and the remote private
network. Encryption of the data packets ensures that any third-party who intercepts the IPsec
packets can not access the data.
3 1 3 1
3 1 3 1
2 2
2 2
Encryption Decryption
Page 12
You can create a VPN tunnel between:
a PC equipped with the FortiClient application and a FortiGate unit
two FortiGate units
third-party VPN software and a FortiGate unit
Third-party VPN software is not covered in this document. Refer to the Fortinet Knowledge
Base for more information on this topic.
VPN gateways
A gateway is a router that connects the local network to other networks. The default gateway
setting in your computers TCP/IP properties specifies the gateway for your local network.
A VPN gateway functions as one end of a VPN tunnel. It receives incoming IPsec packets,
decrypts the encapsulated data packets and passes the data packets to the local network.
Also, it encrypts data packets destined for the other end of the VPN tunnel, encapsulates them,
and sends the IPsec packets to the other VPN gateway. The VPN gateway is a FortiGate unit
because the private network behind it is protected, ensuring the security of the unencrypted
VPN data. The gateway can also be FortiClient software running on a PC since the unencrypted
data is secure on the PC.
The IP address of a VPN gateway is usually the IP address of the network interface that
connects to the Internet. Optionally, you can define a secondary IP address for the interface and
use that address as the local VPN gateway address. The benefit of doing this is that your
existing setup is not affected by the VPN settings.
The following diagram shows a VPN connection between two private networks with FortiGate
units acting as the VPN gateways. This configuration is commonly referred to as
Gateway-to-Gateway IPsec VPN.
y Sit
wa eB
g ate it) (Fo VPN
PN un rtiG gat
t e A ViGate IP a.1.2.3
ate ewa
Si Fort 4.5.6
6
IP b.4.5.6 un y
it)
(
VPN tunnel
Sit
eA Sit
10 net e
19 B ne
.10 wo 2.1 tw
.1.0 rk 68 or
/24 .10 k
.0/
24
Although the IPsec traffic may actually pass through many Internet routers, you can visualize
the VPN tunnel as a simple secure connection between the two FortiGate units.
Users on the two private networks do not need to be aware of the VPN tunnel. The applications
on their computers generate packets with the appropriate source and destination addresses, as
they normally do. The FortiGate units manage all the details of encrypting, encapsulating and
sending the packets to the remote VPN gateway.
Fo
rtiC
lien
nit tP
te u C
r t iGa a.1.2.3 b.4.5.6
Fo
ice
Off
VPN tunnel
Offi
c
10 e net
.10 wo
.1.0 rk
/24
On the PC, the FortiClient application acts as the local VPN gateway. Packets destined for the
office network are encrypted, encapsulated into IPsec packets, and sent through the VPN
tunnel to the FortiGate unit. Packets for other destinations are routed to the Internet as usual.
IPsec packets arriving through the tunnel are decrypted to recover the original IP packets.
Encryption
3DES Triple-DES, in which plain text is DES-encrypted three times by three keys.
DES Digital Encryption Standard, a 64-bit block algorithm that uses a 56-bit key
The default encryption algorithms provided on FortiGate units make recovery of encrypted data
almost impossible without the proper encryption keys
There is a human factor in the security of encryption. The key must be kept secret, known only
to the sender and receiver of the messages. Also, the key must not be something that
unauthorized parties might easily guess, such as the senders name, birthday or simple
sequence such as 123456.
Authentication
In addition to protecting data through encryption, a VPN must ensure that only authorized users
can access the private network. You must use either a preshared key on both VPN gateways or
RSA X.509 security certificates. The examples in this guide use only preshared key
authentication. Refer to the Fortinet Knowledge Base for articles on RSA X.509 security
certificates.
Preshared keys
A preshared key contains at least six random alphanumeric characters. Users of the VPN must
obtain the preshared key from the person who manages the VPN server and add the preshared
key to their VPN client configuration.
Although it looks like a password, the preshared key, also known as a shared secret, is never
sent by either gateway. The preshared key is used in the calculations at each end that generate
Additional authentication
To increase security, you can require additional means of authentication from users:
an identifier, called a peer ID or a local ID
extended authentication (XAUTH) which imposes an additional user name/password
requirement
A Local ID is an alphanumeric value assigned in the Phase 1 configuration. The Local ID of a
peer is called a Peer ID.
A VPN tunnel is established in two phases: Phase 1 and Phase 2. Several parameters determine
how this is done. Except for IP addresses, the settings simply need to match at both VPN
gateways. There are defaults that are appropriate for most cases.
FortiClient distinguishes between Phase 1 and Phase 2 only in the VPN Advanced settings and
uses different terms. Phase 1 is called the IKE Policy. Phase 2 is called the IPsec Policy.
Phase 1
In Phase 1, the two VPN gateways exchange information about the encryption algorithms that
they support and then establish a temporary secure connection to exchange authentication
information.
When you configure your FortiGate unit or FortiClient application, you must specify the
following settings for Phase 1:
Preshared key This must be the same at both ends. It is used to encrypt phase 1
authentication information.
Local interface The network interface that connects to the other VPN gateway.
This applies on a FortiGate unit only.
All other Phase 1 settings have default values. These settings mainly configure the types of
encryption to be used. The default settings on FortiGate units and in the FortiClient application
are compatible. The examples in this guide use these defaults.
For more detailed information about Phase 1 settings, see the Auto Key phase 1 parameters
on page 35.
Phase 2
Similar to the Phase 1 process, the two VPN gateways exchange information about the
encryption algorithms that they support for Phase 2. You may choose different encryption for
Phase 1 and Phase 2. If both gateways have at least one encryption algorithm in common, a
VPN tunnel can be established. Keep in mind that more algorithms each phase does not share
Security Association
This section provides a brief overview of IPsec technology and includes general information
about how to configure IPsec VPNs using this guide.
The following topics are included in this section:
Types of VPNs
Planning your VPN
General preparation steps
How to use this guide to configure an IPsec VPN
VPN configurations interact with the firewall component of the FortiGate unit. There must be a
security policy in place to permit traffic to pass between the private network and the VPN
tunnel.
Security policies for VPNs specify:
the FortiGate interface that provides the physical connection to the remote VPN gateway,
usually an interface connected to the Internet
the FortiGate interface that connects to the private network
IP addresses associated with data that has to be encrypted and decrypted
optionally, a schedule that restricts when the VPN can operate
optionally, the services (types of data) that can be sent
When the first packet of data that meets all of the conditions of the security policy arrives at the
FortiGate unit, a VPN tunnel may be initiated and the encryption or decryption of data is
performed automatically afterward. For more information, see Defining VPN security policies
on page 57.
Types of VPNs
FortiGate unit VPNs can be policy-based or route-based. There is little difference between the
two types. In both cases, you specify phase 1 and phase 2 settings. However there is a
difference in implementation. A route-based VPN creates a virtual IPsec network interface that
applies encryption or decryption as needed to any traffic that it carries. That is why route-based
VPNs are also known as interface-based VPNs. A policy-based VPN is implemented through a
special security policy that applies the encryption you specified in the phase 1 and phase 2
settings.
Route-based VPNs
For a route-based VPN, you create two security policies between the virtual IPsec interface and
the interface that connects to the private network. In one policy the virtual interface is the
source. In the other policy the virtual interface is the destination. The Action for both policies is
Accept. This creates bidirectional policies that ensure traffic will flow in both directions over the
VPN.
Page 18
Policy-based VPNs
For a policy-based VPN, one security policy enables communication in both directions. You
must select IPSEC as the Action and then select the VPN tunnel you defined in the phase 1
settings. You can then enable inbound and outbound traffic as needed within that policy, or
create multiple policies of this type to handle different types of traffic differently. For example
HTTPS traffic may not require the same level of scanning as FTP traffic.
L2TP-over-IPsec Yes No
supported
GRE-over-IPsec No Yes
supported
It is a good idea to plan the VPN configuration ahead of time. This will save time later and be
help you configure your VPN correctly.
Network topologies
The topology of your network will determine how remote peers and clients connect to the VPN
and how VPN traffic is routed. You can read about various network topologies and find the
high-level procedures needed to configure IPsec VPNs in one of these sections.
Table 2: VPN network topologies and brief descriptions
Topology Description
Hub-and-spoke One central FortiGate unit has multiple VPNs to other remote
configurations FortiGate units. See Hub-and-spoke configurations on page 77.
One end of the VPN tunnel has a changing IP address and the other
Dynamic DNS end must go to a dynamic DNS server for the current IP address
configuration before establishing a tunnel. See Dynamic DNS configuration on
page 93.
Topology Description
Configure VPN for Microsoft Windows dialup clients using the built
L2TP and IPsec
in L2TP software. Users do not have to install any See L2TP and
(Microsoft VPN)
IPsec (Microsoft VPN) on page 187.
A VPN configuration defines relationships between the VPN devices and the private hosts,
servers, or networks making up the VPN. Configuring a VPN involves gathering and recording
the following information. You will need this information to configure the VPN.
The private IP addresses of participating hosts, servers, and/or networks. These IP
addresses represent the source addresses of traffic that is permitted to pass through the
VPN. A IP source address can be an individual IP address, an address range, or a subnet
address.
The public IP addresses of the VPN end-point interfaces. The VPN devices establish
tunnels with each other through these interfaces.
The private IP addresses associated with the VPN-device interfaces to the private
networks. Computers on the private networks behind the VPN gateways will connect to
their VPN gateways through these interfaces.
This guide uses a task-based approach to provide all of the procedures needed to create
different types of VPN configurations. Follow the step-by-step configuration procedures in this
guide to set up the VPN.
The following configuration procedures are common to all IPsec VPNs:
1. Define the phase 1 parameters that the FortiGate unit needs to authenticate remote peers or
clients and establish a secure a connection. See Auto Key phase 1 parameters on
page 35.
2. Define the phase 2 parameters that the FortiGate unit needs to create a VPN tunnel with a
remote peer or dialup client. See Phase 2 parameters on page 51.
3. Specify the source and destination addresses of IP packets that are to be transported
through the VPN tunnel. See Defining policy addresses on page 57.
4. Create an IPsec security policy to define the scope of permitted services between the IP
source and destination addresses. See Defining VPN security policies on page 58.
The IPsec VPN menu in FortiOS provides settings to configure an IPsec VPN. IPsec VPNs that
are configured by using the general procedure below. With these steps, your FortiGate unit will
automatically generate unique IPsec encryption and authentication keys.
1. Define phase 1 parameters to authenticate remote peers and clients for a secure connection.
See Phase 1 configuration on page 23.
2. Define phase 2 parameters to create a VPN tunnel with a remote peer or dialup client. See
Phase 2 configuration on page 27.
3. Create a security policy to permit communication between your private network and the
VPN. Policy-based VPNs have an action of IPSEC, where for interface-based VPNs the
security policy action is ACCEPT. See Defining VPN security policies on page 57.
The FortiGate unit implements the Encapsulated Security Payload (ESP) protocol. Internet Key
Exchange (IKE) is performed automatically based on pre-shared keys or X.509 digital
certificates. Interface mode, supported in NAT mode only, creates a virtual interface for the local
end of a VPN tunnel.
This topic contains the following:
Auto Key (IKE)
Manual Key
Concentrator
You can configure VPN peers (or a FortiGate dialup server and a VPN client) to generate unique
Internet Key Exchange (IKE) keys automatically during the IPsec phase 1 and phase 2
exchanges.
When you define phase 2 parameters, you can choose any set of phase 1 parameters to set up
a secure connection for the tunnel and authenticate the remote peer. Auto Key configuration
applies to both tunnel-mode and interface-mode VPNs.
To configure VPN peers go to VPN > IPsec > Auto Key (IKE).
Create Phase 1 Creates a new phase 1 tunnel configuration. For more information, see
Phase 1 configuration on page 23.
Create Phase 2 Creates a new phase 2 configuration. For more information, see
Phase 2 configuration on page 27.
Create FortiClient Creates a new FortiClient VPN. For more information, see FortiClient
VPN VPN on page 30.
If you want to control how the IKE negotiation process controls traffic when there is no traffic, as
well as the length of time the FortiGate unit waits for negotiations to occur, use the
negotiation-timeout and auto-negotiation commands in the CLI.
Page 22
Phase 1 configuration
The basic phase 1 settings associate IPsec phase 1 parameters with a remote gateway, if a
pre-shared key or digital certificate will be used, and if a special identifier will be used to identify
the remote VPN peer or client.
Name Type a name for the phase 1 definition. The maximum name length is 15
characters for an interface mode VPN, 35 characters for a policy-based
VPN. If Remote Gateway is Dialup User, the maximum name length is
further reduced depending on the number of dialup tunnels that can be
established: by 2 for up to 9 tunnels, by 3 for up to 99 tunnels, 4 for up
to 999 tunnels, and so on.
For a tunnel mode VPN, the name normally reflects where the remote
connection originates. For a route-based tunnel, the FortiGate unit also
uses the name for the virtual IPsec interface that it creates
automatically.
IP Address If you selected Static IP Address, enter the IP address of the remote
peer.
Dynamic DNS If you selected Dynamic DNS, enter the domain name of the remote
peer.
Local Interface This option is available in NAT mode only. Select the name of the
interface through which remote peers or dialup clients connect to the
FortiGate unit.
By default, the local VPN gateway IP address is the IP address of the
interface that you selected. Optionally, you can specify a unique IP
address for the VPN gateway in the Advanced settings.
IPsec VPN in the web-based manager Page 23 IPsec VPN for FortiOS 5.0
Pre-shared Key If you selected Pre-shared Key, enter the pre-shared key that the
FortiGate unit will use to authenticate itself to the remote peer or dialup
client during phase 1 negotiations. You must define the same key at the
remote peer or client. The key must contain at least 6 printable
characters. For optimum protection against currently known attacks, the
key must consist of a minimum of 16 randomly chosen alphanumeric
characters.
Certificate Name If you selected RSA Signature, select the name of the server certificate
that the FortiGate unit will use to authenticate itself to the remote peer
or dialup client during phase 1 negotiations. For information about
obtaining and loading the required server certificate, see the FortiOS
User Authentication guide.
Peer Options Peer options are available to authenticate VPN peers or clients,
depending on the Remote Gateway and Authentication Method
settings.
Accept any peer ID Accept the local ID of any remote VPN peer or client. The FortiGate unit
does not check identifiers (local IDs). You can set Mode to Aggressive or
Main.
You can use this option with RSA Signature authentication. But, for
highest security, configure a PKI user/group for the peer and set Peer
Options to Accept this peer certificate only.
Accept this peer ID This option is available when Aggressive Mode is enabled. Enter the
identifier that is used to authenticate the remote peer. This identifier
must match the Local ID that the remote peers administrator has
configured.
If the remote peer is a FortiGate unit, the identifier is specified in the
Local ID field of the Advanced phase 1 configuration.
If the remote peer is a FortiClient user, the identifier is specified in the
Local ID field, accessed by selecting Config in the Policy section of the
VPN connections Advanced Settings.
Accept peer ID in Authenticate multiple FortiGate or FortiClient dialup clients that use
dialup group 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 Accept peer ID in 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.
IPsec VPN in the web-based manager Page 24 IPsec VPN for FortiOS 5.0
To configure Phase 1settings, go to VPN > Auto Key (IKE) and select Create Phase 1.
IKE Version Select the version of IKE to use. This is available only if IPsec Interface
Mode is enabled. For more information about IKE v2, refer to RFC 4306.
IKE v2 is not available if Mode is Aggressive.
When IKE Version is 2, Mode and XAUTH are not available.
IPv6 Version Select if you want to use IPv6 addresses for the remote gateway and
interface IP addresses. This is available only when Enable IPsec
Interface Mode is selected and IPv6 Support is enabled in the
administrative settings (System > Admin > Settings).
Local Gateway IP If you selected Enable IPsec Interface Mode, specify an IP address for
the local end of the VPN tunnel. Select one of the following:
Main Interface IP The FortiGate unit obtains the IP address of the
interface from the network interface settings.
Specify Enter a secondary address of the interface selected in the
phase 1 Local Interface field.
You cannot configure Interface mode in a transparent mode VDOM.
IPsec VPN in the web-based manager Page 25 IPsec VPN for FortiOS 5.0
Select either of the following authentication message digests to check
the authenticity of messages during phase 1 negotiations:
MD5 Message Digest 5, the hash algorithm developed by RSA
Data Security.
SHA1 Secure Hash Algorithm 1, which produces a 160-bit
message digest.
SHA256 Secure Hash Algorithm 2, which produces a 256-bit
message digest.
To specify a third combination, use the Add button beside the fields for
the second combination.
DH Group Select one or more Diffie-Hellman groups from DH group 1, 2, 5 and 14.
At least one of the DH Group settings on the remote peer or client must
match one the selections on the FortiGate unit. Failure to match one or
more DH groups will result in failed negotiations.
Keylife Enter the time (in seconds) that must pass before the IKE encryption key
expires. When the key expires, a new key is generated without
interrupting service. The keylife can be from 120 to 172 800 seconds.
Local ID If the FortiGate unit will act as a VPN client and you are using peer IDs
for authentication purposes, enter the identifier that the FortiGate unit
will supply to the VPN server during the phase 1 exchange.
If the FortiGate unit will act as a VPN client, and you are using security
certificates for authentication, select the distinguished name (DN) of the
local server certificate that the FortiGate unit will use for authentication
purposes.
If the FortiGate unit is a dialup client and will not be sharing a tunnel with
other dialup clients (that is, the tunnel will be dedicated to this Fortinet
dialup client), set Mode to Aggressive.
Note that this Local ID value must match the peer ID value given for the
remote VPN peers Peer Options.
IPsec VPN in the web-based manager Page 26 IPsec VPN for FortiOS 5.0
Password Enter the password that is used for authentication.
NAT Traversal Select the check box if a NAT device exists between the local FortiGate
unit and the VPN peer or client. The local FortiGate unit and the VPN
peer or client must have the same NAT traversal setting (both selected
or both cleared) to connect reliably.
Dead Peer Select this check box to reestablish VPN tunnels on idle connections
Detection and clean up dead IKE peers if required. You can use this option to
receive notification 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.
With Dead Peer Detection selected, you can use the config vpn
ipsec phase1 (tunnel mode) or config vpn ipsec
phase1-interface (interface mode) CLI command to optionally
specify a retry count and a retry interval.
Phase 2 configuration
After IPsec phase 1 negotiations end successfully, you begin phase 2. You configure the
phase 2 parameters to define the algorithms that the FortiGate unit may use to encrypt and
transfer data for the remainder of the session. During phase 2, you select specific IPsec security
associations needed to implement security services and establish a tunnel.
The basic phase 2 settings associate IPsec phase 2 parameters with the phase 1 configuration
that specifies the remote end point of the VPN tunnel. In most cases, you need to configure only
basic phase 2 settings.
To configure Phase 2 settings, go to VPN > Auto Key (IKE) and select Create Phase 2.
IPsec VPN in the web-based manager Page 27 IPsec VPN for FortiOS 5.0
You can use a number of additional advanced phase 2 settings to enhance the operation of the
tunnel.
Authentication Select one of the following message digests to check the authenticity of
messages during an encrypted session:
NULL Do not use a message digest.
MD5 Message Digest 5, the hash algorithm developed by RSA
Data Security.
SHA1 Secure Hash Algorithm 1, which produces a 160-bit
message digest.
SHA256 Secure Hash Algorithm 2, which produces a 256-bit
message digest.
SHA384 Secure Hash Algorithm 2, which produces a 384-bit
message digest.
SHA512 Secure Hash Algorithm 2, which produces a 512-bit
message digest.
Enable replay Replay attacks occur when an unauthorized party intercepts a series of
detection IPsec packets and replays them back into the tunnel.
Enable perfect Perfect forward secrecy (PFS) improves security by forcing a new
forward secrecy Diffie-Hellman exchange whenever keylife expires.
(PFS)
DH Group Select one Diffie-Hellman group (1, 2, 5 or 14). This must match the DH
Group that the remote peer or dialup client uses.
Keylife Select the method for determining when the phase 2 key expires:
Seconds, KBytes, or Both. If you select Both, the key expires when
either the time has passed or the number of KB have been processed.
Autokey Keep Alive Select the check box if you want the tunnel to remain active when no
data is being processed.
IPsec VPN in the web-based manager Page 28 IPsec VPN for FortiOS 5.0
DHCP-IPSec Provide IP addresses dynamically to VPN clients. This is available for
phase 2 configurations associated with a dialup phase 1 configuration.
You also need configure a DHCP server or relay on the private network
interface. You must configure the DHCP parameters separately.
If you configure the DHCP server to assign IP addresses based on
RADIUS user group attributes, you must also set the Phase 1 Peer
Options to Accept peer ID in dialup group and select the appropriate
user group. See Phase 1 configuration on page 23.
If the FortiGate unit acts as a dialup server and you manually assigned
FortiClient dialup clients VIP addresses that match the network behind
the dialup server, selecting the check box will cause the FortiGate unit
to act as a proxy for the dialup clients.
Quick Mode Specify the source and destination IP addresses to be used as selectors
Selector for IKE negotiations. If the FortiGate unit is a dialup server, keep the
default value of 0.0.0.0/0 unless you need to circumvent problems
caused by ambiguous IP addresses between one or more of the private
networks making up the VPN. You can specify a single host IP address,
an IP address range, or a network address. You may optionally specify
source and destination port numbers and a protocol number.
If you are editing an existing phase 2 configuration, the Source address
and Destination address fields are unavailable if the tunnel has been
configured to use firewall addresses as selectors. This option exists only
in the CLI.
Source address If the FortiGate unit is a dialup server, enter the source IP address that
corresponds to the local senders or network behind the local VPN peer
(for example, 172.16.5.0/24 or 172.16.5.0/255.255.255.0 for a
subnet, or 172.16.5.1/32 or 172.16.5.1/255.255.255.255 for a
server or host, or 192.168.10.[80-100] or
192.168.10.80-192.168.10.100 for an address range). A value of
0.0.0.0/0 means all IP addresses behind the local VPN peer.
If the FortiGate unit is a dialup client, source address must refer to the
private network behind the Fortinet dialup client.
Source port Enter the port number that the local VPN peer uses to transport traffic
related to the specified service (protocol number). The range is from 0 to
65535. To specify all ports, type 0.
Destination address Enter the destination IP address that corresponds to the recipients or
network behind the remote VPN peer (for example, 192.168.20.0/24
for a subnet, or 172.16.5.1/32 for a server or host, or
192.168.10.[80-100] for an address range). A value of 0.0.0.0/0
means all IP addresses behind the remote VPN peer.
Destination port Enter the port number that the remote VPN peer uses to transport traffic
related to the specified service (protocol number). To specify all ports,
enter 0.
Protocol Enter the IP protocol number of the service. To specify all services,
enter 0.
IPsec VPN in the web-based manager Page 29 IPsec VPN for FortiOS 5.0
FortiClient VPN
Use the FortiClient VPN configuration settings when configuring an IPsec VPN for remote users
to connect to the VPN tunnel using FortiClient.
To create a FortiClient VPN tunnel, go to VPN > IPsec > Auto Key (IKE) and select Create
FortiClient VPN at the top of the screen.
When configuring a FortiClient VPN connection, the settings for phase 1 and phase 2 settings
are automatically configured by the FortiGate unit. They are set to:
Remote Gateway Dialup User
Mode Aggressive
IPSec Interface Mode Enabled
Default settings for P1 and P2 Proposal
XAUTH Enable as Server (Auto)
IKE mode-config will be enabled
Peer Option Accept any peer ID
The remainder of the settings use the current FortiGate defaults. Note that FortiClient settings
need to match these FortiGate defaults. If you need to configure advanced settings for the
FortiClient VPN, select Edit on the Auto Key (IKE) page (Go to VPN > IPsec > Auto Key (IKE))
and configure the peer options or advanced options.
Local Outgoing Select the local outgoing interface for the VPN.
Interface
Authentication Select the type of authentication used when logging in to the VPN.
Method
Preshared Key If Pre-shared Key was selected in Authentication Method, enter the
pre-shared key in the field provided.
User Group Select a user group. You can also create a user group from the
drop-down list by selecting Create New.
Address Range Enter the start IP address for the DHCP address range for the client.
Start IP
Address Range End Enter the end IP address for the address range.
IP
Enable IPv4 Split Enabled by default, this option enables the FortiClient user to use the
Tunnel VPN to access internal resources while other Internet access is not sent
over the VPN, alleviating potential traffic bottlenecks in the VPN
connection. Disable this option to have all traffic sent through the VPN
tunnel.
Accessible Select from a list of internal networks that the FortiClient user can
Networks access.
IPsec VPN in the web-based manager Page 30 IPsec VPN for FortiOS 5.0
Client Options These options affect how the FortiClient application behaves when
connected to the FortiGate VPN tunnel. When enabled, a check box for
the corresponding option appears on the VPN login screen in
FortiClient, and is not enabled by default.
Save Password - When enabled, if the user selects this option, their
password is stored on the users computer and will automatically
populate each time they connect to the VPN.
Auto Connect - When enabled, if the user selects this option, when the
FortiClient application is launched, for example after a reboot or system
startup, FortiClient will automatically attempt to connect to the VPN
tunnel.
Always Up (Keep Alive) - When enabled, if the user selects this option,
the FortiClient connection will not shut down. When not selected, during
periods of inactivity, FortiClient will attempt to stay connected every
three minutes for a maximum of 10 minutes.
Endpoint When selected, the FortiGate unit requests a registration key from
Registration FortiClient before a connection can be established. A registration key is
defined by going to System > Config > Advanced.
For more information on FortiClient VPN connections to a FortiGate unit,
see the FortiClient Administration Guide.
DNS Server Select which DNS server to use for this VPN:
Use System DNS Use the same DNS servers as the FortiGate unit.
These are configured at System > Interface > DNS. This is the default
option.
Specify Specify the IP address of a different DNS server.
Manual Key
Use manual keys only if it is unavoidable. There are potential difficulties in keeping keys
confidential and in propagating changed keys to remote VPN peers securely.
If required, you can manually define cryptographic keys for establishing an IPsec VPN tunnel.
You would define manual keys in situations where:
you require prior knowledge of the encryption or authentication key (that is, one of the VPN
peers requires a specific IPsec encryption or authentication key).
you need to disable encryption and authentication.
In both cases, you do not specify IPsec phase 1 and phase 2 parameters; you define manual
keys from the CLI using the config vpn ipsec manualkey command.
IPsec VPN in the web-based manager Page 31 IPsec VPN for FortiOS 5.0
Each SPI identifies a Security Association (SA). The value is placed in ESP datagrams to link the
datagrams to the SA. When an ESP datagram is received, the recipient refers to the SPI to
determine which SA applies to the datagram. You must manually specify an SPI for each SA.
There is an SA for each direction, so for each VPN you must specify two SPIs, a local SPI and a
remote SPI, to cover bidirectional communications between two VPN devices.
Name Type a name for the VPN tunnel. The maximum name length is 15
characters for an interface mode VPN, 35 characters for a policy-based
VPN.
Local SPI Type a hexadecimal number (up to 8 characters, 0-9, a-f) that represents
the SA that handles outbound traffic on the local FortiGate unit. The
valid range is from 0x100 to 0xffffffff. This value must match the
Remote SPI value in the manual key configuration at the remote peer.
Remote SPI Type a hexadecimal number (up to 8 characters, 0-9, a-f) that represents
the SA that handles inbound traffic on the local FortiGate unit. The valid
range is from 0x100 to 0xffffffff. This value must match the Local
SPI value in the manual key configuration at the remote peer.
Remote Gateway Enter the IP address of the public interface to the remote peer. The
address identifies the recipient of ESP datagrams.
Local Interface This option is available in NAT mode only. Select the name of the
interface to which the IPsec tunnel will be bound. The FortiGate unit
obtains the IP address of the interface from the network interface
settings.
IPsec VPN in the web-based manager Page 32 IPsec VPN for FortiOS 5.0
Authentication Select one of the following message digests:
Algorithm
NULL Do not use a message digest.
MD5 Message Digest 5 algorithm, which produces a 128-bit
message digest.
SHA1 Secure Hash Algorithm 1, which produces a 160-bit
message digest.
SHA256 Secure Hash Algorithm 2, which produces a 256-bit
message digest.
SHA384 Secure Hash Algorithm 2, which produces a 384-bit
message digest.
SHA512 Secure Has Algorithm 2, which produces a 512-bit
message digest.
Note: The Algorithms for encryption and authentication cannot both be
NULL.
IPsec Interface Create a virtual interface for the local end of the VPN tunnel. Select this
Mode check box to create a route-based VPN, clear it to create a policy-based
VPN.
This is available only in NAT mode.
Concentrator
Available Tunnels A list of defined IPsec VPN tunnels. Select a tunnel from the list and
then select the right arrow.
IPsec Monitor
You can use the IPsec Monitor to view activity on IPsec VPN tunnels and start or stop those
tunnels. The display provides a list of addresses, proxy IDs, and timeout information for all
active tunnels, including tunnel mode and route-based (interface mode) tunnels.
To view the IPsec monitor, go to VPN > Monitor > IPsec Monitor.
IPsec VPN in the web-based manager Page 33 IPsec VPN for FortiOS 5.0
For dialup VPNs, the list provides status information about the VPN tunnels established by
dialup clients, and their IP addresses.
For static IP or dynamic DNS VPNs, the list provides status and IP addressing information about
VPN tunnels, active or not, to remote peers that have static IP addresses or domain names. You
can also start and stop individual tunnels from the list.
IPsec VPN in the web-based manager Page 34 IPsec VPN for FortiOS 5.0
Auto Key phase 1 parameters
This chapter provides detailed step-by-step procedures for configuring a FortiGate unit to
accept a connection from a remote peer or dialup client. The phase 1 parameters identify the
remote peer or clients and support authentication through preshared keys or digital certificates.
You can increase access security further using peer identifiers, certificate distinguished names,
group names, or the FortiGate extended authentication (XAuth) option for authentication
purposes.
For more information on phase 1 parameters in the web-based manager, see Phase 1
configuration on page 23.
The following topics are included in this section:
Overview
Defining the tunnel ends
Choosing main mode or aggressive mode
Authenticating the FortiGate unit
Authenticating remote peers and clients
Defining IKE negotiation parameters
Using XAuth authentication
Overview
To configure IPsec phase 1 settings, go to VPN > IPsec > Auto Key (IKE) and select Create
Phase 1. IPsec phase 1 settings define:
the remote and local ends of the IPsec tunnel
if phase 1 parameters are exchanged in multiple rounds with encrypted authentication
information (main mode) or in a single message with authentication information that is not
encrypted (aggressive mode)
if a preshared key or digital certificates will be used to authenticate the FortiGate unit to the
VPN peer or dialup client
if the VPN peer or dialup client is required to authenticate to the FortiGate unit. A remote
peer or dialup client can authenticate by peer ID or, if the FortiGate unit authenticates by
certificate, it can authenticate by peer certificate.
the IKE negotiation proposals for encryption and authentication
optional XAuth authentication, which requires the remote user to enter a user name and
password. A FortiGate VPN server can act as an XAuth server to authenticate dialup users. A
FortiGate unit that is a dialup client can also be configured as an XAuth client to authenticate
itself to the VPN server.
For all the phase 1 web-based manager fields, see Phase 1 configuration on page 23.
If you want to control how the IKE negotiation process controls traffic when there is no traffic, as
well as the length of time the unit waits for negotiations to occur, use the
negotiation-timeout and auto-negotiation commands in the CLI.
Page 35
Defining the tunnel ends
To begin defining the phase 1 configuration, go to VPN > IPsec > Auto Key (IKE) and select
Create Phase 1. Enter a descriptive name for the VPN tunnel. This is particularly important if you
will create several tunnels.
The phase 1 configuration mainly defines the ends of the IPsec tunnel. The remote end is the
remote gateway with which the FortiGate unit exchanges IPsec packets. The local end is the
FortiGate interface that sends and receives IPsec packets.
The remote gateway can be:
a static IP address
a domain name with a dynamic IP address
a dialup client
A statically addressed remote gateway is the simplest to configure. You specify the IP address.
Unless restricted in the security policy, either the remote peer or a peer on the network behind
the FortiGate unit can bring up the tunnel.
If the remote peer has a domain name and subscribes to a dynamic DNS service, you need to
specify only the domain name. The FortiGate unit performs a DNS query to determine the
appropriate IP address. Unless restricted in the security policy, either the remote peer or a peer
on the network behind the FortiGate unit can bring up the tunnel.
If the remote peer is a dialup client, only the dialup client can bring up the tunnel. The IP address
of the client is not known until it connects to the FortiGate unit. This configuration is a typical
way to provide a VPN for client PCs running VPN client software such as the FortiClient
Endpoint Security application.
The local end of the VPN tunnel, the Local Interface, is the FortiGate interface that sends and
receives the IPsec packets. This is usually the public interface of the FortiGate unit that is
connected to the Internet (typically the WAN1 port). Packets from this interface pass to the
private network through a security policy.
By default, the local VPN gateway is the IP address of the selected Local Interface. If you are
configuring an interface mode VPN, you can optionally use a secondary IP address of the Local
Interface as the local gateway.
The FortiGate unit and the remote peer or dialup client exchange phase 1 parameters in either
Main mode or Aggressive mode. This choice does not apply if you use IKE version 2, which is
available only for route-based configurations.
In Main mode, the phase 1 parameters are exchanged in multiple rounds with encrypted
authentication information
In Aggressive mode, the phase 1 parameters are exchanged in single message with
authentication information that is not encrypted.
Although Main mode is more secure, you must select Aggressive mode if there is more than one
dialup phase 1 configuration for the interface IP address, and the remote VPN peer or client is
authenticated using an identifier local ID). Descriptions of the peer options in this guide indicate
whether Main or Aggressive mode is required.
Auto Key phase 1 parameters Page 36 IPsec VPN for FortiOS 5.0
Choosing the IKE version
If you create a route-based VPN, you have the option of selecting IKE version 2. Otherwise, IKE
version 1 is used.
IKEv2, defined in RFC 4306, simplifies the negotiation process that creates the security
association (SA).
If you select IKEv2:
There is no choice in Phase 1 of Aggressive or Main mode.
FortiOS does not support Peer Options or Local ID.
Extended Authentication (XAUTH) is not available.
You can select only one DH Group.
The FortiGate unit can authenticate itself to remote peers or dialup clients using either a
pre-shared key or an RSA Signature (certificate).
Name Enter a name that reflects the origination of the remote connection.
For interface mode, the name can be up to 15 characters long.
Local Interface Select the interface that is the local end of the IPsec tunnel. For more
information, see Defining the tunnel ends on page 36. The local
interface is typically the WAN1 port.
Auto Key phase 1 parameters Page 37 IPsec VPN for FortiOS 5.0
Mode Select a mode. It is easier to use aggressive mode.
In Main mode, parameters are exchanged in multiple encrypted
rounds.
In Aggressive mode, parameters are exchanged in a single
unencrypted message.
Aggressive mode must be used when the remote VPN peer or client
has a dynamic IP address, or the remote VPN peer or client will be
authenticated using an identifier (local ID).
For more information, see Choosing main mode or aggressive
mode on page 36.
Certificate Name Select the name of the server certificate that the FortiGate unit will
use to authenticate itself to the remote peer or dialup client during
phase 1 negotiations.
You must obtain and load the required server certificate before this
selection. See the FortiOS User Authentication guide. If you have not
loaded any certificates, use the certificate named Fortinet_Factory.
Peer Options Peer options define the authentication requirements for remote peers
or dialup clients. They are not for your FortiGate unit itself.
See Authenticating remote peers and clients on page 40.
Advanced You can use the default settings for most phase 1 configurations.
Changes are required only if your network requires them. These
settings includes IKE version, DNS server, P1 proposal encryption
and authentication settings, and XAuth settings. See Defining IKE
negotiation parameters on page 44.
4. If you are configuring authentication parameters for a dialup user group, optionally define
extended authentication (XAuth) parameters in the Advanced section. See Using the
FortiGate unit as an XAuth server on page 49.
5. Select OK.
Auto Key phase 1 parameters Page 38 IPsec VPN for FortiOS 5.0
To authenticate the FortiGate unit with a pre-shared key
1. Go to VPN > IPsec > Auto Key (IKE).
2. Create a new phase 1 configuration or edit an existing phase 1 configuration.
3. Include appropriate entries as follows:
Name Enter a name that reflects the origination of the remote connection.
Remote Gateway Select the nature of the remote connection. For more information,
see Defining the tunnel ends on page 36.
Local Interface Select the interface that is the local end of the IPsec tunnel. For more
information, see Defining the tunnel ends on page 36. The local
interface is typically the WAN1 port.
Pre-shared Key Enter the preshared key that the FortiGate unit will use to
authenticate itself to the remote peer or dialup client during phase 1
negotiations. You must define the same value at the remote peer or
client. The key must contain at least 6 printable characters and best
practices dictate that it only be known by network administrators.
For optimum protection against currently known attacks, the key
must consist of a minimum of 16 randomly chosen alphanumeric
characters.
Peer options Peer options define the authentication requirements for remote peers
or dialup clients, not for the FortiGate unit itself. You can require the
use of peer IDs, but not client certificates. For more information, see
Authenticating remote peers and clients on page 40.
Advanced You can retain the default settings unless changes are needed to
meet your specific requirements. See Defining IKE negotiation
parameters on page 44.
4. If you are configuring authentication parameters for a dialup user group, optionally define
extended authentication (XAuth) parameters. See Using the FortiGate unit as an XAuth
server on page 49.
5. Select OK.
Auto Key phase 1 parameters Page 39 IPsec VPN for FortiOS 5.0
Authenticating remote peers and clients
Certificates or pre-shared keys restrict who can access the VPN tunnel, but they do not identify
or authenticate the remote peers or dialup clients. You have the following options for
authentication:
Table 3: Methods of authenticating remote VPN peers
For authentication of users of the remote peer or dialup client device, see Using XAuth
authentication on page 48.
Auto Key phase 1 parameters Page 40 IPsec VPN for FortiOS 5.0
If the remote VPN peer has a CA-issued certificate to support a higher level of credibility, you
would enter information similar to the following:
config user peer
edit CA_FG1000
set ca CA_Cert_1
set subject FG1000_at_site1
end
The value that you specify to identify the entry (for example, CA_FG1000) is displayed in the
Accept this peer certificate only list in the IPsec phase 1 configuration when you return to the
web-based manager. For more information about these CLI commands, see the user chapter
of the FortiGate CLI Reference.
A group of certificate holders can be created based on existing user accounts for dialup clients.
To create the user accounts for dialup clients, see the User chapter of the FortiGate
Administration Guide. To create the certificate group afterward, use the config user
peergrp CLI command. See the user chapter of the FortiGate CLI Reference.
Auto Key phase 1 parameters Page 41 IPsec VPN for FortiOS 5.0
Enabling VPN access by peer identifier
Whether you use certificates or pre-shared keys to authenticate the FortiGate unit, you can
require that remote peers or clients have a particular peer ID. This adds another piece of
information that is required to gain access to the VPN. More than one FortiGate/FortiClient
dialup client may connect through the same VPN tunnel when the dialup clients share a
preshared key and assume the same identifier.
A peer ID, also called local ID, can be up to 63 characters long containing standard regular
expression characters. Local ID is set in phase1 Aggressive Mode configuration.
You cannot require a peer ID for a remote peer or client that uses a pre-shared key and has a
static IP address.
Auto Key phase 1 parameters Page 42 IPsec VPN for FortiOS 5.0
5. In the Local ID field, type the identifier that will be shared by all dialup clients. This value
must match the Accept this peer ID value that you specified previously in the phase 1
gateway configuration on the FortiGate unit.
6. Select OK to close all dialog boxes.
7. Configure all dialup clients the same way using the same preshared key and local ID.
To authenticate dialup clients using unique preshared keys and/or peer IDs
1 At the FortiGate VPN server, go to VPN > IPsec > Auto Key (IKE).
2 In the list, select the Edit icon of a phase 1 configuration to edit its parameters.
3 If the clients have unique peer IDs, set Mode to Aggressive.
4 Clear the Pre-shared Key field.
The user account password will be used as the preshared key.
5 Select Accept peer ID in dialup group and then select the group name from the list of user
groups.
6 Select OK.
Follow this procedure to add a unique pre-shared key and unique peer ID to an existing
FortiClient configuration.
Auto Key phase 1 parameters Page 43 IPsec VPN for FortiOS 5.0
4. In the Preshared Key field, type the FortiGate password that belongs to the dialup client (for
example, 1234546).
The user account password will be used as the preshared key.
5. Select Advanced.
6. Under Policy, select Config.
7. In the Local ID field, type the FortiGate user name that you assigned previously to the dialup
client (for example, FortiC1ient1).
8. Select OK to close all dialog boxes.
Configure all FortiClient dialup clients this way using unique preshared keys and local IDs.
Follow this procedure to add a unique pre-shared key to an existing FortiClient configuration.
In phase 1, the two peers exchange keys to establish a secure communication channel between
them. As part of the phase 1 process, the two peers authenticate each other and negotiate a
way to encrypt further communications for the duration of the session. For more information see
Authenticating remote peers and clients on page 40. The P1 Proposal parameters select the
encryption and authentication algorithms that are used to generate keys for protecting
negotiations.
The IKE negotiation parameters determine:
which encryption algorithms may be applied for converting messages into a form that only
the intended recipient can read
which authentication hash may be used for creating a keyed hash from a preshared or
private key
which Diffie-Hellman group (DH Group) will be used to generate a secret session key
Phase 1 negotiations (in main mode or aggressive mode) begin as soon as a remote VPN peer
or client attempts to establish a connection with the FortiGate unit. Initially, the remote peer or
dialup client sends the FortiGate unit a list of potential cryptographic parameters along with a
session ID. The FortiGate unit compares those parameters to its own list of advanced phase 1
parameters and responds with its choice of matching parameters to use for authenticating and
encrypting packets. The two peers handle the exchange of encryption keys between them, and
authenticate the exchange through a preshared key or a digital signature.
Auto Key phase 1 parameters Page 44 IPsec VPN for FortiOS 5.0
Generating keys to authenticate an exchange
The FortiGate unit supports the generation of secret session keys automatically using a
Diffie-Hellman algorithm. These algorithms are defined in RFC 2409. The Keylife setting in the
P1 Proposal area determines the amount of time before the phase 1 key expires. Phase 1
negotiations are rekeyed automatically when there is an active security association. See Dead
peer detection on page 48.
You can enable or disable automatic rekeying between IKE peers through the phase1-rekey
attribute of the config system global CLI command. For more information, see the
system chapter of the FortiGate CLI Reference.
When in FIPS-CC mode, the FortiGate unit requires DH key exchange to use values at least
3072 bits long. However most browsers need the key size set to 1024. You can set the
minimum size of the DH keys in the CLI.
config system global
set dh-params 3072
end
When you use a preshared key (shared secret) to set up two-party authentication, the remote
VPN peer or client and the FortiGate unit must both be configured with the same preshared key.
Each party uses a session key derived from the Diffie-Hellman exchange to create an
authentication key, which is used to sign a known combination of inputs using an authentication
algorithm (such as HMAC-MD5, HMAC-SHA-1, or HMAC-SHA-256). Hash-based Message
Authentication Code (HMAC) is a method for calculating an authentication code using a hash
function plus a secret key, and is defined in RFC 2104. Each party signs a different combination
of inputs and the other party verifies that the same result can be computed.
SHA-256, SHA-384 and SHA-512 are not accelerated by some FortiASIC processors (including
FortiASIC network processors and security processors). As a result, using SHA-256, SHA-384
and SHA-512 may reduce the performance of the FortiGate unit more significantly than SHA-1
which is accelerated by all FortiASIC processors.
When you use preshared keys to authenticate VPN peers or clients, you must distribute
matching information to all VPN peers and/or clients whenever the preshared key changes.
As an alternative, the remote peer or dialup client and FortiGate unit can exchange digital
signatures to validate each others identity with respect to their public keys. In this case, the
required digital certificates must be installed on the remote peer and on the FortiGate unit. By
exchanging certificate DNs, the signed server certificate on one peer is validated by the
presence of the root certificate installed on the other peer.
The following procedure assumes that you already have a phase 1 definition that describes how
remote VPN peers and clients will be authenticated when they attempt to connect to a local
FortiGate unit. For information about the Local ID and XAuth options, see Enabling VPN access
with user accounts and pre-shared keys on page 43 and Using the FortiGate unit as an XAuth
server on page 49. Follow this procedure to add IKE negotiation parameters to the existing
definition.
Auto Key phase 1 parameters Page 45 IPsec VPN for FortiOS 5.0
3. Select Advanced and include appropriate entries and select OK:
P1 Proposal Select the encryption and authentication algorithms that will be used
to generate keys for protecting negotiations.
Add or delete encryption and authentication algorithms as required.
Select a minimum of one and a maximum of three combinations. The
remote peer must be configured to use at least one of the proposals
that you define.
You can select any of these symmetric-key algorithms:
DES-Digital Encryption Standard, a 64-bit block algorithm that
uses a 56-bit key.
3DES-Triple-DES, in which plain text is encrypted three times by
three keys.
AES128-A 128-bit block algorithm that uses a 128-bit key.
AES192-A 128-bit block algorithm that uses a 192-bit key.
AES256-A 128-bit block algorithm that uses a 256-bit key.
You can select one of the following message digests to check the
authenticity of messages during phase 1 negotiations:
MD5-Message Digest 5, the hash algorithm developed by RSA
Data Security.
SHA1-Secure Hash Algorithm 1, which produces a 160-bit
message digest.
SHA-256 Secure Hash Algorithm 256, which produces a 256-bit
message digest
SHA-384 Secure Hash Algorithm 384, which produces a 384-bit
message digest
SHA-512 Secure Hash Algorithm 512, which produces a 512-bit
message digest
To specify a third combination, use the add button beside the fields
for the second combination.
SHA-256, SHA-384 and SHA-512 are not accelerated by some
FortiASIC processors (including FortiASIC network processors and
security processors). As a result, using SHA-256, SHA-384 and
SHA-512 may reduce the performance of the FortiGate unit more
significantly than SHA-1 which is accelerated by all FortiASIC
processors.
Auto Key phase 1 parameters Page 46 IPsec VPN for FortiOS 5.0
DH Group Select one or more Diffie-Hellman groups from DH group 1, 2, and 5.
When using aggressive mode, DH groups cannot be negotiated.
If both VPN peers (or a VPN server and its client) have static IP
addresses and use aggressive mode, select a single DH group. The
setting on the FortiGate unit must be identical to the setting on the
remote peer or dialup client.
When the remote VPN peer or client has a dynamic IP address and
uses aggressive mode, select up to three DH groups on the
FortiGate unit and one DH group on the remote peer or dialup client.
The setting on the remote peer or dialup client must be identical to
one of the selections on the FortiGate unit.
If the VPN peer or client employs main mode, you can select multiple
DH groups. At least one of the settings on the remote peer or dialup
client must be identical to the selections on the FortiGate unit.
Keylife Type the amount of time (in seconds) that will be allowed to pass
before the IKE encryption key expires. When the key expires, a new
key is generated without interrupting service. The keylife can be from
120 to 172800 seconds.
Nat-traversal Enable this option if a NAT device exists between the local FortiGate
unit and the VPN peer or client. The local FortiGate unit and the VPN
peer or client must have the same NAT traversal setting (both
selected or both cleared). When in doubt, enable NAT-traversal. See
NAT traversal on page 47.
Dead Peer Enable this option to reestablish VPN tunnels on idle connections
Detection and clean up dead IKE peers if required. This feature minimizes the
traffic required to check if a VPN peer is available or unavailable
(dead). See Dead peer detection on page 48.
NAT traversal
Network Address Translation (NAT) is a way to convert private IP addresses to publicly routable
Internet addresses and vise versa. When an IP packet passes through a NAT device, the source
or destination address in the IP header is modified. FortiGate units support NAT version 1
(encapsulate on port 500 with non-IKE marker), version 3 (encapsulate on port 4500 with
non-ESP marker), and compatible versions.
NAT cannot be performed on IPsec packets in ESP tunnel mode because the packets do not
contain a port number. As a result, the packets cannot be demultiplexed. To work around this,
the FortiGate unit provides a way to protect IPsec packet headers from NAT modifications.
When the Nat-traversal option is enabled, outbound encrypted packets are wrapped inside a
UDP IP header that contains a port number. This extra encapsulation allows NAT devices to
change the port number without modifying the IPsec packet directly.
To provide the extra layer of encapsulation on IPsec packets, the Nat-traversal option must be
enabled whenever a NAT device exists between two FortiGate VPN peers or a FortiGate unit
and a dialup client such as FortiClient. On the receiving end, the FortiGate unit or FortiClient
removes the extra layer of encapsulation before decrypting the packet.
Auto Key phase 1 parameters Page 47 IPsec VPN for FortiOS 5.0
NAT keepalive frequency
When a NAT device performs network address translation on a flow of packets, the NAT device
determines how long the new address will remain valid if the flow of traffic stops (for example,
the connected VPN peer may be idle). The device may reclaim and reuse a NAT address when a
connection remains idle for too long.
To work around this, when you enable NAT traversal specify how often the FortiGate unit sends
periodic keepalive packets through the NAT device in order to ensure that the NAT address
mapping does not change during the lifetime of a session. To be effective, 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.
Extended authentication (XAuth) increases security by requiring the remote dialup client user to
authenticate in a separate exchange at the end of phase 1. XAuth draws on existing FortiGate
user group definitions and uses established authentication mechanisms such as PAP, CHAP,
RADIUS and LDAP to authenticate dialup clients. You can configure a FortiGate unit to function
either as an XAuth server or an XAuth client.If the server or client is attempting a connection
using XAuth and the other end is not using XAuth, the failed connection attempts that are
logged will not specify XAuth as the reason.
Auto Key phase 1 parameters Page 48 IPsec VPN for FortiOS 5.0
Using the FortiGate unit as an XAuth server
A FortiGate unit can act as an XAuth server for dialup clients. When the phase 1 negotiation
completes, the FortiGate unit challenges the user for a user name and password. It then
forwards the users credentials to an external RADIUS or LDAP server for verification.
If the user records on the RADIUS server have suitably configured Framed-IP-Address fields,
you can assign client virtual IP addresses by XAuth instead of from a DHCP address range. See
Assigning VIPs by RADIUS user group on page 111.
The authentication protocol to use for XAuth depends on the capabilities of the authentication
server and the XAuth client:
Select PAP whenever possible.
You must select PAP for all implementations of LDAP and some implementations of
Microsoft RADIUS.
Select AUTO when the authentication server supports CHAP but the XAuth client does not.
The FortiGate unit will use PAP to communicate with the XAuth client and CHAP to
communicate with the authentication server.
Before you begin, create user accounts and user groups to identify the dialup clients that need
to access the network behind the FortiGate dialup server. If password protection will be
provided through an external RADIUS or LDAP server, you must configure the FortiGate dialup
server to forward authentication requests to the authentication server. For information about
these topics, see the FortiGate User Authentication Guide.
Auto Key phase 1 parameters Page 49 IPsec VPN for FortiOS 5.0
4. Under XAuth, select Enable as Client.
5. In the Username field, type the FortiGate PAP, CHAP, RADIUS, or LDAP user name that the
FortiGate XAuth server will compare to its records when the FortiGate XAuth client attempts
to connect.
6. In the Password field, type the password to associate with the user name.
7. Select OK.
Auto Key phase 1 parameters Page 50 IPsec VPN for FortiOS 5.0
Phase 2 parameters
This section describes the phase 2 parameters that are required to establish communication
through a VPN.
The following topics are included in this section:
Basic phase 2 settings
Advanced phase 2 settings
Configure the phase 2 parameters
After IPsec VPN phase 1 negotiations complete successfully, phase 2 negotiation begins.
Phase 2 parameters define the algorithms that the FortiGate unit can use to encrypt and
transfer data for the remainder of the session. The basic phase 2 settings associate IPsec
phase 2 parameters with a phase 1 configuration.
When defining phase 2 parameters, you can choose any set of phase 1 parameters to set up a
secure connection and authenticate the remote peer.
For more information on phase 2 settings in the web-based manager, see Phase 2
configuration on page 27
The following additional advanced phase 2 settings are available to enhance the operation of
the tunnel:
P2 Proposals
Replay detection
Perfect forward secrecy (PFS)
Keylife
Auto-negotiate
Autokey Keep Alive
DHCP-IPsec
Quick mode selectors
P2 Proposals
In phase 2, the VPN peer or client and the FortiGate unit exchange keys again to establish a
secure communication channel. The P2 Proposal parameters select the encryption and
authentication algorithms needed to generate keys for protecting the implementation details of
Security Associations (SAs). The keys are generated automatically using a Diffie-Hellman
algorithm.
Page 51
Replay detection
IPsec tunnels can be vulnerable to replay attacks. Replay detection enables the FortiGate unit
to check all IPsec packets to see if they have been received before. If any encrypted packets
arrive out of order, the FortiGate unit discards them.
Keylife
The Keylife setting sets a limit on the length of time that a phase 2 key can be used. The default
units are seconds. Alternatively, you can set a limit on the number of kilobytes (KB) of
processed data, or both. If you select both, the key expires when either the time has passed or
the number of KB have been processed. When the phase 2 key expires, a new key is generated
without interrupting service.
Auto-negotiate
By default, the phase 2 security association (SA) is not negotiated until a peer attempts to send
data. The triggering packet and some subsequent packets are dropped until the SA is
established. Applications normally resend this data, so there is no loss, but there might be a
noticeable delay in response to the user.
Automatically establishing the SA can also be important for a dialup peer. This ensures that the
VPN tunnel is available for peers at the server end to initiate traffic to the dialup peer. Otherwise,
the VPN tunnel does not exist until the dialup peer initiates traffic.
When enabled, auto-negotiate initiates the phase 2 SA negotiation automatically, repeating
every five seconds until the SA is established.
Use the following commands to enable it.
config vpn ipsec phase2
edit <phase2_name>
set auto-negotiate enable
end
If the tunnel goes down, the auto-negotiate feature will attempt to re-establish it. However, the
Autokey Keep Alive feature is a better method to ensure your VPN remains up.
While the drop down menus for specifying an address also show address groups, the use of
address groups is not supported.
To made it easy to determine if one of the choices in the drop down menu is an address or an
address group the two types of objects have been broken into sections with the address groups
at the bottom of the list.
When configuring Quick Mode selector Source Address and Destination address, valid options
include IPv4 and IPv6 single addresses, IPv4 subnet, or IPv6 subnet. For more information on
IPv6 IPsec VPN, see Overview of IPv6 IPsec support on page 173.
There are some configurations that require specific selectors:
the VPN peer is a third-party device that uses specific phase2 selectors
the FortiGate unit connects as a dialup client to another FortiGate unit, in which case you
must specify a source IP address, IP address range or subnet
With FortiOS VPNs, your network has multiple layers of security, with quick mode selectors
being an important line of defence.
Routes guide traffic from one IP address to another.
Phase 1 and phase 2 connection settings ensure there is a valid remote end point for the
VPN tunnel that agrees on the encryption and parameters.
Quick mode selectors allow IKE negotiations only for allowed peers.
Security policies control which IP addresses can connect to the VPN.
Security policies also control what protocols are allowed over the VPN along with any
bandwidth limiting.
P2 Proposal Select the encryption and authentication algorithms that will be used
to change data into encrypted code.
Add or delete encryption and authentication algorithms as required.
Select a minimum of one and a maximum of three combinations. The
remote peer must be configured to use at least one of the proposals
that you define.
It is invalid to set both Encryption and Authentication to null.
Authentication You can select either of the following message digests to check the
authenticity of messages during an encrypted session:
NULL Do not use a message digest.
MD5 Message Digest 5.
SHA1 Secure Hash Algorithm 1 - a 160-bit message digest.
To specify one combination only, set the Encryption and
Authentication options of the second combination to NULL. To
specify a third combination, use the Add button beside the fields for
the second combination.
Enable replay Optionally enable or disable replay detection. Replay attacks occur
detection when an unauthorized party intercepts a series of IPsec packets and
replays them back into the tunnel.
Enable perfect Enable or disable PFS. Perfect forward secrecy (PFS) improves
forward secrecy security by forcing a new Diffie-Hellman exchange whenever keylife
(PFS) expires.
Keylife Select the method for determining when the phase 2 key expires:
Seconds, KBytes, or Both. If you select Both, the key expires when
either the time has passed or the number of KB have been
processed. The range is from 120 to 172800 seconds, or from 5120
to 2147483648 KB.
Autokey Keep Alive Enable the option if you want the tunnel to remain active when no
data is being processed.
DHCP-IPsec Select Enable if the FortiGate unit acts as a dialup server and
FortiGate DHCP server or relay will be used to assign VIP addresses
to FortiClient dialup clients. The DHCP server or relay parameters
must be configured separately.
If the FortiGate unit acts as a dialup server and the FortiClient dialup
client VIP addresses match the network behind the dialup server,
select Enable to cause the FortiGate unit to act as a proxy for the
dialup clients.
This is available only for phase 2 configurations associated with a
dialup phase 1 configuration. It works only on policy-based VPNs.
Quick Mode Optionally specify the source and destination IP address to be used
Selector as selectors for IKE negotiations. If the FortiGate unit is a dialup
server, keep the default value 0.0.0.0/0 unless you need to
circumvent problems caused by ambiguous IP addresses between
one or more of the private networks making up the VPN.
Note that IKEv1 does not support the use of multiple addresses in
selectors. Instead, use the default 0.0.0.0/0 subnet selector and rely
on the firewall policy to limit destination addresses. Only use the
Addressing objects if they are carried over from earlier versions of
FortiOS.
If you are editing an existing phase 2 configuration, the Source
address and Destination address fields are unavailable if the tunnel
has been configured to use firewall addresses as selectors. This
option exists only in the CLI. See the dst-addr-type, dst-name,
src-addr-type and src-name keywords for the vpn ipsec
phase2 command in the FortiGate CLI Reference.
Source address If the FortiGate unit is a dialup server, type the source IP address that
corresponds to the local sender(s) or network behind the local VPN
peer (for example, 172.16.5.0/24 or
172.16.5.0/255.255.255.0 for a subnet, or 172.16.5.1/32
or 172.16.5.1/255.255.255.255 for a server or host, or
192.168.10.[80-100] or 192.168.10.80-192.168.10.100
for an address range). A value of 0.0.0.0/0 means all IP addresses
behind the local VPN peer.
If the FortiGate unit is a dialup client, source address must refer to
the private network behind the FortiGate dialup client.
Destination address Type the destination IP address that corresponds to the recipient(s)
or network behind the remote VPN peer (for example,
192.168.20.0/24 for a subnet, or 172.16.5.1/32 for a server or
host, or 192.168.10.[80-100] for an address range). A value of
0.0.0.0/0 means all IP addresses behind the remote VPN peer.
Destination port Type the port number that the remote VPN peer uses to transport
traffic related to the specified service (protocol number). The range is
0 to 65535. To specify all ports, type 0.
Protocol Type the IP protocol number of the service. The range is 1 to 255. To
specify all services, type 0.
This section explains how to specify the source and destination IP addresses of traffic
transmitted through an IPsec VPN, and how to define appropriate security policies.
The following topics are included in this section:
Defining policy addresses
Defining VPN security policies
A VPN tunnel has two end points. These end points may be VPN peers such as two FortiGate
gateways. Encrypted packets are transmitted between the end points. At each end of the VPN
tunnel, a VPN peer intercepts encrypted packets, decrypts the packets, and forwards the
decrypted IP packets to the intended destination.
You need to define firewall addresses for the private networks behind each peer. You will use
these addresses as the source or destination address depending on the security policy.
Po
rt rt 4
Po rt 2 2
Po z)
r Po
(dmt 4 (dm
z)
Fo
A rti
ate VPN connection (re Gate Po
3 o rtiG) mo B rt 3
ort F al te)
P (loc
19
19 Pri 2.16
rk vat 8.1
2.1 two e 0
68
.2.0 en
e (re netw .0/24
/24 vat mo or
Pri al) te) k
(loc
In general:
In a gateway-to-gateway, hub-and-spoke, dynamic DNS, redundant-tunnel, or transparent
configuration, you need to define a policy address for the private IP address of the network
behind the remote VPN peer (for example, 192.168.10.0/255.255.255.0 or
192.168.10.0/24).
In a peer-to-peer configuration, you need to define a policy address for the private IP
address of a server or host behind the remote VPN peer (for example,
172.16.5.1/255.255.255.255 or 172.16.5.1/32 or 172.16.5.1).
Page 57
For a FortiGate dialup server in a dialup-client or Internet-browsing configuration:
If you are not using VIP addresses, or if the FortiGate dialup server assigns VIP addresses to
FortiClient dialup clients through FortiGate DHCP relay, select the predefined destination
address all in the security policy to refer to the dialup clients.
If you assign VIP addresses to FortiClient dialup clients manually, you need to define a policy
address for the VIP address assigned to the dialup client (for example, 10.254.254.1/32),
or a subnet address from which the VIP addresses are assigned (for example,
10.254.254.0/24 or 10.254.254.0/255.255.255.0).
For a FortiGate dialup client in a dialup-client or Internet-browsing configuration, you need to
define a policy address for the private IP address of a host, server, or network behind the
FortiGate dialup server.
Security policies allow IP traffic to pass between interfaces on a FortiGate unit. You can limit
communication to particular traffic by specifying source address and destination addresses.
Then only traffic from those addresses will be allowed.
Policy-based and route-based VPNs require different security policies.
A policy-based VPN requires an IPsec security policy. You specify the interface to the private
network, the interface to the remote peer and the VPN tunnel. A single policy can enable
traffic inbound, outbound, or in both directions.
A route-based VPN requires an Accept security policy for each direction. As source and
destination interfaces, you specify the interface to the private network and the virtual IPsec
interface (phase 1 configuration) of the VPN. The IPsec interface is the destination interface
for the outbound policy and the source interface for the inbound policy. One security policy
must be configured for each direction of each VPN interface.
There are examples of security policies for both policy-based and route-based VPNs
throughout this guide. See Route-based or policy-based VPN on page 95.
If the security policy, which grants the VPN Connection is limited to certain services, DHCP
must be included, otherwise the client wont be able to retrieve a lease from the FortiGates
(IPSec) DHCP server, because the DHCP Request (coming out of the tunnel) will be blocked.
Defining VPN security policies Page 58 IPsec VPN for FortiOS 5.0
Defining an IPsec security policy for a policy-based VPN
An IPsec security policy enables the transmission and reception of encrypted packets, specifies
the permitted direction of VPN traffic, and selects the VPN tunnel. In most cases, a single policy
is needed to control both inbound and outbound IP traffic through a VPN tunnel.
Defining VPN security policies Page 59 IPsec VPN for FortiOS 5.0
FortiGate unit uses the remote gateway specified in its phase 1 tunnel configuration to reply to
the remote peer. When the remote peer receives a reply, it checks its own security policy,
including the tunnel configuration, to determine which communications are permitted. As long
as one or more services are allowed through the VPN tunnel, the two peers begin to negotiate
the tunnel. To follow this negotiation in the web-based manager, go to VPN > Monitor > IPsec
Monitor. There you will find a list of the VPN tunnels, their status, and the data flow both
incoming and outgoing.
Local Interface Select the local interface to the internal (private) network.
Local Protected Subnet Select the name that corresponds to the local network,
server(s), or host(s) from which IP packets may originate.
Outgoing VPN Interface Select the local interface to the external (public) network.
Remote Protected Subnet Select the name that corresponds to the remote network,
server(s), or host(s) to which IP packets may be delivered.
Service Keep the default setting (ANY) unless changes are needed
to meet your specific requirements.
VPN Tunnel Select Use Existing and select the tunnel from the
drop-down list.
Allow traffic to be initiated Select if traffic from the remote network will be allowed to
from the remote site initiate the tunnel.
4. You may enable UTM features, and/or event logging, or select advanced settings to
authenticate a user group, or shape traffic. For more information, see the Firewall Guide.
5. Select OK.
6. Place the policy in the policy list above any other policies having similar source and
destination addresses.
Defining VPN security policies Page 60 IPsec VPN for FortiOS 5.0
configure redundant connections to a remote destination or control access to different services
at different times.
To ensure a secure connection, the FortiGate unit must evaluate IPSEC policies before ACCEPT
and DENY security policies. Because the FortiGate unit reads policies starting at the top of the
list, you must move all IPsec policies to the top of the list. When you define multiple IPsec
policies for the same tunnel, you must reorder the IPsec policies that apply to the tunnel so that
specific constraints can be evaluated before general constraints.
Adding multiple IPsec policies for the same VPN tunnel can cause conflicts if the policies
specify similar source and destination addresses but have different settings for the same
service. When policies overlap in this manner, the system may apply the wrong IPsec policy or
the tunnel may fail.
For example, if you create two equivalent IPsec policies for two different tunnels, it does not
matter which one comes first in the list of IPsec policies the system will select the correct
policy based on the specified source and destination addresses. If you create two different
IPsec policies for the same tunnel (that is, the two policies treat traffic differently depending on
the nature of the connection request), you might have to reorder the IPsec policies to ensure
that the system selects the correct IPsec policy. Reordering is especially important when the
source and destination addresses in both policies are similar (for example, if one policy
specifies a subset of the IP addresses in another policy). In this case, place the IPsec policy
having the most specific constraints at the top of the list so that it can be evaluated first.
When you define a route-based VPN, you create a virtual IPsec interface on the physical
interface that connects to the remote peer. You create ordinary Accept security policies to
enable traffic between the IPsec interface and the interface that connects to the private
network. This makes configuration simpler than for policy-based VPNs, which require IPsec
security policies.
Incoming Interface Select the interface that connects to the private network behind this
FortiGate unit.
Source Address Select the address name that you defined for the private network
behind this FortiGate unit.
Destination Address Select the address name that you defined for the private network
behind the remote peer.
To permit the remote client to initiate communication, you need to define a security policy for
communication in that direction.
Defining VPN security policies Page 61 IPsec VPN for FortiOS 5.0
4. Select Create New and leave the Policy Type as Firewall, and the Policy Subtype as Address
5. Enter these settings in particular:
Source Address Select the address name that you defined for the private network
behind the remote peer.
Outgoing Interface Select the interface that connects to the private network behind this
FortiGate unit.
Destination Address Select the address name that you defined for the private network
behind this FortiGate unit.
Defining VPN security policies Page 62 IPsec VPN for FortiOS 5.0
Gateway-to-gateway configurations
This section explains how to set up a basic gateway-to-gateway (site-to-site) IPsec VPN.
The following topics are included in this section:
Configuration overview
General configuration steps
Configuring the two VPN peers
How to work with overlapping subnets
Testing
Configuration overview
In a gateway-to-gateway configuration, two FortiGate units create a VPN tunnel between two
separate private networks. All traffic between the two networks is encrypted and protected by
FortiGate security policies.
_1 Fo
ate w n1 rtiG
rtiG 172 an1 wa .0.2 ate
Fo .18
.0.2 . 2 0 _2
172
Fin nt
an
10. ce d a r tme0/24
21. ep ep 1.
d .10
101 ar
.0/2 tme HR 10.31
4 nt
In some cases, computers on the private network behind one VPN peer may (by co-incidence)
have IP addresses that are already used by computers on the network behind the other VPN
peer. In this type of situation (ambiguous routing), conflicts may occur in one or both of the
FortiGate routing tables and traffic destined for the remote network through the tunnel may not
be sent. To resolve issues related to ambiguous routing, see How to work with overlapping
subnets on page 70.
In other cases, computers on the private network behind one VPN peer may obtain IP
addresses from a local DHCP server. However, unless the local and remote networks use
different private network address spaces, unintended ambiguous routing and/or IP-address
overlap issues may arise. For a discussion of the related issues, see FortiGate dialup-client
configurations on page 122.
You can set up a fully meshed or partially meshed configuration (see Figure 6 and Figure 7).
Page 63
Figure 6: Fully meshed configuration
Fo
_2 rtiG
i G ate ate
rt _3
Fo
Fo
1 rtiG
te_ ate
r tiGa _4
Fo
_5
i G ate
rt
Fo
In a fully meshed network, all VPN peers are connected to each other, with one hop between
peers. This topology is the most fault-tolerant: if one peer goes down, the rest of the network is
not affected. This topology is difficult to scale because it requires connections between all
peers. In addition, unnecessary communication can occur between peers. Best practices
dictates a hub-and-spoke configuration instead (see Hub-and-spoke configurations on
page 77).
Fo
_2 rtiG
i G ate ate
rt _3
Fo
Fo
1 rtiG
a te_ ate
i G _4
F ort
_5
i G ate
rt
Fo
A partially meshed network is similar to a fully meshed network, but instead of having tunnels
between all peers, tunnels are only configured between peers that communicate with each
other regularly.
The FortiGate units at both ends of the tunnel must be operating in NAT mode and have static
public IP addresses.
When a FortiGate unit receives a connection request from a remote VPN peer, it uses IPsec
phase 1 parameters to establish a secure connection and authenticate that VPN peer. Then, if
the security policy permits the connection, the FortiGate unit establishes the tunnel using IPsec
phase 2 parameters and applies the IPsec security policy. Key management, authentication,
and security services are negotiated dynamically through the IKE protocol.
To support these functions, the following general configuration steps must be performed by
both FortiGate units:
Define the phase 1 parameters that the FortiGate unit needs to authenticate the remote peer
and establish a secure connection.
Define the phase 2 parameters that the FortiGate unit needs to create a VPN tunnel with the
remote peer.
Create security policies to control the permitted services and permitted direction of traffic
between the IP source and destination addresses.
Using auto-ipsec
In some cases, it may be easier to use the auto-ipsec CLI command to notify and push the
IPsec configuration to the branch offices. Fore more information, refer to the FortiGate CLI
Reference.
Configure the VPN peers as follows. Each step is required, but these are general steps. For
more detailed information on each step follow the cross references. See Auto Key phase 1
parameters on page 35. All steps are required. Cross references point to required information
that is repeated. No steps are optional.
The basic phase 2 settings associate IPsec phase 2 parameters with the phase 1 configuration
and specify the remote end point of the VPN tunnel. Before you define the phase 2 parameters,
you need to reserve a name for the tunnel. See Phase 2 configuration on page 27.
4. Configure any additional features such as UTM or traffic shaping you may want. (optional).
5. Select Create New to create another policy for the other direction.
6. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
7. Enter the following information, and select OK.
8. Configure any additional features such as UTM or traffic shaping you may want. (optional).
Device FGT2_to_FGT1_Tunnel
VPN Tunnel Select Use Existing and select peer_1 from the VPN Tunnel drop-down
list.
Select Allow traffic to be initiated from the remote site to enable traffic
from the remote network to initiate the tunnel.
Place VPN policies in the policy list above any other policies having similar source and
destination addresses.
A site-to-site VPN configuration sometimes has the problem that the private subnet addresses
at each end are the same. You can resolve this problem by remapping the private addresses
using virtual IP addresses (VIP).
VIPs allow computers on those overlapping private subnets to each have another set of IP
addresses that can be used without confusion. The FortiGate unit maps the VIP addresses to
the original addresses. This means if PC1 starts a session with PC2 at 10.31.101.10,
FortiGate_2 directs that session to 10.11.101.10 the actual IP address of PC2. Figure 8
shows this Finance network VIP is 10.21.101.0/24 and the HR network is 10.31.101.0/24.
.1
rt 2 .30
17
Po 2.16
P .20
2.
or .1
16
17
t2
FGT1_to_FGT2
rt 1 10 PC 2
P
10 Fo Po
or
.10
PC 1.10 ate ate 1.1
10.
1 rtiG _2 0
Fo
Fin
an HR
1 ce 1 ne
( VI 0.11. netw ( VI 0.11. twor
P 1 10 or P 1 10 k
0.2 1.0 k 0.3 1.0
1.1 /24 1.1 /24
01 01
.0/ .0/
24 24
) )
Name Enter vpn-local. A meaningful name for the local private network.
Type Subnet
Interface Any
Type Subnet
Interface Any
Testing
The best testing is to look at the packets both as the VPN tunnel is negotiated, and when the
tunnel is up.
11.Start debugging:
diag debug app ike 255
diag debug enable
12.Have the remote end attempt a VPN connection.
If the remote end attempts the connection they become the initiator. This situation makes it
easier to debug VPN tunnels because then you have the remote information and all of your
local information. by initiate the connection, you will not see the other ends information.
13.If possible go to the web-based manager on your FortiGate unit, go to the VPN monitor and
try to bring the tunnel up.
14.Stop the debug output:
diag debug disable
initiator Starts the VPN attempt, in the above procedure that is the remote
end
R U THERE and dead peer detection (dpd), also known as dead gateway detection
after three failed attempts to contact the remote end it will be
R U THERE ack
declared dead, no farther attempts will be made to contact it
This section describes how to set up hub-and-spoke IPsec VPNs. The following topics are
included in this section:
Configuration overview
Configure the hub
Configure the spokes
Dynamic spokes configuration example
Configuration overview
In a hub-and-spoke configuration, VPN connections radiate from a central FortiGate unit (the
hub) to a number of remote peers (the spokes). Traffic can pass between private networks
behind the hub and private networks behind the remote peers. Traffic can also pass between
remote peer private networks through the hub.
Site_1 Site_2
Sp _2
ok
e_ oke
1 Sp
b
Hu
HR network
Finance network
Page 77
Hub-and-spoke infrastructure requirements
The FortiGate hub must be operating in NAT mode and have a static public IP address.
Spokes may have static IP addresses, dynamic IP addresses (see FortiGate dialup-client
configurations on page 122), or static domain names and dynamic IP addresses (see
Dynamic DNS configuration on page 93).
All spokes use the large subnet address, 10.1.0.0/16 for example, as
the IPsec destination selector
the destination of the security policy from the private subnet to the VPN (required for
policy-based VPN, optional for route-based VPN)
the destination of the static route to the VPN (route-based)
Each spoke uses the address of its own protected subnet as the IPsec source selector and as
the source address in its VPN security policy. The remote gateway is the public IP address of
the hub FortiGate unit.
Authentication
Authentication is by a common preshared key or by certificates. For simplicity, the examples in
this chapter assume that all spokes use the same preshared key.
Local Interface Select the FortiGate interface that connects to the remote gateway.
This is usually the FortiGate units public interface.
Enable IPsec You must select Advanced to see this setting. If IPsec Interface
Interface Mode Mode is enabled, the FortiGate unit creates a virtual IPsec interface
for a route-based VPN. Disable this option if you want to create a
policy-based VPN. For more information, see Comparing
policy-based or route-based VPNs on page 19.
After you select OK to create the phase 1 configuration, you cannot
change this setting.
2. Define the phase 2 parameters needed to create a VPN tunnel with each spoke. See Phase
2 parameters on page 51. Enter these settings in particular:
Phase 1 Select the name of the phase 1 configuration that you defined for
this spoke.
To add policies
1. Go to Policy > Policy > Policy and select Create New.
2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
Incoming Interface Select the VPN Tunnel (IPsec Interface) you configured in Step 1.
Source Address Select the address name you defined in Step 2 for the private network
behind the spoke FortiGate unit.
Outgoing Interface Select the hubs interface to the internal (private) network.
Destination Address Select the source address that you defined in Step 1.
Incoming Interface Select the VPN Tunnel (IPsec Interface) you configured in Step 1.
Source Address Select the address name you defined in Step 2 for the private network
behind the spoke FortiGate units.
Outgoing Interface Select the source address that you defined in Step 1.
Destination Address Select the hubs interface to the internal (private) network.
To add policies
1. Go to Policy > Policy > Policy and select Create New.
2. Select the Policy Type as VPN and leave the Policy Subtype as IPsec.
3. Enter these settings in particular:
Local Interface Select the hubs interface to the internal (private) network.
Local Protected Subnet Select the source address that you defined in Step 1.
Remote Protected Subnet Select the address name you defined in Step 2 for the private
network behind the spoke FortiGate unit.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration that you created for the spoke in Step 1.
Select Allow traffic to be initiated from the remote site to enable
traffic from the remote network to initiate the tunnel.
Incoming Interface Select the zone you created for your VPN.
Outgoing Interface Select the zone you created for your VPN.
Source Address Select the address of the private network behind Spoke 1.
Destination Address Select the address of the private network behind Spoke 2.
Although this procedure assumes that the spokes are all FortiGate units, a spoke could also be
VPN client software, such as FortiClient Endpoint Security.
Perform these steps at each FortiGate unit that will act as a spoke.
IP Address Type the IP address of the interface that connects to the hub.
Enable IPsec Enable if you are creating a route-based VPN. Clear if you are
Interface Mode creating a policy-based VPN
2. Create the phase 2 tunnel definition. See Phase 2 parameters on page 51. Select the set of
phase 1 parameters that you defined for the hub. You can select the name of the hub from
the Static IP Address part of the list.
Outgoing Interface Select the spokes interface to the internal (private) network.
Incoming Interface Select the spokes interface to the internal (private) network.
Destination Address Select the hub destination addresses you defined in Step 2.
Local Interface Select the spokes interface to the internal (private) network.
Local Protected Subnet Select the spoke address you defined in Step 1.
Outgoing VPN Interface Select the spokes interface to the external (public) network.
Remote Protected Subnet Select the hub address you defined in Step 2.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration you defined.
Select Allow traffic to be initiated from the remote site to
enable traffic from the remote network to initiate the tunnel.
Source Address Select the spoke address group you defined in Step 1.
Outgoing Interface Select the spokes interface to the internal (private) network.
4. Select Create New, leave the Policy Type as Firewall and leave the Policy Subtype as
Address, and enter these settings:
Incoming Interface Select the spokes interface to the internal (private) network.
Destination Address Select the spoke address group you defined in Step 1.
Outgoing VPN Select the spokes interface to the external (public) network.
Interface
Remote Protected Select the spoke address group you defined in Step 1.
Subnet
VPN Tunnel Select Use Existing and select the name of the phase 1 configuration
you defined.
Select Allow traffic to be initiated from the remote site to enable traffic
from the remote network to initiate the tunnel.
Place this policy or policies in the policy list above any other policies having similar source and
destination addresses.
This example demonstrates how to set up a basic route-based hub-and-spoke IPsec VPN that
uses preshared keys to authenticate VPN peers.
Site_1 Site_2
10.1.1.0/24 10.1.2.0/24
Sp _2
ok
e_ oke
1 Sp
_1
ate
rtiG
Fo b) 172.16.10.1
( Hu
HR network
10.1.0.0/24
In the example configuration, the protected networks 10.1.0.0/24, 10.1.1.0/24 and 10.1.2.0/24
are all part of the larger subnet 10.1.0.0/16. The steps for setting up the example
hub-and-spoke configuration create a VPN among Site 1, Site 2, and the HR Network.
The spokes are dialup. Their addresses are not part of the configuration on the hub, so only one
spoke definition is required no matter the number of spokes. For simplicity, only two spokes are
shown.
Mode Main
The basic phase 2 settings associate IPsec phase 2 parameters with the phase 1 configuration
and specify the remote end points of the VPN tunnels.
Phase 1 Select the Phase 1 configuration that you defined previously (for
example, toSpokes).
Type Subnet
To define the security policy for traffic from the hub to the spokes
1. Go to Policy > Policy > Policy. and select Create New,
2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3. Enter the following information, and select OK:
Outgoing Interface Select the virtual IPsec interface that connects to the spokes,
toSpokes.
Place the policy in the policy list above any other policies having similar source and destination
addresses.
4. Select OK.
Mode Main
Pre-shared Key Enter the preshared key. The value must be identical to the
preshared key that you specified previously in the FortiGate_1
configuration
Enable IPsec Select Advanced to see this option. Enable the option to create a
Interface Mode route-based VPN.
Phase 1 Select the name of the phase 1 configuration that you defined
previously, for example, toHub.
Type Subnet
Subnet/IP Range Enter the IP address of the private network behind the spoke.
For spoke_1, this is 10.1.1.0/24.
For spoke_2, this is 10.1.2.0/24.
Type Subnet
Outgoing Interface Select the interface to the internal (private) network, port1.
Destination Address Select the address for this spokes protected network LocalNet.
Incoming Interface Select the interface to the internal private network, port1.
Source Address Select the address for this spokes protected network, LocalNet.
Place these policies in the policy list above any other policies having similar source and
destination addresses.
This section describes how to configure a site-to-site VPN, in which one FortiGate unit has a
static IP address and the other FortiGate unit has a domain name and a dynamic IP address.
The following topics are included in this section:
Dynamic DNS over VPN concepts
Dynamic DNS topology
General configuration steps
Configure the dynamically-addressed VPN peer
Configure the fixed-address VPN peer
Testing
A typical computer has a static IP address and one or more DNS servers to resolve fully
qualified domain names (FQDN) into IP addresses. A domain name assigned to this computer is
resolved by any DNS server having an entry for the domain name and its static IP address. The
IP address never changes or changes only rarely so the DNS server can reliably say it has the
correct address for that domain all the time.
Routing
When an interface has some form of changing IP address (DDNS, PPPoE, or DHCP assigned
address), routing needs special attention. The standard static route cannot handle the changing
IP address. The solution is to use the dynamic-gateway command in the CLI. Say for example
you already have four static routes, and you have a PPPoE connection over the wan2 interface
and you want to use that as your default route.
The route is configured on the dynamic address VPN peer trying to access the static address
FortiGate unit.
Page 93
To configure dynamic gateway routing - CLI
config router static
edit 5
set dst 0.0.0.0 0.0.0.0
set dynamic-gateway enable
set device wan2
next
end
For more information on DDNS, see the System Administration guide.
Remote Gateway
When configuring the Phase 1 entry for a VPN tunnel, the Remote Gateway determines the
addressing method the remote end of the tunnel uses as one of Static IP Address, Dialup User,
or Dynamic DNS. There are different fields for each option.
When you select the Dynamic DNS VPN type there is a related field called Dynamic DNS. The
Dynamic DNS field is asking for the FQDN of the remote end of the tunnel. It uses this
information to look up the IP address of the remote end of the tunnel through the DDNS server
associated with that domain name.
In this scenario, two branch offices each have a FortiGate unit and are connected in a
gateway-to-gateway VPN configuration. One FortiGate unit has a domain name (example.com)
with a dynamic IP address. See branch_2 in Figure 12.
Whenever the branch_2 unit connects to the Internet (and possibly also at predefined intervals
set by the ISP), the ISP may assign a different IP address to the FortiGate unit. The unit has its
domain name registered with a dynamic DNS service. The branch_2 unit checks in with the
DDNS server on a regular basis, and that server provides the DNS information for the domain
name, updating the IP address from time to time. Remote peers have to locate the branch_2
FortiGate unit through a DNS lookup each time to ensure the address they get is current and
correct.
er bra
erv nc _2
NS
s h_ nch 10.
D .0/2
4 1 bra 10.
68.
1 10.
.1 0/2
192 4
exa
.20
.1 mp
.16 le.c
172 om
NS
ic D
y n am r
D erve
s
When a remote peer (such as the branch_1 FortiGate unit in Figure 12) initiates a connection
to example.com, the local DNS server looks up and returns the IP address that matches the
domain name example.com. The remote peer uses the retrieved IP address to establish a VPN
connection with the branch_2 FortiGate unit.
Assumptions
You have administrator access to both FortiGate units.
Both FortiGate units have interfaces named wan1 and internal. (If not, you can use the alias
feature to assign these labels as nicknames to other interfaces to follow this example.)
Both FortiGate units have the most recent firmware installed, have been configured for their
networks, and are currently passing normal network traffic.
The branch_2 FortiGate unit has its wan1 interface defined as a dynamic DNS interface
with the domain name of example.com.
A basic gateway-to-gateway configuration is in place (see Gateway-to-gateway
configurations on page 63) except one of the FortiGate units has a static domain name and
a dynamic IP address instead of a static IP address.
The FortiGate unit with the domain name is subscribed to one of the supported dynamic
DNS services. Contact one of the services to set up an account. For more information and
instructions about how to configure the FortiGate unit to push its dynamic IP address to a
dynamic DNS server, see the System Administration guide
When a FortiGate unit receives a connection request from a remote VPN peer, it uses IPsec
phase 1 parameters to establish a secure connection and authenticate the VPN peer. Then, if
the security policy permits the connection, the FortiGate unit establishes the tunnel using IPsec
phase 2 parameters and applies the security policy. Key management, authentication, and
security services are negotiated dynamically through the IKE protocol.
It is assumed that this FortiGate unit (branch_2) has already had its public facing interface, for
example the wan1, configured with the proper dynamic DNS configuration.
ver bra
_2
S ser nc
h_ nch 10.
DN .0/2
4 1 bra 10.
.1 10.
168 0/2
192. 4
exa
0.1 m
.1 6.2 IP = ple.c
172 ? om
S
DN
n a mic
Dy erve r
s
Name Enter branch_2, a name to identify the VPN tunnel. This name
appears in phase 2 configurations, security policies, and the VPN
monitor.
Enable IPsec Enable for a route-based VPN and when configuring policies, go to
Interface Mode Creating branch_2 route-based security policies on page 100.
Disable for a policy-based VPN and when configuring policies, go to
Creating branch_2 policy-based security policies on page 101.
If enabled, default settings are used.
Interface Select internal. The interface that will be handling the traffic from the
internal network.
Define an address name for the IP address and netmask of the private network behind the
remote peer.
4. Select Create New.
5. Enter the following information, and select OK.
Define a policy to permit the branch_1 remote VPN peer to initiate VPN sessions.
1. Select Create New.
2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3. Enter the following information, and select OK.
Source Address Select branch_1_internal. The address name for the private network
behind the remote peer.
Outgoing Interface Select internal. The interface connecting the private network behind
this FortiGate unit.
Destination Address Select branch_2_internal. The address name for the private network
behind this FortiGate unit.
Dynamic DNS configuration Page 100 IPsec VPN for FortiOS 5.0
4. Optionally configure any other security policy settings you require such as UTM or traffic
shaping for this policy.
5. Place these policies in the policy list above any other policies having similar source and
destination addresses. This will ensure VPN traffic is matched against the VPN policies
before any other policies.
Local Interface Select internal. The interface connecting the private network behind
this FortiGate unit.
Local Protected Select branch_2_internal. The address name for the private network
Subnet behind this local FortiGate unit.
Remote Protected Select branch_1_internal. The address name for the private network
Subnet behind branch_1, the remote peer.
VPN Tunnel Select Use Existing and select branch_2 from the drop-down list.
The name of the phase 1 tunnel.
4. Optionally configure any other security policy settings you require such as UTM or traffic
shaping for this policy.
5. Place these policies in the policy list above any other policies having similar source and
destination addresses. This will ensure VPN traffic is matched against the VPN policies
before any other policies.
Dynamic DNS configuration Page 101 IPsec VPN for FortiOS 5.0
Configure the fixed-address VPN peer
The fixed-address VPN peer, branch_1, needs to retrieve the IP address from the dynamic DNS
service to initiate communication with the dynamically-addressed peer, branch_2. It also
depends on the peer ID (local ID) to initiate the VPN tunnel with branch_2.
ver bra
_2
S ser nc
h_ nch 10.
DN /24 1 bra 10.
8.1.0 10.
.16 0/2
192 4
exa
20.1 m
. 16. IP = ple.c
172 ? om
N S
m ic D
a
Dyn erver
s
Name Enter branch_1. A name to identify the VPN tunnel. This name
appears in phase 2 configurations, security policies and the VPN
monitor.
Remote Gateway Select Dynamic DNS. The remote peer this FortiGate is connecting
to has a dynamic IP address.
Dynamic DNS Type the fully qualified domain name of the remote peer (for
example, example.com).
Dynamic DNS configuration Page 102 IPsec VPN for FortiOS 5.0
Peer Options Select Accept this peer ID, and enter example.com. This option
only appears when the mode is set to Aggressive. The identifier of
the FortiGate unit with the dynamic address.
Enable IPsec Enable for a route-based VPN and when configuring policies, go to
Interface Mode Creating branch_1 route-based security policies on page 104.
Disable for a policy-based VPN and when configuring policies, go to
Creating branch_1 policy-based security policies on page 105.
If Interface mode is enabled, default settings are used.
4. Define the phase 2 parameters needed to create a VPN tunnel with the remote peer. See
Phase 2 parameters on page 51. Enter these settings in particular:
Interface Select internal. This is the interface on this FortiGate unit that will be
handling with this traffic.
4. Define an address name for the IP address and netmask of the private network behind the
remote peer.
5. Select Create New.
Dynamic DNS configuration Page 103 IPsec VPN for FortiOS 5.0
6. Enter the following information, and select OK.
Interface Select any. The interface on this FortiGate unit that will be handling
with this traffic. If you are unsure, or multiple interfaces may be
handling this traffic use any.
Incoming Interface Select internal. The interface that connects to the private network
behind the branch_1 FortiGate unit.
Source Address Select branch_1_internal. The address name that you defined for the
private network behind this FortiGate unit.
Outgoing Interface Select branch_1. The VPN Tunnel (IPsec Interface) you configured
earlier.
Destination Address Select branch_2_internal. The address name that you defined for the
private network behind the branch_2 peer.
To permit the remote client to initiate communication, you need to define a security policy for
communication in that direction.
4. Select Create New.
5. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
6. Enter the following information, and select OK.
Incoming Interface Select branch_1. The VPN Tunnel (IPsec Interface) you configured
earlier.
Source Address Select branch_2_internal. The address name that you defined for the
private network behind the branch_2 remote peer.
Outgoing Interface Select internal. The interface that connects to the private network
behind this FortiGate unit.
Dynamic DNS configuration Page 104 IPsec VPN for FortiOS 5.0
Destination Address Select branch_1_internal. The address name that you defined for the
private network behind this FortiGate unit.
Local Interface Select internal. The interface that connects to the private network
behind this FortiGate unit.
Local Protected Select branch_1_internal. The address name that you defined for the
Subnet private network behind this FortiGate unit.
Remote Protected Select branch_2_internal. The address name that you defined for the
Subnet private network behind the remote peer.
VPN Tunnel Select Use Existing and select branch_1 from the drop-down list.
Select Allow traffic to be initiated from the remote site to enable
traffic from the remote network to initiate the tunnel.
4. Place this security policy in the policy list above any other policies having similar source and
destination addresses.
Testing
Once both ends are configured, you can test the VPN tunnel.
Dynamic DNS configuration Page 105 IPsec VPN for FortiOS 5.0
To test the VPN initiated by branch_1
1. On branch_1, go to VPN > Monitor > IPsec Monitor.
2. Select the tunnel listed for branch_1, and select the status column.
The difference between branch_2 and branch_1 at this point is that the tunnel entry for
branch-1 will not have a remote gateway IP address. It will be resolved when the VPN tunnel
is started.
3. If this does not create a VPN tunnel with increasing values for incoming and outgoing data,
you need to start troubleshooting.
Some troubleshooting ideas include:
If there was no entry for the tunnel on the monitor page, check the Auto Key (IKE) page to
verify the phase 1 and phase 2 entries exist.
Check the security policy or policies, and ensure there is an outgoing policy as a minimum.
Check that you entered a local ID in the phase 1 configuration, and that branch_1 has the
same local ID.
Ensure the local DNS server has an up-to-date DNS entry for exmaple.com.
For more information on VPN troubleshooting and testing, see VPN troubleshooting tips on
page 221.
Dynamic DNS configuration Page 106 IPsec VPN for FortiOS 5.0
FortiClient dialup-client configurations
The FortiClient Endpoint Security application is an IPsec VPN client with antivirus, antispam and
firewall capabilities. This section explains how to configure dialup VPN connections between a
FortiGate unit and one or more FortiClient Endpoint Security applications.
FortiClient users are usually mobile or remote users who need to connect to a private network
behind a FortiGate unit. For example, the users might be employees who connect to the office
network while traveling or from their homes.
For greatest ease of use, the FortiClient application can download the VPN settings from the
FortiGate unit to configure itself automatically. This section covers both automatic and manual
configuration.
The following topics are included in this section:
Configuration overview
FortiClient-to-FortiGate VPN configuration steps
Configure the FortiGate unit
Configure the FortiClient Endpoint Security application
Adding XAuth authentication
FortiClient dialup-client configuration example
Configuration overview
Dialup users typically obtain dynamic IP addresses from an ISP through Dynamic Host
Configuration Protocol (DHCP) or Point-to-Point Protocol over Ethernet (PPPoE). Then, the
FortiClient Endpoint Security application initiates a connection to a FortiGate dialup server.
By default the FortiClient dialup client has the same IP address as the host PC on which it runs.
If the host connects directly to the Internet, this is a public IP address. If the host is behind a
NAT device, such as a router, the IP address is a private IP address. The NAT device must be
NAT traversal (NAT-T) compatible to pass encrypted packets (see NAT traversal on page 47).
The FortiClient application also can be configured to use a virtual IP address (VIP). For the
duration of the connection, the FortiClient application and the FortiGate unit both use the VIP
address as the IP address of the FortiClient dialup client.
For a faster and easier method of configuring a FortiGate - to - FortiClient VPN, see One button
FortiGate - to - FortiClient Phase1 VPN on page 109.
The FortiClient application sends its encrypted packets to the VPN remote gateway, which is
usually the public interface of the FortiGate unit. It also uses this interface to download VPN
settings from the FortiGate unit. See Automatic configuration of FortiClient dialup clients on
page 108.
Page 107
Figure 15:Example FortiClient dialup-client configuration
Dialup_1
_1
ate
tr iG
Fo
Site_1 Dialup_2
Dialup_3
Peer identification
The FortiClient application can establish an IPsec tunnel with a FortiGate unit configured to act
as a dialup server. When the FortiGate unit acts as a dialup server, it does not identify the client
using the phase 1 remote gateway address. The IPsec tunnel is established if authentication is
successful and the IPsec security policy associated with the tunnel permits access. If
configured, the FortiGate unit could also require FortiClient registration, that is, the remote user
would be required to have FortiClient installed before connection is completed.
There are several different ways to authenticate dialup clients and restrict access to private
networks based on client credentials. For more information, see Authenticating remote peers
and clients on page 40.
FortiClient dialup-client configurations Page 108 IPsec VPN for FortiOS 5.0
One button FortiGate - to - FortiClient Phase1 VPN
On the FortiOS VPN IKE page there is a method to create a Phase1 portion of a VPN tunnel
between the FortiGate and FortiClient. Very little information is required for this configuration.
No encryption or authentication method is required. This feature is ideal for setting up quick
VPN connections with basic settings.
On the Phase 1 screen (VPN > IPsec > Phase 1) is the option Create a FortiClient VPN. When
selected, the FortiGate uint requires a few basic VPN configuration related questions. Once all
the information is added, select OK. This will create a new dial-up IPsec-interface mode tunnel.
Phase 1 and Phase 2 will be added using the default ike settings.
The following Settings will be used when creating a one-button FortiClient VPN Phase1 object:
Remote Gateway: Dialup User
Mode: Aggressive
Enable IPSec Interface Mode
Default setting for P1 and P2 Proposal
XAUTH Enable as Server (Auto)
IKE mode-config will be enabled
Peer Option set to Accept any peer ID
Rest of the setting use the current defaults (Default value needs to be the same on FCT side)
Once the completed, you need tocreate a default Phase2 configuration. This only requires a
name for the Phase2 object, and select the FortiClient connection Phase1 name.
FortiClient dialup-client configurations Page 109 IPsec VPN for FortiOS 5.0
ensure this by reserving a range of IP addresses on the private network for FortiClient users. Or,
you can assign FortiClient VIPs from an uncommonly used subnet such as 10.254.254.0/24 or
192.168.254.0/24.
You can reserve a VIP address for a particular client according to its device MAC address and
type of connection. The DHCP server then always assigns the reserved VIP address to the
client. For more information about this feature, see the dhcp reserved-address section in the
system chapter of the FortiGate CLI Reference.
On the host computer, you can find out the VIP address that the FortiClient Endpoint Security
application is using. For example, in Windows command prompt, type ipconfig /all
On Linux or Mac OS X, type ifconfig in a terminal window. The output will also show the IP
address that has been assigned to the host Network Interface Card (NIC).
It is best to assign VIPs using DHCP over IPsec. The FortiGate dialup server can act as a DHCP
server or relay requests to an external DHCP server. You can also configure VIPs manually on
FortiClient applications, but it is more difficult to ensure that all clients use unique addresses.
If you assign a VIP on the private network behind the FortiGate unit and enable DHCP-IPsec (a
phase 2 advanced option), the FortiGate unit acts as a proxy on the local private network for the
FortiClient dialup client. Whenever a host on the network behind the dialup server issues an
ARP request for the device MAC address of the FortiClient host, the FortiGate unit answers the
ARP request on behalf of the FortiClient host and forwards the associated traffic to the
FortiClient host through the tunnel. For more information, see DHCP-IPsec on page 53
FortiGate units fully support RFC 3456. The FortiGate DHCP over IPsec feature can be enabled
to allocate VIP addresses to FortiClient dialup clients using a FortiGate DHCP server.
Figure 16 shows an example of a FortiClient-to-FortiGate VPN where the FortiClient application
is assigned a VIP on an uncommonly used subnet. The diagram also shows that while the
destination for the information in the encrypted packets is the private network behind the
FortiGate unit, the destination of the IPsec packets themselves is the public interface of the
FortiGate unit that acts as the end of the VPN tunnel.
FortiClient dialup-client configurations Page 110 IPsec VPN for FortiOS 5.0
Figure 16:IP address assignments in a FortiClient dialup-client configuration
Traffic destination
10.11.101.2
Dialup client
3 1 3 1
2 2
VIP address
10.254.254.100
IPSec packets
Destination 172.20.120.141
IPSec packets
Destination 172.20.120.141
3 1
2
172.20.120.141
1 3
2 Fo
rtiG
ate
Traffic destination _1
10.11.101.2
10.11.101.2
FortiClient dialup-client configurations Page 111 IPsec VPN for FortiOS 5.0
FortiClient-to-FortiGate VPN configuration steps
Configuring dialup client capability for FortiClient dialup clients involves the following general
configuration steps:
1. If you will be using VIP addresses to identify dialup clients, determine which VIP addresses
to use. As a precaution, consider using VIP addresses that are not commonly used.
2. Configure the FortiGate unit to act as a dialup server. See Configure the FortiGate unit on
page 112.
3. If the dialup clients will be configured to obtain VIP addresses through DHCP over IPsec,
configure the FortiGate unit to act as a DHCP server or to relay DHCP requests to an
external DHCP server.
4. Configure the dialup clients. See Configure the FortiClient Endpoint Security application on
page 116.
When a FortiGate unit has been configured to accept connections from FortiClient
dialup-clients, you can optionally arrange to have an IPsec VPN configuration downloaded to
FortiClient dialup clients automatically. For more information, see Configuring the FortiGate
unit as a VPN policy server on page 115.
Configuring the FortiGate unit to establish VPN connections with FortiClient Endpoint Security
users involves the following steps:
Configure the VPN settings
If the dialup clients use automatic configuration, configure the FortiGate unit as a VPN policy
server
If the dialup clients obtain VIP addresses by DHCP over IPsec, configure an IPsec DHCP
server or relay
The procedures in this section cover basic setup of policy-based and route-based VPNs
compatible with FortiClient Endpoint Security. A route-based VPN is simpler to configure.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, security policies and the VPN monitor.
Local Interface Select the interface through which clients connect to the FortiGate
unit.
FortiClient dialup-client configurations Page 112 IPsec VPN for FortiOS 5.0
Mode Select Main (ID Protection).
Pre-shared Key Enter the pre-shared key. This must be the same preshared key
provided to the FortiClient users.
Enable IPsec You must select Advanced to see this setting. If IPsec Interface
Interface Mode Mode is enabled, the FortiGate unit creates a virtual IPsec interface
for a route-based VPN.
2. Define the phase 2 parameters needed to create a VPN tunnel with the FortiClient peer. See
Phase 2 parameters on page 51. Enter these settings in particular:
Phase 1 Select the name of the phase 1 configuration that you defined.
3. Define names for the addresses or address ranges of the private networks that the VPN
links. These addresses are used in the security policies that permit communication between
the networks. For more information, see Defining policy addresses on page 57.
Enter these settings in particular:
Define an address name for the individual address or the subnet address that the dialup
users access through the VPN.
If FortiClient users are assigned VIP addresses, define an address name for the subnet to
which these VIPs belong.
4. Define security policies to permit communication between the private networks through the
VPN tunnel. Route-based and policy-based VPNs require different security policies. For
detailed information about creating security policies, see Defining VPN security policies on
page 58.
If the security policy, which grants the VPN Connection is limited to certain services, DHCP
must be included, otherwise the client wont be able to retrieve a lease from the FortiGates
(IPSec) DHCP server, because the DHCP Request (coming out of the tunnel) will be blocked.
Incoming Interface Select the VPN Tunnel (IPsec Interface) you configured in Step 1.
FortiClient dialup-client configurations Page 113 IPsec VPN for FortiOS 5.0
Outgoing Interface Select the interface that connects to the private network behind this
FortiGate unit.
If you want to allow hosts on the private network to initiate communications with the FortiClient
users after the tunnel is established, you need to define a security policy for communication in
that direction.
1. Go to Policy > Policy > Policy and select Create New.
2. Leave the Policy Type as Firewall and leave the Policy Subtype as Address.
3. Enter these settings in particular:
Incoming Interface Select the interface that connects to the private network behind this
FortiGate unit.
Outgoing Interface Select the interface that connects to the private network behind this
FortiGate unit.
Local Interface Select the interface that connects to the private network behind
this FortiGate unit.
Local Protected Subnet Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Remote Protected If FortiClient users are assigned VIPs, select the address name
Subnet that you defined in Step 3 for the VIP subnet. Otherwise, select
All.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration that you created in Step 1.
Select Allow traffic to be initiated from the remote site to enable
traffic from the remote network to initiate the tunnel.
FortiClient dialup-client configurations Page 114 IPsec VPN for FortiOS 5.0
Place VPN policies in the policy list above any other policies having similar source and
destination addresses.
FortiClient dialup-client configurations Page 115 IPsec VPN for FortiOS 5.0
5. Open the Advanced... menu and select Server for the Mode option.
6. For the Type, select IPsec.
7. Select OK.
The following procedure explains how to configure the FortiClient Endpoint Security application
to communicate with a remote FortiGate dialup server using the VIP address that you specify
manually. These procedures are based on FortiClient 5.0.
Configuring FortiClient
This procedure explains how to configure the FortiClient application manually using the default
IKE and IPsec settings. For more information, refer to the FortiClient Administration Guide.
This procedure includes instructions for configuring a virtual IP for the FortiClient application,
either manually or using DHCP over IPsec.
Remote Gateway Enter the IP address or the fully qualified domain name (FQDN) of the
remote gateway.
3. Select OK.
FortiClient dialup-client configurations Page 116 IPsec VPN for FortiOS 5.0
FortiClient dialup-client configuration example
This example demonstrates how to set up a FortiClient dialup-client IPsec VPN that uses
preshared keys for authentication purposes. In the example configuration, the DHCP over IPsec
feature is enabled in the FortiClient Endpoint Security application so that the FortiClient
Endpoint Security application can acquire a VIP address through the FortiGate DHCP server.
Both route-based and policy-based solutions are covered.
Dialup_1
1 VIP address
te_
r t iGa Po 10.254.254.1
o
LAN
F 17 rt 1
2.2
10.11.101.0/24 0.1
20.1 Dialup_2
Po 41
rt 2
VIP address
10.254.254.2
Configuring FortiGate_1
When a FortiGate unit receives a connection request from a dialup client, it uses IPsec phase 1
parameters to establish a secure connection and authenticate the client. Then, if the security
policy permits the connection, the FortiGate unit establishes the tunnel using IPsec phase 2
parameters and applies the IPsec security policy. Key management, authentication, and
security services are negotiated dynamically through the IKE protocol.
FortiClient dialup-client configurations Page 117 IPsec VPN for FortiOS 5.0
To support these functions, the following general configuration steps must be performed at the
FortiGate unit:
Define the phase 1 parameters that the FortiGate unit needs to authenticate the dialup
clients and establish a secure connection. See To define the phase 1 parameters on
page 118.
Define the phase 2 parameters that the FortiGate unit needs to create a VPN tunnel and
enable all dialup clients having VIP addresses on the 10.254.254.0/24 network to connect
using the same tunnel definition. See To define the phase 2 parameters on page 118.
Create security policy to control the permitted services and permitted direction of traffic
between the IP source address and the dialup clients. See To define the firewall addresses
on page 119.
Configure the FortiGate unit to service DHCP requests from dialup clients. See Configuring
the FortiClient Endpoint Security application on page 120.
Name todialups
Mode Main
Advanced Select
Name td_2
Phase 1 todialups
Advanced DHCP-IPsec
FortiClient dialup-client configurations Page 118 IPsec VPN for FortiOS 5.0
To define the firewall addresses
1. Go to Firewall Objects > Address > Addresses.
2. Select Create New, enter the following information, and select OK:
Name internal_net
Type Subnet
Interface Port 2
3. Select Create New, enter the following information, and select OK:
Name dialups
Type IP Range
The security policies for route-based and policy-based VPNs are described in separate sections
below.
Action ACCEPT
FortiClient dialup-client configurations Page 119 IPsec VPN for FortiOS 5.0
Action ACCEPT
Service DHCP
Action ACCEPT
10.Place these policies in the policy list above any other policies having similar source and
destination addresses.
The policy in step 7 is required for DHCP to function properly for policy-based VPNs. You can
omit this policy if you change the Destination Address Name to all in the step before.
Route-based policies are not affected by this.
VPN Tunnel Select Use Existing and select todialups from the
drop-down list.
4. Place the policy in the policy list above any other policies having similar source and
destination addresses.
FortiClient dialup-client configurations Page 120 IPsec VPN for FortiOS 5.0
address acquired through FortiGate DHCP relay as its IP source address for the duration of the
connection.
To configure FortiClient
1. Go to Remote Access and select the down-arrow for the VPN connection.
2. Select Add new connection and complete following information:
3. Select OK.
FortiClient dialup-client configurations Page 121 IPsec VPN for FortiOS 5.0
FortiGate dialup-client configurations
This section explains how to set up a FortiGate dialup-client IPsec VPN. In a FortiGate
dialup-client configuration, a FortiGate unit with a static IP address acts as a dialup server and a
FortiGate unit having a dynamic IP address initiates a VPN tunnel with the FortiGate dialup
server.
The following topics are included in this section:
Configuration overview
FortiGate dialup-client configuration steps
Configure the server to accept FortiGate dialup-client connections
Configure the FortiGate dialup client
Configuration overview
A dialup client can be a FortiGate unit. The FortiGate dialup client typically obtains a dynamic IP
address from an ISP through the Dynamic Host Configuration Protocol (DHCP) or Point-to-Point
Protocol over Ethernet (PPPoE) before initiating a connection to a FortiGate dialup server.
_1 FG
ate _D
t i G ialu
For p
Site_1 Site_2
In a dialup-client configuration, the FortiGate dialup server does not rely on a phase 1 remote
gateway address to establish an IPsec VPN connection with dialup clients. As long as
authentication is successful and the IPsec security policy associated with the tunnel permits
access, the tunnel is established.
Several different ways to authenticate dialup clients and restrict access to private networks
based on client credentials are available. To authenticate FortiGate dialup clients and help to
distinguish them from FortiClient dialup clients when multiple clients will be connecting to the
VPN through the same tunnel, best practices dictate that you assign a unique identifier (local ID
Page 122
or peer ID) to each FortiGate dialup client. For more information, see Authenticating remote
peers and clients on page 40.
Whenever you add a unique identifier (local ID) to a FortiGate dialup client for identification
purposes, you must select Aggressive mode on the FortiGate dialup server and also specify the
identifier as a peer ID on the FortiGate dialup server. For more information, see Enabling VPN
access with user accounts and pre-shared keys on page 43.
Users behind the FortiGate dialup server cannot initiate the tunnel because the FortiGate dialup
client does not have a static IP address. After the tunnel is initiated by users behind the
FortiGate dialup client, traffic from the private network behind the FortiGate dialup server can
be sent to the private network behind the FortiGate dialup client.
Encrypted packets from the FortiGate dialup client are addressed to the public interface of the
dialup server. Encrypted packets from the dialup server are addressed either to the public IP
address of the FortiGate dialup client (if the dialup client connects to the Internet directly), or if
the FortiGate dialup client is behind a NAT device, encrypted packets from the dialup server are
addressed to the public IP address of the NAT device.
If a router with NAT capabilities is in front of the FortiGate dialup client, the router must be NAT-T
compatible for encrypted traffic to pass through the NAT device. For more information, see
NAT traversal on page 47.
When the FortiGate dialup server decrypts a packet from the FortiGate dialup client, the source
address in the IP header may be one of the following values, depending on the configuration of
the network at the far end of the tunnel:
If the FortiGate dialup client connects to the Internet directly, the source address will be the
private IP address of a host or server on the network behind the FortiGate dialup client.
If the FortiGate dialup client is behind a NAT device, the source address will be the public IP
address of the NAT device.
In some cases, computers on the private network behind the FortiGate dialup client may (by
co-incidence) have IP addresses that are already used by computers on the network behind the
FortiGate dialup server. In this type of situation (ambiguous routing), conflicts may occur in one
or both of the FortiGate routing tables and traffic destined for the remote network through the
tunnel may not be sent.
In many cases, computers on the private network behind the FortiGate dialup client will most
likely obtain IP addresses from a local DHCP server behind the FortiGate dialup client. However,
unless the local and remote networks use different private network address spaces, unintended
ambiguous routing and IP-address overlap issues may arise.
To avoid these issues, you can configure FortiGate DHCP relay on the dialup client instead of
using a DHCP server on the network behind the dialup client. The FortiGate dialup client can be
configured to relay DHCP requests from the local private network to a DHCP server that resides
on the network behind the FortiGate dialup server (see Figure 19 on page 124). You configure
the FortiGate dialup client to pass traffic from the local private network to the remote network
by enabling FortiGate DHCP relay on the FortiGate dialup client interface that is connected to
the local private network.
Afterward, when a computer on the network behind the dialup client broadcasts a DHCP
request, the dialup client relays the message through the tunnel to the remote DHCP server. The
remote DHCP server responds with a private IP address for the computer. To avoid ambiguous
routing and network overlap issues, the IP addresses assigned to computers behind the dialup
client cannot match the network address space used by the private network behind the
FortiGate dialup server.
FortiGate dialup-client configurations Page 123 IPsec VPN for FortiOS 5.0
Figure 19:Preventing network overlap in a FortiGate dialup-client configuration
FG
_1 _D
ate ialu
ortiG p
F
Site_2
Site_1
DHCP discovery
message initiates
tunnel
CP
DH er
v
ser
When the DHCP server resides on the private network behind the FortiGate dialup server, the IP
destination address specified in the IPsec security policy on the FortiGate dialup client must
refer to that network.
You must add a static route to the DHCP server FortiGate unit if it is not directly connected to
the private network behind the FortiGate dialup server; its IP address does not match the IP
address of the private network. Also, the destination address in the IPsec security policy on the
FortiGate dialup client must refer to the DHCP server address. The DHCP server must be
configured to assign a range of IP addresses different from the DHCP server's local network,
and also different from the private network addresses behind the FortiGate dialup server. See
Routing on page 93.
FortiGate dialup-client configurations Page 124 IPsec VPN for FortiOS 5.0
FortiGate dialup-client configuration steps
The procedures in this section assume that computers on the private network behind the
FortiGate dialup client obtain IP addresses from a local DHCP server. The assigned IP
addresses do not match the private network behind the FortiGate dialup server.
In situations where IP-address overlap between the local and remote private networks is likely
to occur, FortiGate DHCP relay can be configured on the FortiGate dialup client to relay DHCP
requests to a DHCP server behind the FortiGate dialup server. For more information, see To
configure DHCP relay on a FortiGate interface on page 115.
Configuring dialup client capability for FortiGate dialup clients involves the following general
configuration steps:
Determine which IP addresses to assign to the private network behind the FortiGate dialup
client, and add the IP addresses to the DHCP server behind the FortiGate dialup client. Refer
to the software suppliers documentation to configure the DHCP server.
Configure the FortiGate dialup server. See Configure the server to accept FortiGate
dialup-client connections on page 125.
Configure the FortiGate dialup client. See Configure the FortiGate dialup client on
page 127.
Before you begin, optionally reserve a unique identifier (peer ID) for the FortiGate dialup client.
The dialup client will supply this value to the FortiGate dialup server for authentication purposes
during the IPsec phase 1 exchange. In addition, the value will enable you to distinguish
FortiGate dialup-client connections from FortiClient dialup-client connections. The same value
must be specified on the dialup server and on the dialup client.
1. At the FortiGate dialup server, define the phase 1 parameters needed to authenticate the
FortiGate dialup client and establish a secure connection. See Auto Key phase 1
parameters on page 35. Enter these settings in particular:
Name Enter a name to identify the VPN tunnel. This name appears in phase
2 configurations, security policies and the VPN monitor.
Local Interface Select the interface through which clients connect to the FortiGate
unit.
FortiGate dialup-client configurations Page 125 IPsec VPN for FortiOS 5.0
Peer Options If you will be assigning an ID to the FortiGate dialup client, select
Accept this peer ID and type the identifier that you reserved for the
FortiGate dialup client into the adjacent field.
Enable IPsec You must select Advanced to see this setting. If IPsec Interface
Interface Mode Mode is enabled, the FortiGate unit creates a virtual IPsec interface
for a route-based VPN. Disable this option if you want to create a
policy-based VPN.
After you select OK to create the phase 1 configuration, you cannot
change this setting.
2. Define the phase 2 parameters needed to create a VPN tunnel with the FortiGate dialup
client. See Phase 2 parameters on page 51. Enter these settings in particular:
Phase 1 Select the name of the phase 1 configuration that you defined.
3. Define names for the addresses or address ranges of the private networks that the VPN
links. See Defining policy addresses on page 57. Enter these settings in particular:
Define an address name for the server, host, or network behind the FortiGate dialup
server.
Define an address name for the private network behind the FortiGate dialup client.
4. Define the security policies to permit communications between the private networks through
the VPN tunnel. Route-based and policy-based VPNs require different security policies. For
detailed information about creating security policies, see Defining VPN security policies on
page 58.
Incoming Interface Select the VPN tunnel (IPsec interface) created in Step 1.
Outgoing Interface Select the interface that connects to the private network
behind this FortiGate unit.
FortiGate dialup-client configurations Page 126 IPsec VPN for FortiOS 5.0
Policy-based VPN security policy
1. Go to Policy > Policy > Policy and select Create New.
2. Select the Policy Type of VPN and leave the Policy Subtype as IPsec.
3. Enter these settings in particular:
Local Interface Select the interface that connects to the private network
behind this FortiGate unit.
Local Protected Subnet Select the address name that you defined in Step 3 for
the private network behind this FortiGate unit.
Remote Protected Subnet Select the address name that you defined in Step 3.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration that you created in Step 1. from the
drop-down list.
Select Allow traffic to be initiated from the remote site to
enable traffic from the remote network to initiate the
tunnel.
Clear Allow outbound to prevent traffic from the local
network from initiating the tunnel after the tunnel has
been established.
4. To prevent traffic from the local network from initiating the tunnel after the tunnel has been
established, you need to disable the outbound VPN traffic in the CLI
config firewall policy
edit <policy_number>
set outbound disable
end
Place the policy in the policy list above any other policies having similar source and destination
addresses.
If configuring a route-based policy, configure a default route for VPN traffic on this interface.
Local Interface Select the interface that connects to the public network.
FortiGate dialup-client configurations Page 127 IPsec VPN for FortiOS 5.0
Mode The FortiGate dialup client has a dynamic IP address,
select Aggressive.
Local ID If you defined a peer ID for the dialup client in the FortiGate
dialup server configuration, enter the identifier of the dialup
client. The value must be identical to the peer ID that you
specified previously in the FortiGate dialup server
configuration.
Enable IPsec Interface Mode If IPsec Interface Mode is enabled, the FortiGate unit
creates a virtual IPsec interface for a route-based VPN.
Disable this option if you want to create a policy-based
VPN.
After you select OK to create the phase 1 configuration,
you cannot change this setting.
2. Define the phase 2 parameters needed to create a VPN tunnel with the dialup server. See
Phase 2 parameters on page 51. Enter these settings in particular:
Phase 1 Select the name of the phase 1 configuration that you defined.
3. Define names for the addresses or address ranges of the private networks that the VPN
links. See Defining policy addresses on page 57. Enter these settings in particular:
Define an address name for the server, host, or network behind the FortiGate dialup
server.
Define an address name for the private network behind the FortiGate dialup client.
4. Define security policies to permit communication between the private networks through the
VPN tunnel. Route-based and policy-based VPNs require different security policies. For
detailed information about creating security policies, see Defining VPN security policies on
page 58.
Incoming Interface Select the interface that connects to the private network
behind this FortiGate unit.
Outgoing Interface Select the VPN tunnel (IPsec interface) created in Step 1.
FortiGate dialup-client configurations Page 128 IPsec VPN for FortiOS 5.0
Action Select ACCEPT.
Local Interface Select the interface that connects to the private network
behind this FortiGate unit.
Local Protected Subnet Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Remote Protected Subnet Select the address name that you defined in Step 3 for the
private network behind the dialup server.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration that you created in Step 1 from the
drop-down list.
Clear Allow traffic to be initiated from the remote site to
prevent traffic from the remote network from initiating the
tunnel after the tunnel has been established.
Place the policy in the policy list above any other policies having similar source and destination
addresses.
FortiGate dialup-client configurations Page 129 IPsec VPN for FortiOS 5.0
Supporting IKE Mode config clients
IKE Mode Config is an alternative to DHCP over IPsec. A FortiGate unit can be configured as
either an IKE Mode Config server or client. This chapter contains the following sections:
Automatic configuration overview
IKE Mode Config overview
Configuring IKE Mode Config
Example: FortiGate unit as IKE Mode Config server
Example: FortiGate unit as IKE Mode Config client
VPN configuration for remote clients is simpler if it is automated. Several protocols support
automatic configuration:
The Fortinet FortiClient Endpoint Security application can completely configure a VPN
connection with a suitably configured FortiGate unit given only the FortiGate units address.
This protocol is exclusive to Fortinet. For more information, see the FortiClient dialup-client
configurations chapter.
DHCP over IPsec can assign an IP address, Domain, DNS and WINS addresses. The user
must first configure IPsec parameters such as gateway address, encryption and
authentication algorithms.
IKE Mode Config can configure host IP address, Domain, DNS and WINS addresses. The
user must first configure IPsec parameters such as gateway address, encryption and
authentication algorithms. Several network equipment vendors support IKE Mode Config,
which is described in the ISAKMP Configuration Method document
draft-dukes-ike-mode-cfg-02.txt.
This chapter describes how to configure a FortiGate unit as either an IKE Mode Config server or
client.
Dialup VPN clients connect to a FortiGate unit that acts as a VPN server, providing the client the
necessary configuration information to establish a VPN tunnel. The configuration information
typically includes a virtual IP address, netmask, and DNS server address.
IKE Mode Config is available only for VPNs that are route-based, also known as
interface-based. A FortiGate unit can function as either an IKE Configuration Method server or
client. IKE Mode Config is configurable only in the CLI.
IKE Mode Config is configured with the CLI command config vpn ipsec
phase1-interface. The mode-cfg variable enables IKE Mode Config. The type field
determines whether you are creating an IKE Mode Config server or a client. Setting type to
dynamic creates a server configuration, otherwise the configuration is a client.
Page 130
Configuring an IKE Mode Config client
If the FortiGate unit will connect as a dialup client to a remote gateway that supports IKE Mode
Config, the relevant vpn ipsec phase1-interface variables are as follows:
Variable Description
ike-version 1 IKE v1 is the default for FortiGate IPsec VPNs.
IKE Mode Config is also compatible with IKE v2
(RFC 4306).
mode-cfg enable Enable IKE Mode Config.
type {ddns | static} If you set type to dynamic, an IKE Mode Config server
is created.
assign-ip Enable to request an IP address from the server.
{enable | disable}
interface <interface_name> This is a regular IPsec VPN field. Specify the physical,
aggregate, or VLAN interface to which the IPsec tunnel
will be bound.
proposal This is a regular IPsec VPN field that determines the
<encryption_combination> encryption and authentication settings that the client will
accept. For more information, see Defining IKE
negotiation parameters on page 44.
mode-cfg-ip-version {4|6} Select if the Method client receives an IPv4 or IPv6 IP
address. The default is 4. the ip-version setting
matches this variables value.
ip-version <4 | 6> This is a regular IPsec VPN field. By default, IPsec VPNs
use IPv4 addressing. You can set ip-version to 6 to
create a VPN with IPv6 addressing.
Variable Description
ike-version 1 IKE v1 is the default for FortiGate IPsec VPNs.
IKE Mode Config is also compatible with IKE v2
(RFC 4306).
mode-cfg enable Enable IKE Mode Config.
type dynamic Any other setting creates an IKE Mode Config client.
interface <interface_name> This is a regular IPsec VPN field. Specify the physical,
aggregate, or VLAN interface to which the IPsec tunnel
will be bound.
Supporting IKE Mode config clients Page 131 IPsec VPN for FortiOS 5.0
Variable Description
proposal This is a regular IPsec VPN field that determines the
<encryption_combination> encryption and authentication settings that the server will
accept. For more information, see Defining IKE
negotiation parameters on page 44.
ip-version <4 | 6> This is a regular IPsec VPN field. By default, IPsec VPNs
use IPv4 addressing. You can set ip-version to 6 to
create a VPN with IPv6 addressing.
IP address assignment
Usually you will want to assign IP addresses to clients. The simplest method is to assign
addresses from a specific range, similar to a DHCP server.
If your clients are authenticated by a RADIUS server, you can obtain the users IP address
assignment from the Framed-IP-Address attribute. The user must be authenticated using
XAuth.
Supporting IKE Mode config clients Page 132 IPsec VPN for FortiOS 5.0
To assign IP addresses from a RADIUS server
The users must be authenticated by a RADIUS server and assigned to the FortiGate user group
<grpname>. Since the IP address will not be static, type is set to dynamic, and mode-cfg is
enabled. This is IKE Configuration Method so that compatible clients can configure themselves
with settings that the FortiGate unit provides.
config vpn ipsec phase1-interface
edit vpn1
set type dynamic
set mode-cfg enable
set assign-ip enable
set assign-ip-from usrgrp
set xauthtype auto
set authusrgrp <grpname>
end
In this example, the FortiGate unit assigns IKE Mode Config clients addresses in the range of
10.11.101.160 through 10.11.101.180. DNS and WINS server addresses are also provided. The
public interface of the FortiGate unit is Port 1.
The ipv4-split-include variable specifies a firewall address that represents the networks
to which the clients will have access. This destination IP address information is sent to the
clients.
Only the CLI fields required for IKE Mode Config are shown here. For detailed information about
these variables, see the FortiGate CLI Reference.
config vpn ipsec phase1-interface
edit vpn1
set ip-version 4
set type dynamic
set interface port1
set proposal 3des-sha1 aes128-sha1
set mode-cfg enable
set mode-cfg-ipversion 4
set assign-ip enable
set assign-ip-type ip
set assign-ip-from range
set ipv4-start-ip 10.11.101.160
set ipv4-end-ip 10.11.101.180
set ipv4-netmask 255.255.255.0
set dns-server1 10.11.101.199
set dns-server2 66.11.168.195
set wins-server1 10.11.101.191
set domain example
set ipv4-split-include OfficeLAN
end
Supporting IKE Mode config clients Page 133 IPsec VPN for FortiOS 5.0
Example: FortiGate unit as IKE Mode Config client
In this example, the FortiGate unit connects to a VPN gateway with a static IP address that can
be reached through Port 1. Only the port, gateway and proposal information needs to be
configured. All other configuration information will come from the IKE Mode Config server.
config vpn ipsec phase1-interface
edit vpn1
set ip-version 4
set type static
set remote-gw <gw_address>
set interface port 1
set proposal 3des-sha1 aes128-sha1
set mode-cfg enable
set mode-cfg-ipversion 4
set assign-ip enable
end
Supporting IKE Mode config clients Page 134 IPsec VPN for FortiOS 5.0
Internet-browsing configuration
This section explains how to support secure web browsing performed by dialup VPN clients,
and/or hosts behind a remote VPN peer. Remote users can access the private network behind
the local FortiGate unit and browse the Internet securely. All traffic generated remotely is subject
to the security policy that controls traffic on the private network behind the local FortiGate unit.
The following topics are included in this section:
Configuration overview
Creating an Internet browsing security policy
Routing all remote traffic through the VPN tunnel
Configuration overview
A VPN provides secure access to a private network behind the FortiGate unit. You can also
enable VPN clients to access the Internet securely. The FortiGate unit inspects and processes
all traffic between the VPN clients and hosts on the Internet according to the Internet browsing
policy. This is accomplished even though the same FortiGate interface is used for both
encrypted VPN client traffic and unencrypted Internet traffic.
In Figure 20, FortiGate_1 enables secure Internet browsing for FortiClient Endpoint Security
users such as Dialup_1 and users on the Site_2 network behind FortiGate_2, which could be a
VPN peer or a dialup client.
_1
lup
Dia
FG
_1 _D
i G ate ialu
p_
rt 2
Fo
Site_1 Site_2
We
Users browse
b ser
ver
internet through
the VPN tunnel
You can adapt any of the following configurations to provide secure Internet browsing:
a gateway-to-gateway configuration (see Gateway-to-gateway configurations on page 63)
a FortiClient dialup-client configuration (see FortiClient dialup-client configurations on
page 107)
a FortiGate dialup-client configuration (see FortiGate dialup-client configurations on
page 122)
Page 135
The procedures in this section assume that one of these configurations is in place, and that it is
operating properly.
To create an internet-browsing configuration based on an existing gateway-to-gateway
configuration, you must edit the gateway-to-gateway configuration as follows:
On the FortiGate unit that will provide Internet access, create an Internet browsing security
policy. See Creating an Internet browsing security policy, below.
Configure the remote peer or client to route all traffic through the VPN tunnel. You can do this
on a FortiGate unit or on a FortiClient Endpoint Security application. See Routing all remote
traffic through the VPN tunnel on page 137.
On the FortiGate unit that acts as a VPN server and will provide secure access to the Internet,
you must create an Internet browsing security policy. This policy differs depending on whether
your gateway-to-gateway configuration is policy-based or route-based.
Outgoing VPN Interface The interface to which the VPN tunnel is bound.
Remote Protected Subnet The internal range of address of the remote spoke site.
VPN Tunnel Select Use Existing and select the tunnel that provides
access to the private network behind the FortiGate unit.
Destination Address The internal range of address of the remote spoke site.
Action ACCEPT
The VPN clients must be configured to route all Internet traffic through the VPN tunnel.
To make use of the Internet browsing configuration on the VPN server, the VPN peer or client
must route all traffic through the VPN tunnel. Usually, only the traffic destined for the private
network behind the FortiGate VPN server is sent through the tunnel.
The remote end of the VPN can be a FortiGate unit that acts as a peer in a gateway-to-gateway
configuration, or a FortiClient application that protects an individual client PC.
To configure a remote peer FortiGate unit for Internet browsing via VPN, see Configuring a
FortiGate remote peer to support Internet browsing.
To configure a FortiClient Endpoint Security application for Internet browsing via VPN, see
Configuring a FortiClient application to support Internet browsing on page 138.
These procedures assume that your VPN connection to the protected private network is
working and that you have configured the FortiGate VPN server for Internet browsing as
described in Creating an Internet browsing security policy on page 136.
This section discusses the options for supporting redundant and partially redundant IPsec
VPNs, using route-based approaches.
The following topics are included in this section:
Configuration overview
General configuration steps
Configure the VPN peers - route-based VPN
Redundant route-based VPN configuration example
Partially-redundant route-based VPN example
Creating a backup IPsec interface
Configuration overview
A FortiGate unit with two interfaces connected to the Internet can be configured to support
redundant VPNs to the same remote peer. If the primary connection fails, the FortiGate unit can
establish a VPN using the other connection.
Redundant tunnels do not support Tunnel Mode. You must use Interface Mode.
A fully-redundant configuration requires redundant connections to the Internet on both peers.
Figure 21 on page 140 shows an example of this. This is useful to create a reliable connection
between two FortiGate units with static IP addresses.
When only one peer has redundant connections, the configuration is partially-redundant. For an
example of this, see Partially-redundant route-based VPN example on page 156. This is
useful to provide reliable service from a FortiGate unit with static IP addresses that accepts
connections from dialup IPsec VPN clients.
In a fully-redundant VPN configuration with two interfaces on each peer, four distinct paths are
possible for VPN traffic from end to end. Each interface on a peer can communicate with both
interfaces on the other peer. This ensures that a VPN will be available as long as each peer has
one working connection to the Internet.
You configure a VPN and an entry in the routing table for each of the four paths. All of these
VPNs are ready to carry data. You set different routing distances for each route and only the
shortest distance route is used. If this route fails, the route with the next shortest distance is
used.
The redundant configurations described in this chapter use route-based VPNs, otherwise
known as virtual IPsec interfaces. This means that the FortiGate unit must operate in NAT mode.
You must use auto-keying. A VPN that is created using manual keys (see Manual-key
configurations on page 170) cannot be included in a redundant-tunnel configuration.
The configuration described here assumes that your redundant VPNs are essentially equal in
cost and capability. When the original VPN returns to service, traffic continues to use the
replacement VPN until the replacement VPN fails. If your redundant VPN uses more expensive
facilities, you want to use it only as a backup while the main VPN is down. For information on
how to do this, see Creating a backup IPsec interface on page 163.
Page 139
Figure 21:Example redundant-tunnel configuration
Redundant tunnel
Primary tunnel Fo
rtiG
_1 ate
ate _2
tr iG
Fo
Site_1 Site_2
A VPN that is created using manual keys (see Manual-key configurations on page 170) cannot
be included in a redundant-tunnel configuration.
VPN peers are configured using Interface Mode for redundant tunnels.
Configure each VPN peer as follows:
1. Ensure that the interfaces used in the VPN have static IP addresses.
Redundant VPN configurations Page 140 IPsec VPN for FortiOS 5.0
2. Create a phase 1 configuration for each of the paths between the peers. Enable IPsec
Interface mode so that this creates a virtual IPsec interface. Enable dead peer detection so
that one of the other paths is activated if this path fails.
Enter these settings in particular, and any other VPN settings as required:
Path 1
Path 2
Path 3
Path 4
For more information, see Auto Key phase 1 parameters on page 35.
Redundant VPN configurations Page 141 IPsec VPN for FortiOS 5.0
3. Create a phase 2 definition for each path. See Phase 2 parameters on page 51. Select the
phase 1 configuration (virtual IPsec interface) that you defined for this path. You can select
the name from the Static IP Address part of the list.
4. Create a route for each path to the other peer. If there are two ports on each peer, there are
four possible paths between the peer devices.
Destination IP/Mask The IP address and netmask of the private network behind the
remote peer.
Distance For each path, enter a different value to prioritize the paths.
5. Define the security policy for the local primary interface. See Defining VPN security policies
on page 58. You need to create two policies for each path to enable communication in both
directions. Enter these settings in particular:
Incoming Interface Select the local interface to the internal (private) network.
Outgoing Interface Select one of the virtual IPsec interfaces you created in
Step 2.
Schedule Always
Service Any
Action ACCEPT
6. Select Create New, leave the Policy Type as Firewall and leave the Policy Subtype as
Address, and enter these settings:
Incoming Interface Select one of the virtual IPsec interfaces you created in
Step 2.
Outgoing Interface Select the local interface to the internal (private) network.
Schedule Always
Service Any
Action ACCEPT
7. Place the policy in the policy list above any other policies having similar source and
destination addresses.
8. Repeat this procedure at the remote FortiGate unit.
Redundant VPN configurations Page 142 IPsec VPN for FortiOS 5.0
Redundant route-based VPN configuration example
This example demonstrates a fully redundant site-to-site VPN configuration using route-based
VPNs. At each site, the FortiGate unit has two interfaces connected to the Internet through
different ISPs. This means that there are four possible paths for communication between the
two units. In this example, these paths, listed in descending priority, are:
FortiGate_1 WAN 1 to FortiGate_2 WAN 1
FortiGate_1 WAN 1 to FortiGate_2 WAN 2
FortiGate_1 WAN 2 to FortiGate_2 WAN 1
FortiGate_1 WAN 2 to FortiGate_2 WAN 2
N2 2
Redundant tunnel WA 6.30.
17 WA 2 .1
2.1 N2 17
6.2
0.2
Primary tunnel
FFortiGate_2
FortiGate_1
e_1 N1
WA .2
WA
8 . 20
19 N1 .16
2.1
68 192
.10
.2
For each path, VPN configuration, security policies and routing are defined. By specifying a
different routing distance for each path, the paths are prioritized. A VPN tunnel is established on
each path, but only the highest priority one is used. If the highest priority path goes down, the
traffic is automatically routed over the next highest priority path. You could use dynamic routing,
but to keep this example simple, static routing is used.
Configuring FortiGate_1
You must
configure the interfaces involved in the VPN
define the phase 1 configuration for each of the four possible paths, creating a virtual IPsec
interface for each one
define the phase 2 configuration for each of the four possible paths
configure routes for the four IPsec interfaces, assigning the appropriate priorities
configure incoming and outgoing security policies between the internal interface and each of
the virtual IPsec interfaces
Redundant VPN configurations Page 143 IPsec VPN for FortiOS 5.0
3. Enter the following information and then select OK:
IP/Netmask 10.21.101.0/255.255.255.0
4. Select the WAN1 interface and select Edit, enter the following information and then select
OK:
IP/Netmask 192.168.10.2/255.255.255.0
5. Select the WAN2 interface and select Edit, enter the following information and then select
OK:
IP/Netmask 172.16.20.2/255.255.255.0
Name Site_1_A
IP Address 192.168.20.2
Mode Main
Advanced
3. Select Create Phase 1, enter the following information, and select OK:
Name Site_1_B
IP Address 172.16.30.2
Redundant VPN configurations Page 144 IPsec VPN for FortiOS 5.0
Mode Main
Advanced
4 Select Create Phase 1, enter the following information, and select OK:
Name Site_1_C
IP Address 192.168.20.2
Mode Main
Advanced
5. Select Create Phase 1, enter the following information, and select OK:
Name Site_1_D
IP Address 172.16.30.2
Mode Main
Advanced
Redundant VPN configurations Page 145 IPsec VPN for FortiOS 5.0
Enable IPsec Interface Mode Select
Name Route_A
Phase 1 Site_1_A
3. Select Create Phase 2, enter the following information and select OK:
Name Route_B
Phase 1 Site_1_B
4. Select Create Phase 2, enter the following information and select OK:
Name Route_C
Phase 1 Site_1_C
5. Select Create Phase 2, enter the following information and select OK:
Name Route_D
Phase 1 Site_1_D
To configure routes
1. Go to Router > Static > Static Routes.
For low-end FortiGate units, go to System > Network > Routing.
2. Select Create New, enter the following default gateway information and then select OK:
Device WAN1
Gateway 192.168.10.1
Distance (Advanced) 10
3. Select Create New, enter the following information and then select OK:
Device Site_1_A
Distance (Advanced) 1
Redundant VPN configurations Page 146 IPsec VPN for FortiOS 5.0
4. Select Create New, enter the following information and then select OK:
Device Site_1_B
Distance (Advanced) 2
5. Select Create New, enter the following information and then select OK:
Device Site_1_C
Distance (Advanced) 3
6. Select Create New, enter the following information and then select OK:
Device Site_1_D
Distance (Advanced) 4
Schedule Always
Service Any
Action ACCEPT
Redundant VPN configurations Page 147 IPsec VPN for FortiOS 5.0
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Redundant VPN configurations Page 148 IPsec VPN for FortiOS 5.0
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Redundant VPN configurations Page 149 IPsec VPN for FortiOS 5.0
Service Any
Action ACCEPT
Configuring FortiGate_2
The configuration for FortiGate_2 is very similar that of FortiGate_1. You must
configure the interfaces involved in the VPN
define the phase 1 configuration for each of the four possible paths, creating a virtual IPsec
interface for each one
define the phase 2 configuration for each of the four possible paths
configure routes for the four IPsec interfaces, assigning the appropriate priorities
configure incoming and outgoing security policies between the internal interface and each of
the virtual IPsec interfaces
IP/Netmask 10.31.101.0/255.255.255.0
3. Select the WAN1 interface and then select Edit. Enter the following information and then
select OK:
IP/Netmask 192.168.20.2/255.255.255.0
4. Select the WAN2 interface and then select Edit. Enter the following information and then
select OK:
IP/Netmask 172.16.30.2/255.255.255.0
Name Site_2_A
IP Address 192.168.10.2
Mode Main
Redundant VPN configurations Page 150 IPsec VPN for FortiOS 5.0
Authentication Method Preshared Key
Advanced
3. Select Create Phase 1, enter the following information, and select OK:
Name Site_2_B
IP Address 172.16.20.2
Mode Main
Advanced
4. Select Create Phase 1, enter the following information, and select OK:
Name Site_2_C
IP Address 192.168.10.2
Mode Main
Advanced
Redundant VPN configurations Page 151 IPsec VPN for FortiOS 5.0
5. Select Create Phase 1, enter the following information, and select OK:
Name Site_2_D
IP Address 172.16.20.2
Mode Main
Advanced
Name Route_A
Phase 1 Site_2_A
3. Select Create Phase 2, enter the following information and select OK:
Name Route_B
Phase 1 Site_2_B
4. Select Create Phase 2, enter the following information and select OK:
Name Route_C
Phase 1 Site_2_C
5. Select Create Phase 2, enter the following information and select OK:
Name Route_D
Phase 1 Site_2_D
To configure routes
1. Go to Router > Static > Static Routes.
For low-end FortiGate units, go to System > Network > Routing.
Redundant VPN configurations Page 152 IPsec VPN for FortiOS 5.0
2. Select Create New, enter the following default gateway information and then select OK:
Device WAN1
Gateway 192.168.10.1
Distance (Advanced) 10
3. Select Create New, enter the following information and then select OK:
Device Site_2_A
Distance (Advanced) 1
4. Select Create New, enter the following information and then select OK:
Device Site_2_B
Distance (Advanced) 2
5. Select Create New, enter the following information and then select OK:
Device Site_2_C
Distance (Advanced) 3
6. Select Create New, enter the following information and then select OK:
Device Site_2_D
Distance (Advanced) 4
Redundant VPN configurations Page 153 IPsec VPN for FortiOS 5.0
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Redundant VPN configurations Page 154 IPsec VPN for FortiOS 5.0
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Redundant VPN configurations Page 155 IPsec VPN for FortiOS 5.0
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
This example demonstrates how to set up a partially redundant IPsec VPN between a local
FortiGate unit and a remote VPN peer that receives a dynamic IP address from an ISP before it
connects to the FortiGate unit. For more information about FortiGate dialup-client
configurations, see FortiGate dialup-client configurations on page 122.
When a FortiGate unit has more than one interface to the Internet (see FortiGate_1 in Figure 23),
you can configure redundant routes. If the primary connection fails, the FortiGate unit can
establish a VPN using the redundant connection.
In this case, FortiGate_2 has only one connection to the Internet. If the link to the ISP were to go
down, the connection to FortiGate_1 would be lost, and the tunnel would be taken down. The
tunnel is said to be partially redundant because FortiGate_2 does not support a redundant
connection.
In the configuration example:
Both FortiGate units operate in NAT mode.
Two separate interfaces to the Internet (192.168.10.2 and 172.16.20.2) are available on
FortiGate_1. Each interface has a static public IP address.
FortiGate_2 has a single connection to the Internet and obtains a dynamic public IP address
(for example, 172.16.30.1) when it connects to the Internet.
FortiGate_2 forwards IP packets from the SOHO network (10.31.101.0/24) to the corporate
network (10.21.101.0/24) behind FortiGate_1 through a partially redundant IPsec VPN.
Encrypted packets from FortiGate_2 are addressed to the public interface of FortiGate_1.
Encrypted packets from FortiGate_1 are addressed to the public IP address of FortiGate_2.
There are two possible paths for communication between the two units. In this example, these
paths, listed in descending priority, are:
FortiGate_1 WAN 1 to FortiGate_2 WAN 1
FortiGate_1 WAN 2 to FortiGate_2 WAN 1
Redundant VPN configurations Page 156 IPsec VPN for FortiOS 5.0
For each path, VPN configuration, security policies and routing are defined. By specifying a
different routing distance for each path, the paths are prioritized. A VPN tunnel is established on
each path, but only the highest priority one is used. If the highest priority path goes down, the
traffic is automatically routed over the next highest priority path. You could use dynamic routing,
but to keep this example simple, static routing is used.
17 WA Redundant tunnel
2.1 N2
6.2 Primary tunnel
0.2
FortiGate_1
_1
WA
19 N1 17 WA
2.1 N1
2.1
68 6.3
.10 0.1
.1
FortiGate_2
Fo
Corporate network
10.21.101.0/24
SOHO network
10.31.101.0/24
Configuring FortiGate_1
You must
configure the interfaces involved in the VPN
define the phase 1 configuration for each of the two possible paths, creating a virtual IPsec
interface for each one
define the phase 2 configuration for each of the two possible paths
configure incoming and outgoing security policies between the internal interface and each of
the virtual IPsec interfaces
IP/Netmask 10.21.101.2/255.255.255.0
3. Select the WAN1 interface and select Edit. Enter the following information and select OK:
IP/Netmask 192.168.10.2/255.255.255.0
Redundant VPN configurations Page 157 IPsec VPN for FortiOS 5.0
4. Select the WAN2 interface and select Edit. Enter the following information and select OK:
IP/Netmask 172.16.20.2/255.255.255.0
Name Site_1_A
Mode Main
Advanced
3. Select Create Phase 1, enter the following information, and select OK:
Name Site_1_B
Mode Main
Advanced
Redundant VPN configurations Page 158 IPsec VPN for FortiOS 5.0
To define the phase 2 configurations for the two VPNs
1. Go to VPN > IPsec > Auto Key (IKE).
2. Select Create Phase 2, enter the following information and select OK:
Name Route_A
Phase 1 Site_1_A
3. Select Create Phase 2, enter the following information and select OK:
Name Route_B
Phase 1 Site_1_B
To configure routes
1. Go to Router > Static > Static Routes.
For low-end FortiGate units, go to System > Network > Routing.
2. Select Create New, enter the following default gateway information and select OK:
Device WAN1
Gateway 192.168.10.1
Distance (Advanced) 10
Schedule Always
Service Any
Action ACCEPT
Redundant VPN configurations Page 159 IPsec VPN for FortiOS 5.0
Outgoing Interface Site_1_B
Schedule Always
Service Any
Action ACCEPT
Configuring FortiGate_2
The configuration for FortiGate_2 is similar to that of FortiGate_1. You must
configure the interface involved in the VPN
define the phase 1 configuration for the primary and redundant paths, creating a virtual
IPsec interface for each one
define the phase 2 configurations for the primary and redundant paths, defining the internal
network as the source address so that FortiGate_1 can automatically configure routing
configure the routes for the two IPsec interfaces, assigning the appropriate priorities
configure security policies between the internal interface and each of the virtual IPsec
interfaces
IP/Netmask 10.31.101.2/255.255.255.0
3. Select the WAN1 interface and select Edit. Set the Addressing mode to DHCP.
Name Site_2_A
IP Address 192.168.10.2
Mode Main
Advanced
Redundant VPN configurations Page 160 IPsec VPN for FortiOS 5.0
Enable IPsec Interface Mode Select
3. Select Create Phase 1, enter the following information, and select OK:
Name Site_2_B
IP Address 172.16.20.2
Mode Main
Advanced
Name Route_A
Phase 1 Site_2_A
Advanced
3. Select Create Phase 2, enter the following information and select OK:
Name Route_B
Phase 1 Site_2_B
Advanced
To configure routes
1. Go to Router > Static > Static Routes.
For low-end FortiGate units, go to System > Network > Routing.
Redundant VPN configurations Page 161 IPsec VPN for FortiOS 5.0
2. Select Create New, enter the following information and then select OK:
Device Site_2_A
Distance (Advanced) 1
3. Select Create New, enter the following information and then select OK:
Device Site_2_B
Distance (Advanced) 2
Schedule Always
Service Any
Action ACCEPT
Schedule Always
Service Any
Action ACCEPT
Redundant VPN configurations Page 162 IPsec VPN for FortiOS 5.0
Creating a backup IPsec interface
You can configure a route-based VPN that acts as a backup facility to another VPN. It is used
only while your main VPN is out of service. This is desirable when the redundant VPN uses a
more expensive facility.
You can configure a backup IPsec interface only in the CLI. The backup feature works only on
interfaces with static addresses that have dead peer detection enabled. The monitor option
creates a backup VPN for the specified phase 1 configuration.
In the following example, backup_vpn is a backup for main_vpn.
config vpn ipsec phase1-interface
edit main_vpn
set dpd on
set interface port1
set nattraversal enable
set psksecret "hard-to-guess"
set remote-gw 192.168.10.8
set type static
end
edit backup_vpn
set dpd on
set interface port2
set monitor main_vpn
set nattraversal enable
set psksecret "hard-to-guess"
set remote-gw 192.168.10.8
set type static
end
Redundant VPN configurations Page 163 IPsec VPN for FortiOS 5.0
Transparent mode VPNs
This section describes transparent VPN configurations, in which two FortiGate units create a
VPN tunnel between two separate private networks transparently.
The following topics are included in this section:
Configuration overview
Configure the VPN peers
Configuration overview
In transparent mode, all interfaces of the FortiGate unit except the management interface (which
by default is assigned IP address 10.10.10.1/255.255.255.0) are invisible at the network layer.
Typically, when a FortiGate unit runs in transparent mode, different network segments are
connected to the FortiGate interfaces. Figure 24 shows the management station on the same
subnet. The management station can connect to the FortiGate unit directly through the
web-based manager.
er
r out
Edge
at e_1
ortiG 10
Ma
F .10
n .10
sta agem .1
tio
n ent
Site_1
10.10.10.0/24
An edge router typically provides a public connection to the Internet and one interface of the
FortiGate unit is connected to the router. If the FortiGate unit is managed from an external
address (see Figure 25 on page 165), the router must translate (NAT) a routable address to
direct management traffic to the FortiGate management interface.
Page 164
Figure 25:Management station on external network
er
r out
ge T
Ed th NA
wi 17
2.1
6.1
0.1
00
ate_1
rtiG 10
Fo .10
.10
.1
Site_1 Ma
n
sta agem
10.10.10.0/24 tion ent
In a transparent VPN configuration, two FortiGate units create a VPN tunnel between two
separate private networks transparently. All traffic between the two networks is encrypted and
protected by FortiGate security policies.
Both FortiGate units may be running in transparent mode, or one could be running in
transparent mode and the other running in NAT mode. If the remote peer is running in NAT
mode, it must have a static public IP address.
VPNs between two FortiGate units running in transparent mode do not support
inbound/outbound NAT (supported through CLI commands) within the tunnel. In addition, a
FortiGate unit running in transparent mode cannot be used in a hub-and-spoke configuration.
Encrypted packets from the remote VPN peer are addressed to the management interface of
the local FortiGate unit. If the local FortiGate unit can reach the VPN peer locally, a static route
to the VPN peer must be added to the routing table on the local FortiGate unit. If the VPN peer
connects through the Internet, encrypted packets from the local FortiGate unit must be routed
to the edge router instead. For information about how to add a static route to the FortiGate
routing table, see the Advanced Routing Guide.
In the example configuration shown in Figure 25, Network Address Translation (NAT) is enabled
on the router. When an encrypted packet from the remote VPN peer arrives at the router through
the Internet, the router performs inbound NAT and forwards the packet to the FortiGate unit.
Refer to the software suppliers documentation to configure the router.
If you want to configure a VPN between two FortiGate units running in transparent mode, each
unit must have an independent connection to a router that acts as a gateway to the Internet,
and both units must be on separate networks that have a different address space. When the
two networks linked by the VPN tunnel have different address spaces (see Figure 26 on
page 166), at least one router must separate the two FortiGate units, unless the packets can be
redirected using ICMP (see Figure 27 on page 166).
Transparent mode VPNs Page 165 IPsec VPN for FortiOS 5.0
Figure 26:Link between two FortiGate units in transparent mode
r
ute
Ro
_1 Fo
ate rtiG
ortiG ate
F _2
Network_1 Network_2
In Figure 27, interface C behind the router is the default gateway for both FortiGate units.
Packets that cannot be delivered on Network_1 are routed to interface C by default. Similarly,
packets that cannot be delivered on Network_2 are routed to interface C. In this case, the router
must be configured to redirect packets destined for Network_1 to interface A and redirect
packets destined for Network_2 to interface B.
r
ute
Ro
C ICM
P
ICM P
ate_1 A
Fo
rtiG
rtiG Network_3 B ate
F o _2
Network_1 Network_2
If there are additional routers behind the FortiGate unit (see Figure 28 on page 167) and the
destination IP address of an inbound packet is on a network behind one of those routers, the
FortiGate routing table must include routes to those networks. For example, in Figure 28, the
FortiGate unit must be configured with static routes to interfaces A and B in order to forward
packets to Network_1 and Network_2 respectively.
Transparent mode VPNs Page 166 IPsec VPN for FortiOS 5.0
Figure 28:Destinations on remote networks behind internal routers
_1
i Gate
or t
F
1
uter_ A Network_3
Ro Ro
B ute
r_2
Network_1 Network_2
Transparent mode VPNs Page 167 IPsec VPN for FortiOS 5.0
Configure the VPN peers
IP Address Type the IP address of the public interface to the remote peer. If the
remote peer is a FortiGate unit running in transparent mode, type the
IP address of the remote management interface.
Advanced Select Nat-traversal, and type a value into the Keepalive Frequency
field. These settings protect the headers of encrypted packets from
being altered by external NAT devices and ensure that NAT address
mappings do not change while the VPN tunnel is open. For more
information, see NAT traversal on page 47 and NAT keepalive
frequency on page 48.
3. Define the phase 2 parameters needed to create a VPN tunnel with the remote peer. See
Phase 2 parameters on page 51. Select the set of phase 1 parameters that you defined for
the remote peer. The name of the remote peer can be selected from the Static IP Address
list.
4. Define the source and destination addresses of the IP packets that are to be transported
through the VPN tunnel. See Defining policy addresses on page 57. Enter these settings in
particular:
For the originating address (source address), enter the IP address and netmask of the
private network behind the local peer network. for the management interface, for
example, 10.10.10.0/24. This address needs to be a range to allow traffic from your
network through the tunnel. Optionally select any for this address.
For the remote address (destination address), enter the IP address and netmask of the
private network behind the remote peer (for example, 192.168.10.0/24). If the remote
peer is a FortiGate unit running in transparent mode, enter the IP address of the remote
management interface instead.
5. Define an IPsec security policy to permit communications between the source and
destination addresses. See Defining VPN security policies on page 58. Enter these settings
in particular:
Local Interface Select the local interface to the internal (private) network.
Local Protected Subnet Select the source address that you defined in Step 4.
Transparent mode VPNs Page 168 IPsec VPN for FortiOS 5.0
Outgoing VPN Interface Select the interface to the edge router. When you configure
the IPsec security policy on a remote peer that operates in
NAT mode, you select the public interface to the external
(public) network instead.
Remote Protected Subnet Select the destination address that you defined in Step 4.
VPN Tunnel Select Use Existing and select the name of the phase 2
tunnel configuration that you created in Step 3 from the
drop-down list.
Select Allow traffic to be initiated from the remote site to
enable traffic from the remote network to initiate the tunnel.
6. Place the policy in the policy list above any other policies having similar source and
destination addresses.
7. Define another IPsec security policy to permit communications between the source and
destination addresses in the opposite direction. This security policy and the previous one
form a bi-directional policy pair. See Defining VPN security policies on page 58. Enter
these settings in particular:
Local Interface Select the interface to the edge router. When you configure
the IPsec security policy on a remote peer that operates in
NAT mode, you select the public interface to the external
(public) network instead.
Local Protected Subnet Select the destination address that you defined in Step 4.
Outgoing VPN Interface Select the local interface to the internal (private) network.
Remote Protected Subnet Select the source address that you defined in Step 4.
VPN Tunnel Select Use Existing and select the name of the phase 2
tunnel configuration that you created in Step 3 from the
drop-down list.
Select Allow traffic to be initiated from the remote site to
enable traffic from the remote network to initiate the tunnel.
8. Repeat this procedure at the remote FortiGate unit to create bidirectional security policies.
Use the local interface and address information local to the remote FortiGate unit.
For more information on transparent mode, see the System Administration Guide.
Transparent mode VPNs Page 169 IPsec VPN for FortiOS 5.0
Manual-key configurations
This section explains how to manually define cryptographic keys to establish an IPsec VPN,
either policy-based or route-based.
For more information on web-based manual key configuration, see Manual Key on page 31.
The following topics are included in this section:
Configuration overview
Specify the manual keys for creating a tunnel
By default Manual key configurations to not appear on the Web-based Manager. You need to
enable the feature first.
Configuration overview
You manual define cryptographic keys where prior knowledge of the encryption and/or
authentication key is required (that is, one of the VPN peers requires a specific IPsec encryption
and/or authentication key). In this case, you do not specify IPsec phase 1 and phase 2
parameters; you define manual keys by going to VPN > IPsec > Manual Key.
If one VPN peer uses specific authentication and encryption keys to establish a tunnel, both
VPN peers must be configured to use the same encryption and authentication algorithms and
keys.
It may not be safe or practical to define manual keys because network administrators must be
trusted to keep the keys confidential, and propagating changes to remote VPN peers in a
secure manner may be difficult.
It is essential that both VPN peers be configured with matching encryption and authentication
algorithms, matching authentication and encryption keys, and complementary Security
Parameter Index (SPI) settings.
You can define either the encryption or the authentication as NULL (disabled), but not both.
Each SPI identifies a Security Association (SA). The value is placed in ESP datagrams to link the
datagrams to the SA. When an ESP datagram is received, the recipient refers to the SPI to
determine which SA applies to the datagram. An SPI must be specified manually for each SA.
Because an SA applies to communication in one direction only, you must specify two SPIs per
configuration (a local SPI and a remote SPI) to cover bidirectional communications between two
VPN peers.
If you are not familiar with the security policies, SAs, selectors, and SA databases for your
particular installation, do not attempt the following procedure without qualified assistance.
Page 170
Specify the manual keys for creating a tunnel
Local SPI Type a hexadecimal number (up to 8 characters, 0-9, a-f) that
represents the SA that handles outbound traffic on the local
FortiGate unit. The valid range is from 0x100 to 0xffffffff.
This value must match the Remote SPI value in the manual
key configuration at the remote peer.
Remote SPI Type a hexadecimal number (up to 8 characters, 0-9, a-f) that
represents the SA that handles inbound traffic on the local
FortiGate unit. The valid range is from 0x100 to 0xffffffff.
This value must match the Local SPI value in the manual key
configuration at the remote peer.
Remote Gateway Type the IP address of the public interface to the remote peer.
The address identifies the recipient of ESP datagrams.
Local Interface Select the name of the physical, aggregate, or VLAN interface
to which the IPsec tunnel will be bound. The FortiGate unit
obtains the IP address of the interface from System > Network
> Interface settings. This is available in NAT mode only.
IPsec Interface Mode Select to create a route-based VPN. A virtual IPsec interface is
created on the Local Interface that you selected. This option is
available only in NAT mode.
3. Select OK.
This chapter describes how to configure your FortiGate units IPv6 IPsec VPN functionality.
By default IPv6 configurations to not appear on the Web-based Manager. You need to enable
the feature first.
To enable IPv6
1. Go to System > Admin > Settings.
2. In the Display Options on GUI section, select IPv6.
3. Select Apply.
FortiOS supports route-based IPv6 IPsec, but not policy-based. This section describes how
IPv6 IPsec support differs from IPv4 IPsec support. FortiOS 4.0 MR3 is IPv6 Ready Logo
Program Phase 2 certified.
Where both the gateways and the protected networks use IPv6 addresses, sometimes called
IPv6 over IPv6, you can create either an auto-keyed or manually-keyed VPN. You can combine
IPv6 and IPv4 addressing in an auto-keyed VPN in the following ways:
Compared with IPv4 IPsec VPN functionality, there are some limitations:
Except for IPv6 over IPv4, remote gateways with Dynamic DNS are not supported.
You cannot use RSA certificates in which the common name (cn) is a domain name that
resolves to an IPv6 address. This is because FortiOS 3.0 does not support IPv6 DNS.
DHCP over IPsec is not supported, because FortiOS 3.0 does not support IPv6 DHCP.
Selectors cannot be firewall address names. Only IP address, address range and subnet are
supported.
Redundant IPv6 tunnels are not supported.
Page 173
Certificates
On a VPN with IPv6 phase 1 configuration, you can authenticate using VPN certificates in which
the common name (cn) is an IPv6 address. The cn-type keyword of the user peer command
has an option, ipv6, to support this.
Configuration of an IPv6 IPsec VPN follows the same sequence as for an IPv4 route-based
VPN: phase 1 settings, phase 2 settings, security policies and routing.
By default IPv6 configurations to not appear on the Web-based Manager. You need to enable
the feature first.
To enable IPv6
1. Go to System > Admin > Settings.
2. In the Display Options on GUI section, select IPv6.
3. Select Apply.
Phase 1 configuration
In the web-based manager, you define the Phase 1 as IPv6 in the Advanced settings. Enable the
IPv6 Version check box. You can then enter an IPv6 address for the remote gateway.
In the CLI, you define an IPsec phase 1 configuration as IPv6 by setting ip-version to 6. Its
default value is 4. Then, the local-gw and remote-gw keywords are hidden and the
corresponding local-gw6 and remote-gw6 keywords are available. The values for
local-gw6 and remote-gw6 must be IPv6 addresses. For example:
config vpn ipsec phase1-interface
edit tunnel6
set ip-version 6
set remote-gw6 0:123:4567::1234
set interface port3
set proposal 3des-md5
end
Phase 2 configuration
To create an IPv6 IPsec phase 2 configuration in the web-based manager, you need to define
IPv6 selectors in the Advanced settings. Change the default 0.0.0.0/0 address for Source
address and Destination address to the IPv6 value ::/0. If needed, enter specific IPv6
addresses, address ranges or subnet addresses in these fields.
IPv6 IPsec VPNs Page 174 IPsec VPN for FortiOS 5.0
In the CLI, set src-addr-type and dst-addr-type to ip6, range6 or subnet6 to specify
IPv6 selectors. By default, zero selectors are entered, ::/0 for the subnet6 address type, for
example. The simplest IPv6 phase 2 configuration looks like this:
config vpn ipsec phase2-interface
edit tunnel6_p2
set phase1name tunnel6
set proposal 3des-md5
set src-addr-type subnet6
set dst-addr-type subnet6
end
Security policies
To complete the VPN configuration, you need a security policy in each direction to permit traffic
between the protected networks port and the IPsec interface. You need IPv6 policies unless the
VPN is IPv4 over IPv6.
Routing
Appropriate routing is needed for both the IPsec packets and the encapsulated traffic within
them. You need a route, which could be the default route, to the remote VPN gateway via the
appropriate interface. You also need a route to the remote protected network via the IPsec
interface.
To create a static route in the web-based manager
1. Go to Router > Static > Static Routes.
On low-end FortiGate units, go to System > Network > Routing.
2. Select the drop-down arrow on the Create New button and select IPv6 Route.
3. Enter the information and select OK.
In the CLI, use the router static6 command. For example, where the remote network is
fec0:0000:0000:0004::/64 and the IPsec interface is toB:
config router static6
edit 1
set device port2
set dst 0::/0
next
edit 2
set device toB
set dst fec0:0000:0000:0004::/64
next
end
If the VPN is IPV4 over IPv6, the route to the remote protected network is an IPv4 route. If the
VPN is IPv6 over IPv4, the route to the remote VPN gateway is an IPv4 route.
IPv6 IPsec VPNs Page 175 IPsec VPN for FortiOS 5.0
To access IPv6 functionality through the web-based manager, go to System Admin > Settings
and enable IPv6 in the section, Display Options on GUI.
fec c7
0 :00 :25
01 83
:20 f:fe
9:0 :0ff
fff: :2 09
fe8 Port rt 2 01
3:2 2
5f2 Po c0:00
fe
Fo
te A rtiG Po
rt 3 rtiGa ate rt 3
Po Fo B
64 fec
00::/ 0 :00
0:00 00
:00
:0 00 00
00 :00
0:00 04
::/6
fec 4
IPv6 IPsec VPNs Page 176 IPsec VPN for FortiOS 5.0
route-based VPN, except that ip-version is set to 6 and the remote-gw6 keyword is used to
specify an IPv6 remote gateway address.
config vpn ipsec phase1-interface
edit toB
set ip-version 6
set interface port2
set remote-gw6 fec0:0000:0000:0003:209:0fff:fe83:25c7
set dpd enable
set psksecret maryhadalittlelamb
set proposal 3des-md5 3des-sha1
end
By default, phase 2 selectors are set to accept all subnet addresses for source and destination.
The default setting for src-addr-type and dst-addr-type is subnet. The IPv6 equivalent
is subnet6. The default subnet addresses are 0.0.0.0/0 for IPv4, ::/0 for IPv6.
config vpn ipsec phase2-interface
edit toB2
set phase1name toB
set proposal 3des-md5 3des-sha1
set pfs enable
set replay enable
set src-addr-type subnet6
set dst-addr-type subnet6
end
IPv6 IPsec VPNs Page 177 IPsec VPN for FortiOS 5.0
Configure FortiGate A routing
This simple example requires just two static routes. Traffic to the protected network behind
FortiGate B is routed via the virtual IPsec interface toB. A default route sends all IPv6 traffic out
on port2.
config router static6
edit 1
set device port2
set dst 0::/0
next
edit 2
set device toB
set dst fec0:0000:0000:0004::/64
end
Configure FortiGate B
The configuration of FortiGate B is very similar to that of FortiGate A. A virtual IPsec interface
toA is configured on port2 and its remote gateway is the public IP address of FortiGate A.
Security policies enable traffic to pass between the private network and the IPsec interface.
Routing ensures traffic for the private network behind FortiGate A goes through the VPN and
that all IPv6 packets are routed to the public network.
config system interface
edit port2
config ipv6
set ip6-address fec0::0003:209:0fff:fe83:25c7/64
end
next
edit port3
config ipv6
set ip6-address fec0::0004:209:0fff:fe83:2569/64
end
end
config vpn ipsec phase1-interface
edit toA
set ip-version 6
set interface port2
set remote-gw6 fec0:0000:0000:0001:209:0fff:fe83:25f2
set dpd enable
set psksecret maryhadalittlelamb
set proposal 3des-md5 3des-sha1
end
config vpn ipsec phase2-interface
edit toA2
set phase1name toA
set proposal 3des-md5 3des-sha1
set pfs enable
set replay enable
set src-addr-type subnet6
set dst-addr-type subnet6
IPv6 IPsec VPNs Page 178 IPsec VPN for FortiOS 5.0
end
config firewall policy6
edit 1
set srcintf port3
set dstintf toA
set srcaddr all6
set dstaddr all6
set action accept
set service ANY
set schedule always
next
edit 2
set srcintf toA
set dstintf port3
set srcaddr all6
set dstaddr all6
set action accept
set service ANY
set schedule always
end
config router static6
edit 1
set device port2
set dst 0::/0
next
edit 2
set device toA
set dst fec0:0000:0000:0000::/64
end
In this example, two private networks with IPv4 addressing communicate securely over IPv6
infrastructure.
Fo
te A rtiG Po
rt
ort
3 r tiGa ate 3
P Fo B
19
2.1
4 68
.2. 0/2 .3.0
/24
8
.16
192
IPv6 IPsec VPNs Page 179 IPsec VPN for FortiOS 5.0
Configure FortiGate A interfaces
Port 2 connects to the IPv6 public network and port 3 connects to the IPv4 LAN.
config system interface
edit port2
config ipv6
set ip6-address fec0::0001:209:0fff:fe83:25f2/64
end
next
edit port3
set 192.168.2.1/24
end
IPv6 IPsec VPNs Page 180 IPsec VPN for FortiOS 5.0
next
edit 2
set srcintf toB
set dstintf port3
set srcaddr all
set dstaddr all
set action accept
set service ANY
set schedule always
end
Configure FortiGate B
The configuration of FortiGate B is very similar to that of FortiGate A. A virtual IPsec interface
toA is configured on port2 and its remote gateway is the public IP address of FortiGate A. The
IPsec phase 2 configuration has IPv4 selectors.
IPv4 security policies enable traffic to pass between the private network and the IPsec interface.
An IPv4 static route ensures traffic for the private network behind FortiGate A goes through the
VPN and an IPv6 static route ensures that all IPv6 packets are routed to the public network.
config system interface
edit port2
config ipv6
set ip6-address fec0::0003:fe83:25c7/64
end
next
edit port3
set 192.168.3.1/24
end
config vpn ipsec phase1-interface
edit toA
set ip-version 6
set interface port2
set remote-gw6 fec0:0000:0000:0001:209:0fff:fe83:25f2
set dpd enable
IPv6 IPsec VPNs Page 181 IPsec VPN for FortiOS 5.0
set psksecret maryhadalittlelamb
set proposal 3des-md5 3des-sha1
end
config vpn ipsec phase2-interface
edit toA2
set phase1name toA
set proposal 3des-md5 3des-sha1
set pfs enable
set replay enable
end
config firewall policy
edit 1
set srcintf port3
set dstintf toA
set srcaddr all
set dstaddr all
set action accept
set service ANY
set schedule always
next
edit 2
set srcintf toA
set dstintf port3
set srcaddr all
set dstaddr all
set action accept
set service ANY
set schedule always
end
config router static6
edit 1
set device port2
set dst 0::/0
next
edit 2
set device toA
set dst 192.168.2.0/24
end
IPv6 IPsec VPNs Page 182 IPsec VPN for FortiOS 5.0
Site-to-site IPv6 over IPv4 VPN example
In this example, IPv6-addressed private networks communicate securely over IPv4 public
infrastructure.
10 Po
rt 2 24 .0.1 rt 2
Po .0.1/ .1/
.0 24
10
te A Fo Po
rt 3 r tiGa rtiG
ate rt
Po Fo B
3
fec
64 0
00::/ :00
00
:00 :00
000 00
:00
0:0 04
00 ::/6
0:0 4
fec
IPv6 IPsec VPNs Page 183 IPsec VPN for FortiOS 5.0
config vpn ipsec phase2-interface
edit toB2
set phase1name toB
set proposal 3des-md5 3des-sha1
set pfs enable
set replay enable
set src-addr-type subnet6
set dst-addr-type subnet6
end
IPv6 IPsec VPNs Page 184 IPsec VPN for FortiOS 5.0
Configure FortiGate B
The configuration of FortiGate B is very similar to that of FortiGate A. A virtual IPsec interface
toA is configured on port2 and its remote gateway is the IPv4 public IP address of FortiGate A.
The IPsec phase 2 configuration has IPv6 selectors.
IPv6 security policies enable traffic to pass between the private network and the IPsec interface.
An IPv6 static route ensures traffic for the private network behind FortiGate A goes through the
VPN and an IPv4 static route ensures that all IPv4 packets are routed to the public network.
config system interface
edit port2
set 10.0.1.1/24
next
edit port3
config ipv6
set ip6-address fec0::0004:209:0fff:fe83:2569/64
end
config vpn ipsec phase1-interface
edit toA
set interface port2
set remote-gw 10.0.0.1
set dpd enable
set psksecret maryhadalittlelamb
set proposal 3des-md5 3des-sha1
end
config vpn ipsec phase2-interface
edit toA2
set phase1name toA
set proposal 3des-md5 3des-sha1
set pfs enable
set replay enable
set src-addr-type subnet6
set dst-addr-type subnet6
end
config firewall policy6
edit 1
set srcintf port3
set dstintf toA
set srcaddr all6
set dstaddr all6
set action accept
set service ANY
set schedule always
next
edit 2
set srcintf toA
set dstintf port3
set srcaddr all6
set dstaddr all6
set action accept
IPv6 IPsec VPNs Page 185 IPsec VPN for FortiOS 5.0
set service ANY
set schedule always
end
config router static6
edit 1
set device toA
set dst fec0:0000:0000:0000::/64
end
config router static
edit 1
set device port2
set gateway 10.0.1.254
end
IPv6 IPsec VPNs Page 186 IPsec VPN for FortiOS 5.0
L2TP and IPsec (Microsoft VPN)
This section describes how to set up a VPN that is compatible with the Microsoft Windows
native VPN, which is Layer 2 Tunneling Protocol (L2TP) with IPsec encryption.
The following topics are included in this section:
Overview
Assumptions
Configuring the FortiGate unit
Configuring the Windows PC
Troubleshooting
Overview
The topology of a VPN for Microsoft Windows dialup clients is very similar to the topology for
FortiClient Endpoint Security clients.
ent
te Cli
mo
Re
17
2.2
0.1 Port 1
20
.14
1
N
LA /24
Po ice 1.0
ent r Off 1.10
Cli 10 t 2 1
te .11 10.
mo te_
1 .10
Re iGa
1.1
00
r t
Fo
H .11
TT .1
10
P/ 01
H .1
TT 2
PS 0
D 11.
10
N 1
S 01
.
Se .1
r v 60
er
FT 1.
10
P 10
.1
S e 1.
r v 17
er 0
Sa .11
m .1
10
b a 01
Se .18
rv 0
er
For users, the difference is that instead of installing and using the FortiClient application, they
configure a network connection using the software built into the Microsoft Windows operating
system. Starting in FortiOS 4.0 MR2, you can configure a FortiGate unit to work with unmodified
Microsoft VPN client software.
Page 187
L2TP and IPSec is supported for native Windows XP, Windows Vista and Mac OSX native VPN
clients. However, in Mac OSX (OSX 10.6.3, including patch releases) the L2TP feature does not
work properly on the Mac OS side.
Assumptions
L2TP and IPsec (Microsoft VPN) Page 188 IPsec VPN for FortiOS 5.0
To create a user account - CLI
To create a user account called user1 with the password 123_user, enter:
config user local
edit user1
set type password
set passwd "123_user"
set status enable
end
Name Type or edit the user group name (for example, L2TP_group).
Available The list of Local users, RADIUS servers, LDAP servers, TACACS+
Users/Groups servers, or PKI users that can be added to the user group. To add a
member to this list, select the name and then select the right arrow
button.
Members The list of Local users, RADIUS servers, LDAP servers, TACACS+
servers, or PKI users that belong to the user group. To remove a
member, select the name and then select the left arrow button.
2. Select OK.
Configuring L2TP
You can only configure L2TP settings in the CLI. As well as enabling L2TP, you set the range of
IP address values that are assigned to L2TP clients and specify the user group that can access
the VPN. For example, to allow access to users in the L2TP_group and assign them addresses
in the range 192.168.0.50 to 192.168.0.59, enter:
L2TP and IPsec (Microsoft VPN) Page 189 IPsec VPN for FortiOS 5.0
config vpn l2tp
set sip 192.168.0.50
set eip 192.168.0.59
set status enable
set usrgrp "L2TP_group"
end
One of the security policies for the L2TP over IPsec VPN uses the client address range, so you
need also need to create a firewall address for that range. For example,
config firewall address
edit L2TPclients
set type iprange
set start-ip 192.168.0.50
set end-ip 192.168.0.59
end
Alternatively, you could define this range in the web-based manager.
Configuring IPsec
The Microsoft VPN client uses IPsec for encryption. The configuration needed on the FortiGate
unit is the same as for any other IPsec VPN with the following exceptions.
Transport mode is used instead of tunnel mode.
The encryption and authentication proposals must be compatible with the Microsoft client.
L2TP over IPsec is supported on the FortiGate unit using policy-based, not route-based
configurations.
Local Interface Select the network interface that connects to the Internet.
For example, port1.
Pre-shared Key Enter the preshared key. This key must also be entered in
the Microsoft VPN client.
DH Group 2
L2TP and IPsec (Microsoft VPN) Page 190 IPsec VPN for FortiOS 5.0
NAT Traversal Enable
3. Make this a transport-mode VPN. You must use the CLI to do this. If your phase 2 name is
dialup_p2, you would enter:
config vpn ipsec phase2
edit dialup_p2
set encapsulation transport-mode
end
L2TP and IPsec (Microsoft VPN) Page 191 IPsec VPN for FortiOS 5.0
Configuring phase 2 - CLI
To configure a phase 2 to work with your phase_1 configuration, you would enter:
config vpn ipsec phase2
edit dialup_p2
set phase1name dialup_p1
set proposal aes256-md5 3des-sha1 aes192-sha1
set replay enable
set pfs disable
set keylifeseconds 3600
set encapsulation transport-mode
end
Local Interface Select the interface that connects to the private network
behind this FortiGate unit.
VPN Tunnel Select Use Existing and select the name of the phase 1
configuration that you created. For example, dialup_p1.
See Configuring IPsec on page 190.
L2TP and IPsec (Microsoft VPN) Page 192 IPsec VPN for FortiOS 5.0
Configuring the IPSEC security policy - CLI
If your VPN tunnel (phase 1) is called dialup_p1, your protected network is on port2, and your
public interface is port1, you would enter:
config firewall policy
edit 0
set srcintf port2
set dstintf port1
set srcaddr all
set dstaddr all
set action ipsec
set schedule always
set service ANY
set inbound enable
set vpntunnel dialup_p1
end
Source Address Select the firewall address that you defined for the L2TP
clients.
Outgoing Interface Select the interface that connects to the private network
behind this FortiGate unit.
Action ACCEPT
L2TP and IPsec (Microsoft VPN) Page 193 IPsec VPN for FortiOS 5.0
Configuring the Windows PC
Configuration of the Windows PC for a VPN connection to the FortiGate unit consists of the
following:
In Network Connections, configure a Virtual Private Network connection to the FortiGate
unit.
Ensure that the IPSEC service is running.
Ensure that IPsec has not been disabled for the VPN client. It may have been disabled to
make the Microsoft VPN compatible with an earlier version of FortiOS.
The instructions in this section are based on Windows XP SP3. Other versions of Windows may
vary slightly.
L2TP and IPsec (Microsoft VPN) Page 194 IPsec VPN for FortiOS 5.0
Troubleshooting
This section describes some checks and tools you can use to resolve issues with
L2TP-over-IPsec VPNs.
This section includes:
Quick checks
Mac OS X and L2TP
Setting up logging
Using the FortiGate unit debug commands
Quick checks
The table below is a list of common L2TP over IPsec VPN problems and the possible solutions.
IPsec tunnel does not come up. Check the logs to determine whether the failure is in
Phase 1 or Phase 2.
Check the settings, including encapsulation setting, which
must be transport-mode.
Check the user password.
Confirm that the user is a member of the user group
assigned to L2TP.
On the Windows PC, check that the IPsec service is
running and has not been disabled. See Configuring the
Windows PC on page 194.
Tunnel connects, but there is no Did you create an ACCEPT security policy from the public
communication. network to the protected network for the L2TP clients?
See Configuring security policies on page 192.
Setting up logging
L2TP logging must be enabled to record L2TP events. Alert email can be configured to report
L2TP errors.
L2TP and IPsec (Microsoft VPN) Page 195 IPsec VPN for FortiOS 5.0
To view FortiGate logs
1. Go to Log & Report > Event Log > VPN.
2. Select the Log location if required.
3. After each attempt to start the L2TP over IPsec VPN, select Refresh to view logged events.
Typical L2TP over IPsec session startup log entries - raw format
2010-01-11 16:39:58 log_id=0101037127 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 1" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1"
status=success init=remote mode=main dir=outbound stage=1
role=responder result=OK
2010-01-11 16:39:58 log_id=0101037127 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 1" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1"
status=success init=remote mode=main dir=outbound stage=2
role=responder result=OK
2010-01-11 16:39:58 log_id=0101037127 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 1" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1"
status=success init=remote mode=main dir=inbound stage=3 role=responder
result=DONE
2010-01-11 16:39:58 log_id=0101037127 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 1" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
L2TP and IPsec (Microsoft VPN) Page 196 IPsec VPN for FortiOS 5.0
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
status=success init=remote mode=main dir=outbound stage=3
role=responder result=DONE
2010-01-11 16:39:58 log_id=0101037129 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 2" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
status=success init=remote mode=quick dir=outbound stage=1
role=responder result=OK
2010-01-11 16:39:58 log_id=0101037133 type=event subtype=ipsec
pri=notice vd="root" msg="install IPsec SA" action="install_sa"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
role=responder in_spi=61100fe2 out_spi=bd70fca1
2010-01-11 16:39:58 log_id=0101037139 type=event subtype=ipsec
pri=notice vd="root" msg="IPsec phase 2 status change"
action="phase2-up" rem_ip=172.20.120.151 loc_ip=172.20.120.141
rem_port=500 loc_port=500 out_intf="port1"
cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A" group="N/A"
xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
phase2_name=dialup_p2
2010-01-11 16:39:58 log_id=0101037138 type=event subtype=ipsec
pri=notice vd="root" msg="IPsec connection status change"
action="tunnel-up" rem_ip=172.20.120.151 loc_ip=172.20.120.141
rem_port=500 loc_port=500 out_intf="port1"
cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A" group="N/A"
xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
tunnel_ip=172.20.120.151 tunnel_id=1552003005 tunnel_type=ipsec
duration=0 sent=0 rcvd=0 next_stat=0 tunnel=dialup_p1_0
2010-01-11 16:39:58 log_id=0101037129 type=event subtype=ipsec
pri=notice vd="root" msg="progress IPsec phase 2" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
status=success init=remote mode=quick dir=inbound stage=2
role=responder result=DONE
2010-01-11 16:39:58 log_id=0101037122 type=event subtype=ipsec
pri=notice vd="root" msg="negotiate IPsec phase 2" action="negotiate"
rem_ip=172.20.120.151 loc_ip=172.20.120.141 rem_port=500 loc_port=500
out_intf="port1" cookies="5f6da1c0e4bbf680/d6a1009eb1dde780" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="dialup_p1_0"
status=success role=responder esp_transform=ESP_3DES esp_auth=HMAC_SHA1
2010-01-11 16:39:58 log_id=0103031008 type=event subtype=ppp vd=root
pri=information action=connect status=success msg="Client
172.20.120.151 control connection started (id 805), assigned ip
192.168.0.50"
2010-01-11 16:39:58 log_id=0103029013 type=event subtype=ppp vd=root
pri=notice pppd is started
2010-01-11 16:39:58 log_id=0103029002 type=event subtype=ppp vd=root
pri=notice user="user1" local=172.20.120.141 remote=172.20.120.151
L2TP and IPsec (Microsoft VPN) Page 197 IPsec VPN for FortiOS 5.0
assigned=192.168.0.50 action=auth_success msg="User 'user1' using l2tp
with authentication protocol MSCHAP_V2, succeeded"
2010-01-11 16:39:58 log_id=0103031101 type=event subtype=ppp vd=root
pri=information action=tunnel-up tunnel_id=1645784497 tunnel_type=l2tp
remote_ip=172.20.120.151 tunnel_ip=192.168.0.50 user="user1"
group="L2TPusers" msg="L2TP tunnel established"
L2TP and IPsec (Microsoft VPN) Page 198 IPsec VPN for FortiOS 5.0
GRE over IPsec (Cisco VPN)
This section describes how to configure a FortiGate VPN that is compatible with Cisco-style
VPNs that use GRE in an IPsec tunnel.
The following topics are included in this section:
Overview
Configuring the FortiGate unit
Configuring the Cisco router
Troubleshooting
Overview
Cisco products that include VPN support often use Generic Routing Encapsulation (GRE)
protocol tunnel over IPsec encryption. This chapter describes how to configure a FortiGate unit
to work with this type of Cisco VPN.
Cisco VPNs can use either transport mode or tunnel mode IPsec. Before FortiOS 4.0 MR2, the
FortiGate unit was compatible only with tunnel mode IPsec.
1 Cis
ate .14
rt 1 20 co
rtiG Po .20.1 13 rou
Fo 172 8 .5.1 ter
16
192.
00
rt 2 1.1
Po 1.10
1
10.
10 LAN 10 LAN
.11 -1 .21 -2
.10 .10
1.0 1.0
/24 /24
Page 199
Configuring the FortiGate unit
Local Interface Select the FortiGate units public interface. For example,
172.20.120.141.
Pre-shared Key Enter the preshared key. It must match the preshared key
on the Cisco device.
GRE over IPsec (Cisco VPN) Page 200 IPsec VPN for FortiOS 5.0
Advanced Select the Advanced button to see the following settings.
P1 Proposal 3DES-MD5
At least one proposal must match the settings on the
Cisco unit.
For more information about these settings, see Auto Key phase 1 parameters on page 35.
2. Define the phase 2 parameters needed to create a VPN tunnel with the remote peer. For
compatibility with the Cisco router, Quick Mode Selectors must be entered, which includes
specifying protocol 47, the GRE protocol. Enter these settings in particular:
Phase 1 Select the name of the phase 1 configuration that you defined in
Step 1.
P2 Proposal 3DES-MD5
At least one proposal must match the settings on the Cisco unit.
Source Port 0
Destination Port 0
Protocol 47
For more information about these settings, see Phase 2 parameters on page 51.
3. If the Cisco device is configured to use transport mode IPsec, you need to use transport
mode on the FortiGate VPN. You can configure this only in the CLI. In your phase 2
configuration, set encapsulation to transport-mode as follows:
config vpn phase2-interface
edit to_cisco_p2
set encapsulation transport-mode
end
GRE over IPsec (Cisco VPN) Page 201 IPsec VPN for FortiOS 5.0
To configure the IPsec VPN - CLI
config vpn ipsec phase1-interface
edit tocisco
set interface port1
set proposal 3des-sha1 aes128-sha1
set remote-gw 192.168.5.113
set psksecret xxxxxxxxxxxxxxxx
end
config vpn ipsec phase2-interface
edit tocisco_p2
set phase1name "tocisco"
set proposal 3des-md5
set encapsulation tunnel-mode // if tunnel mode
set encapsulation transport-mode // if transport mode
set protocol 47
set src-addr-type ip
set dst-start-ip 192.168.5.113
set src-start-ip 172.20.120.141
end
GRE over IPsec (Cisco VPN) Page 202 IPsec VPN for FortiOS 5.0
Adding GRE tunnel end addresses
You will also need to add tunnel end addresses. The Cisco router configuration requires an
address for its end of the GRE tunnel. Using the CLI, enter tunnel end addresses that are not
used elsewhere on the FortiGate unit, like this:
config system interface
edit gre1
set ip 10.0.1.1 255.255.255.255
set remote-ip 10.0.1.2
end
Outgoing Interface Select the GRE tunnel virtual interface you configured.
Action ACCEPT
2. To permit the remote client to initiate communication, you need to define a firewall address
security policy for communication in that direction:
Incoming Interface Select the GRE tunnel virtual interface you configured.
Action ACCEPT
GRE over IPsec (Cisco VPN) Page 203 IPsec VPN for FortiOS 5.0
3. Define a pair of ACCEPT firewall address security policies to permit traffic to flow between
the GRE virtual interface and the IPsec virtual interface:
Incoming Interface Select the GRE virtual interface. See Configuring the
GRE tunnel on page 202.
Outgoing Interface Select the virtual IPsec interface you created. See
Configuring the IPsec VPN on page 200.
Action ACCEPT
Incoming Interface Select the virtual IPsec interface you created. See
Configuring the IPsec VPN on page 200.
Outgoing Interface Select the GRE virtual interface. See Configuring the
GRE tunnel on page 202.
Action ACCEPT
GRE over IPsec (Cisco VPN) Page 204 IPsec VPN for FortiOS 5.0
edit 3 // GRE tunnel to IPsec interface
set srcintf "gre1"
set dstintf "tocisco"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ANY"
next
edit 4 // IPsec interface to GRE tunnel
set srcintf "tocisco"
set dstintf "gre1"
set srcaddr "all"
set dstaddr "all"
set action accept
set schedule "always"
set service "ANY"
end
Configuring routing
Traffic destined for the network behind the Cisco router must be routed to the GRE tunnel. To do
this, create a static route
1. Go to Router > Static > Static Routes and select Create New.
For low-end FortiGate units, go to System > Network > Routing and select Create New.
2. Enter the following information and select OK.
Destination IP/Mask Enter the IP address and netmask for the network behind the
Cisco router. For example 10.21.101.0 255.255.255.0.
GRE over IPsec (Cisco VPN) Page 205 IPsec VPN for FortiOS 5.0
Configuring the Cisco router
Using Cisco IOS, you would configure the Cisco router as follows, using the addresses from the
example:
config ter
crypto ipsec transform-set myset esp-3des esp-md5-hmac
no mode
exit
no ip access-list extended tunnel
ip access-list extended tunnel
permit gre host 192.168.5.113 host 172.20.120.141
exit
interface Tunnel1
ip address 10.0.1.2 255.255.255.0
tunnel source 192.168.5.113
tunnel destination 172.20.120.141
!
ip route 10.11.101.0 255.255.255.0 Tunnel1
end
clea crypto sa
clea crypto isakmp
For transport mode, change no mode to mode transport.
This is only the portion of the Cisco router configuration that applies to the GRE-over-IPsec
tunnel. For more information, refer to the Cisco documentation.
Troubleshooting
This section describes some checks and tools you can use to resolve issues with the
GRE-over-IPsec VPN.
Quick checks
Here is a list of common problems and what to verify.
No communication with remote Use the execute ping command to ping the Cisco
network. device public interface.
Use the FortiGate VPN Monitor page to see whether the
IPsec tunnel is up or can be brought up.
GRE over IPsec (Cisco VPN) Page 206 IPsec VPN for FortiOS 5.0
IPsec tunnel does not come up. Check the logs to determine whether the failure is in
Phase 1 or Phase 2.
Check that the encryption and authentication settings
match those on the Cisco device.
Check the encapsulation setting: tunnel-mode or
transport-mode. Both devices must use the same mode.
Tunnel connects, but there is no Check the security policies. See Configuring security
communication. policies on page 203.
Check routing. See Configuring routing on page 205.
Setting up logging
To configure FortiGate logging for IPsec
1. Go to Log & Report > Log Config > Log Settings.
2. Select the Event Logging.
3. Select VPN activity event.
4. Select Apply.
GRE over IPsec (Cisco VPN) Page 207 IPsec VPN for FortiOS 5.0
2. Attempt to use the VPN or set up the VPN tunnel and note the debug output.
3. Enter CTRL-C to stop the debug output.
4. Enter the following command to reset debug settings to default:
diagnose debug reset
GRE over IPsec (Cisco VPN) Page 208 IPsec VPN for FortiOS 5.0
Protecting OSPF with IPsec
For enhanced security, OSPF dynamic routing can be carried over IPsec VPN links.
The following topics are included in this section:
Overview
OSPF over IPsec configuration
Creating a redundant configuration
Overview
This chapter shows an example of OSPF routing conducted over an IPsec tunnel between two
FortiGate units. The network shown in Figure 34 is a single OSPF area. FortiGate_1 is an Area
border router that advertises a static route to 10.22.10.0/24 in OSPF. FortiGate_2 advertises its
local LAN as an OSPF internal route.
/24
.1 0.0
10.22
19
2.1 P
1 .141 68 ort Fo
rtiG
te_ rt 2 20 .0. 2
iGa Po .20.1 13
1 ate
F ort 172
_2
Po
rt 1
1 Port3 Port3
P ort
10.1.1.1 VPN tunnel 10.1.1.2
tunnel_wan1
OSPF cost 10
L
L 10 ocal
10 ocal 10.1.2.1 VPN tunnel 10.1.2.2 .31 LA
.21 LA tunnel_wan2 .10 N
.10 N 1.0
1.0 OSPF cost 200 /24
/24
The section OSPF over IPsec configuration describes the configuration with only one IPsec
VPN tunnel, tunnel_wan1. Then, the section Creating a redundant configuration on page 215
describes how you can add a second tunnel to provide a redundant backup path. This is shown
in Figure 34 as VPN tunnel tunnel_wan2.
Only the parts of the configuration concerned with creating the IPsec tunnel and integrating it
into the OSPF network are described. It is assumed that security policies are already in place to
allow traffic to flow between the interfaces on each FortiGate unit.
Page 209
OSPF over IPsec configuration
To configure Phase 1
1 Define the phase 1 configuration needed to establish a secure connection with the other
FortiGate unit. For more information, see Auto Key phase 1 parameters on page 35. Enter
these settings in particular:
Pre-shared Key Enter the preshared key. It must match the preshared
key on the other FortiGate unit.
FortiGate_1 FortiGate_2
IP 10.1.1.1 10.1.1.2
Remote_IP 10.1.1.2 10.1.1.1
These addresses are from a network that is not used for anything else.
Protecting OSPF with IPsec Page 210 IPsec VPN for FortiOS 5.0
To configure Phase 2
1. Enter a name to identify this phase 2 configuration, twan1_p2, for example.
2. Select the name of the phase 1 configuration that you defined in Step 1, tunnel_wan1 for
example.
Configuring OSPF
This section does not attempt to explain OSPF router configuration. It focusses on the
integration of the IPsec tunnel into the OSPF network. This is accomplished by assigning the
tunnel as an OSPF interface, creating an OSPF route to the other FortiGate unit.
This configuration uses loopback interfaces to ease OSPF troubleshooting. The OSPF router ID
is set to the loopback interface address.The loopback interface ensures the router is always up.
Even though technically the router ID doesnt have to match a valid IP address on the FortiGate
unit, having an IP that matches the router ID makes troubleshooting a lot easier.
The two FortiGate units have slightly different configurations. FortiGate_1 is an AS border router
that advertises its static default route. FortiGate_2 advertises its local LAN as an OSPF internal
route.
Setting the router ID for each FortiGate unit to the lowest possible value is useful if you want the
FortiGate units to be the designated router (DR) for their respective ASes. This is the router that
broadcasts the updates for the AS.
Leaving the IP address on the OSPF interface at 0.0.0.0 indicates that all potential routes will be
advertised, and it will not be limited to any specific subnet. For example if this IP address was
10.1.0.0, then only routes that match that subnet will be advertised through this interface in
OSPF.
Protecting OSPF with IPsec Page 211 IPsec VPN for FortiOS 5.0
To create the loopback interface
A loopback interface can be configured in the CLI only. For example, if the interface will have an
IP address of 10.0.0.1, you would enter:
config system interface
edit lback1
set vdom root
set ip 10.0.0.1 255.255.255.255
set type loopback
end
The loopback addresses and corresponding router IDs on the two FortiGate units must be
different. For example, set the FortiGate 1 loopback to 10.0.0.1 and the FortiGate 2 loopback to
10.0.0.2.
Advanced Options
Redistribute Select the Connected and Static check boxes. Use their default
metric values.
Areas Select Create New, enter the Area and Type and then select OK.
Area 0.0.0.0
Type Regular
Interfaces Enter a name for the OSPF interface, ospf_wan1 for example.
Name
IP 0.0.0.0
Protecting OSPF with IPsec Page 212 IPsec VPN for FortiOS 5.0
To configure OSPF area and interfaces - CLI
Your loopback interface is 10.0.0.1, your tunnel ends are on the 10.1.1.0/24 network, and your
virtual IPsec interface is named tunnel_wan1. Enter the following CLI commands:
config router ospf
set router-id 10.0.0.1
config area
edit 0.0.0.0
end
config network
edit 4
set prefix 10.1.1.0 255.255.255.0
next
edit 2
set prefix 10.0.0.1 255.255.255.255
end
config ospf-interface
edit ospf_wan1
set cost 10
set interface tunnel_wan1
set network-type point-to-point
end
config redistribute connected
set status enable
end
config redistribute static
set status enable
end
end
Protecting OSPF with IPsec Page 213 IPsec VPN for FortiOS 5.0
To configure OSPF area and interfaces - web-based manager
1. On FortiGate_2, go to Router > Dynamic > OSPF.
For low end FortiGate units, you first need to enable Dynamic Routing by going to System >
Admin > Settings.
2. Complete the following.
Router ID 10.0.0.2
Areas Select Create New, enter the Area and Type and then select OK.
Area 0.0.0.0
Type Regular
Interfaces
Name Enter a name for the OSPF interface, ospf_wan1 for example.
IP 0.0.0.0
IP/Netmask 10.0.0.2/255.255.255.255
Area 0.0.0.0
IP/Netmask 10.1.1.0/255.255.255.255
Area 0.0.0.0
IP/Netmask 10.31.101.0/255.255.255.255
Area 0.0.0.0
9. Select Apply.
Protecting OSPF with IPsec Page 214 IPsec VPN for FortiOS 5.0
To configure OSPF area and interfaces - CLI
If for example, your loopback interface is 10.0.0.2, your tunnel ends are on the 10.1.1.0/24
network, your local LAN is 10.31.101.0/24, and your virtual IPsec interface is named
tunnel_wan1, you would enter:
config router ospf
set router-id 10.0.0.2
config area
edit 0.0.0.0
end
config network
edit 1
set prefix 10.1.1.0 255.255.255.0
next
edit 2
set prefix 10.31.101.0 255.255.255.0
next
edit 2
set prefix 10.0.0.2 255.255.255.255
end
config ospf-interface
edit ospf_wan1
set interface tunnel_wan1
set network-type point-to-point
end
end
You can improve the reliability of the OSPF over IPsec configuration described in the previous
section by adding a second IPsec tunnel to use if the default one goes down. Redundancy in
this case is not controlled by the IPsec VPN configuration but by the OSPF routing protocol.
To do this you:
Create a second route-based IPsec tunnel on a different interface and define tunnel end
addresses for it.
Add the tunnel network as part of the OSPF network and define the virtual IPsec interface as
an additional OSPF interface.
Set the OSPF cost for the added OSPF interface to be significantly higher than the cost of
the default route.
Protecting OSPF with IPsec Page 215 IPsec VPN for FortiOS 5.0
Adding the OSPF interface
OSPF uses the metric called cost when determining the best route, with lower costs being
preferred. Up to now in this example, only the default cost of 10 has been used. Cost can be set
only in the CLI.
The new IPsec tunnel will have its OSPF cost set higher than that of the default tunnel to ensure
that it is only used if the first tunnel goes down. The new tunnel could be set to a cost of 200
compared to the default cost is 10. Such a large difference in cost will ensure this new tunnel
will only be used as a last resort.
If the new tunnel is called tunnel_wan2, you would enter the following on both FortiGate units:
config router ospf
config ospf-interface
edit ospf_wan2
set cost 200
set interface tunnel_wan2
set network-type point-to-point
end
end
Protecting OSPF with IPsec Page 216 IPsec VPN for FortiOS 5.0
Monitoring and troubleshooting
This section provides some general maintenance and monitoring procedures for VPNs.
The following topics are included in this section:
Monitoring VPN connections
Testing VPN connections
Testing VPN connections
Logging VPN events
VPN troubleshooting tips
You can use the monitor to view activity on IPsec VPN tunnels and to start or stop those
tunnels. The display provides a list of addresses, proxy IDs, and timeout information for all
active tunnels.
Page 217
of the remote host, the Remote gateway column displays the public IP address and UDP
port of the remote host.
When a FortiGate dialup client establishes a tunnel, the Remote gateway column displays
the public IP address and UDP port of the FortiGate dialup client.
The Username column displays the peer ID, certificate name, or XAuth user name of the
dialup client (if a peer ID, certificate name, or XAuth user name was assigned to the dialup
client for authentication purposes).
The Timeout column displays the time before the next key exchange. The time is calculated
by subtracting the time elapsed since the last key exchange from the keylife.
The Proxy ID Source column displays the IP addresses of the hosts, servers, or private
networks behind the FortiGate unit. A network range may be displayed if the source address
in the security encryption policy was expressed as a range of IP addresses.
The meaning of the value in the Proxy ID Destination column changes, depending on the
configuration of the network at the far end:
When a FortiClient dialup client establishes a tunnel:
If VIP addresses are not used and the remote host connects to the Internet directly,
the Proxy ID Destination field displays the public IP address of the Network Interface
Card (NIC) in the remote host.
If VIP addresses are not used and the remote host is behind a NAT device, the Proxy
ID Destination field displays the private IP address of the NIC in the remote host.
If VIP addresses were configured (manually or through FortiGate DHCP relay), the
Proxy ID Destination field displays either the VIP address belonging to a FortiClient
dialup client, or a subnet address from which VIP addresses were assigned.
When a FortiGate dialup client establishes a tunnel, the Proxy ID Destination field
displays the IP address of the remote private network.
A VPN connection has multiple stages that can be confirmed to ensure the connection is
working properly. It is easiest to see if the final stage is successful first since if it is successful
the other stages will be working properly. Otherwise, you will need to work back through the
stages to see where the problem is located.
When a VPN connection is properly established, traffic will flow from one end to the other as if
both ends were physically in the same place. If you can determine the connection is working
properly then any problems are likely problems with your applications.
If the connection is not working properly, you can move on to Troubleshooting VPN
connections on page 219 to determine the exact problem.
Monitoring and troubleshooting Page 218 IPsec VPN for FortiOS 5.0
If the connection has problems, see Troubleshooting VPN connections on page 219.
Dialup connection
A dialup VPN connection has additional steps. To confirm that a VPN between a local network
and a dialup client has been configured correctly, at the dialup client, issue a ping command to
test the connection to the local network. The VPN tunnel initializes when the dialup client
attempts to connect.
If the ping or traceroute fail, it indicates a connection problem between the two ends of the
tunnel. This may or may not indicate problems with the VPN tunnel, or dialup client. As with the
LAN connection, confirm the VPN tunnel is established by checking VPN > Monitor > IPsec
Monitor.
Monitoring and troubleshooting Page 219 IPsec VPN for FortiOS 5.0
6. Have the remote FortiGate initiate the VPN connection in the web-based manager by going
to VPN > Monitor and selecting Bring up.
This makes the remote FortiGate the initiator and the local FortiGate becomes the
responder. Establishing the connection in this manner means the local FortiGate will have its
configuration information as well as the information the remote computer sends. Having
both sets of information locally makes it easier to troubleshoot your VPN connection.
7. Watch the screen for output, and after roughly 15 seconds enter the following CLI command
to stop the output.
diagnose debug disable
8. If needed, save the log file of this output to a file on your local computer. Saving the output to
a file can make it easier to search for a particular phrase, and is useful for comparisons.
You can configure the FortiGate unit to log VPN events. For IPsec VPNs, phase 1 and phase 2
authentication and encryption events are logged. For information about how to interpret log
messages, see the FortiGate Log Message Reference.
Monitoring and troubleshooting Page 220 IPsec VPN for FortiOS 5.0
VPN troubleshooting tips
Most connection failures are due to a configuration mismatch between the FortiGate unit and
the remote peer. In general, begin troubleshooting an IPsec VPN connection failure as follows:
1. Ping the remote network or client to verify whether the connection is up. See Testing VPN
connections on page 218.
2. Traceroute the remote network or client. If DNS is working, you can use domain names.
Otherwise use IP addresses.
3. Check the routing behind the dialup client. Routing problems may be affecting DHCP. If this
appears to be the case, configure a DHCP relay service to enable DHCP requests to be
relayed to a DHCP server on or behind the FortiGate server.
Monitoring and troubleshooting Page 221 IPsec VPN for FortiOS 5.0
4. Verify the configuration of the FortiGate unit and the remote peer. Check the following IPsec
parameters:
The mode setting for ID protection (main or aggressive) on both VPN peers must be
identical.
The authentication method (preshared keys or certificates) used by the client must be
supported on the FortiGate unit and configured properly.
If preshared keys are being used for authentication purposes, both VPN peers must have
identical preshared keys.
The remote client must have at least one set of phase 1 encryption, authentication, and
Diffie-Hellman settings that match corresponding settings on the FortiGate unit.
Both VPN peers must have the same NAT traversal setting (enabled or disabled).
The remote client must have at least one set of phase 2 encryption and authentication
algorithm settings that match the corresponding settings on the FortiGate unit.
If you are using manual keys to establish a tunnel, the Remote SPI setting on the
FortiGate unit must be identical to the Local SPI setting on the remote peer, and vise
versa.
5. To correct the problem, see the following table.
Table 5: VPN trouble-shooting tips
Mode settings do not match. Select complementary mode settings. See Choosing main
mode or aggressive mode on page 36.
Preshared keys do not match. Reenter the preshared key. See Authenticating remote
peers and clients on page 40.
Phase 1 or phase 2 key Make sure that both VPN peers have at least one set of
exchange proposals are proposals in common for each phase. See Defining IKE
mismatched. negotiation parameters on page 44 and Configure the
phase 2 parameters on page 54.
NAT traversal settings are Select or clear both options as required. See NAT
mismatched. traversal on page 47 and NAT keepalive frequency on
page 48.
SPI settings for manual key Enter complementary SPI settings. See Manual-key
tunnels are mismatched. configurations on page 170.
Monitoring and troubleshooting Page 222 IPsec VPN for FortiOS 5.0
Index
Numerics concentrator 82
3DES-Triple-DES 46 IPSec tunnel mode 33
IPSec VPN, policy-based 33
A configuring
Accept peer certificate 41 dynamic DNS VPN 96
FortiClient dialup-client VPN 112
Accept this peer certificate
FortiClient in dialup-client VPN 116
group only 41
FortiGate dialup-client VPN 125
adding, configuring defining FortiGate in dialup-client IPsec VPN 127
IPSec VPN phase 1 23
gateway-to-gateway IPsec VPN 65
IPSec VPN phase 1 advanced options 24 hub-and-spoke IPsec VPN 77
IPSec VPN phase 2 27 manual keys 171
IPSec VPN phase 2 advanced options 27
transparent mode IPsec VPN 168
AES128,192 ,256 46
aggregated subnets D
for hub-and-spoke VPN 78 dead gateway detection 76
aggressive mode 35 Dead Peer Detection (DPD) 48, 76
Allow inbound, encryption policy 59 Phase 1 48
Allow outbound, encryption policy 59 designated router (DR), OSPF 211
always up 31 DH Group
ambiguous routing IPsec interface mode 55
resolving in FortiGate dialup-client configuration Phase 1 45
123 Phase 2 51
VPN routing 70 DH key size, FIPS-CC 45
authenticating DHCP relay
based on peer IDs 42 in FortiGate dialup client configuration 123
FortiGate unit pre-shared key 39 DHCP server 53
IPsec VPN peers and clients 40 in FortiClient dialup-client configuration 115
through IPsec certificate 37
DHCP-IPsec
through XAuth settings 49
IPSec VPN, phase 2 29
authentication phase 2 53
SHA-1, 256, 384, 512 46
dialup-client IPsec configuration
Authentication Algorithm dialup server for FortiClient dialup clients 112
Manual Key 172 dialup server for FortiGate dialup clients 125
auto connect 31 FortiGate client configuration 127
Autokey FortiGate dialup client configuration 125
IPSec VPN 22 requirements for FortiClient access 111
keep alive 52 requirements for FortiGate client access 124
Diffie-Hellman algorithm 45, 51
B
Digital Encryption Standard 15
backup VPN 163 DNS server, dynamic DNS configuration 96
C domain name, dynamic DNS configuration 95, 97
Dynamic DNS (DDNS) 93
Certificate Name, Phase 1 38
configuration steps 96
certificate, IPsec domain name configuration 97
group 41 overview 93
Local ID setting 41 remote VPN peer configuration 102
using DN to establish access 40
dynamic IP address
viewing local DN 41 for remote host 107
Challenge-Handshake Authentication Protocol (CHAP) FortiGate DDNS peer 95
49 FortiGate dialup client 122
Cisco VPN 199 dynamic VPN address
client IP mode-cfg 133
assigning with RADIUS 111
Page 223
dynamic-gateway 93 G
E gateway-to-gateway IPsec configuration
configuration steps 65
Enable perfect forward secrecy (PFS) overview 63
IPsec interface mode 54 policy-based firewall policy 69
Phase 2 52 route-based firewall policy 67
Enable replay detection generating
IPsec interface mode 54 IPsec phase 1 keys 45
Enable replay detection, Phase 2 52 IPsec phase 2 keys 51
Encapsulation 12 GRE-over-IPsec VPN 199
Encryption Algorithm
IPSec VPN, manual key 32 H
Encryption Algorithm, Manual Key 171 Hash-based Message Authentication Code (HMAC) 45
Encryption Key, Manual Key 171 HMAC-MD5 45
encryption policy HMAC-SHA-1 45
allow outbound and inbound 59 hub-and-spoke
defining IP addresses 57 spoke subnet addressing 78
defining IPsec 60 hub-and-spoke IPsec configuration
defining multiple for same IPsec tunnel 60 concentrator, defining 82
evaluating multiple 61 configuration example 87
outbound and inbound NAT 59 hub configuration 79
traffic direction 59 infrastructure requirements 78
examples overview 77
hub-and-spoke VPN 87 policy-based concentrator 82
Extended Authentication (XAuth) 37, 48, 116 policy-based firewall policy 81
extended authentication (XAuth) 38 route-based firewall policy 80
route-based inter-spoke communication 82
F spoke configuration 83
firewall IP addresses
defining 57 I
firewall policy IKE Configuration Method 133
defining for policy-based VPN 59 IKE encryption key 47
defining for route-based VPN 61 IKE negotiation
hub to spoke 84 parameters 44
policy-based, for FortiGate dialup client 129 IKEv2 37
policy-based, for gateway-to-gateway 69 Inbound NAT, encryption policy 59
policy-based, for hub-and-spoke 81 initiator 75
route-based, for FortiGate dialup client 128
Internet-browsing
route-based, for gateway-to-gateway 67
configuring FortiClient 138
route-based, for hub-and-spoke 80
spoke to spoke 85 Internet-browsing firewall policy
VPN server 136
using as route-based "concentrator" 83
Internet-browsing IPsec configuration
FortiASIC 45, 46
FortiClient dialup-client configuration 137
FortiClient
gateway-to-gateway configuration 136
auto connect 31
infrastructure requirements 135
keep alive 31
overview 135
save password 31
IP protocol 108 219
FortiClient dialup client configuration
example 117 IPcomp 219
FortiClient dialup-client configuration IPsec monitor 33
configuration steps 112 IPSec VPN
FortiClient configuration 116 adding manual key 31
overview 107 Autokey list 22
VIP address assignment 109 concentrator list 33
Forticlient VPN 30 configuring phase 1 23
configuring phase 1 advanced options 24
FortiGate dialup client IPsec configuration
configuring phase 2 27
FortiGate acting as client 122
configuring phase 2 advanced options 27
policy-based firewall policy 129
Manual Key list 31
route-based firewall policy 128
using DHCP relay in 123