
Setting up a FortiGate IPsec VPN is a straightforward process that requires some basic configuration. First, ensure that the FortiGate unit is properly connected to the internet and the network you want to secure.
To start, create a new IPsec phase 1 proposal by going to VPN > IPsec Wizard > Proposal. Here, you can select the encryption algorithm, authentication method, and other settings that will be used for the VPN connection.
The FortiGate unit comes with a default IPsec policy that allows traffic to pass through the VPN tunnel. However, you may need to adjust this policy to suit your specific requirements.
Select the policy from the list and click Edit to make any necessary changes.
IKEv2 and VPN
IKEv2 and VPN are crucial components of a FortiGate IPsec VPN setup. IKEv2 is used for user authentication.
To configure IPsec IKEv2, navigate to VPN > IPsec Wizard > Template Type = Custom. IPsec Wizard Step 1 requires specifying the IP Version, Remote Gateway, Interface, Mode Config, and Authentication Method.
The IP Version can be either v4 or v6, and the Remote Gateway should be set to Dialup User. The Interface should be the WAN interface specified in the previous step.
Mode Config should be enabled, and Assign IP From should be specified as a range or address object. Split Tunneling can also be enabled, specifying the network(s) accessible.
Authentication Method can be either preshared key or certificate, and IKE Version should be set to 2 for EAP user authentication. Accept Types should be set to Any Peer ID, and Phase 2 Selectors should be left as all zeroes for local and remote addresses.
IKEv2 uses EAP for user authentication, so EAP should be enabled using the CLI inside the configured IPsec tunnel for user authentication. This is done by referencing the blanket User Group created earlier, which matches any User.
A table summarizing the required settings for IPsec Wizard Step 1:
Note that for advanced custom configurations, see Remote access.
FortiClient and Users
To set up FortiClient and users, you'll need to create a Username and Password for each user. Make a note of these credentials as you'll need them to log in to the VPN later.
When adding a new user, you can also add contact information, such as a company email address, if desired. You can then select an existing User Group or create a new one by clicking the + icon. If you're creating a new User Group, be sure to select Firewall as the Type.
To configure the User Group for VPN, you'll need to edit the user group, add the new VPN user to it, and save to complete the setup. This process is similar to the command "config user group edit 'VPN_Users' set member 'vpnuser' next end".
Recommended read: Set up Vpn between Azure and Aws
Authentication
Authentication is a crucial step in setting up a secure connection between FortiClient and users. You'll want to choose a reliable method for authenticating users, and in this case, Pre-shared Key is the way to go.
To implement Pre-shared Key, simply select it as your authentication method. This will ensure that users are authenticated securely.
For IKE Version, you'll want to choose 2, as this is the recommended version for optimal security.
FortiClient Configuration
To configure FortiClient, start by downloading the latest version from support.fortinet.com. Once installed, click Configure VPN to begin the setup process.
You'll need to specify the VPN settings, which include selecting IPsec VPN as the type. This is a crucial step, as it will determine how your data is encrypted and transmitted.
Next, enter the public IP address of your WAN interface as the Remote Gateway. This is the address that will be used to connect to your network.
Choose an authentication method, such as Preshared Key or Certificate. This will determine how FortiClient verifies your identity.
Enable Single Sign On for VPN Tunnel to allow seamless authentication.
Specify the port number we selected earlier, which is 10428.
In the Advanced Settings, expand VPN Settings and select IKE Version 2. This will ensure the most secure connection possible.
Finally, select Mode Config as the Options. This will configure the VPN settings for you.
For more insights, see: Windows Azure Vpn Setup
New User
To create a new user in FortiClient, you'll need to set up a user account with a username and password. Make a note of these credentials, as you'll need them to log in to the VPN later.
Create a new user with type 'Local User', and configure login credentials for the new user. Ensure to make a note of the username and password, as this will be the login you use to access the VPN later.
Add contact info for the user if desired, such as a company email address. You can also add the user to an existing User Group or create a new one by clicking the + icon.
To add a new user to an existing User Group, select the group from the dropdown menu. If you're creating a new User Group, give it a name and select Firewall as the type.
Once you've added the new user to the User Group, save the changes to complete the setup. Repeat these steps for any additional VPN users you wish to add.
To apply the User Group to the VPN, go to VPN > IPsec Tunnels, edit the VPN tunnel you created, and select the VPN_Users group under the Authentication tab.
Address Management
To manage addresses in FortiGate, you'll need to create a new address range for your VPN. This is done by going to Policy & Objects > Addresses and adding a new address with IP Range selected in the dropdown.
Make sure to choose an address range that will be used for the new VPN.
You'll also need to create a new User Group with type 'Firewall' to manage access to this address range.
Here's a step-by-step guide to creating addresses and address groups in FortiGate:
- Create addresses for all local addresses/sub
- config firewall address
- edit AcretoGate_local_1
- set allow-routing enable
- set subnet 192.168.1.0 255.255.255.0
- next
- edit AcretoGate_local_2
- set allow-routing enable
- set subnet 192.168.2.0 255.255.255.0
- next
Create an address group to add all the addresses created in the previous step:
- config firewall addrgrp
- edit AcretoGate_local_grp
- set member AcretoGate_local_1 AcretoGate_local_2
- next
Verify and Monitor
To verify and monitor your FortiGate IPsec VPN setup, you'll want to use the diagnose command to view the VPN tunnel list. This will give you a clear picture of your active sessions.
Using the diagnose vpn tunnel list command will show you a list of your current VPN tunnels. You can use this information to identify any issues with your setup.
You might like: How Do I Use Proton Vpn
To get a summary of your VPN tunnels, use the diagnose vpn ipsec tunnel summary command. This will give you a quick overview of your VPN connections.
If you're experiencing issues with your VPN setup, you can use the diagnose debug application ike -1 command to debug IKE negotiations. This will help you troubleshoot any problems with your VPN connections.
For another approach, see: How to Use Google One Vpn
Network and Routing
To set up a Fortigate IPsec VPN, you'll need to retrieve network information from your FortiGate firewall. This includes making a note of your WAN address and LAN address, which can be found under Network > Interfaces.
Your WAN address is your device's public address, and your LAN address is the network you're connecting to via the VPN tunnel. If your device has a DNS hostname, you can use that instead of the WAN address.
Here's a quick rundown of the key network settings you'll need to note:
You'll also need to configure your Fortigate to route traffic through the VPN tunnel. This involves adding static routes and policy routes to direct traffic through the tunnel.
Determine Address Range
To determine the address range for your VPN, you'll want to add a new address on your FortiGate firewall. This is done by going to Policy & Objects > Addresses and selecting IP Range in the dropdown.
You'll need to create a new IP address range to be used with the VPN. This range should be defined on your FortiGate firewall.
To do this, go to Policy & Objects > Addresses and click on "Create New". Then, select "IP Range" from the dropdown.
Here's a step-by-step guide to creating a new IP address range:
Remember to create a new User Group with type 'Firewall' when adding the address range.
Route Traffic to Internal Network
Route traffic to your internal network by following these steps. To do this, you'll need to configure your FortiGate firewall to route traffic from the VPN tunnel to your local network.
First, make sure you have the necessary network information, including your WAN and LAN addresses, which you can find under Network > Interfaces. Note down the WAN address, which is your device's public address, and the LAN address, which is the network you're connecting to via the VPN tunnel.
To configure the routing changes, you'll need to add a static route to direct traffic through the tunnel. This can be done by adding a static route with a higher administrative distance, as shown in Scenario 2 of Step 5.
Here are the specific steps to add a static route:
- Add IP at the tunnel interface
- Add a static route to direct the traffic through the tunnel with a higher administrative distance
- Add a policy route to direct the specific traffic through the tunnel
To route VPN traffic to your internal network, you'll need to add a static route with a specific destination IP address. This can be done by editing the router static configuration and setting the destination IP address to 10.10.10.0/24, as shown in Step 6.
Here's a summary of the steps to route traffic to your internal network:
Tunnel and Connection
To set up a Fortigate IPsec VPN, you'll need to create a new IPsec tunnel. This can be done by going to VPN > IPsec Tunnels and clicking the + to create a new IPsec Tunnel.
The template type is typically set to Remote access, and for Remote device type, choose Client-based and select Cisco. You'll also need to set the Pre-shared key for the Authentication method, entering a secure password that you'll need to remember for later.
You can select the group you set up earlier by User Group, and optionally check the box Require 'Group Name' on VPN client if you'll be connecting to more than one VPN tunnel. Enter a Group Name of your choice if necessary.
To configure the network information, select lan as the Local interface and choose a Local Address from your list. You'll also need to enter the Client Address Range, specifying the network range that will be used for your VPN connection.
Here's a summary of the required settings:
Once you've completed the setup, you can bring the tunnel up by running the command `bash diagnose vpn tunnel up AcretoGate`. Be sure to check the status of tunnel Phase-1 after bringing the tunnel up.
SSL and Security
IPsec VPN is generally recommended for its faster connection speeds and stability, but SSL VPN is a good fallback choice when network restrictions prevent IPsec from working.
Both IPsec and SSL VPN are considered equally secure for business use.
IPsec VPN provides faster connection speeds and is more stable, but SSL VPN is compatible in more network locations.
Explore further: Fortinet Vpn Connection Is down
Selectors (Traffic Encryption)
Selectors (Traffic Encryption) play a crucial role in securing your online traffic.
Configuring Phase 2 Selectors, as seen in the example "RA_IPsec_VPN_Phase2", is a key step in this process.
This involves setting the phase 1 name, proposal, and keepalive settings among other things.
The proposal setting determines the encryption method, with AES256-SHA256 being a secure option.
Dhgrp 14 is also specified, which is a group of Diffie-Hellman groups used for key exchange.
A src-subnet of 0.0.0.0/0 and a dst-subnet of 192.168.1.0/24 are also defined.
Creating a new IPsec tunnel is another essential step in securing your online traffic.
This involves going to VPN > IPsec Tunnels and clicking the + to create a new IPsec Tunnel, as shown in the example.
This process allows you to define the settings for your IPsec tunnel, including the phase 2 selectors.
Set up SSL tunnel
To set up an SSL tunnel, you'll need to go to the VPN tab and select SSL-VPN Portals.
You might enjoy: Ssl Vpn Configuration Fortigate
Click on Create new to start setting up a new SSL-VPN Portal. This will begin the process of configuring the tunnel.
Under Tunnel Mode, you'll need to enable split tunneling by clicking the slider. This will give your VPN users the ability to access specific network ranges.
Choose the network ranges your VPN users need to have access to, such as a local area network (lan).
Readers also liked: Nord Vpn Not Allowing Internet Access
Vs Ssl
IPsec is generally recommended for faster connection speeds and greater stability, but it may not be available in all network locations.
SSL VPN is a good fallback choice when IPsec is not available, as it is compatible with more network locations.
Both IPsec and SSL VPN are considered equally secure for business use.
IPsec provides faster connection speeds and is more stable, but SSL VPN is compatible in more network locations.
You can use both standards in your business, choosing the one that best suits your needs.
Suggestion: Opera Gx Vpn Not Working
DNS Note
When setting up a VPN, it's essential to understand the role of DNS in the process. You have the choice to use the gateway's DNS server or specify your own DNS server.
The option you choose here needs to match up to the settings you enter in the VPN client. This ensures a smooth and secure connection.
If you choose to use the gateway's DNS server, make sure it's configured correctly. The gateway's DNS server is usually set by default, but it's always a good idea to double-check.
You can also specify your own DNS server, which gives you more control over your internet traffic. Just remember to enter the same DNS server settings in the VPN client.
In either case, using the correct DNS settings is crucial for establishing a secure VPN connection.
Explore further: Azure Vpn Gateway
Site-to-Site and Multi-User
To set up a Site-to-Site VPN, you'll need to configure two FortiGate devices, FG1 and FG2. On FG1, go to VPN > IPsec Wizard and select Site to Site – FortiGate, then select Site2Site/FortiGate/No Nat and enter the remote IP: 10.10.10.2/24, outgoing interface: port3.
You'll also need to specify the local interface: port2, IP: 192.168.20.0/24, and remote subnet: 192.168.10.0/24. This will create two policies and two static routes in the firewall.
On FG2, repeat the same configuration, but with a remote IP of 10.10.10.1/24 and local IP of 192.168.10.0/24. This will allow the two devices to communicate securely.
Once you've finished configuring both devices, go to your IPsec Tunnels and double click on Inactive, then right click on the tunnel > Bring UP > All Phase 2 selectors. This should bring up the tunnel and allow you to verify the status of the connection.
To verify your configuration, go to Logs & Reports > Event > VPN Event and check for any errors or issues. If everything is set up correctly, you should be able to ping from WebTerm1 to WebTerm2.
Readers also liked: Virtual Ip in Fortigate
Connect on iOS and Mac
To connect to your FortiGate IPsec VPN on iOS and Mac, you'll need a VPN client. VPN Tracker is a popular choice that works well with Fortinet FortiGate firewalls.
First, open the VPN Tracker FortiGate connection creator on your device. You can find this on the VPN Tracker app or website.
Next, enter the WAN IP address (or hostname) of your FortiGate device, which can be found under Network > Interfaces on your FortiGate device.
Follow the steps in the wizard and enter your connection details as prompted. You'll need to create a free account and securely save your connection to your account using end-to-end encryption.
Here's a quick rundown of the steps:
- Open the VPN Tracker FortiGate connection creator
- Enter the WAN IP address (or hostname) of your FortiGate device
- Follow the steps in the wizard and enter your connection details
- Securely save your connection to your account
With these steps complete, you can now connect to your FortiGate IPsec VPN in VPN Tracker on iOS and Mac.
Featured Images: pexels.com


