Description | This article describes the configuration of BGP neighborship using a loopback interface over IPsec (site-to-site). |
Scope | FortiGate. |
Solution |
Topology:
Configuration on ISP1: Loopback interface configuration:
config system interface
VPN configuration: Phase 1 configuration: config vpn ipsec phase1-interface
Phase 2 configuration: config vpn ipsec phase2-interface In this example, two Phase-2 configurations are present: one labeled 'IPSEC' for handling interesting traffic, and another labeled 'BGP' for exchanging BGP-related traffic. It is also possible to configure a single Phase-2 parameter by setting both the source and destination subnets to '0.0.0.0', which allows all traffic to pass through.
BGP configuration:
config router bgp
Policy configuration:
The policy must be configured to allow BGP traffic from the IPsec tunnel to the loopback interface on both the FortiGate's.
config firewall policy edit 0 set name "Loopback" set srcintf "IPSEC" set dstintf "BGP-Loopback" set action accept set srcaddr "all" set dstaddr "all" set schedule "always" set service "BGP" next end
Configuration on ISP-2:
Loopback configuration:
config system interface
VPN Configuration: Phase 1 configuration:
config vpn ipsec phase1-interface
Phase 2 configuration : config vpn ipsec phase2-interface
BGP configuration:
config router bgp
For one FortiGate to know its IPsec neighbor peer, the IP 'exchange-interface-ip' is used to exchange the overlay interface IP addresses between peers. Note that this feature is Fortinet-specific. Refer to Technical Tip: How to use exchange-interface-IP in IPsec Tunnel.
'exchange-ip-addr4' can be used to explicitly announce the IP address willing to be exchanged. It may be any desired IP (usually used on ADVPN with BGP on loopback scenarios). If the option is not available to be used, enable 'exchange-interface-ip' prior. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.