Skip to main content
Contributor
December 14, 2020

Technical Tip: Configure an IP Address on an IPsec Tunnel Interface

  • December 14, 2020
  • 0 replies
  • 50369 views
Description

 

This article describes the reasoning and process for configuring an IP address for an IPsec tunnel interface.

 

Scope

 

FortiGate, IPsec.

 

Solution

 

  1. Background.

 

  1. Default behavior without IP.

 

  1. Potential issues.

 

  1. Recommended practice.

  • Assign an IP address to all IPsec tunnel interfaces to ensure FortiGate self-originated traffic uses a valid and routable source IP. This allows services such as ping, SFTP backups, SNMP, and logging to work properly.
  • Configure IP addresses on both ends of the VPN using the same subnet. A /30 subnet is commonly used for site-to-site tunnels, while a /24 subnet may be used for larger deployments such as hub-and-spoke.
  • Configure the Remote IP/Netmask field to define the remote tunnel address. This also automatically adds a static route in the FortiGate routing table.
  • The local tunnel interface IP is typically configured with a /32 subnet mask, while the remote side may use a larger subnet, such as /24 or /16, depending on the network design.

 

Summary.

IPsec tunnels without IPs can cause self-generated traffic to fail.

Always assign IPs to tunnel interfaces to ensure proper routing and service reliability.

Manual source IP configuration is possible, but secondary to proper IP assignment.

 

In the following example, the IPsec tunnel interface has a local IP address of 172.16.1.101 and a Remote IP/Netmask of 172.16.1.1/24 (255.255.255.0). To set the interface address, go to Network -> Interfaces and edit the IPsec tunnel interface:

 

IPsec_Interface.png

 

The equivalent CLI configuration would be as follows:

 

config system interface

    edit "advpn1"

        set vdom "root"
        set ip 172.16.1.101 255.255.255.255
        set allowaccess ping
        set type tunnel
        set remote-ip 172.16.1.1 255.255.255.0
        set snmp-index 9
        set interface "VLAN201"

end

 

Note:

By default, FortiGate self-originating traffic relies on routing table lookups to select the egress interface; SD-WAN rule policy routes do not apply unless the specific feature supports interface-select-method (sdwan/specify).


Related article:

Technical Tip: How to control/change the FortiGate source IP for self-originating traffic : SNMP , Syslog , FortiAnalyzer , Alert Email , FortiManager