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...

Security Best Practices in Oracle Cloud Infrastructure (OCI)

  Today we are going to talk about security in OCI, indicating some Best Practices. As organizations increasingly adopt cloud technologies, ensuring robust security measures becomes paramount. Oracle Cloud Infrastructure (OCI) offers a comprehensive suite of tools and services to help secure your cloud environment. Here are some best practices to enhance your security posture on OCI. Identity and Access Management (IAM) One of the foundational elements of OCI security is Identity and Access Management (IAM). IAM allows you to control who has access to your cloud resources and what actions they can perform. Best practices include: Principle of Least Privilege: Grant users the minimum level of access necessary for their roles. Avoid assigning broad privileges like Administrator or Root unless absolutely required. Use Groups and Policies: Create groups for users with similar roles and assign policies to these groups rather than to individual users. This simplifies management and e...

Compartments in OCI

Hi and welcome to my blog. My intention with this blog is to explain in a simple and intuitive way how to work with OCI. And to begin with, let's start with one of the key elements of OCI, the compartment. Compartments are logical divisions used to organize the resources in OCI. To draw an analogy, you can think of them like folders in Windows or directories in Linux. Essentially, each element in your environment will be stored in a compartment, and you'll need to access that compartment in the OCI console to locate those elements. Following you can see the main characteristics of the compartments: For all of these reasons, compartments are a powerful feature to ensure security isolation and acccess control in your environment. It is also important to know that child compartments inherit their parents policies. To access to the compartment view in OCI, just navigate to Identity & Security / Compartments, and you will see all the compartments deployed in your environment. A ...