Note:

Set up an Oracle Cloud Infrastructure Site-to-Site VPN with Static Routing Between two OCI Regions

Introduction

When your applications, databases, or services are distributed across different Oracle Cloud Infrastructure (OCI) regions or tenants, the preferred method for enabling network communication between them is Remote Peering Connection (RPC) peering. If RPC peering is not feasible, an alternative is to establish an OCI Site-to-Site VPN IPSec connection. While OCI does not directly support creating an OCI Site-to-Site VPN IPSec using the Dynamic Routing Gateway (DRG), you can configure a custom VPN endpoint (like Libreswan) on one side and utilize the DRG on the other to achieve this connection.

image

image

You can also use this method if you need to set up an OCI Site-to-Site VPN between on-premises and OCI and do not want to use the DRG as the Virtual Private Network (VPN) endpoint but your own custom VPN endpoint.

Objectives

Prerequisites

Task 1: Review the Destination OCI Region (VCN, Subnet, DRG, VCN Attachments and Instances)

In this task, we will check what we have in place to get started.

The following image illustrates what we have created so far.

image

Task 2: Review the Source OCI Region (VCN, Public Subnet, Internet Gateway, and Instances)

The following image illustrates what we have created so far.

image

Task 3: Collect the Public IP Address of the CPE Instance from the Source OCI Region

Task 4: Create a new CPE in the Destination OCI Region

Task 5: Configure the OCI Site-to-Site VPN in the Destination OCI Region

Task 6: Collect the Public IP Address of the IPSec Tunnels in the Destination OCI Region and Download the CPE Configuration

Task 7: Configure the CPE Instance in the Source OCI Region and Install and Configure Libreswan

Task 8: Open the Firewall on the CPE Instance in the Source OCI Region and Configure the VCN and Subnet Security Lists

Configure the VCN and subnet security lists to allow the ingress ports required for the IPSec connection. To allow the tunnels to be established correctly, you need to make sure the network security on both sides is allowing the ports that are required.

Disable the Linux Firewall on the CPE

In some cases (for testing purposes) it might be better to completely disable the Linux Firewall of the CPE Instance where Libreswan is running on. This can be done with the following command:

[root@cpe ipsec.d]# systemctl disable --now firewalld

Run the following command to make sure the firewall service for Libreswan is NOT running.

[root@cpe ipsec.d]# systemctl status firewalld

Task 9: Activate and Verify if the IPSec Tunnel is up on Both Sides

Task 10: Configure the Static Routing

Task 11: Initiate Final Ping from the Source and Destination Instances

Task 12: Verify the OCI Site-to-Site VPN Status

Task 13: Enable Equal Cost Multi-Path (ECMP) Routing

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.