Building an Architecture Step-by-Step in OCI: Route Tables, Internet and NAT Gateways

Continuing the series of articles with the goal of creating a step-by-step architecture in Oracle Cloud Infrastructure (OCI) to run a web application, we will now create new Route Tables, Internet and NAT Gateways.

Route Tables contains a set of rules that are used to determine where network traffic is directed (for example, to the internet, to your on-premises network, or to a peered VCN).

Internet Gateway is a virtual router you can add to your VCN to enable direct connectivity to the internet. It supports connections initiated from within the VCN (egress) and connections initiated from the internet (ingress).

NAT Gateway allows instances on a private subnet, without public IP addresses, to access the Internet without exposing them to incoming Internet connections.

To allow instances on the private subnet to access the Internet (egress), we need to create a NAT Gateway. To create a new NAT Gateway, on the Resources menu, click NAT Gateways.

Click Create NAT Gateway.

In the Create NAT Gateway dialog box, use the information below and click Create NAT Gateway:

  • Name: myNatGateway
  • Create In Compartment: The compartment name (e.g. mycompartment)

Click Close.

The NAT Gateway has been created.

To allow instances on the public subnet to access the Internet (ingress and egress), we need to create an Internet Gateway. To create a new Internet Gateway, on the Resources menu, click Internet Gateways.

Click Create Internet Gateway.

In the Create Internet Gateway dialog box, use the information below and click Create Internet Gateway:

  • Name: myInternetGateway
  • Create In Compartment: The compartment name (e.g. mycompartment)

The Internet Gateway has been created.

A default Route Table was created for this VCN, but we will not use it. We will create two new Route Tables, one for the public subnet and one for the private subnet. To create a new Route Table, on the Resources menu, click Route Tables.

Click Create Route Table.

In the Create Route Table dialog box, use the information below:

  • Name: myPrivateRouteTable
  • Create In Compartment: The compartment name (e.g. mycompartment)

Click + Additional Route Rule, use the information below and click Create Route Table:

  • Target Type: NAT Gateway
  • Destination CIDR Block: 0.0.0.0/0
  • Compartment: The compartment name (e.g. mycompartment)
  • Target NAT Gateway: The NAT Gateway name (e.g. myNatGateway)

Click Create Route Table again.
In the Create Route Table dialog box, use the information below:

  • Name: myPublicRouteTable
  • Create In Compartment: The compartment name (e.g. mycompartment)

Click + Additional Route Rule, use the information below and click Create Route Table:

  • Target Type: Internet Gateway
  • Destination CIDR Block: 0.0.0.0/0
  • Compartment: The compartment name (e.g. mycompartment)
  • Target Internet Gateway: The Internet Gateway name (e.g. myInternetGateway)

The Route Tables were created.

Good job!
In this article you learned how to create new Route Tables, Internet and NAT Gateways.

Have a good time!

Author: Waslley Souza

Consultor Oracle com foco em tecnologias Oracle Fusion Middleware e SOA. Certificado Oracle WebCenter Portal, Oracle ADF e Java.