OCI VCN Subnet Planning

Oracle Cloud Infrastructure (OCI) reserves 3 IP addresses per subnet, the fewest of any major cloud provider. This makes OCI the most address-efficient option for tightly-packed subnet plans.

OCI Reserved IPs

For any subnet, OCI reserves:

AddressPurpose
Network + 0Network address
Network + 1Default gateway
Last addressBroadcast address

Example: In a 10.0.1.0/24 subnet:

  • 10.0.1.0 is the network address
  • 10.0.1.1 is the default gateway
  • 10.0.1.255 is the broadcast address
  • Usable range: 10.0.1.2 through 10.0.1.254 = 253 hosts

This is only 1 less than the theoretical standard mode maximum (254), making OCI the closest to standard RFC 950 behavior among cloud providers.

Minimum Subnet Size

The smallest subnet OCI allows is /30 (4 addresses, 1 usable). This is smaller than AWS (/28) and Azure/GCP (/29). A /30 in OCI provides a single usable IP, which can be useful for dedicated service endpoints.

VCN Architecture

OCI networking is organized around Virtual Cloud Networks (VCNs). A VCN is assigned a CIDR block (or multiple blocks since OCI supports multiple CIDR ranges per VCN). Subnets can be either regional (span all availability domains in a region) or AD-specific (limited to one availability domain).

Regional subnets are recommended for new deployments because they simplify management and provide better availability.

A common production VCN uses a /16 address space:

VCN: 10.0.0.0/16 (65,536 addresses)
+----- Public Subnets (regional)
|   +--- 10.0.1.0/24  Load balancers (253 hosts)
|   +--- 10.0.2.0/24  Bastion hosts (253 hosts)
+----- Private Subnets (regional)
|   +--- 10.0.10.0/24 App tier (253 hosts)
|   +--- 10.0.11.0/24 App tier overflow (253 hosts)
|   +--- 10.0.20.0/24 Database tier (253 hosts)
|   +--- 10.0.21.0/24 Database standby (253 hosts)
+----- OKE Subnets
|   +--- 10.0.100.0/24 Worker nodes (253 hosts)
|   +--- 10.0.200.0/16-subset Pod IPs (via CNI)
+----- Spare: remaining space for growth

Public vs. Private Subnets

In OCI, subnets have an explicit public or private designation:

  • Public subnets allow instances to have public IP addresses. A public subnet must be associated with a route table that has an Internet Gateway.
  • Private subnets block public IP assignment entirely. Instances reach the internet (if needed) via a NAT Gateway.

This is different from AWS where any subnet can technically have public IPs (controlled by auto-assign settings). In OCI, the public/private distinction is set at subnet creation time.

Security Model

OCI uses two layers of network security:

LayerScopeState
Security ListsPer-subnetStateful (default) or stateless
Network Security Groups (NSGs)Per-VNIC (network interface)Stateful

Security Lists apply to all resources in a subnet. NSGs apply to individual VNICs and can be shared across subnets. OCI recommends using NSGs for fine-grained control and Security Lists for broad subnet-level rules.

Sizing Tips

ScenarioRecommended CIDRUsable (OCI)
Minimal service endpoint/301
Small utility subnet/2813
Standard workload/24253
OKE worker nodes/24253
Large workload/204,093

OKE (Kubernetes) Networking

Oracle Kubernetes Engine (OKE) supports two CNI plugins:

  • Flannel overlay: Pods get IPs from a virtual overlay network, not from VCN subnets. Node subnet sizing only needs to fit node count.
  • OCI VCN-Native Pod Networking: Pods get VCN IPs directly (similar to AWS VPC CNI). Requires larger subnets to fit both nodes and pods.

For VCN-Native networking, plan the pod subnet at /20 or larger to accommodate pod density.

Multi-VCN with DRG

For larger deployments, OCI uses a Dynamic Routing Gateway (DRG) to connect multiple VCNs:

  1. Hub VCN: Shared services, firewall appliances, DNS.
  2. Spoke VCNs: Workload-specific, peered through the DRG.
  3. On-premises: Connected via FastConnect or IPSec VPN through the DRG.

Each VCN needs a unique, non-overlapping CIDR range. Plan your IPAM across all VCNs before creating any.

Common Mistakes

  1. Overlapping CIDR ranges. VCN peering via DRG requires non-overlapping ranges. Plan the full address map up front.
  2. Using AD-specific subnets. Regional subnets are simpler and more resilient. Use AD-specific subnets only when required by legacy services.
  3. Forgetting the public/private distinction. Unlike AWS, this cannot be changed after creation. Plan subnet types before deploying.
  4. Undersizing for OKE VCN-Native networking. Pod IPs consume VCN addresses. Size the pod subnet for peak cluster capacity.

Tools

Use our subnet calculator with Oracle Cloud mode to see correct host counts with 3 reserved IPs. The VLSM planner can generate multi-tier VCN layouts with correct OCI sizing.

References