Changing Which VCN Route Table a Subnet Uses

Change which virtial cloud network (VCN) route table a subnet uses.

For an overview of routing in your VCN and subnets, see VCN Route Tables.
    1. On the Virtual Cloud Networks list page, select the VCN that contains the route table you want to work with. If you need help finding the list page or the VCN, see Listing VCNs.
    2. On the details page, perform one of the following actions depending on the option that you see:
      • Select the Subnets tab, then select the name of the subnet you want to work with.
      • Scroll down to the table following the VCN details, which lists the subnets in the VCN. Select the name of the subnet you want to work with.
    3. On the subnet details page, perform one of the following actions depending on the option that you see:
      • On the subnet details page, select Actions then select Edit.
      • On the subnet details page, select Edit.
    4. In the Route Table section, select the new route table you want the subnet to use.
    5. Select Save changes.
    The changes takes effect within a few seconds.
  • Use the network subnet update command and described parameters to change which route table a subnet uses:

    oci network subnet update --subnet-id ocid --route-table-id routetable-ocid ... [OPTIONS]

    The route-table-id is the OCID of the route table the subnet will use.

    For a complete list of flags and variable options for CLI commands, see the CLI Command Reference.

  • Run the UpdateRouteTable operation to change which VCN route table a subnet uses.