Creating a NAT Gateway

Create a NAT gateway in your a virtual cloud network(VCN) in Networking.

    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Click the name of the VCN that you're interested in.
    3. Under Resources, click NAT Gateways.
    4. Click Create NAT Gateway.
    5. Enter the following values:
      • Name: A friendly name for the NAT gateway. It doesn't have to be unique. Avoid entering confidential information.
      • Create in Compartment: The compartment in which you want to create the NAT gateway, if different from the compartment you're currently working in.
      • Choose IP Address Type: Specify whether the public IP address is reserved or ephemeral.
        • Ephemeral IP Address: Select this option to let Oracle specify an ephemeral IP address for you from the Oracle IP pool. This option is the default.
        • Reserved IP Address: Select this option to specify an existing reserved IP address by name, or to create a new reserved IP address by assigning a name and selecting a source IP pool for the address. If you don't select a pool that you've created, the default Oracle IP pool is used.
      • Route Table Association: (Advanced option) You can associate a specific VCN route table with this gateway. If you associate a route table, afterwards the gateway must always have a route table associated with it. You can modify the rules in the current route table or replace it with another route table.
      • Tags: (Advanced option) If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
    6. Click Create NAT Gateway.

    The NAT gateway is then created and displayed on the NAT Gateways page in the compartment that you chose. The gateway allows traffic by default. At any time, you can block or allow traffic through it.

  • Use the network internet-gateway create command and required parameters to create a NAT gateway in your VCN:

    oci network nat-gateway create --compartment-id compartment-ocid --vcn-id vcn-ocid ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateNatGateway operation to create a NAT gateway in your VCN.