Note:

Connect On-premises to OCI using an IPSec VPN with Hub and Spoke VCN Routing Architecture

Introduction

Oracle Cloud Infrastructure (OCI) makes it easy to configure VPN connectivity between your on-premises environment and your OCI environment, however they can create some complexities in routing when using a hub and spoke topology in OCI. In this tutorial, we will set up an Internet Protocol Security (IPSec) VPN connection to OCI, and configure routing to ensure that traffic from the on-premises environment is evaluated by firewall policies before connecting to resources in OCI.

image

The following images illustrate the traffic flows.

Objectives

Prerequisites

Complete the following tutorials:

Task 1: Prepare the On-premises Environment

Task 2: Create a CPE in OCI

Before creating an IPSec VPN connection, we need to first create a CPE object in OCI.

Task 3: Create a Site-to-Site VPN in OCI

To configure the OCI Site-to-Site VPN, we need to perform the configuration on two ends, the OCI side and the on-premises side.

Task 4: Configure Hub and Spoke VCN Routing for the On-premises Subnet

To route network traffic coming from the on-premises network within our Hub and Spoke network architecture, we need to make some changes to Dynamic Routing Gateways (DRG) and VCN route tables.

The following image illustrates the routing tables so this is our starting point.

image

Task 4.1: Update the Route Import

Task 4.2: Create a new Hub VCN Route Table and Associate with the IPSec DRG Attachment

Task 4.3: Update the Hub VCN Private Subnet Route Table

The last route table to update is the VCN route table that is associated with the private subnet in the hub VCN.

Task 5: Create a Site-to-Site VPN on On-premises using pfSense

We have configured the OCI side of the IPSec tunnel. Let’s configure the on-premises side. We are using a pfSense firewall as the IPSec termination endpoint.

Task 5.1: Create the IPSec Tunnel (Phase 1 ISAKMP)

Task 5.2: Create the IPSec Tunnel (Phase 2 IPSec)

Task 5.3: Enable the Tunnel Interface

Task 5.4: Open the Firewall Rules for IPSec

Task 5.5: Configure IPSec Routing

In this task, we will configure routing so that the pfSense firewall knows how to reach the OCI network through the IPSec tunnel and the OPT1 interface.

Task 6: Configure On-premises Routing

We have routing working on pfSense, that is the IPSec VPN endpoint. We need to make sure that the rest of the on-premises network knows how to reach the OCI networks. So we need to route all traffic destined to OCI to the pfSense VPN endpoint.

Configure routing on the test On-premises Compute Client

We are using a pfSense instance to simulate the on-premises network.

Note: This is a different instance than the one we just used to configure the IPSec tunnel on!

Task 7: Verify the Connectivity

We have configured the VPN, added the correct firewall rules, and configured routing, now test the connectivity.

Task 7.1: Ping from On-premises to Spoke VCN A

Task 7.2: Ping from Spoke VCN B to On-premises

Task 7.3: Check IPSec VPN Network Statistics on OCI

Task 7.4: Check IPSec VPN Network Statistics on the pfSense VPN Instance (On-premises)

Network Visualizer

As we have added the VPN, we can use the Network Visualizer on the OCI Console to get a network overview.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.