This topic provides configuration for a FortiGate that is running software version 6.0.4.

FortiGate experience is recommended. For more details on how to use FortiGate products, visit their official site. For FortiGate documentation for high availability (HA) or manual deployment, see the Fortinet Document Library.


Oracle provides configuration instructions for a set of vendors and devices. Make sure to use the configuration for the correct vendor.

If the device or software version that Oracle used to verify the configuration does not exactly match your device or software, the configuration might still work for you. Consult your vendor's documentation and make any necessary adjustments.

If your device is for a vendor not in the list of verified vendors and devices, or if you're already familiar with configuring your device for IPSec, see the list of supported IPSec parameters and consult your vendor's documentation for assistance.

VPN Connect is the IPSec VPN that Oracle Cloud Infrastructure offers for connecting your on-premises network to a virtual cloud network (VCN).

The following diagram shows a basic IPSec connection to Oracle Cloud Infrastructure with redundant tunnels. IP addresses used in this diagram are for example purposes only.

This image summarizes the general layout of your on-premises network, VPN Connect tunnels, and VCN.

Best Practices

This section covers general best practices and considerations for using VPN Connect.

Configure All Tunnels for Every IPSec Connection

Oracle deploys two IPSec headends for each of your connections to provide high availability for your mission-critical workloads. On the Oracle side, these two headends are on different routers for redundancy purposes. Oracle recommends configuring all available tunnels for maximum redundancy. This is a key part of the "Design for Failure" philosophy.

Have Redundant CPEs in Your On-Premises Network Locations

Each of your sites that connects with IPSec to Oracle Cloud Infrastructure should have redundant edge devices (also known as customer-premises equipment (CPE)). You add each CPE to the Oracle Console and create a separate IPSec connection between your dynamic routing gateway (DRG)  and each CPE. For each IPSec connection, Oracle provisions two tunnels on geographically redundant IPSec headends. For more information, see the Connectivity Redundancy Guide (PDF).

Routing Protocol Considerations

When you create an IPSec VPN, it has two redundant IPSec tunnels. Oracle encourages you to configure your CPE to use both tunnels (if your CPE supports it). Note that in the past, Oracle created IPSec VPNs that had up to four IPSec tunnels.

The following two routing types are available, and you choose the routing type separately for each tunnel in the IPSec VPN:

  • BGP dynamic routing: The available routes are learned dynamically through BGP. The DRG dynamically learns the routes from your on-premises network. On the Oracle side, the DRG advertises the VCN's subnets.
  • Static routing: When you set up the IPSec connection to the DRG, you specify the particular routes to your on-premises network that you want the VCN to know about. You also must configure your CPE device with static routes to the VCN's subnets. These routes are not learned dynamically.

For more information about routing with VPN Connect, including Oracle recommendations on how to manipulate the BGP best path selection algorithm, see Routing for the Oracle IPSec VPN.

Other Important CPE Configurations

Ensure access lists on your CPE are configured correctly to not block necessary traffic from or to Oracle Cloud Infrastructure.

If you have multiple tunnels up simultaneously, ensure that your CPE is configured to handle traffic coming from your VCN on any of the tunnels. For example, you need to disable ICMP inspection, configure TCP state bypass, and so on. For more details about the appropriate configuration, contact your CPE vendor's support.

Caveats and Limitations

This section covers general important characteristics and limitations of VPN Connect to be aware of.

Asymmetric Routing

Oracle uses asymmetric routing across the multiple tunnels that make up the IPSec connection. Configure your firewalls accordingly. Otherwise, ping tests or application traffic across the connection will not reliably work.

When you use multiple tunnels to Oracle Cloud Infrastructure, Oracle recommends that you configure your routing to deterministically route traffic through the preferred tunnel. If you want to use one IPSec tunnel as primary and another as backup, configure more-specific routes for the primary tunnel (BGP) and less-specific routes (summary or default route) for the backup tunnel (BGP/static). Otherwise, if you advertise the same route (for example, a default route) through all tunnels, return traffic from your VCN to your on-premises network will route to any of the available tunnels (because Oracle uses asymmetric routing).

For specific Oracle routing recommendations about how to force symmetric routing, see Routing for the Oracle IPSec VPN.

Route-Based or Policy-Based IPSec VPN

The IPSec protocol uses Security Associations (SAs) to determine how to encrypt packets. Within each SA, you define encryption domains to map a packet's source and destination IP address and protocol type to an entry in the SA database to define how to encrypt or decrypt a packet.


Other vendors or industry documentation might use the term proxy ID, security parameter index (SPI), or traffic selector when referring to SAs or encryption domains.

There are two general methods for implementing IPSec tunnels:

  • Route-based tunnels: Also called next-hop-based tunnels. A route table lookup is performed on a packet's destination IP address. If that route’s egress interface is an IPSec tunnel, the packet is encrypted and sent to the other end of the tunnel.
  • Policy-based tunnels: The packet's source and destination IP address and protocol are matched against a list of policy statements. If a match is found, the packet is encrypted based on the rules in that policy statement.

The Oracle VPN headends use route-based tunnels but can work with policy-based tunnels with some caveats listed in the following sections.


The Oracle VPN headend supports only a single encryption domain. If your policy includes multiple entries, the tunnel will flap or there will be connectivity problems in which only a single policy works at any one time.
Encryption domain for route-based tunnels

If your CPE supports route-based tunnels, use that method to configure the tunnel. It's the simplest configuration with the most interoperability with the Oracle VPN headend.

Route-based IPSec uses an encryption domain with the following values:

  • Source IP address: Any (
  • Destination IP address: Any (
  • Protocol: IPv4

If you need to be more specific, you can use a single summary route for your encryption domain values instead of a default route.

Encryption domain for policy-based tunnels

If your CPE supports only policy-based tunnels, there are restrictions on the policy that you can use on the CPE.

When you use policy-based tunnels, every policy entry that you define generates a pair of IPSec SAs. This pair is referred to as an encryption domain.


The Oracle VPN headend supports only a single encryption domain. If your policy includes multiple entries, the tunnel will flap or there will be connectivity problems in which only a single policy works at any one time.

If you use policy-based IPSec, Oracle recommends using a single encryption domain with the following values:

  • Source IP address: Any (
  • Destination IP address: VCN CIDR (example:
  • Protocol: IPv4

Make sure the single encryption domain matches any traffic that needs to go from your on-premises network across the IPSec tunnel to the VCN. The VCN CIDR must not overlap with your on-premises network.

If Your CPE Is Behind a NAT Device

In general, the CPE IKE identifier configured on your end of the connection must match the CPE IKE identifier that Oracle is using. By default, Oracle uses the CPE's public IP address, which you provide when you create the CPE object in the Oracle Console. However, if your CPE is behind a NAT device, the CPE IKE identifier configured on your end might be the CPE's private IP address, as show in the following diagram.

This image shows the CPE behind a NAT device, the public and private IP addresses, and the CPE IKE identifier.

Some CPE platforms do not allow you to change the local IKE identifier. If you cannot, you must change the remote IKE ID in the Oracle Console to match your CPE's local IKE ID. You can provide the value either when you set up the IPSec connection, or later, by editing the IPSec connection. Oracle expects the value to be either an IP address or a fully qualified domain name (FQDN) such as For instructions, see Changing the CPE IKE Identifier That Oracle Uses.

CPE Configuration


The configuration instructions in this section are provided by Oracle Cloud Infrastructure for your CPE. If you need support or further assistance, contact your CPE vendor's support directly.

The following figure shows the basic layout of the IPSec connection.

This image summarizes the general layout of the IPSec connection and tunnels.

By default, FortiGate provisions the IPSec tunnel in route-based mode. This topic focuses on FortiGate with a route-based VPN configuration.

If necessary, you can have FortiGate provision the IPSec tunnel in policy-based mode. To enable the feature, go to System, and then to Feature Visiblity. Under Additional Features, enable the Policy-based IPsec VPN feature.

This image shows where to select a policy-based VPN.

About Using IKEv2

Oracle supports Internet Key Exchange version 1 (IKEv1) and version 2 (IKEv2). If you configure the IPSec connection in the Console to use IKEv2, you must configure your CPE to use only IKEv2 and related IKEv2 encryption parameters that your CPE supports. For a list of parameters that Oracle supports for IKEv1 or IKEv2, see Supported IPSec Parameters.

If you want to use IKEv2, there's a variation on one of the tasks presented in the next section. Specifically, in task 2, when configuring authentication, select IKE version 2.

Configuration Process


Before starting, ensure you have a valid license or trial license to configure FortiGate.
Task 1: Use the wizard to create the VPN
  1. Go to VPN, and then to IPsec Wizard to create a new VPN tunnel.
  2. On the VPN Creation Wizard page, specify the following items:  
    • Name: Description used to identify the IPSec tunnel.
    • Template Type: Site to Site
    • Remote Device Type: Cisco
    • NAT Configuration: No NAT between sites

    This image shows the start of the VPN creation wizard.

  3. Click Next.
  4. On the Authentication page, specify the following items:
    • Remote Device: IP Address
    • IP Address: IP address for the Oracle VPN headend. Oracle generated this value when creating the IPSec tunnel.
    • Outgoing Interface: The WAN interface configured for external traffic.
    • Authentication Method: Pre-shared Key. Oracle supports only shared secret keys.
    • Pre-shared Key: The shared secret. Oracle generated this value when creating the IPSec tunnel.

    This image shows the Authentication page of the wizard.

  5. Click Next.
  6. On the Policy & Routing page, specify the following items:
    • Local Interface: The LAN interface configured for internal traffic.
    • Local Subnets: The subnet used for internal traffic.
    • Remote Subnets: The Oracle VCN subnets that will be used for the IPSec tunnel.
    • Internet Access: None

    This image shows the Policy & Routing page of the wizard.

  7. Click Create.

    A summary message is shown with details about the configuration. Notice that the wizard automatically creates security policies with the subnets that you specified and adds the required static routes.

    This image shows the summary page at the end of the wizard.

Task 2: Add Phase 1 and Phase 2 parameters to each IPSec tunnel

You must convert each newly created IPSec tunnel into a custom tunnel to add the recommended parameters for Phase 1 and Phase 2.

Perform the following steps for each tunnel.

  1. Go to VPN, and then click IPsec Tunnels.
  2. Select the tunnel and click Edit to view the Edit VPN Tunnel page.
  3. Click Convert to Custom Tunnel.

    This image shows the page for editing the VPN tunnel.

  4. Edit the relevant sections to match the required settings shown in the following screenshots. Remember to click the check mark icon in the top-right corner of each section after making your changes.

    The IP address shown in the first screenshot is an example address.

    Notice that if you want to use IKEv2, on the Authentication screen, instead select IKE Version 2.

    This image shows the Network section when editing the tunnel.

    This image shows the Authentication section when editing the tunnel.

    This image shows the Phase 1 Proposal section when editing the tunnel.

    This image shows the Phase 2 Selectors section when editing the tunnel.

  5. After configuring all sections, click OK to save and close the dialogs.
Task 3: Verify the IPSec connection

At this point, the IPSec tunnel will not be established by default because FortiGate uses the IP address assigned on the WAN interface. In this case, this IP address is a private IP address because Oracle does 1:1 NAT. This private IP address will be used as the local IKE ID and will not match the one expected on the Oracle DRG. To resolve this, you can manually change the local IKE ID on your FortiGate by using the CPE's CLI, or you can change the value that Oracle uses in the Oracle Console (see the instructions that follow). Either way, this fixes the incompatibility and brings up the IPSec tunnel.

To change the CPE IKE identifier that Oracle uses (Oracle Console)
  1. Open the navigation menu. Under Core Infrastructure, go to Networking and click IPSec Connections.

    A list of the IPSec connections in the compartment that you're viewing is displayed. If you don’t see the one you're looking for, verify that you’re viewing the correct compartment (select from the list on the left side of the page).

  2. For the IPSec connection you're interested in, click the Actions icon (three dots), and then click Edit.

    The current CPE IKE identifier that Oracle is using is displayed at the bottom of the dialog.

  3. Enter your new values for CPE IKE Identifier Type and CPE IKE Identifier, and then click Save Changes.

Redundancy with BGP Over IPSec

For redundancy, Oracle recommends using BGP over IPSec. By default, if you have two connections of the same type (for example, two IPSec VPNs that both use BGP), and you advertise the same routes across both connections, Oracle prefers the oldest established route when responding to requests or initiating connections. If you want to force routing to be symmetric, Oracle recommends using BGP and AS path prepending with your routes to influence which path Oracle uses when responding to and initiating connections. For more information, see Routing Details for Connections to Your On-Premises Network.

The Oracle DRG uses /30 or /31 as subnets for configuring IP addresses on the interface tunnels. Remember that the IP address must be part of the IPSec VPN's encryption domain and must be allowed in the firewall policy to reach the peer VPN through the interface tunnel. You might need to implement a static route through the tunnel interface for the peer IP address.

Oracle's BGP ASN in commercial regions is 31898. If you're configuring VPN Connect for the Government Cloud, see Required VPN Connect Parameters for Government Cloud and also Oracle's BGP ASN.

For your side, you can use a private ASN. Private ASNs are in the range 64512–65534.

Task 1: Edit the tunnel interface

In the first task, you add the BGP IP address to the newly created FortiGate tunnel interface.

Perform the following steps for each tunnel.

  1. Go to Network, and then Interface.
  2. Select the interface you're interested in and click Edit.

    This image shows the tunnel interface to edit.

  3. Configure the following items:
    • IP: Enter the BGP IP address that you assigned to the FortiGate end of the tunnel interface. The following screenshot shows an example value of
    • Remote IP/Network Mask: Add the BGP IP address that you assigned to the Oracle end of the tunnel interface. Include either a /30 or /31 mask, depending on how you specified the addresses in the Oracle Console. In the following screenshot, was used, where is assigned to the FortiGate end, and is assigned to the Oracle end.
    • Ping access (recommended): In the Administrative Access section, enable ping access.

      This image shows configuration of BGP addresses and ICMP access.

  4. Click OK.
Task 2: Add a static route for the Oracle IP address

For each tunnel, add a /32 static route towards the Oracle IP address through the tunnel, as shown in the following screenshot.

This image shows the static route to the Oracle BGP IP address through the tunnel.

Task 3: Configure BGP

Perform the following steps for each tunnel.

  1. Go to Network, and then BGP.
  2. Enter the following items:
    • Local AS: Your BGP ASN. You can use a private ASN. Private ASNs are in the range 64512–65534.
    • Router ID: A value to provide a unique identity for this BGP router among its peers.
    • Neighbors: Click Create New and enter the BGP IP address for the Oracle end of the tunnel, and the Oracle BGP ASN (31898 for commercial regions). If you're configuring VPN Connect for connecting to the Government Cloud, see Oracle's BGP ASN.
    • Networks: Optionally use this field to advertise a specific subnet over BGP. You can also advertise subnets by using the Redistribute section in the Advanced Options section.

      This image shows the local BGP options to configure.

  3. Click OK.


The following CLI command is useful for gathering statistical data such as the number of packets encrypted versus decrypted, the number of bytes sent versus received, the encryption domain (SPI) identifier, and so on. This kind of information can be critical for determining an issue with the VPN.

diagnose vpn tunnel list

The following command indicates a lack of firewall policy, a lack of forwarding route, and policy ordering issues. If there are no communication issues, this command returns blank output.

diagnose debug flow

The following command verifies BGP neighbor status information. Remember that an "Active" state doesn't mean that the BGP session is up. "Active" refers to a BGP state message. For more information, see BGP Background and Concepts in the FortiGate documentation.

get router info bgp summary

The following command provides more detailed information about a BGP neighbor.

get router info bgp neighbors

A Monitoring service is also available from Oracle Cloud Infrastructure to actively and passively monitor your cloud resources. For information about monitoring your VPN Connect, see VPN Connect Metrics.

If you have issues, see VPN Connect Troubleshooting.