Skip to main content

VCN


In the previous post we saw how to create a Compute Instance in OCI. To do this it was necessary to place it on a network segment, so in today's post we are going to go into the networking part of OCI.

Networking is a very broad topic, with a lot of associated resources. Today we will start with the most basic and important one, as it will contain the rest of the networking resources, Virtual Cloud Network (or VCN).

A Virtual Cloud Network is a software-defined private network. You have access to the VCN but not to the hardware, as it is all software. 

A VCN allows resources to communicate securely with the Internet, other instances or on-premise data centers.

It resides in a single region and can have up to 5 CIDR Blocks (it is recommended to use the private IP ranges specified in RFC 1918 (10.0.0.0.0/8, 172.16/12 and 192.168/16).

In OCI the supported size is from /16 to /30. As the netmask gets larger, the network size gets smaller.
We stop at /30 (4 addresses) because a VCN reserves 3 addresses: the first 2 for the network and the last one for broadcast.

As in the previous posts, we will look at different ways of creating a VCN:

  • Manually from OCI Console
Select "Virtual Cloud Network" under Networking section:


Click on "Create VCN" button:


And fill the information required:


  • With Terraform code
Use Infrastructure as Code to deploy it:

resource "oci_core_vcn" "test_vcn" {
    #Required
    compartment_id = var.compartment_id

    #Optional
    byoipv6cidr_details {
        #Required
        byoipv6range_id = oci_core_byoipv6range.test_byoipv6range.id
        ipv6cidr_block = var.vcn_byoipv6cidr_details_ipv6cidr_block
    }
    cidr_block = var.vcn_cidr_block
    cidr_blocks = var.vcn_cidr_blocks
    defined_tags = {"Operations.CostCenter"= "42"}
    display_name = var.vcn_display_name
    dns_label = var.vcn_dns_label
    freeform_tags = {"Department"= "Finance"}
    ipv6private_cidr_blocks = var.vcn_ipv6private_cidr_blocks
    is_ipv6enabled = var.vcn_is_ipv6enabled
    is_oracle_gua_allocation_enabled = var.vcn_is_oracle_gua_allocation_enabled
}

Code obtained from the official Terraform documentation:

  • OCICLI
It is also to use the OCI API to create resources:

oci network vcn create -c [text]

To see all available options:








Popular posts from this blog

Subnets

  A few days ago, in the previous post, we saw how to create a VCN. Today we are going to see how to create a subnet. A subnet is nothing more or less than a division of the VCN. A subnet can be contained in a single AD or be common to the entire region (recommended option). To deploy a DB or a compute instance, it is necessary to have previously created a subnet, to place it there and to take an IP within its range. It is also important to note that within the same VCN, the IP ranges of the subnets cannot overlap. A subnet can be public if you want to present the resources to the Internet or private if you do not. To access these resources, resources such as bastions, VPNs or Fastconnect must be used. In later posts we will go into more detail about all of these pieces in more detail. As usual, we are going to look at different ways of creating a VCN in OCI: Manually from OCI Console Access a previously created VCN, in which we want to deploy the subnet. In the subn...

Compute instances

In today's post, we are going to talk about compute instances in OCI. First of all, what is a compute instance? A compute instance is the OCI resource that you must deploy to provision and manage compute hosts. So, If you have the requirement to create a Virtual Machine (VM) or an infrastructure to host your application then you must use Compute Instance service. OCI offers 2 flavours: Bare Metal: Physical server without any virtualisation. Direct access to the hardware. The user has to manage the virtualisation layer, as well as the rest of the layers: OS, App Container, code... It is  a Single-Tenant Model, i.e. dedicated to only one client. It does not share hardware with other clients. Virtual Machine: It is basically a Bare metal with a virtualisation layer (which is taken care of by the Cloud Provider). Therefore, it has a hypervisor where it can run VMs smaller than the BM. It is based on a Multi-Tenant model. OCI also offers different shapes depending on the requi...

Object Storage

  Object Storage in Oracle Cloud Infrastructure (OCI) is a cloud-based service that lets you store and access any kind of digital file—like photos, videos, documents, or backups—easily and securely. Instead of using folders like on your computer, it organizes everything in containers called “buckets,” where each file is an “object.” It’s designed to handle large amounts of data, so you don’t have to worry about running out of space, and your files are safely stored and always available when you need them. In OCI Object Storage, there are different storage tiers depending on how often you need to access your files: The Standard tier is for data you use regularly—it's fast and always ready.  The Archive tier is for files you don’t need very often, like old backups or logs; it’s much cheaper, but it takes a few hours to access the data when you need it.  You can move files between these tiers to save money using something called lifecycle policies —these are simple rules...