Skip to main content

VPN Setup Guide

Introduction

This document provides a complete step-by-step guide to configure a Site-to-Site (S2S) IPsec VPN between E2E Cloud and Amazon Web Services (AWS). The VPN ensures secure, encrypted communication between the E2E Cloud network and the AWS VPC for private workloads, hybrid cloud setups, and cross-platform connectivity.

VPC Peering

E2E Cloud Side Configuration

1- Deploy the FortiGate Firewall

  • Log in to the E2E Cloud Console.
  • Navigate to Network → Add New Firewall.
  • Select the required Plan.
  • Enter: Firewall Name, VPC, Public IP Allocation (Enable Public IP)
  • Click Create.
  • Wait until the firewall status becomes Running.

VPC Peering

2- Access the FortiGate Firewall

  • Note the Public IP displayed in the E2E Cloud Console.

  • Open a browser and visit: http://<FortiGate-Public-IP>.

  • Log in using: Username : admin , Password: Sent to your E2E Cloud account's registered email.

  • After login, the FortiGate dashboard will appear.

VPC Peering

VPC Peering

3- AWS Side Configuration

Create VPC

  • Go to VPC → Your VPCs → Create VPC.
  • Configure: Name: E2E-AWS, IPv4 CIDR: 10.0.0.0/16, Tenancy: Default.
  • Click Create VPC.

VPC Peering

Create Subnets

A. Public Subnet

  • VPC → Subnets → Create Subnet.
  • Enter: Name: E2E-AWS-Public-Subnet, AZ: us-east-1a, CIDR: 10.0.1.0/24.
  • Create.

B. Private Subnet

  • Create another subnet with: Name: E2E-AWS-Private-Subnet, AZ: us-east-1a or 1b, CIDR: 10.0.2.0/24.

VPC Peering

Create an Internet Gateway

  • Go to Internet Gateways → Create IGW.
  • Name: E2E-IGW.
  • Attach it to the E2E-AWS VPC.

VPC Peering

Create NAT Gateway

  • Go to NAT Gateways → Create NAT Gateway.
  • Configure: Name: E2E-AWS-NAT-GW, Availability-Mode: Regional, Select the vpc, Subnet: E2E-Public-Subnet.
  • Method of Elastic IP (EIP) allocation : Automatic.
  • Click on Create.

VPC Peering

Configure Route Tables

  • Public Route Table

Add route: Destination: 0.0.0.0/0, Target: E2E-IGW.

VPC Peering

  • Private Route Table

Add route: Destination: 0.0.0.0/0, Target: E2E-AWS-NAT-GW

VPC Peering

  • Associate:
  • Public Subnet → Public Route Table

VPC Peering

  • Private Subnet → Private Route Table

VPC Peering

Create Security Group

  • Go to Security Groups → Create Security Group.
  • Name: E2E-VPN-SG
  • Add inbound rules: SSH (22) , ICMP, Application ports (if required).

VPC Peering

Create Customer Gateway (CGW)

  • Go to Customer Gateways → Create.
  • Enter:Name: E2E-AWS-CGW, IP Address: Public IP of E2E FortiGate

VPC Peering

  • Click on Create.

VPC Peering

Create Virtual Private Gateway (VGW)

  • Go to Virtual Private Gateways → Create
  • Name: E2E-VGW.
  • Attach VGW to E2E-AWS VPC.

VPC Peering

Create Site-to-Site VPN

  • Go to VPN Connections → Create.
  • Enter: Name: E2E-VPN-Connection, Target Gateway: E2E-VGW, Customer Gateway: E2E-CGW, Routing: Static, Static IP Prefixes : E2E VPC CIDR.
  • Add E2E VPC CIDR Range (e.g., 192.168.10.0/24)

VPC Peering

VPC Peering

Download VPN Configuration.

  • Select VPN Connection → Download Configuration.
  • Choose: Vendor: Fortinet, Platform: FortiGate, Software: Latest.
  • This file contains: Tunnel outside IPs, PSKs, Inside IPs, Phase-1 & Phase-2 parameters.

VPC Peering

Add Routes in AWS

  • Add routes to both Public and Private route tables: Destination : E2E Subnet (e.g., 192.168.10.0/24), Target: Virtual Private Gateway.

VPC Peering

VPC Peering

4- FortiGate Configuration (E2E Side)

Configure Phase-1 (IKE)

  • Go to: VPN → IPsec Tunnels → Create New → Custom.

VPC Peering

  • Configure:
ParameterValue
IP VersionIPv4
Remote GatewayStatic IP
IP AddressAWS Outside IP
Local Interfaceport1
Pre-Shared KeyFrom AWS config
IKE VersionIKEv2
EncryptionAES128
AuthenticationSHA1
DH Group2
Key Lifetime28800
  • Disable NAT Traversal if the firewall is not behind NAT.
  • The above details are available in the AWS Configuration File which downloaded in step 3.10

VPC Peering

VPC Peering

Configure Phase-2

  • Go to: VPN → IPsec Tunnels → Select Tunnel → Phase 2 Selectors → Create New

VPC Peering

ParameterValue
NameAs per AWS config
Local AddressE2E Subnet
Remote AddressAWS VPC CIDR
EncryptionAES128
AuthenticationSHA1
PFSEnabled
DH Group2
Key Lifetime3600
Auto-negotiateEnabled

VPC Peering

VPC Peering

  • The above details are also available in the AWS Configuration File which downloaded in step 3.10.

Configure Tunnel Interface

  • Go to Network → Interfaces.
  • Edit the tunnel interface (E2E-AWS).

VPC Peering

  • Set: IP Address: 169.254.x.x(from AWS file), Remote IP: 169.254.x.x/30, Enable Ping

VPC Peering

  • The above details are also available in the AWS Configuration File which downloaded in step 3.10.

Add Static Route (E2E → AWS)

  • Go to: Network → Static Routes → Create New

VPC Peering

VPC Peering

Destination : 10.0.0.0/16 (AWS VPC CIDR) , Interface: VPN tunnel interface

VPC Peering

Configure Firewall Policies

VPC Peering

  • Firewall Policy > Create new.

Policy 1: E2E → AWS

Firewall Policy Configuration
FieldValue
Incoming InterfacePort 2
Outgoing InterfaceVPN Tunnel (E2E-AWS)
Sourceall
Destinationall
ActionACCEPT
NATDisable

VPC Peering

Policy 2: AWS → E2E

  • Reverse of Policy 1.

VPC Peering

VPC Peering

VPN Tunnel Verification

  • The two VPN policies were created successfully.

  • Next, we verified that the Site-to-Site VPN tunnel is UP on both:

  • AWS Side (Virtual Private Gateway).

VPC Peering

  • E2E FortiGate Side

VPC Peering

  • Both tunnels were established successfully.

5- Create Test Servers on Both Sides

  • We created:

  • One E2E Cloud VM

VPC Peering

  • One AWS EC2 instance

VPC Peering

  • These servers were used to test private connectivity over the VPN tunnel.

Note on Public IP for E2E Cloud Server

  • While creating the E2E Cloud VM, the Public IP option was not enabled under the VPC settings. Therefore, the server was created without a public IP.

Important Information

  • If you want a public IP during node creation, you must:

  • Select VPC.

  • Enable Public IP.

If Node is Created Without Public IP

You must purchase a Reserved IP from E2E Cloud.

Reserved IP Cost: ₹199/month
  • After purchasing the Reserved IP:
  • Attach it to the server.
  • Access the machine through SSH normally.
  • In this setup, we purchased a Reserved IP, attached it to the node, and accessed it via SSH.

Ping Test from E2E → AWS

  • AWS EC2 Private IP: 10.0.0.232.
  • Initially, the ping failed.
  • This indicated that routing was not set correctly on the E2E VM

VPC Peering

Routing Fix on E2E VM

Incorrect Route Removed.

  • We removed the route: 192.168.0.0/18 via 10.11.86.1.

  • This network is not used for the AWS Site-to-Site VPN and could cause incorrect routing.

VPC Peering

Correct Route Added

  • We added the correct new route:
sudo ip route add 10.0.0.0/16 via 10.11.86.6 dev ens4

VPC Peering

info

Explanation 10.0.0.0/16 → AWS VPC CIDR.

10.11.86.6 → FortiGate (E2E) private IP

ens4 → Correct interface connected to the FortiGate network.

This ensures all AWS-bound traffic (10.0.0.0/16) goes through the FortiGate, entering the Site-to-Site VPN tunnel.

  • After adding the correct route, we pinged the AWS private IP again and it worked successfully.

6- Connectivity Test

E2E → AWS Ping Test

  • Ping from the E2E server to AWS EC2 private IP:

ping 10.0.0.232

VPC Peering

Result: Successful

AWS → E2E Ping Test

  • Ping from AWS EC2 to E2E server private IP:
ping <E2E-private-IP>

VPC Peering

Result: Successful

  • The Site-to-Site VPN is now fully active and bi-directional.

7- SSH from E2E VM to AWS EC2

Generate SSH Key

  • On E2E VM:
cat ~/.ssh/e2e_aws_key.pub

VPC Peering

  • SSH into AWS EC2 using PEM key.
  • Add key to:
~/.ssh/authorized_keys

  • Set permissions:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

VPC Peering

Test SSH

ssh -i ~/.ssh/e2e_aws_key ubuntu@10.0.1.119

VPC Peering

  • Successfully logged in.

Conclusion

  • The Site-to-Site VPN between E2E Cloud FortiGate Firewall and AWS VPC has been successfully deployed and verified.
  • Bi-directional connectivity, including ICMP and SSH traffic, is functional.