FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
hgarara
Staff
Staff
Article Id 344847
Description This article describes configuration about policy-based IPsec tunnel with FortiGate's GUI where both sides have static IP.
Scope FortiGate.
Solution

Steps to configure policy-based IPsec tunnel:

 

Untitled.png

 

Configure FotiGate1.

Step 1:
Enable 'Policy based IPsec VPN' under System -> Feature Visibility.

 
 

feature.png

 

Step 2:

 

Go to VPN -> IPsec select Create new and name the tunnel. Select Custom and Next. Uncheck the check box 'Enable IPsec Interface Mode'.

 

enable.png

 

Step 3:

 

Configure Phase1 and Phase2:

 

fgt1 tunne;.png

 

Step 4:

 

Create a new policy Policy & Objects -> Firewall Policy. Select Create new. Specify incoming port (LAN) and outgoing port (interface to which the tunnel is attached). Specify source and destination. Select Action as 'IPsec' and select the tunnel created earlier from the dropdown menu.

 

policy.png

 

If needed, enable 'Allow traffic to be initiated from the remote site'. By default, the tunnel is initiated from the local network. When the option 'Allow traffic to be initiated from the remote site' is enabled traffic from the remote VPN peer network can also initiate the tunnel. Both options can be activated simultaneously for bi-directional tunnel initiation.

 

In most cases the IPsec tunnel will be configured with the internet (WAN) facing interface, in that case default route will be already configured, so no extra route needs to be configured.

 

Step 5:

 

Configure FortiGate2 following the same steps.

Remote firewall can be also configured in interface-based mode or policy-based IPsec VPN (vice-versa) on either side.

 

Troubleshooting: 

Flow debug example:


diag  debug  reset
diag debug   flow filter addr 192.168.200.2
diag debug flow filter proto 1
diag debug console timestamp enable

diag debug flow trace start 999
diag debug enable

 

debugs.png

 

Sniffer example: 

 

diag sniffer packet any 'host 192.168.100.2 and host 192.168.200.2 and icmp' 4 0 l

 

sniffer.png

 

Tip: There are some limitations to using a policy-based IPsec tunnel.  

SSL VPN interface cannot be used with policy-based IPsec tunnels. If this is a requirement consider using a Route (Interface) Based VPN.

Types of VPNs