Back to Blog
Building Your Network in Oracle Cloud Infrastructure (OCI): A Step-by-Step Guide

Building Your Network in Oracle Cloud Infrastructure (OCI): A Step-by-Step Guide

   Mariusz Antonik    Networking    2 min read    1,225 views

Building Your Network in Oracle Cloud Infrastructure (OCI): A Step-by-Step Guide

Every reliable cloud deployment starts with a solid network foundation. In OCI, that foundation is the Virtual Cloud Network (VCN)—a private, software-defined network for your compute, databases, and services. This guide explains compartments, public vs private subnets, and a practical setup flow.

1. Tenancy, Compartments, and VCNs

Your tenancy is your company’s root account. Inside it, create compartments—logical containers for isolation, access control, and cost tracking.

DMCloudArchitect (Tenancy) ├─ Production │ ├─ Networking │ ├─ Compute │ └─ Databases └─ Development ├─ Networking ├─ Compute └─ Databases 

Keep network resources in a dedicated Networking compartment for clean IAM and troubleshooting.

2. What Is a VCN?

A VCN is a private, customizable network in a single region that can span multiple ADs. You define IP ranges (CIDRs), subnets, gateways, routes, and security.

  • Example VCN CIDR: 10.0.0.0/16
  • Example Subnets: 10.0.1.0/24 (public), 10.0.2.0/24 (private)

3. Public vs Private Subnets

Public Subnets

  • Internet access via an Internet Gateway.
  • For web frontends, bastions, public LBs.
  • Instances can have public IPs.

Private Subnets

  • No direct internet exposure.
  • For databases and internal services.
  • Outbound only via NAT Gateway for updates.

4. Create a Basic Network (Console)

  1. Create a Compartment: Identity & Security → Compartments → Create.
  2. Create a VCN: Networking → Virtual Cloud Networks → Create (Quick setup or Custom). Choose CIDR like 10.0.0.0/16.
  3. Create Subnets: Public-Subnet 10.0.1.0/24, Private-Subnet 10.0.2.0/24.
  4. Configure Routes: Public → 0.0.0.0/0 → Internet Gateway; Private → 0.0.0.0/0 → NAT Gateway.
  5. Security: Use NSGs or Security Lists. Example: allow TCP 22 (SSH) from your IP to public; allow DB port from app subnet only.

5. Key Networking Components

  • Internet Gateway: public ingress/egress
  • NAT Gateway: private egress only
  • Service Gateway: private access to OCI services
  • DRG: on-prem/VPN or inter-VCN connectivity
  • LPG: local peering same region
  • Route Tables: traffic paths per subnet
  • NSGs/Security Lists: firewall policies

6. Organizing for Growth

  • Plan non-overlapping CIDRs for future peering/VPNs.
  • Use tags for owner/cost center.
  • Separate prod vs dev in distinct compartments/VCNs.
  • Document the IP plan early.
VCN: 10.0.0.0/16 ├─ Public Subnet: 10.0.1.0/24 (Web) └─ Private Subnet: 10.0.2.0/24 (DB)

7. Tips for Developers & Small Businesses

  • Start with Quick Create; customize later.
  • Keep most resources private; expose only what’s needed.
  • Automate with Terraform/CLI for repeatability.
  • Use Flow Logs and Monitoring for troubleshooting.

8. Summary

Organize with compartments, define a clean VCN, split public/private subnets, and apply least-privilege security. A solid network unlocks secure, scalable deployments for your workloads.


About the Author
Mariusz Antonik

Oracle Cloud Infrastructure expert and consultant specializing in database management and automation.

All Tags
#Advanced #alerts #Bash #bash cpu monitoring script #bash monitoring #bash scripting #Beginner #Best Practices #block volume backup #Capacity Planning #cloud backup strategy #cpu bottleneck #CPU Monitoring #cpu monitoring linux #cpu monitoring script linux #cpu trends #cpu usage trends #cpu usage trends linux #create oracle db system in oci #cron cpu monitoring #cron cpu monitoring linux #cron jobs #database monitoring #database performance #detect slow queries mysql #devops #disk capacity planning server #disk forecasting linux #disk growth trend linux #Disk Monitoring #disk usage #disk usage script linux #disk usage trends #Early Detection #easy infrastructure monitoring #free-tier #Guide #health dashboards #Health Reporting #historical server monitoring #how to monitor cpu usage linux #infrastructure #infrastructure health #infrastructure health dashboard #infrastructure health reporting #infrastructure monitoring #infrastructure monitoring report #infrastructure trends #infrastructure trends monitoring #Infrastructure Visibility #lightweight linux monitoring #lightweight monitoring #linux #linux administration #linux cpu monitoring #linux cpu usage #linux disk capacity planning #linux disk usage #Linux monitoring #linux monitoring setup #linux monitoring tools #linux performance #linux performance monitoring #linux server #linux server monitoring #linux servers #linux storage #linux tools #low maintenance monitoring #monitor cpu usage over time linux #monitor linux server health #monitor server trends #monitor small production server #monitoring without complexity #MySQL #mysql health reporting #MySQL monitoring #mysql optimization #MySQL Performance #mysql performance degradation #mysql performance monitoring #mysql performance trends #mysql query performance issues #mysql server monitoring #mysql slow queries #mysql slow query analysis #mysql slow query monitoring #mysql trends #mysql-health #networking #nsg #OCI #oci backup #oci bastion tutorial #oci block volume #oci infrastructure as code #OCI monitoring #oci networking #oci oracle database private subnet setup #oci oracle database tutorial #oci security #oci setup guide #oci terraform tutorial #oci tutorial for beginners #oci vcn terraform #oci virtual machine db system guide #oracle base database service tutorial #oracle cloud bastion #oracle cloud free tier tutorial #oracle cloud infrastructure step by step #oracle cloud infrastructure tutorial #oracle cloud storage #oracle database on oci setup #oracle-cloud #Performance #Performance Degradation #performance monitoring #performance trend monitoring #performance trends #plan disk growth server #practical server monitoring #predict disk usage growth #private instance access #query optimization #Security #security lists #server health #server health reporting #server health weekly report #server monitoring #Server Performance #server trend analysis #server-trends #simple cpu monitoring linux #simple linux monitoring #simple monitoring small business #simple monitoring system #simple ops monitoring #slow queries #slow query reporting mysql #small business infrastructure #small business IT #small business servers #small infrastructure monitoring #small server monitoring #ssh bastion #storage capacity planning linux #storage monitoring #subnets #system health reporting #terraform oci compute #terraform oracle cloud infrastructure #Trend Monitoring #trend-analysis #trends #Tutorial #vcn