<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kamran Arif on Medium]]></title>
        <description><![CDATA[Stories by Kamran Arif on Medium]]></description>
        <link>https://medium.com/@hpnvgjmd?source=rss-15c5d36dc3d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mCbKLkg-AFM1C6a7TUE7Lw@2x.jpeg</url>
            <title>Stories by Kamran Arif on Medium</title>
            <link>https://medium.com/@hpnvgjmd?source=rss-15c5d36dc3d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:23:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hpnvgjmd/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Bridging the Clouds: A Human Guide to AWS-to-OCI Site-to-Site VPN]]></title>
            <link>https://medium.com/@hpnvgjmd/bridging-the-clouds-a-human-guide-to-aws-to-oci-site-to-site-vpn-2c138fcd3ca8?source=rss-15c5d36dc3d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/2c138fcd3ca8</guid>
            <category><![CDATA[site-to-site-vpn]]></category>
            <category><![CDATA[s2s-vpn]]></category>
            <category><![CDATA[oci-networking]]></category>
            <category><![CDATA[aws-site-to-site-vpn]]></category>
            <dc:creator><![CDATA[Kamran Arif]]></dc:creator>
            <pubDate>Sun, 08 Mar 2026 06:17:07 GMT</pubDate>
            <atom:updated>2026-03-08T06:17:07.843Z</atom:updated>
            <content:encoded><![CDATA[<p>Connecting different cloud providers is the ultimate “boss fight” for a Cloud Architect. Recently, I bridged <strong>Oracle Cloud Infrastructure (OCI)</strong> and <strong>Amazon Web Services (AWS)</strong> using a Site-to-Site (S2S) VPN. Specifically, I used <strong>Libreswan</strong> on an AWS EC2 instance to act as my “on-premises” gateway.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PDAiqRTQvZrn6Gg_4MgQrg.png" /><figcaption>Architecture Diagram</figcaption></figure><p>Here is the roadmap to getting your multi-cloud tunnel established and — more importantly — actually passing traffic.</p><p><strong>Phase 1: Setting the Foundation</strong></p><p><strong>1. Deploy the AWS Instance</strong></p><p>· <strong>The Compute</strong>: Spin up an EC2 instance — Amazon Linux or RHEL works best for Libreswan.</p><p>· <strong>The Elastic IP</strong>: Assign an <strong>Elastic IP</strong> to your instance. This static public IP is what OCI will use to find you.</p><p>· <strong>Security Group (The Handshake)</strong>: You must open <strong>Inbound UDP Ports 500 and 4500</strong> from the OCI Tunnel IPs. Without this, the IPsec handshake will time out immediately.</p><p><strong>2. Build the OCI VCN Architecture</strong></p><p>· <strong>Two Subnets</strong>: Create a <strong>Public Subnet</strong> (with an Internet Gateway) and a <strong>Private Subnet</strong>.</p><p>· <strong>The DRG</strong>: Attach a <strong>Dynamic Routing Gateway (DRG)</strong> to your VCN.</p><p>· <strong>Security Lists</strong>: Like AWS, you must allow <strong>Inbound UDP 500/4500</strong> from your &lt;AWS_Public_IP&gt;.</p><p><strong>3. Create the S2S Connection in OCI</strong></p><p>· <strong>CPE</strong>: Register your <strong>&lt;AWS_Public_IP&gt;</strong>.</p><p>· <strong>The Connection</strong>: Link your <strong>CPE</strong> and <strong>DRG</strong>, selecting <strong>IKEv2</strong> and <strong>Static Routing</strong>.</p><p>· <em>Note</em>: Copy the two tunnel endpoints and secrets provided by OCI.</p><p><strong>Phase 2: The Routing Logic (Don’t Skip This!)</strong></p><p>The tunnel can be “Up,” but if the routers don’t know the tunnel exists, your pings will fail.</p><p><strong>1. OCI Route Tables</strong></p><p>In your <strong>Private Subnet Route Table</strong>, you need two specific rules:</p><p>· <strong>Internet Path</strong>: Destination 0.0.0.0/0 → Target: <strong>NAT Gateway</strong> (to allow your private VMs to reach the web).</p><p>· <strong>AWS Path</strong>: Destination &lt;AWS_VPC_CIDR&gt; (e.g., 172.31.0.0/16) → Target: <strong>Dynamic Routing Gateway (DRG)</strong>.</p><p><strong>2. AWS Route Tables</strong></p><p>In your AWS VPC Route Table, you must tell AWS that the way to get to Oracle is through your Libreswan instance:</p><p>· <strong>OCI Path</strong>: Destination &lt;OCI_VCN_CIDR&gt; (e.g., 10.0.0.0/16) → Target: <strong>Instance</strong> (Select your Libreswan EC2 ID).</p><p><strong>Phase 3: Configuring Libreswan</strong></p><p>Now, we move to the AWS instance to set up the “brain” of our tunnel.</p><p><strong>Installation and IP Forwarding</strong></p><p>We need to allow the Linux kernel to pass traffic between the networks.</p><p>Bash</p><p><em>sudo yum install -y libreswan</em></p><p><em># Enable IP Forwarding so the instance acts as a gateway</em></p><p><em>echo “net.ipv4.ip_forward=1” | sudo tee -a /etc/sysctl.conf</em></p><p><em>echo “net.ipv4.conf.all.accept_redirects=0” | sudo tee -a /etc/sysctl.conf</em></p><p><em>echo “net.ipv4.conf.all.send_redirects=0” | sudo tee -a /etc/sysctl.conf</em></p><p><em>sudo sysctl -p</em></p><p><strong>The Connection Settings (/etc/ipsec.d/oci-vpn.conf)</strong></p><p>OCI is very picky about identifiers. Use your AWS Public IP for the leftid.</p><p>sudo vi /etc/ipsec.d/oci-vpn.conf</p><p><em># Tunnel 1 Configuration</em></p><p><em>conn oci-tunnel-1</em></p><p><em>authby=secret</em></p><p><em>ikev2=insist</em></p><p><em>left=%defaultroute</em></p><p><em>leftid=&lt;AWS_Public_IP&gt; # Your AWS Static Public IP</em></p><p><em>leftsubnet=&lt;AWS_VPC_CIDR&gt; # e.g., 172.31.0.0/16</em></p><p><em>right=&lt;OCI_Tunnel_1_IP&gt; # From OCI VPN Console</em></p><p><em>rightid=&lt;OCI_Tunnel_1_IP&gt;</em></p><p><em>rightsubnet=&lt;OCI_VCN_CIDR&gt; # e.g., 10.0.0.0/16</em></p><p><em>ike=aes256-sha2_256;modp2048</em></p><p><em>phase2alg=aes256-sha2_256;modp2048</em></p><p><em>forceencaps=yes</em></p><p><em>auto=start</em></p><p><em># Tunnel 2 Configuration (Adding this prevents the “no suitable connection” error)</em></p><p><em>conn oci-tunnel-1</em></p><p><em>authby=secret</em></p><p><em>ikev2=insist</em></p><p><em>left=%defaultroute</em></p><p><em>leftid=&lt;AWS_Public_IP&gt; # Your AWS Static Public IP</em></p><p><em>leftsubnet=&lt;AWS_VPC_CIDR&gt; # e.g., 172.31.0.0/16</em></p><p><em>right=&lt;OCI_Tunnel_2_IP&gt; # From OCI VPN Console</em></p><p><em>rightid=&lt;OCI_Tunnel_2_IP&gt;</em></p><p><em>rightsubnet=&lt;OCI_VCN_CIDR&gt; # e.g., 10.0.0.0/16</em></p><p><em>ike=aes256-sha2_256;modp2048</em></p><p><em>phase2alg=aes256-sha2_256;modp2048</em></p><p><em>forceencaps=yes</em></p><p><em>auto=start</em></p><p><strong>The Authentication Key (/etc/ipsec.d/oci-vpn.secrets)</strong></p><p>sudo vi /etc/ipsec.d/oci-vpn.secrets</p><p><em>Format matters here — ensure you have a space on either side of that colon.</em></p><p><em>Plaintext</em></p><p><em>&lt;AWS_Public_IP&gt; &lt;OCI_Tunnel_1_IP&gt; : PSK “&lt;Actual_Secret_From_OCI_Tunnel_1&gt;”</em></p><p><em>&lt;AWS_Public_IP&gt; &lt;OCI_Tunnel_2_IP&gt; : PSK “&lt;Actual_Secret_From_OCI_Tunnel_2&gt;”</em></p><p><strong>Phase 4: Bringing it Online</strong></p><p>Run these commands to initiate the handshake:</p><p>Bash</p><p><em>sudo systemctl restart ipsec</em></p><p><em>sudo ipsec auto — rereadsecrets</em></p><p><em>sudo ipsec auto — up oci-tunnel-1</em></p><p><strong>The Final Checklist</strong></p><p>· <strong>Security Groups</strong>: Ensure <strong>UDP 500</strong> and <strong>UDP 4500</strong> are open on both AWS and OCI firewalls.</p><p>· <strong>Source/Dest Check</strong>: In the AWS Console, disable the <strong>“Source/Destination Check”</strong> on your EC2 instance so it can route traffic that isn’t its own.</p><p>· <strong>The Ping Test</strong>: Once OCI shows the tunnel as <strong>“Up”</strong>, try pinging an OCI private IP from your AWS instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c138fcd3ca8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>