Skip to main content

Accessing OCI public services via private network

Introduction

When you running your workloads on any public cloud, protecting your network, data, instance from prying eyes and hands is one of the most important things.

But whenever you need to access public services offered by a cloud, one has to go through the internet. When your data is going through the internet, your network/instance(if not using NAT) and data are exposed to the public.

Is there a way to access public services offered by a public cloud safely, securely and with the same performance and high availability?

So if you are using Oracle Cloud Infrastructure(OCI), look no further, your answer is Service Access Gateway(SGW).

OCI users can access all these services directly from their Virtual Cloud Network(VCN) with private Subnet without any NAT, IGW by using SGW(No need to go to the internet). All traffic for these services is routed through OCI's internal network, thus protecting your data/network/instance.

How to set up an SGW?

This section explains step by step on how to create an SGW and configure it to access the OCI services from your private subnet.

1. Let's create a VCN.

Goto Networking->Virtual Cloud Networks and click on Create Virtual Cloud Network
Provide a name, select Create Virtual Cloud Network only,  CIDR block and click create.

2. Create a Private Subnet

Click on Create Subnet, provide a name, select Regional, CIDR block, and select the default route table and click on create

3. Create a Service Gateway

Click on Service Gateways from the left menu and click on Create Service Gateway. Provide a name and in services select "All Services in Oracle Services Network". If you want to only access Object storage via SGW please select "OCI Object Storage". In this example lets select "All Services in Oracle Services Network" which gives private access to all these services. Click on Create.

It's that simple. So lets test if we can access any OCI public services via our Private subnet.

4. Let's add a Route rule to tell VCN to send the traffic to SGW.

Click on Route Tables from the left menu and click on "Default Route Table for Test-SGW-VCN" default route table. Click on "Add Route Rules" and from drop-down select "Service Gateway" since we want access to All services, lets select "All Services in Oracle Services Network" for destination service. Select newly created SGW for "Target Service Gateway"

That's it, now you can access all these services from the newly created Private subnet.

PS: This is a personal blog. Any comments and questions are welcome.

Comments

Popular posts from this blog

Enable stats GUI on haproxy.

Add bottom snippet to the haproxy.conf below the defaults section. listen  stats         bind 19.41.259.10:1234         mode            http         log             global         maxconn 10         clitimeout      100s         srvtimeout      100s         contimeout      100s         timeout queue   100s         stats enable         stats hide-version         stats refresh 30s         stats show-node         stats auth admin:password         stats uri  /haproxy?stats Make sure you are updating the IP address on the bind to your VIP and if you want, you can change th...

atoi implementation in C

Algo for you own implementation of atoi :) :) int val = 0;    for each char in the string       val = val *10 + char-48 lets write some code for it :) int myatoi(char *convetIt) {      int val = 0;      while(*convetIt)      {           val = (val * 10) + *convetIt - 48;           convetIt++;      } } So how it works? lets see how it works take an example of string "123" formula : val = (val * 10 ) + *convetIt - 48                 val = (0 * 10 ) + '1' - 48      =>      0*10  + 49 - 48 =  0  + 1 = 1                 val = (1 * 10)  + '2' - 48      =>     1*10  + 50 - 48 = 10...

How to install openstack with Devstack on a single machine.

I think the best way to start messing with openstack is to install openstack using devstack. Its easy, customizable, easy to debug and the best part is one can simply discard the installed one and install new one in no time ! So I'll be giving you the steps to install  openstack on a physical box.  i.e all the component of the openstack will be installed on a single machine. Steps to follow. 1. Create a user as 'stack'. adduser stack 2.Install sudo and give the user 'stack' the sudo permission as most of the installation requires sudo permission. apt-get install sudo -y || yum install -y sudo echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers 2a. Once done with that, one can assign a password by doing passwd stack and then logout as root and login back as stack for all of the below steps. 3.Get the openstack code. The steps are install git and clone the code from github. sudo apt-get install git -y || yum instal...