FortiGate IPSec VPN User Guide
FortiGate IPSec VPN User Guide
www.fortinet.com
FortiGate™ IPSec VPN User Guide
Version 3.0
16 July 2007
01-30005-0065-20070716
Trademarks
ABACAS, APSecure, FortiASIC, FortiBIOS, FortiBridge, FortiClient,
FortiGate, FortiGuard, FortiGuard-Antispam, FortiGuard-Antivirus,
FortiGuard-Intrusion, FortiGuard-Web, FortiLog, FortiManager, Fortinet,
FortiOS, FortiPartner, FortiProtect, FortiReporter, FortiResponse,
FortiShield, FortiVoIP, and FortiWiFi are trademarks of Fortinet, Inc. in the
United States and/or other countries. The names of actual companies and
products mentioned herein may be the trademarks of their respective
owners.
Contents
Contents
Introduction ........................................................................................ 9
About FortiGate IPSec VPNs ........................................................................... 9
Using the web-based manager and CLI to configure IPSec VPNs ............ 10
About this document ...................................................................................... 10
Document conventions................................................................................ 12
Typographic conventions...................................................................... 12
Fortinet documentation .................................................................................. 12
Fortinet Tools and Documentation CD ........................................................ 14
Fortinet Knowledge Center ........................................................................ 14
Comments on Fortinet technical documentation ........................................ 14
Customer service and technical support ...................................................... 14
Authentication ............................................................................................. 35
Configure the hub............................................................................................ 35
Define the hub-spoke VPNs........................................................................ 35
Define the hub-spoke firewall policies......................................................... 36
Configuring communication between spokes (policy-based VPN) ............. 37
Configuring communication between spokes (route-based VPN) .............. 38
Using a zone as a concentrator............................................................ 38
Using a zone with a policy as a concentrator ....................................... 38
Using firewall policies as a concentrator .............................................. 39
Configure the spokes ..................................................................................... 40
Configuring firewall policies for hub-to-spoke communication .................... 40
Configuring firewall policies for spoke-to-spoke communication ................ 41
Dynamic spokes configuration example....................................................... 42
Configure the hub (FortiGate_1) ................................................................. 43
Define the IPsec configuration.............................................................. 43
Define the firewall policies .................................................................... 43
Configure communication between spokes.......................................... 44
Configure the spokes .................................................................................. 45
Define the IPsec configuration.............................................................. 45
Define the firewall policies .................................................................... 46
Internet-browsing configuration..................................................... 79
Configuration overview................................................................................... 79
Creating an Internet browsing firewall policy ............................................... 80
Routing all remote traffic through the VPN tunnel ....................................... 81
Configuring a FortiGate remote peer to support Internet browsing ............. 82
Configuring a FortiClient application to support Internet browsing.............. 82
Index................................................................................................ 161
Introduction
This chapter introduces you to FortiGate VPNs and the following topics:
• About FortiGate IPSec VPNs
• About this document
• Fortinet documentation
• Customer service and technical support
Document conventions
The following document conventions are used in this guide:
• In the examples, private IP addresses are used for both private and public IP
addresses.
• Notes and Cautions are used to provide important information:
Caution: Warns you about commands or procedures that could have unexpected or
! undesirable results including loss of data or damage to equipment.
Typographic conventions
FortiGate documentation uses the following typographical conventions:
Convention Example
Keyboard input In the Gateway Name field, type a name for the remote VPN
peer or client (for example, Central_Office_1).
Code examples config vpn ipsec phase2
edit FG1toDialupClients
set single-source enable
end
CLI command syntax config vpn ipsec phase2
edit <tunnel_name>
set single-source enable
end
Document names FortiGate Administration Guide
File content <HTML><HEAD><TITLE>Firewall
Authentication</TITLE></HEAD>
<BODY><H4>You must authenticate to use this
service.</H4>
Menu commands Go to VPN > IPSEC > Auto Key and select Create Phase 1.
Program output Initiator: tunnel 172.16.20.143,
transform=ESP_3DES, HMAC_SHA1
Variables <tunnel_name>
Fortinet documentation
The most up-to-date publications and previous releases of Fortinet product
documentation are available from the Fortinet Technical Documentation web site
at http://docs.forticare.com.
The following FortiGate product documentation is available:
• FortiGate QuickStart Guide
Provides basic information about connecting and installing a FortiGate unit.
Once you have this information, you can select a VPN topology that meets the
requirements of your situation (see “Network topologies” on page 16).
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:
• Gateway-to-gateway configurations
• Hub-and-spoke configurations
• Dynamic DNS configurations
• FortiClient dialup-client configurations
• FortiGate dialup-client configurations
• Internet-browsing configuration
• Redundant VPN configurations
• Transparent mode VPNs
• Manual-key configurations
These sections contain high-level configuration guidelines with cross-references
to detailed configuration procedures. If you need more detail to complete a step,
select the cross-reference in the step to drill-down to more detail. Return to the
original procedure to complete the procedure. For a general overview of how to
configure a VPN, see “General preparation steps” below.
Policy-based Route-based
Available in NAT/Route or Transparent Available only in NAT/Route mode
mode
Requires a firewall policy with IPSEC Requires only a simple firewall policy with
action that specifies the VPN tunnel. One ACCEPT action. A separate policy is required
policy controls connections in both for connections in each direction.
directions.
Supports DHCP over IPSec Does not support DHCP over IPSec
You create a policy-based VPN by defining an IPSec firewall policy between two
network interfaces and associating it with a VPN tunnel (phase 1) configuration.
You create a route-based VPN by creating a VPN phase 1 configuration with
IPSec interface mode enabled. This creates a virtual IPSec interface. You then
define a firewall policy to permit traffic to flow between the virtual IPSec interface
and another network interface.
Note: The steps given above assume that you will perform Steps 1 and 2 to have the
FortiGate unit generate unique IPSec encryption and authentication keys automatically. In
situations where a remote VPN peer or client requires a specific IPSec encryption and/or
authentication key, you must configure the FortiGate unit to use manual keys instead of
performing Steps 1 and 2. For more information, see “Manual-key configurations” on
page 111.
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
• Configure the VPN peers
• Configuration example
• How to work with overlapping subnets
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 firewall policies.
Site_1 Site_2
Internet
FortiGate_1 FortiGate_2
Note: 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 29.
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 71.
You can set up a fully meshed or partially meshed configuration (see Figure 2 and
Figure 3).
Fully meshed
FortiGate_2 FortiGate_3
FortiGate_1 FortiGate_4
FortiGate_5
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. We recommend a hub-and-spoke
configuration instead (see “Hub-and-spoke configurations” on page 33).
Paritally meshed
FortiGate_2 FortiGate_3
FortiGate_1 FortiGate_4
FortiGate_5
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Static IP Address.
IP Address Type the IP address of the remote peer public interface.
Local Interface Select the FortiGate unit’s 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 “Choosing
policy-based or route-based VPNs” on page 16.
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 remote
peer. See “Phase 2 parameters” on page 143. Enter these settings in particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. These addresses are used in the firewall policies that permit
communication between the networks. For more information, see “Defining
firewall addresses” on page 149.
Enter these settings in particular:
• Define an address name for the IP address and netmask of the private network
behind the local FortiGate unit.
• Define an address name for the IP address and netmask of the private network
behind the remote peer.
4 Define firewall policies to permit communication between the private networks
through the VPN tunnel. Route-based and policy-based VPNs require different
firewall policies. For detailed information about creating firewall policies, see
“Defining firewall policies” on page 150.
Policy-based VPN firewall policy
Define an IPSec firewall policy to permit communications between the source and
destination addresses. Enter these settings in particular:
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Action Select IPSEC.
VPN Tunnel Select the name of the phase 1 configuration that you
created in Step 1.
Select Allow inbound to enable traffic from the remote
network to initiate the tunnel.
Select Allow outbound to enable traffic from the local
network to initiate the tunnel.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Action Select ACCEPT.
NAT Disable.
To permit the remote client to initiate communication, you need to define a firewall
policy for communication in that direction. Enter these settings in particular:
Source Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Destination Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Action Select ACCEPT.
NAT Disable.
5 Place VPN policies in the policy list above any other policies having similar source
and destination addresses.
6 Repeat this procedure at the remote FortiGate unit.
Configuration example
The following example demonstrates how to set up a basic gateway-to-gateway
IPSec VPN that uses preshared keys to authenticate the two VPN peers.
FortiGate_1 FortiGate_2
Internet
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Enable to create a route-based VPN.
Interface Mode Disable to create a policy-based VPN.
This example shows both policy and route-based VPNs.
2 Select Create New, enter the following information, and select OK:
3 Place the policy in the policy list above any other policies having similar source
and destination addresses.
3 Select Create New, enter the following information, and select OK:
4 Place the policies in the policy list above any other policies having similar source
and destination addresses.
Configure FortiGate_2
The configuration of FortiGate_2 is similar to that of FortiGate_1. You must:
• Define the phase 1 parameters that FortiGate_2 needs to authenticate
FortiGate_1 and establish a secure connection.
• Define the phase 2 parameters that FortiGate_2 needs to create a VPN tunnel
with FortiGate_1.
• Create the firewall policy and define the scope of permitted services between
the IP source and destination addresses.
3 Place the policy in the policy list above any other policies having similar source
and destination addresses.
3 Select Create New, enter the following information to create an inbound policy,
and then select OK:
4 Place the policy in the policy list above any other policies having similar source
and destination addresses.
Internet
After the tunnel is established, hosts on each side can communicate with hosts on
the other side using the mapped IP addresses. For example, PC1 can
communicate with PC2 using IP address 10.0.2.100. FortiGate_2 maps
connections for IP address 10.0.2.100 to IP address 192.168.2.100.
Hub-and-spoke configurations
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.
Figure 6: Example hub-and-spoke configuration
Site_1 Site_2
Internet
Spoke_1 Spoke_2
Hub
Subnet_1 (192.168.2.0/24)
All spokes use the large subnet address, 10.1.0.0/16 for example, as
• the IPsec destination selector
• the destination of the firewall policy from the private subnet to the VPN
(required for policy-based VPN, optional for interface-based VPN)
• the destination of the static route to the VPN (interface-based)
Each spoke uses the address of its own protected subnet as the IPsec source
selector and as the source address in its VPN firewall 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.
Remote Gateway The remote gateway is the other end of the VPN tunnel. There are
three options:
Static IP Address Enter the spoke’s public IP address. You will
need to create a phase 1 configuration for
each spoke.
Either the hub or the spoke can establish the
VPN connection.
Dialup User No additional information is needed. The
hub accepts connections from peers with
appropriate encryption and authentication
settings. Only one phase 1 configuration is
needed for multiple dialup spokes.
Only the spoke can establish the VPN
tunnel.
Dynamic DNS If the spoke subscribes to a dynamic DNS
service, enter the spoke’s domain name.
Either the hub or the spoke can establish the
VPN connection. For more information, see
“Dynamic DNS configurations” on page 49.
Local Interface Select the FortiGate interface that connects to the remote
gateway. This is usually the FortiGate unit’s 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 “Choosing
policy-based or route-based VPNs” on page 16.
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 143. Enter these settings in particular:
Source Interface/Zone Select the hub’s interface to the internal (private) network.
Source Address Name Select the source address that you defined in Step 1.
Destination Interface/Zone Select the hub’s public network interface.
Destination Address Name Select the address name you defined in Step 2 for the
private network behind the spoke FortiGate unit.
Action IPSEC
VPN Tunnel Select the name of the phase 1 configuration that you
created for the spoke in Step 1.
Select Allow inbound to enable traffic from the remote
network to initiate the tunnel.
Select Allow outbound to enable traffic from the local
network to initiate the tunnel.
Route-based VPN firewall policies
Define ACCEPT firewall policies to permit communications between the hub and
the spoke. You need one policy for each direction. Enter these settings in
particular:
Source Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Source Address Name Select the address name you defined in Step 2 for the
private network behind the spoke FortiGate unit.
Destination Interface/Zone Select the hub’s interface to the internal (private) network.
Destination Address Name Select the source address that you defined in Step 1.
Action Select ACCEPT.
NAT Enable.
Source Interface/Zone Select the address name you defined in Step 2 for the
private network behind the spoke FortiGate units.
Source Address Name Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Destination Interface/Zone Select the source address that you defined in Step 1.
Destination Address Name Select the hub’s interface to the internal (private) network.
Action Select ACCEPT.
NAT Enable.
Note: To remove tunnels from the VPN concentrator, select the tunnel in the Members list
and select the left-pointing arrow.
4 Repeat Step 3 until all of the tunnels associated with the spokes are included in
the concentrator.
5 Select OK.
Source Interface/Zone Select the zone you created for your VPN.
Source Address Name Select All.
Destination Interface/Zone Select the zone you created for your VPN.
Destination Address Name Select All.
Action Select ACCEPT.
NAT Enable.
Protection profile If you want to apply a protection profile to this traffic, select
the appropriate profile.
2 Select OK.
3 Select OK.
2 Create the phase 2 tunnel definition. See “Phase 2 parameters” on page 143.
Enter these settings in particular:
Remote Gateway 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.
Source Interface/Zone Select the spoke’s interface to the internal (private) network.
Source Address Name Select the spoke address you defined in Step 1.
Destination Interface/Zone Select the spoke’s interface to the external (public) network.
Destination Address Name Select the hub address you defined in Step 2.
Action Select IPSEC
VPN Tunnel Select the name of the phase 1 configuration you defined.
Select Allow inbound to enable traffic from the remote
network to initiate the tunnel.
Select Allow outbound to enable traffic from the local
network to initiate the tunnel.
Destination Interface/Zone Select the spoke’s interface to the internal (private) network.
Destination Address Name Select the spoke addresses you defined in Step 2.
Action Select ACCEPT
NAT Enable
Source Interface/Zone Select the spoke’s interface to the internal (private) network.
Source Address Name Select the spoke address you defined in Step 1.
Destination Interface/Zone Select the virtual IPSec interface you created.
Destination Address Name Select the hub destination addresses you defined in Step 2.
Action Select ACCEPT
NAT Enable
Source Interface/Zone Select the spoke’s interface to the internal (private) network.
Source Address Name Select this spoke’s address name.
Destination Interface/Zone Select the virtual IPSec interface you created.
Destination Address Name Select the spoke address group you defined in Step 1.
Action Select ACCEPT
NAT Enable
3 Place this policy or policies in the policy list above any other policies having similar
source and destination addresses.
Spoke_1 Spoke_2
Internet
172.16.10.1
Site_1 Site_2
10.1.1.0/24 10.1.2.0/24
Hub FortiGate_1
HR Network
10.1.0.0/24
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.
To define the firewall policy for traffic from the hub to the spokes
1 Go to Firewall > Policy.
2 Select Create New, enter the following information, and select OK:
Source Interface/Zone
Select the interface to the HR network, port 1.
Address Name
HR_Network
Destination Interface/Zone
Select the virtual IPSec interface that connects to the
spokes, toSpokes
Address Name
Spoke_net
Schedule As required.
Service As required.
Action ACCEPT
3 Place the policy in the policy list above any other policies having similar source
and destination addresses.
5 Select OK.
2 Select OK.
Source Interface/Zone
Select the virtual IPSec interface, toHub.
Address Name
Select the aggregate protected network address
Spoke_net
Destination Interface/Zone
Select the interface to the internal (private) network,
port1.
Address Name
Select the address for this spoke’s protected network
LocalNet
Schedule As required.
Service As required.
Action ACCEPT
3 Select Create New, enter the following information, and select OK:
Source Interface/Zone
Select the interface to the internal (private) network,
port1.
Address Name
Select the address for this spoke’s protected network
LocalNet
Destination Interface/Zone
Select the virtual IPSec interface, toHub.
Address Name
Select the aggregate protected network address
Spoke_net
Schedule As required.
Service As required.
Action ACCEPT
4 Place these policies in the policy list above any other policies having similar
source and destination addresses.
Configuration overview
In this type of scenario, one of the FortiGate units in a gateway-to-gateway
configuration has a static domain name (for example, example.com) and a
dynamic IP address. See FortiGate_2 in Figure 9. Whenever that FortiGate 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. Therefore, remote
peers have to locate the FortiGate unit through DNS lookup.
Site_1 Site_2
FortiGate_1 FortiGate_2
Internet
172.16.20.1 example.com
DNS Server
Dynamic DNS
server
Whenever the FortiGate unit detects that its IP address has changed, it notifies
the dynamic DNS server and provides the new IP address to the server. The
dynamic DNS server makes the updated IP address available to all DNS servers
and the new IP address remains in effect until the FortiGate unit detects that its IP
address has changed again.
A FortiGate unit that has static domain name and a dynamic IP address can
initiate VPN connections anytime—the remote peer replies to the FortiGate unit
using the source IP address that was sent in the packet header. However,
changes to a dynamic IP address must be resolved before a remote peer can
establish a VPN connection to the domain name—the remote peer must request a
DNS lookup for the matching IP address before initiating the connection.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Static IP Address.
IP Address Type the IP address of the public interface to the remote peer.
Mode Select Aggressive.
Enable IPSec Enable for a route-based VPN.
Interface Mode Disable for a policy-based VPN.
Local ID Type a character string that the local FortiGate unit can use to
identify itself to the remote peer (for example, you could type the
fully qualified domain name of the FortiGate unit, example.com).
This value must be identical to the value in the Accept this peer ID
field of the phase 1 remote gateway configuration on the remote
peer.
2 Define the phase 2 parameters needed to create a VPN tunnel with the remote
peer. See “Phase 2 parameters” on page 143. Enter these settings in particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. These addresses are used in the firewall policies that permit
communication between the networks. For more information, see “Defining
firewall addresses” on page 149.
Enter these settings in particular:
• Define an address name for the IP address and netmask of the private network
behind the local FortiGate unit.
• Define an address name for the IP address and netmask of the private network
behind the remote peer.
4 Define firewall policies to permit communications between the private networks
through the VPN tunnel. Route-based and policy-based VPNs require different
firewall policies. For detailed information about creating firewall policies, see
“Defining firewall policies” on page 150.
Policy-based VPN firewall policy
Define an IPSec policy to permit communication between the private networks.
Enter these settings in particular, and then select OK:
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Action Select ACCEPT.
NAT Disable.
To permit the remote peer to initiate communication, you need to define a firewall
policy for communication in that direction. Enter these settings in particular:
Source Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Destination Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Action Select ACCEPT.
NAT Disable.
5 Place these policies in the policy list above any other policies having similar
source and destination addresses.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Dynamic DNS.
Dynamic DNS Type the fully qualified domain name of the remote peer (for
example, example.com).
Mode Select Aggressive.
Peer Options Select Accept this peer ID, and type the identifier of the
dynamically-addressed FortiGate unit. This is the value you
entered in the Local ID field of the other unit’s phase 1 remote
gateway configuration.
Enable IPSec Enable for a route-based VPN.
Interface Mode Disable for a policy-based VPN.
2 Define the phase 2 parameters needed to create a VPN tunnel with the remote
peer. See “Phase 2 parameters” on page 143. Enter these settings in particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. See “Defining firewall addresses” on page 149. Enter these
settings in particular:
• Define an address name for the IP address and netmask of the private network
behind the local FortiGate unit.
• Define an address name for the IP address and netmask of the private network
behind the remote peer.
4 Define the firewall policies to permit communications between the source and
destination addresses. See “Defining firewall policies” on page 150. Enter these
settings in particular and then select OK:
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Action Select ACCEPT.
NAT Disable.
To permit the remote client to initiate communication, you need to define a firewall
policy for communication in that direction. Enter these settings in particular:
Source Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind the remote peer.
Destination Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Action Select ACCEPT.
NAT Disable.
5 Place these policies in the policy list above any other policies having similar
source and destination addresses.
FortiClient dialup-client
configurations
The FortiClient Host Security application is a 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 Host 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.
Note: The FortiClient configurations in this guide do not apply to the FortiClient Consumer
Edition, which does not include the IPSec VPN feature.
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 Host Security application initiates a connection to
a FortiGate dialup server.
Site_1
Dialup_1
Internet
Dialup_2
FortiGate_1
Dialup_3
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-T compatible to pass encrypted
packets (see “NAT traversal” on page 140). 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.
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
address to download VPN settings from the FortiGate unit. See “Automatic
configuration of FortiClient dialup clients” on page 56.
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
firewall policy associated with the tunnel permits access. 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 131.
Finally, the FortiGate unit searches the implicated IPSec firewall policies to
determine which private network(s) the dialup clients may access. The rest of the
VPN policy information is retrieved from the existing IPSec phase 1 and phase 2
parameters in the dialup-client configuration.
Note: To determine the VIP address that the FortiClient Host Security application is using,
type ipconfig /all at the Windows Command Prompt on the FortiClient host. 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.
Note: 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 145.
Note: FortiGate units fully support RFC 3456, Dynamic Host Configuration Protocol
(DHCPv4) Configuration of IPsec Tunnel Mode. The FortiGate DHCP over IPSec feature
can be enabled to allocate VIP addresses to FortiClient dialup clients using a FortiGate
DHCP server if a policy-based VPN is configured. DHCP over IPSec is not compatible with
FortiGate route-based VPNs.
3 1
2
172.16.30.1
1 3
2
192.168.20.2
Note: 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 FortiGate dialup clients automatically. For more information, see “Configuring the
FortiGate unit as a VPN policy server” on page 62.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Dialup User.
Local Interface Select the interface through which clients connect to the
FortiGate unit.
Mode Select Main (ID Protection).
Authentication Method Select Pre-shared Key.
Pre-shared Key Enter the pre-shared key. This must be the same preshared
key provided to the FortiClient users.
Peer option Select Accept any peer ID.
Enable IPSec Interface You must select Advanced to see this setting. If IPSec
Mode 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 FortiClient
peer. See “Phase 2 parameters” on page 143. Enter these settings in particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. These addresses are used in the firewall policies that permit
communication between the networks. For more information, see “Defining
firewall addresses” on page 149.
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 virtual IP addresses, define an address name
for the subnet to which these VIPs belong.
4 Define firewall policies to permit communication between the private networks
through the VPN tunnel. Route-based and policy-based VPNs require different
firewall policies. For detailed information about creating firewall policies, see
“Defining firewall policies” on page 150.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name If FortiClient users are assigned VIPs, select the address
name that you defined in Step 3 for the VIP subnet.
Otherwise, select All.
Action Select IPSEC.
VPN Tunnel Select the name of the phase 1 configuration that you
created in Step 1.
Select Allow inbound to enable traffic from the remote
network to initiate the tunnel.
Select Allow Outbound if you want to allow hosts on the
private network to initiate communications with the
FortiClient users after the tunnel is established.
Source Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Source Address Name Select All.
Destination Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Destination Address Name Select All.
Action Select ACCEPT.
NAT Disable.
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 firewall
policy for communication in that direction. Enter these settings in particular:
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select All.
Destination Interface/Zone Select the VPN Tunnel (IPSec Interface) you configured in
Step 1.
Destination Address Name Select All.
Action Select ACCEPT.
NAT Disable.
5 Place VPN policies in the policy list above any other policies having similar source
and destination addresses.
IP Range Enter the range of VIP addresses that the DHCP server can
dynamically assign to dialup clients when they connect. As a
precaution, do not assign VIP addresses that match the private
network behind the FortiGate unit (for example, if the dialup
clients need to access a host on local subnet 192.168.12.0/24,
you could configure the DHCP server to assign any VIP address
in the 10.254.254.100 to 10.254.254.125 range). If you
need to exclude specific IP addresses from the range, you can
define an exclusion range (see Advanced below).
Network Mask Enter the network mask of the IP addresses that you specified in
the IP Range fields (for example, 255.255.255.0 for a class C
network).
Default Gateway Enter the IP address of the default gateway that the DHCP
server assigns to DHCP clients.
Domain If you want the FortiGate unit to assign a domain name to dialup
clients when they connect, enter the registered domain name.
Lease Time Specify a lease time:
• Select Unlimited to allow the dialup client to use the assigned
IP address for an unlimited amount of time (that is, until the
client disconnects).
• Enter the amount of time (in days, hours, and minutes) that
the dialup client may use the assigned IP address, after
which the dialup client must request new settings from the
DHCP server. The range is from 5 minutes to 100 days.
Advanced Set these Advanced options as applicable:
• In the DNS Server 1 field, type the IP address of the DNS
server that dialup clients can access after the tunnel has
been established. You can specify up to three DNS servers.
• In the WINS Server 1 field, type the IP address of the
Windows Internet Service (WINS) server that dialup clients
can access after the tunnel has been established. You can
specify a second WINS server if required.
• If you want to send DHCP options to the dialup client, type
the option code in the Code field, and if applicable, type any
associated data in the Option field (for more information, see
RFC 2132, DHCP Options and BOOTP Vendor Extensions).
• To specify any VIP addresses that must be excluded from the
VIP address range, select Add, and then type the starting
and ending IP addresses. You can add more than one range
to exclude.
Note: For VPNs with automatic configuration, only preshared keys are supported.
Certificates are not supported.
4 Follow the remaining steps only if you want to configure a VIP. Otherwise, select
OK.
5 Select Advanced.
6 Enable Acquire a virtual IP address and then select the adjacent Config button.
Dialup_1
FortiGate_1
Server_1
192.168.12.1 VIP address
Port 2
Internet 10.254.254.100
Port 1
172.16.10.1
Dialup_2
VIP address
10.254.254.101
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 firewall policy permits the connection, the FortiGate unit
establishes the tunnel using IPSec phase 2 parameters and applies the IPSec
firewall 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 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 “Define the phase 1
parameters” on page 67.
• 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
“Define the phase 2 parameters” on page 67.
• Create an IPSec firewall policy to control the permitted services and permitted
direction of traffic between the IP source address and the dialup clients. A
single policy controls both inbound and outbound IP traffic through the VPN
tunnel. See “Define the IPSec firewall policy” on page 68.
• Configure the FortiGate unit to relay DHCP requests from dialup clients to the
DHCP server. See “Configure FortiGate_1 to assign VIPs” on page 69.
3 Place the policy in the policy list above any other policies having similar source
and destination addresses.
Note: You may optionally configure the FortiGate unit to act as a DHCP relay instead. See
“To configure DHCP relay on the FortiGate unit” on page 62.
Name Enter a name for the DHCP server, ClientVIPs for example.
Enable Select
Type Select IPSEC.
IP Range 10.254.254.1 - 10.254.254.100
Network Mask 255.255.255.0
Default Gateway Enter the IP address of the default gateway that the DHCP
server assigns to DHCP clients.
To configure FortiClient
1 At the remote host, start FortiClient.
2 Go to VPN > Connections and select Add.
3 In the Connection Name field, type a descriptive name for the connection.
4 In the Remote Gateway field, type the public static IP address of the FortiGate
unit.
5 In the Remote Network fields, type the private IP address and netmask of the
server that FortiClient needs to access behind the FortiGate unit (for example,
192.168.12.1/255.255.255.255).
6 From the Authentication Method list, select Preshared Key.
7 In the Preshared Key field, type the preshared key. The value must be identical to
the preshared key that you specified previously in the FortiGate_1 configuration.
8 Select Advanced.
9 In the Advanced Settings dialog box, select Acquire virtual IP address and then
select Config.
10 Verify that the Dynamic Host Configuration Protocol (DHCP) over IPSec option is
selected, and then select OK.
11 Select OK twice to close the dialog boxes.
12 Exit FortiClient and repeat this procedure at all other remote hosts.
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.
Site_1
Internet Site_2
FortiGate_1
FG_Dialup
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, we
recommend that you assign a unique identifier (local ID) to each FortiGate dialup
client. For more information, see “Authenticating remote peers and clients” on
page 131.
Note: 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 using user accounts and pre-shared keys” on
page 135.
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.
Note: 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 140.
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/or
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 14 on page 73). 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.
Site_1
DHCP discovery
FortiGate_1 message
initiates tunnel
Internet
Site_2
DHCP Server
FG_Dialup
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.
When the DHCP server resides on the private network behind the FortiGate
dialup server as shown in Figure 14, the IP destination address specified in the
IPSec firewall policy on the FortiGate dialup client must refer to that network.
Note: If the DHCP server is not directly connected to the private network behind the
FortiGate dialup server (that is, its IP address does not match the IP address of the private
network), you must add (to the FortiGate dialup client’s routing table) a static route to the
DHCP server, and the IP destination address specified in the IPSec firewall policy on the
FortiGate dialup client must refer to the DHCP server address. In this case, the DHCP
server must be configured to assign IP addresses that do not belong to the network on
which the DHCP server resides. In addition, the IP addresses cannot match the network
address space used by the private network behind the FortiGate dialup server.
• Computers on the private network behind the FortiGate dialup client can obtain
IP addresses either from a DHCP server behind the FortiGate dialup client, or
a DHCP server behind the FortiGate dialup server.
• If the DHCP server resides on the network behind the dialup client, the
DHCP server must be configured to assign IP addresses that do not match
the private network behind the FortiGate dialup server.
• If the DHCP server resides on the network behind the FortiGate dialup
server, the DHCP server must be configured to assign IP addresses that do
not match the private network behind the FortiGate dialup client. In addition,
the FortiGate dialup client routing table must contain a static route to the
DHCP server (see the “Router Static” chapter of the FortiGate
Administration Guide).
Note: 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 the FortiGate unit” on page 62.
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 supplier’s documentation to
configure the DHCP server.
• Configure the FortiGate dialup server. See “Configure the server to accept
FortiGate dialup-client connections” on page 75.
• Configure the FortiGate dialup client. See “Configure the FortiGate dialup
client” on page 76.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Dialup User.
Local Interface Select the interface through which clients connect to the FortiGate
unit.
Mode If you will be assigning an ID to the FortiGate dialup client, select
Aggressive.
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 143. Enter these settings in
particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. See “Defining firewall addresses” on page 149. 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 firewall policies to permit communications between the private
networks through the VPN tunnel. Route-based and policy-based VPNs require
different firewall policies. For detailed information about creating firewall policies,
see “Defining firewall policies” on page 150.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name Select the address name that you defined in Step 3.
Action Select IPSEC.
VPN Tunnel Select the name of the phase 1 configuration that you
created in Step 1.
Select Allow inbound 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.
Source Interface/Zone Select the VPN tunnel (IPSec interface) created in Step 1.
Source Address Name Select All.
Destination Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Destination Address Name Select All.
Action Select ACCEPT.
NAT Disable
5 Place the policy in the policy list above any other policies having similar source
and destination addresses.
Name Enter a name to identify the VPN tunnel. This name appears in
phase 2 configurations, firewall policies and the VPN monitor.
Remote Gateway Select Static IP Address.
IP Address Type the IP address of the dialup server’s public interface.
Local Interface Select the interface that connects to the public network.
Mode Because the FortiGate dialup client has a dynamic IP address,
select Aggressive.
Advanced Select to view the following options.
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 If IPSec Interface Mode is enabled, the FortiGate unit creates a
Interface Mode 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 143. Enter these settings in particular:
3 Define names for the addresses or address ranges of the private networks that
the VPN links. See “Defining firewall addresses” on page 149. 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 firewall policies to permit communication between the private networks
through the VPN tunnel. Route-based and policy-based VPNs require different
firewall policies. For detailed information about creating firewall policies, see
“Defining firewall policies” on page 150.
Policy-based VPN firewall policy
Define an IPSec firewall policy to permit communications between the source and
destination addresses. Enter these settings in particular:
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined in Step 3 for the
private network behind this FortiGate unit.
Destination Interface/Zone Select the FortiGate unit’s public interface.
Destination Address Name Select the address name that you defined in Step 3 for the
private network behind the dialup server.
Action Select IPSEC.
VPN Tunnel Select the name of the phase 1 configuration that you
created in Step 1.
Clear Allow inbound to prevent traffic from the remote
network from initiating the tunnel after the tunnel has been
established.
Select Allow outbound to enable traffic from the local
network to initiate the tunnel.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select All.
Destination Interface/Zone Select the VPN tunnel (IPSec interface) created in Step 1.
Destination Address Name Select All.
Action Select ACCEPT.
NAT Disable
5 Place the policy in the policy list above any other policies having similar source
and destination addresses.
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 firewall 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 firewall 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 15, FortiGate_1 enables secure Internet browsing for FortiClient Host
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.
Site_2
FG_Dialup_2
Site_1
FortiGate_1
Dialup_1
Internet
Web server
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 19)
• a FortiClient dialup-client configuration (see “FortiClient dialup-client
configurations” on page 55)
• a FortiGate dialup-client configuration (see “FortiGate dialup-client
configurations” on page 71)
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 firewall policy. See “Creating an Internet browsing firewall 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 Host Security
application. See “Routing all remote traffic through the VPN tunnel” on
page 81.
The VPN clients must be configured to route all Internet traffic through the VPN
tunnel.
All packets are routed through the VPN tunnel, not just packets destined for the
protected private network.
Configuration overview
A FortiGate unit with two interfaces 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.
A fully-redundant configuration requires redundant connections to the Internet on
both peers. Figure 16 on page 84 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 98. This is useful for 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/Route mode. You must use auto-keying. A VPN that is
created using manual keys (see “Manual-key configurations” on page 111) 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 104.
Site_1
Redundant tunnel
Primary tunnel
FortiGate_1
Internet
Site_2
FortiGate_2
Primary tunnel
Redundant tunnel
Note: A VPN that is created using manual keys (see “Manual-key configurations” on
page 111) cannot be included in a redundant-tunnel configuration.
Path 2
Path 3
Path 4
For more information, see “Auto Key phase 1 parameters” on page 127.
3 Create a phase 2 definition for each path. See “Phase 2 parameters” on page 143.
Enter these settings in particular:
Phase 1 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.
Device One of the virtual IPSec interfaces on the local peer.
Distance For each path, enter a different value to prioritize the paths.
5 Define the firewall policy for the local primary interface. See “Defining firewall
policies” on page 150. You need to create two policies for each path to enable
communication in both directions. Enter these settings in particular:
Source Interface/Zone Select the local interface to the internal (private) network
Source Address Name All
Destination Interface/Zone Select one of the virtual IPSec interfaces you created in
Step 2.
Destination Address Name All
Schedule Always
Service Any
Action ACCEPT
Source Interface/Zone Select one of the virtual IPSec interfaces you created in
Step 2.
Source Address Name All
Destination Interface/Zone Select the local interface to the internal (private) network.
Destination Address Name All
Schedule Always
Service Any
Action ACCEPT
6 Place the policy in the policy list above any other policies having similar source
and destination addresses.
7 Repeat this procedure at the remote FortiGate unit.
WAN2 172.16.20.2
WAN1 10.10.10.2
FortiGate_1
Finance Network
192.168.12.0/24
Internet
FortiGate_2
WAN1 10.10.20.2
WAN2 172.16.30.2
HR Network
192.168.22.0/24
For each path, VPN configuration, firewall 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 firewall policies between the internal interface
and each of the virtual IPSec interfaces
3 Select the Edit icon for the WAN1 interface, enter the following information and
then select OK:
4 Select the Edit icon for the WAN2 interface, enter the following information and
then select OK:
Name Site_1_A
Remote Gateway Static IP Address
IP Address 10.10.20.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
3 Select Create Phase 1, enter the following information, and select OK:
Name Site_1_B
Remote Gateway Static IP Address
IP Address 172.16.30.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
4 Select Create Phase 1, enter the following information, and select OK:
Name Site_1_C
Remote Gateway Static IP Address
IP Address 10.10.20.2
Local Interface WAN2
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
5 Select Create Phase 1, enter the following information, and select OK:
Name Site_1_D
Remote Gateway Static IP Address
IP Address 172.16.30.2
Local Interface WAN2
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection 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.
2 Select Create New, enter the following default gateway information and then
select OK:
3 Select Create New, enter the following information and then select OK:
4 Select Create New, enter the following information and then select OK:
5 Select Create New, enter the following information and then select OK:
6 Select Create New, enter the following information and then select OK:
3 Select Create New, enter the following information, and select OK:
4 Select Create New, enter the following information, and select OK:
5 Select Create New, enter the following information, and select OK:
6 Select Create New, enter the following information, and select OK:
Service Any
Action ACCEPT
7 Select Create New, enter the following information, and select OK:
8 Select Create New, enter the following information, and select OK:
9 Select Create New, enter the following information, and select OK:
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 firewall policies between the internal interface
and each of the virtual IPSec interfaces
3 Select the Edit icon for the WAN1 interface, enter the following information and
then select OK:
4 Select the Edit icon for the WAN2 interface, enter the following information and
then select OK:
Name Site_2_A
Remote Gateway Static IP Address
IP Address 10.10.10.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
3 Select Create Phase 1, enter the following information, and select OK:
Name Site_2_B
Remote Gateway Static IP Address
IP Address 172.16.20.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
4 Select Create Phase 1, enter the following information, and select OK:
Name Site_2_C
Remote Gateway Static IP Address
IP Address 10.10.10.2
Local Interface WAN2
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
5 Select Create Phase 1, enter the following information, and select OK:
Name Site_2_D
Remote Gateway Static IP Address
IP Address 172.16.20.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
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.
2 Select Create New, enter the following default gateway information and then
select OK:
3 Select Create New, enter the following information and then select OK:
4 Select Create New, enter the following information and then select OK:
5 Select Create New, enter the following information and then select OK:
6 Select Create New, enter the following information and then select OK:
3 Select Create New, enter the following information, and select OK:
4 Select Create New, enter the following information, and select OK:
5 Select Create New, enter the following information, and select OK:
6 Select Create New, enter the following information, and select OK:
7 Select Create New, enter the following information, and select OK:
8 Select Create New, enter the following information, and select OK:
9 Select Create New, enter the following information, and select OK:
FortiGate_1
Corporate Network
192.168.12.0/24
Internet
VPN tunnel
WAN1
Internal
FortiGate_2
SOHO Network
192.168.22.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 firewall policies between the internal
interface and each of the virtual IPSec interfaces
3 Select the Edit icon for the WAN1 interface, enter the following information and
then select OK:
4 Select the Edit icon for the WAN2 interface, enter the following information and
then select OK:
Name Site_1_A
Remote Gateway Dialup User
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
3 Select Create Phase 1, enter the following information, and select OK:
Name Site_1_B
Remote Gateway Dialup User
Local Interface WAN2
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection 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
To configure routes
1 Go to Router > Static.
2 Select Create New, enter the following default gateway information and then
select OK:
3 Select Create New, enter the following information, and select OK:
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 firewall policies between the internal interface and each of the virtual
IPSec interfaces
3 Select the Edit icon for the WAN1 interface, enter the following information and
then select OK:
Name Site_2_A
Remote Gateway Static IP Address
IP Address 10.10.10.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
3 Select Create Phase 1, enter the following information, and select OK:
Name Site_2_B
Remote Gateway Static IP Address
IP Address 172.16.20.2
Local Interface WAN1
Mode Main
Authentication Method Preshared Key
Pre-shared Key Enter the preshared key.
Peer Options Accept any peer ID
Advanced
Enable IPSec Interface Mode Select
Dead Peer Detection Select
Name Route_A.
Phase 1 Site_2_A
Advanced
Source Address 192.168.22.0/24
3 Select Create Phase 2, enter the following information and select OK:
Name Route_B.
Phase 1 Site_2_B
Advanced
Source Address 192.168.22.0/24
To configure routes
1 Go to Router > Static.
2 Select Create New, enter the following information and then select OK:
3 Select Create New, enter the following information and then select OK:
3 Select Create New, enter the following information, and select OK:
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 19 shows the management station on the same subnet. The management
station can connect to the FortiGate unit directly through the web-based manager.
Site_1
10.10.10.0/24
Management
station
Internet
10.10.10.1
Edge router
FortiGate_1
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 20 on page 106), the router must
translate (NAT) a routable address to direct management traffic to the FortiGate
management interface.
Site_1
10.10.10.0/24
Management
station
Edge router
VPN
FortiGate_1 Remote Sites
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 “Router Static” chapter of the FortiGate Administration Guide.
In the example configuration shown in Figure 20, 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 supplier’s
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 21 on page 107), at
least one router must separate the two FortiGate units, unless the packets can be
redirected using ICMP (see Figure 22 on page 107).
Figure 21: Link between two FortiGate units running in Transparent mode
Internet
FortiGate_1 FortiGate_2
Network_1 Network_2
Router
Network_1 Network_2
In Figure 22, 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.
Figure 22: ICMP redirecting packets to two FortiGate units running in Transparent
mode
Internet
Router
C
FortiGate_1 FortiGate_2
A Network_3 B
ICMP
Network_1 Network_2
If there are additional routers behind the FortiGate unit (see Figure 23 on
page 108) 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 23, 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.
Internet
FortiGate_1
Router_1 Router_2
A Network_3 B
Network_1 Network_2
2 Define the phase 2 parameters needed to create a VPN tunnel with the remote
peer. See “Phase 2 parameters” on page 143. Enter these settings in particular:
Phase 1 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.
3 Define the source and destination addresses of the IP packets that are to be
transported through the VPN tunnel. See “Defining firewall addresses” on
page 149. Enter these settings in particular:
• For the originating address (source address), enter the IP address of the local
management interface (for example, 10.10.10.1/32).
• 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.
4 Define an IPSec firewall policy to permit communications between the source and
destination addresses. See “Defining firewall policies” on page 150. Enter these
settings in particular:
Source Interface/Zone Select the local interface to the internal (private) network.
Source Address Name Select the source address that you defined in Step 3.
Destination Interface/Zone Select the interface to the edge router. When you configure
the IPSec firewall policy on a remote peer that operates in
NAT/Route mode, you select the public interface to the
external (public) network instead.
Destination Address Name Select the destination address that you defined in Step 3.
Action IPSEC
VPN Tunnel Select the name of the phase 2 tunnel configuration that you
created in Step 2.
Select Allow inbound to enable traffic from the remote
network to initiate the tunnel.
Select Allow outbound to enable traffic from the local
network to initiate the tunnel.
5 Place the policy in the policy list above any other policies having similar source
and destination addresses.
6 Repeat this procedure at the remote FortiGate unit.
Manual-key configurations
This section explains how to manually define cryptographic keys to establish an
IPSec VPN, either policy-based or route-based.
The following topics are included in this section:
• Configuration overview
• Specify the manual keys for creating a tunnel
Configuration overview
You can manually define cryptographic keys for the FortiGate unit to establish an
IPSec VPN.
You define manual 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 on the VPN >
IPSEC > Manual Key tab instead.
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.
Note: 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.
Caution: 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.
3 Select OK.
Compared with IPv4 IPSec VPN functionality, there are some limitations:
• Except for IPv6 over IPv4, remote gateways with Dynamic DNS are not
supported. This is because FortiOS 3.0 does not support IPv6 DNS.
• 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.
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.
Phase 1 configuration
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.
Phase 2 configuration
An IPv6 IPSec phase 2 configuration has IPv6 address selectors. The
src-addr-type and dst-addr-type options ip6, range6 and subnet6
require IPv6 addresses, but are otherwise the same as the similarly-named IPv4
options. The name option, referring to a firewall address or address group name,
applies only to IPv4 configurations.
Firewall policies
To complete the VPN configuration, you need a firewall policy in each direction to
permit traffic between the protected network’s 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. 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.
FortiGate A FortiGate B
Internet
Port3 Port3
Port 2
feco:0001:209:0fff:fe83:25f2 Port 2
feco:0001:209:0fff:fe83:25C7
fec0:0000:0000:0000::/64 fec0:0000:0000:0004::/64
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. Firewall 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
end
FortiGate A FortiGate B
Internet
Port3 Port3
Port 2
feco:0001:209:0fff:fe83:25f2 Port 2
feco:0001:209:0fff:fe83:25C7
192.168.2.0/24 192.168.3.0/24
end
next
edit port3
set 192.168.2.1/24
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 firewall 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
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
FortiGate A FortiGate B
Internet
Port3 Port3
Port 2 Port 2
10.0.0.1/24 10.0.1.1/24
fec0:0000:0000:0000::/64 fec0:0000:0000:0004::/64
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 firewall 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.
Note: The information and procedures in this section do not apply to VPN peers that
perform negotiations using manual keys. Refer to “Manual-key configurations” on page 111
instead.
Overview
IPSec phase 1 settings define:
• the ends of the IPSec tunnel, remote and local
• whether the various 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)
• whether a preshared key or digital certificates will be used to authenticate the
FortiGate unit to the VPN peer or dialup client
• whether 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.
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 141.
5 Select OK.
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 141.
5 Select OK.
• You can permit access to remote peers or dialup clients who each have a
unique peer ID and a unique preshared key. Each peer or client must have a
user account on the FortiGate unit. See “Enabling VPN access using user
accounts and pre-shared keys” on page 135.
For authentication of users of the remote peer or dialup client device, see “Using
XAuth authentication” on page 141.
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.
Before you begin, you must obtain the identifier (local ID) of the remote peer or
dialup client. If you are using the FortiClient Host Security application as a dialup
client, refer to the Authenticating FortiClient Dialup Clients Technical Note to view
or assign an identifier. To assign an identifier to a FortiGate dialup client or a
FortiGate unit that has a dynamic IP address and subscribes to a dynamic DNS
service, see “To assign an identifier (local ID) to a FortiGate unit” on page 135.
If required, a dialup user group can be created from existing user accounts for
dialup clients. To create the user accounts and user groups, see the “User”
chapter of the FortiGate Administration Guide.
To authenticate dialup clients using unique preshared keys and/or peer IDs
The following procedure supports FortiGate/FortiClient dialup clients that use
unique preshared keys and/or peer IDs. The client must have an account on the
FortiGate unit and be a member of the dialup user group.
The dialup user group must be added to the FortiGate configuration before it can
be selected (see the “User” chapter of the FortiGate Administration Guide).
The FortiGate dialup server compares the local ID that you specify at each dialup
client to the FortiGate user-account user name. The dialup-client preshared key is
compared to a FortiGate user-account password.
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 field should be empty).
5 Select Accept peer ID in dialup group and then select the group name from the list
of user groups.
6 Select OK.
Note: 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 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 or
HMAC-SHA-1). Each party signs a different combination of inputs and the other
party verifies that the same result can be computed.
Note: 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 other’s identity with respect to their
public keys. In this case, the required digital certificates (see the FortiGate
Certificate Management User Guide) 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 using user accounts and pre-shared
keys” on page 135 and “Using the FortiGate unit as an XAuth server” on
page 141. Follow this procedure to add IKE negotiation parameters to the existing
definition.
4 Select OK.
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 problem, 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.
3 Select Advanced.
4 Under XAuth, select Enable as Server.
5 The Server Type setting determines the type of encryption method to use between
the XAuth client, the FortiGate unit and the authentication server. Select one of
the following options:
• PAP—Password Authentication Protocol.
• CHAP— Challenge-Handshake Authentication Protocol.
• MIXED—Use PAP between the XAuth client and the FortiGate unit, and CHAP
between the FortiGate unit and the authentication server.
6 From the User Group list, select the user group that needs to access the private
network behind the FortiGate unit. The group must be added to the FortiGate
configuration before it can be selected here.
7 Select OK.
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
Figure 27: Basic Phase 2 settings (VPN > IPSEC > Auto Key (IKE) > Create Phase 2
The information and procedures in this section do not apply to VPN peers that
perform negotiations using manual keys. Refer to “Manual-key configurations” on
page 111 instead.
P2 Proposal
In phase 2, the FortiGate unit and the VPN peer or client exchange keys again to
establish a secure communication channel between them. 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.
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. 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.
DHCP-IPSec
Select this option if the FortiGate unit assigns VIP addresses to FortiClient dialup
clients through a DHCP server or relay. This option is available only if the Remote
Gateway in the phase 1 configuration is set to Dialup User and it works only on
policy-based VPNs.
The DHCP-IPSec option causes the FortiGate dialup server to act as a proxy for
FortiClient dialup clients that have VIP addresses on the subnet of the private
network behind the FortiGate unit. In this case, the FortiGate dialup server acts as
a proxy on the local private network for the FortiClient dialup client. When a host
on the network behind the dialup server issues an ARP request that corresponds
to 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.
The quick mode selectors allow IKE negotiations only for peers that match the
specified configuration. This does not control traffic on the VPN. Access to IPSec
VPN tunnels is controlled through firewall policies.
4 Select Advanced.
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.
Encryption You can select any of the following symmetric-key algorithms:
• NULL-Do not use an encryption algorithm.
• 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.
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, the hash algorithm developed by RSA Data
Security.
• SHA1-Secure Hash Algorithm 1, which produces 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 security
forward secrecy by forcing a new Diffie-Hellman exchange whenever keylife expires.
(PFS)
DH Group Select one Diffie-Hellman group (1, 2, or 5). The remote peer or dialup
client must be configured to use the same group.
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 Enable the option if you want the tunnel to remain active when no data is
Alive 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 addresses to be used as
Selector selectors for IKE negotiations. If the FortiGate unit is a dialup server, the
default value 0.0.0.0/0 should be kept 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/or 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. 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.
Source port Type the port number that the local 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.
Destination Type the destination IP address that corresponds to
address 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.
6 Select OK.
To define an IP address
1 Go to Firewall > Address and select Create New.
2 In the Address Name field, type a descriptive name that represents the network,
server(s), or host(s).
3 In the Subnet/IP Range field, type the corresponding IP address and subnet mask
(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 for a server or host) or IP address range (for example,
192.168.10.[80-100] or 192.168.10.80-192.168.10.100).
4 Select OK.
When used in conjunction with the natip CLI attribute (see the “config firewall”
chapter of the FortiGate CLI Reference), outbound NAT enables you to change
the source addresses of IP packets before they go into the tunnel. This feature is
often used to resolve ambiguous routing when two or more of the private networks
making up a VPN have the same or overlapping IP addresses. For examples of
how to use these two features together, see the FortiGate Outbound NAT for
IPSec VIP Technical Note and the FortiGate IPSec VPN Subnet-address
Translation Technical Note.
When inbound NAT is enabled, inbound encrypted packets are intercepted and
decrypted, and the source IP addresses of the decrypted packets are translated
into the IP address of the FortiGate interface to the local private network before
they are routed to the private network. If the computers on the local private
network can communicate only with devices on the local private network (that is,
the FortiGate interface to the private network is not the default gateway) and the
remote client (or remote private network) does not have an IP address in the
same network address space as the local private network, enable inbound NAT.
Most firewall policies control outbound IP traffic. An outbound policy usually has a
source address originating on the private network behind the local FortiGate unit,
and a destination address belonging to a dialup VPN client or a network behind
the remote VPN peer. The source address that you choose for the firewall policy
identifies from where outbound cleartext IP packets may originate, and also
defines the local IP address or addresses that a remote server or client will be
allowed to access through the VPN tunnel. The destination address that you
choose for the firewall policy identifies where IP packets must be forwarded after
they are decrypted at the far end of the tunnel, and determines the IP address or
addresses that the local network will be able to access at the far end of the tunnel.
You can fine-tune a policy for services such as HTTP, FTP, and POP3; enable
logging, traffic shaping, antivirus protection, web filtering, email filtering, file
transfer, and email services throughout the VPN; and optionally allow connections
according to a predefined schedule. For more information, see the “Firewall
Policy” chapter of the FortiGate Administration Guide.
Note: As an option, differentiated services can be enabled in the firewall policy through CLI
commands. For more information, see the “firewall” chapter of the FortiGate CLI Reference.
When a remote server or client attempts to connect to the private network behind
a FortiGate gateway, the firewall policy intercepts the connection attempt and
starts the VPN tunnel. The 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 firewall 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.
3 You may enable a protection profile, and/or event logging, or select advanced
settings to authenticate a user group, or shape traffic. For more information, see
the “Firewall Policy” chapter of the FortiGate Administration Guide.
4 Select OK.
5 Place the policy in the policy list above any other policies having similar source
and destination addresses.
To ensure a secure connection, the FortiGate unit must evaluate IPSEC policies
before ACCEPT and DENY firewall 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.
Note: 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.
Source Interface/Zone Select the interface that connects to the private network
behind this FortiGate unit.
Source Address Name Select the address name that you defined for the private
network behind this FortiGate unit.
Destination Interface/Zone Select the IPSec Interface you configured.
Destination Address Name Select the address name that you defined for the private
network behind the remote peer.
Action Select ACCEPT.
NAT Disable.
To permit the remote client to initiate communication, you need to define a firewall
policy for communication in that direction. Enter these settings in particular:
Destination Address Name Select the address name that you defined for the private
network behind this FortiGate unit.
Action Select ACCEPT.
NAT Disable.
Bring up tunnel
Note: If you take down an active tunnel while a dialup client such as FortiClient is still
connected, FortiClient will continue to show the tunnel connected and idle. The dialup client
must disconnect before another tunnel can be initiated.
Note: If available on your FortiGate unit, you can enable the storage of log messages to a
system hard disk. In addition, as an alternative to the options listed above, you may choose
to forward log messages to a remote computer running a WebTrends firewall reporting
server. For more information about enabling either of these options through CLI commands,
see the “log” chapter of the FortiGate CLI Reference.
3 If the options are concealed, select the blue arrow beside each option to reveal
and configure associated settings.
4 If logs will be written to system memory, from the Log Level list, select Information.
For more information, see the “Log&Report” chapter of the FortiGate
Administration Guide.
5 Select Apply.
Entries similar to the following indicate that phase 1 negotiations broke down
because the preshared keys belonging to the VPN peers were not identical. A
tunnel was not established.
2005-03-31 16:06:39 log_id=0101023003 type=event subtype=ipsec pri=error vd=root
loc_ip=192.168.70.2 loc_port=500 rem_ip=192.168.80.2 rem_port=500 out_if=port2
vpn_tunnel=s cookies=3896343ae575f210/0a7ba199149e31e9 action=negotiate
status=negotiate_error msg="Negotiate SA Error: probable pre-shared secret mismatch"
For more information about how to interpret error log messages, see the FortiGate
Log Message Reference.
Index
A customer service 14