Create a Virtual Cloud Network (VCN)

Create a virtual cloud network (VCN) to provide a private, customizable cloud network.

You can manually create the VCN and its features or you can use the networking quickstart option to set up a VCN with the necessary gateways, a public subnet, a private subnet, routing tables, and security lists.

You can add subnets and security rules as necessary. For example, you can use the provisioned private subnet for the Function service, and create a second private subnet to house the database.

Use a Wizard to Create a Virtual Cloud Network

You can use a predefined workflow to quickly create a virtual cloud network (VCN) with internet connectivity.

The wizard creates a virtual cloud network contains with the following elements:

  • An internet gateway, a NAT gateway, and a service gateway for the VCN

  • A regional public subnet with routing to the internet gateway

    Instances in a public subnet may optionally have public IP addresses.

  • A regional private subnet with routing to the NAT gateway and service gateway (and therefore the Oracle Services Network)

    Instances in a private subnet cannot have public IP addresses.

  • Basic security list rules for the two subnets, including SSH access

To use the wizard to create a virtual cloud network:

  1. In the Console, click the Oracle Cloud icon at the top of the page to go to the Console home page.
  2. Click the quick action for Networking: Set up a network with a wizard.
  3. Select VCN with Internet Connectivity, and then click Start Workflow.
  4. Specify a friendly name for the VCN. It doesn't have to be unique, however it can't be changed later in the Console (but you can change it with the API). Avoid entering confidential information.
  5. Use the default Compartment or select a different compartment.
  6. Use the default CIDR blocks listed for the VCN and subnets, or specify a different range.
  7. Click Next.
  8. Review the information and click Previous to make changes or click Create to create the VCN.

Create a Private Subnet

Create a private subnet to house resources for which you do no want to provide access through public IP addresses.

Subnets act as a unit of configuration within the virtual cloud network (VCN). All virtual network interface cards (VNICs) in a given subnet use the same route table, security lists, and DHCP options. When you designate a subnet as private, VNICs in the subnet can't have public IP addresses.

  1. Open the navigation menu. Under Core Infrastructure, go to Networking and click Virtual Cloud Networks.
  2. Choose a compartment you have permission to work in (on the left side of the page). The page updates to display only the resources in that compartment.
  3. Click the VCN where you want to create the subnet.
  4. In the VCN details page, click Subnets.
  5. Click Create Subnet.

    Enter the following:

    • Name: A friendly name for the subnet (for example, domain-db-subnet). It doesn't have to be unique, and it cannot be changed later in the Console (but you can change it with the API). Avoid entering confidential information.
    • Regional or Availability Domain-Specific: Select Regional (recommended), which means the subnet spans all availability domains in the region. Later when you launch an instance, you can create it any availability domain in the region.
    • CIDR Block: A single, contiguous CIDR block within the VCN's CIDR block. For example: 10.0.5.0/24 if the VCN CIDR block is 10.0.0.0/16) You cannot change this value later.
    • Route Table: Select the default route table.
    • Subnet Access: Select Private Subnet, which means instances in the subnet cannot have public IP addresses.
    • Use DNS Hostnames in this Subnet:This option is available only if you provided a DNS label for the VCN during creation. The option is required for assignment of DNS hostnames to hosts in the subnet, and required if you plan to use the VCN's default DNS feature (called the Internet and VCN Resolver). If the check box is selected, you can specify a DNS label for the subnet, or the Console will generate one for you. The dialog box automatically displays the corresponding DNS Domain Name for the subnet (<subnet_DNS_label>.<VCN_DNS_label>.oraclevcn.com).
    • DHCP Options: Select the default set of DHCP options.
    • Security Lists: Select the security list your created earlier, such as domain-db-security-list.
    • Tags: Leave as is. You can add tags later if you want.
  6. Click Create Subnet.