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.
markdr_FTNT
Staff
Staff
Article Id 192292
Description This article describes using Peer ID to select between multiple IPsec dial-up tunnels. While this approach is valid for IKEv1 (especially Aggressive Mode), it is not the primary or recommended tunnel-selection mechanism for IKEv2.
Scope FortiGate.
Solution

Dial-up VPN tunnels are used when the remote VPN gateway or remote VPN client IP address is dynamic and therefore unknown. Many users use a single dial-up tunnel (Phase 1 and Phase 2) for all remote dial-up VPN gateways and clients.

Note:

When multiple IKEv1 Dialup IPSec connections are configured on one WAN interface, only the first Dialup connection is checked by the FortiGate. Peer IDs are used in this kind of scenario; the FortiGate uses the peer ID to know which phase1 the FortiClient needs to match.


In some cases, multiple dial-up tunnels are required.

For example:
To grant different remote VPN client users access to different networks and services. To grant remote VPN gateways access to different networks and services.

FortiGates uses Peer IDs as the unique identifier to select a dial-up tunnel. When multiple dial-up tunnels are added, give each tunnel a different Peer ID.
Assign corresponding Peer IDs to remote VPN gateways and remote VPN clients.


To be able to add a Peer ID on an IPsec tunnel created by the wizard, there are 2 options:

 

  1. Using the CLI.

anignan_0-1668197476261.png

 

  1. Using the GUI: Aggressive mode configuration in the first dial-up tunnel.

 

Note:

When the IPsec tunnel is created by the wizard, there is no GUI option to add a peer ID until converting the IPsec Tunnel to a custom tunnel.

 

Untitled.gif
 
The Peer ID also works with the main mode, but in the main mode, both peers authenticate each other based on their IP addresses by default. So, the peer ID is not required in this case. Only if the remote peer has a dynamic IP or a non-IP-based method like DDNS is the peer ID required.
 
For IKEv2, FortiGate does not primarily use Peer ID to select between multiple dialup Phase1 configurations. Instead, FortiGate uses the Network ID attribute to distinguish and select the appropriate IKEv2 dial-up tunnel.

Edit the second dial-up tunnel and select the next Peer ID (different than any other Peer ID configured):

GGMACHAIN_0-1769114380125.png

 

 

Note: 
There is no limit on the number of custom tunnels that can be created using different Peer IDs. The actual number of configurable tunnels depends on the FortiGate model (see the maximum value table of IPSec tunnels, vpn.ipsec.phase1) and available bandwidth. 
 
FortiClient Configuration:
 
GGMACHAIN_1-1769114380128.png

 

 

Debug verification for each tunnel:

The following commands enable IKE to debug logs:

diagnose debug reset

diagnose debug application ike -1
diagnose debug enable
tau-kvm68 # ike 0: comes 10.5.22.160:1011->10.5.22.168:500,ifindex=3....
ike 0: IKEv1 exchange=Aggressive id=df23d7be2de17010/0000000000000000 len=511ike 0:df23d7be2de17010/0000000000000000:0: responder: aggressive mode get 1st message...
......
ike 0::0: received peer identifier FQDN 'dialup1'
 
To disable debug:
 
diagnose debug disable
diagnose debug reset
 
From the FortiGate IPSec Monitor tab:
 
kb_1912_4.png

 

For the second peer ID (dialup2):
 
tau-kvm68 # ike 0: comes 10.5.22.160:1011->10.5.22.168:500,ifindex=3....
ike 0: IKEv1 exchange=Aggressive id=d74d09b92f8f1cbd/0000000000000000 len=511
......
ike 0::1: received peer identifier FQDN 'dialup2'
 
JeanPhilippe_P_0-1741685648438.png
 
From v7.6.0, IPsec has the option to match the ZTNA TAG for dial-up IPsec connections. Refer to the document for more information: Security posture tag match enforced before dial-up IPsec VPN connection.
 
Note:
IPv4 address is not supported for a Peer ID setup for IPsec VPN tunnels. Refer to the document for more information: Troubleshooting Tip: The IPv4 address is not supported for Peer ID for IPsec vpn tunnels.
 
Related articles:

Technical Tip: How to configure a FortiGate as IPsec VPN Dial-Up client when FortiGate is not behind...

Technical Tip: IPSec dial-up full tunnel with FortiClient

Technical Tip: FortiGate Hub with multiple IPSec Dial-up phase1 using IKEv2 and PSK authentication