Skip to main content
This document describes how to configure an IPsec tunnel between an Aviatrix Gateway and a FortiGate firewall using Aviatrix Site2Cloud. This task is divided into two parts:
  1. Configure a Site2Cloud tunnel in Aviatrix CoPilot.
  2. Configure a VPN tunnel and related components in the FortiGate Firewall.

Setting up External (S2C) Connection

  1. In Aviatrix CoPilot, launch an Aviatrix Transit Gateway.
  2. Navigate to Networking > Connectivity > External Connections (S2C) and click Add New to create a Site2Cloud connection using the values for one of the below options (for either you can select either PSK or certificate-based authentication).
  1. After the connection is created, select the vertical ellipsis Three dots menu menu for that connection and select Download Configuration.
  2. Select Generic from the Vendor dropdown list and click the Download to download the external (S2C) configuration. Use this configuration file to configure the tunnels and interfaces in your Fortinet FortiGate firewall.

FortiGate Configuration

The configuration and screenshots below make the following three assumptions:
  • There are two interfaces on the FortiGate:
    • Interface port1 is an externally facing interface.
    • Interface port2 is an internally facing interface.
  • You have a subnet in AWS, Azure, or GCP in a VPC/VNet that has an Aviatrix Gateway. This subnet is defined as “10.0.0.0/16” for the examples below but it can be any valid CIDR range.
    In the examples below this range is referred to as AWS_Cloud.
  • You have a subnet behind your FortiGate firewall that will be accessible in the cloud. This subnet is defined as “172.16.0.0/20” in the examples below but it can be any valid CIDR range.
    In the examples below, this range is referred to as Shared_With_AWS.

Configuring Named Address Ranges in FortiGate

Access the FortiGate Dashboard. Under Policy & Objects > Addresses, create two new addresses: AWS_Cloud and Shared_With_AWS.

AWS_Cloud

FieldExpected Value
NameAWS_Cloud
TypeSubnet
Subnet / IP RangeCIDR matching the range specified in tunnel configuration (remote to FortiGate)
InterfaceAny
Show in Address ListEnabled
Static Route ConfigurationEnabled
AWS Cloud Configuration

Shared_With_AWS

FieldExpected Value
NameShared_With_AWS
TypeSubnet
Subnet / IP RangeCIDR matching the range specified in tunnel configuration (local to FortiGate)
InterfaceAny
Show in Address ListEnabled
Static Route ConfigurationEnabled
Shared with AWS Configuration

Creating an IPsec Tunnel on FortiGate

  1. Log in to the FortiGate and access the Dashboard.
  2. In the VPN menu, select IPsec Wizard.
  3. Change the Template Type to “Custom.”
  4. Enter any value as the Name. For this example, we are using “aviatrix-gatew.”
  5. Click Next >.
  6. Fill out the Network fields as recommended below:
    FieldExpected Value
    Nameaviatrix-gatew (for example)
    Template TypeCustom
FortiGate Configuration

New VPN Tunnel Tab

Complete the Network fields on the New VPN Tunnel tab as follows: Network section of New VPN Tunnel Tab
FieldExpected Value
IP VersionIPv4
Remote GatewayStatic IP Address
IP AddressPublic IP address of Aviatrix Gateway
InterfaceSelect the Appropriate Port/Interface
Local GatewayDisabled
Mode ConfigUnmark this checkbox
NAT TraversalEnable
Keepalive FrequencyAny value
Dead Peer DetectionOn Demand
Forward Error CorrectionUnmark this checkbox
Advanced OptionsDisabled
FortiGate Network Configuration Authentication section of New VPN Tunnel Tab
FieldExpected Value
MethodPre-shared Key
Pre-shared KeyEnter the value from the downloaded configuration or the value typed in to the field in Aviatrix Site2Cloud
IKE Version1
IKE ModeMain (ID protection)
Authentication Configuration Phase 1 Proposal section of New VPN Tunnel Tab
FieldExpected Value
EncryptionMatch value specified in Aviatrix S2C configuration (Phase 1 Encryption)
AuthenticationMatch value specified in Aviatrix S2C configuration (Phase 1 Authentication)
Diffie-Hellman GroupMatch value specified in Aviatrix S2C configuration (Phase 1 DH Groups)
Key Lifetime (seconds)28800
Local IDLeave Blank
Phase 1 Proposal XAUTH section of New VPN Tunnel Tab
FieldExpected Value
TypeDisabled
XAUTH Configuration Phase 2 Selectors > New Phase 2 seciton of New VPN Tunnel Tab
FieldExpected Value
NameAny String Value
CommentsAny String Value
Local AddressNamed Address - Shared_With_AWS
Remote AddressNamed Address - AWS_Cloud
Phase 2 Selector Advanced section of New VPN Tunnel Tab
Obtain the values from the downloaded configuration file.
FieldExpected Value
EncryptionMatch value specified in Aviatrix S2C configuration (Phase 2 Encryption)
AuthenticationMatch value specified in Aviatrix S2C configuration (Phase 2 Authentication)
Diffie-Hellman GroupMatch value specified in Aviatrix S2C configuration (Phase 2 DH Groups)
Key Lifetime (seconds)3600
Phase 2 Advanced
  1. Click OK.
  2. Navigate to Network > Interfaces.
  3. Click on the Tunnel created above (e.g. aviatrix-gatew) and assign the IP address from the downloaded configuration file. FortiGate Interface Configuration

Configure IPv4 Policy

  1. Go to Policy & Objects > IPv4 DoS Policy.
  2. Create two new IPv4 policies:
  • Outbound traffic from FortiGate (Shared_With_AWS) to Aviatrix (AWS_Cloud) IPv4 Outbound Policy
  • Inbound traffic from Aviatrix (AWS_Cloud) to FortiGate (Shared_With_AWS) IPv4 Inbound Policy
The reference to port2 in the screenshots should be replaced with your own interface name that represents the internal facing interface.
Be sure to select ACCEPT for “action” and select ALL for “service.”

Adding a Static Route

In the FortiGate UI, go to Network > Static Routes and add a new static route for traffic destined to “AWS_Cloud” to use the VPN tunnel. Static Route Configuration
If Named Address is disabled, be sure that you enabled Static Route Configuration on the Address configuration.Address Static Configuration

IPsec Monitor

  1. In the Fortigate UI, navigate to Dashboard > Network and click the IPsec widget.
  2. Select the Aviatrix tunnel, and click Bring Up.
  3. You can then check the tunnel status in CoPilot under Diagnostics > Cloud Routes.

Troubleshoot

Error Message failed to get valid proposal no suitable proposal found Solution Check that the Phase 1 authentication, encryption, and Diffie-Hellman groups match on both sides. If you are experiencing low IPsec throughput, you may want to configure two commands on the Fortigate.
config system global
    set ipsec-asic-offload disable
end

configure system global
    set ipsec-hmac-offload disable
end