Managing Routes

Creating a Route

You can use routes to specify preferred paths for traffic from your network to destinations outside your network. A route specifies the IP address of the destination as well as the vNICset that provides the next hop for routing packets.

For example, if you want to set up a VPN connection to your instances, you must create a route to specify that traffic to the reachable subnets specified in the VPN connection should be routed through the vNICs of the VPN gateway.

To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Network tab.
  3. In the Network drop-down list, expand IP Network, and then click Routes.
  4. Click Create Route.
  5. Select or enter the required information:
    • Name: Enter a name for the route.
    • Administrative Distance: Enter 0, 1, or 2 to specify the administrative distance of the route. The administrative distance indicates the priority of a route. The highest priority is 0. When multiple routes to a destination exist, the route with the highest priority is used. If multiple routes with the highest priority exist, traffic is routed and load-balanced across all those routes. In this case, traffic is routed over all vNICs specified in these routes as if they belonged to a single vNICset.
    • IP Address Prefix: Enter the IP address prefix, in CIDR format, of the destination network that you want to specify the route to. The destination IP address prefix must be an external network or host.
    • Next Hop vNICset: Select the vNICset that you want to use to route packets to the specified destination. When a vNICset containing multiple vNICs is used in a route, Equal Cost Multipath (ECMP) anycast routing is implemented. Traffic routed by that route is load balanced across all the vNICs in the vNICset. Using vNICsets with multiple vNICs also ensures high availability for traffic across the specified vNICs.
    • Description: Enter a meaningful description for the route.
    • Tags: Enter a list of the tags that you want to associate with the route, if required.

  6. Click Create.
    The route is created.

To create a route using the CLI, use the opc compute route add command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To create a route using the API, use the POST /network/v1/route/ method. See REST API for Oracle Cloud Infrastructure Compute Classic.

You can also create a route by using an orchestration. See Orchestration v1 Attributes Specific to Each Object Type or Orchestration v2 Attributes Specific to Each Object Type.

Listing Routes

After creating routes, you can view a list of routes along with information about the destination of each route, the vNICset used by the route, and the administrative distance of the route.

To complete this task, you must have the Compute_Monitor or Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Network tab.
  3. In the Network drop-down list, expand IP Network, and then click Routes.
The Routes page displays a list of routes along with information about each route such as the destination IP address prefix, the vNICset used by the route, and the administrative distance of the route.

To list routes using the CLI, use the opc compute route list command. See For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To list routes using the API, use the GET /network/v1/route/container/ method. See REST API for Oracle Cloud Infrastructure Compute Classic.

Updating a Route

After you’ve created a route, if required, you can update the route to change the destination, the next hop vNICset, or the administrative distance of the route.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Note:

You should always use your orchestrations to manage resources that you’ve created using orchestrations. Don’t, for example, use the web console or the CLI or REST API to update an object that you created using an orchestration. This could cause your orchestration to either attempt to re-create the object and associated resources, or to go into an error state. See Workflows for Updating Orchestrations v2.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Network tab.
  3. In the Network drop-down list, expand IP Network, and then click Routes.
  4. Go to the route that you want to update, and from the menu icon menu, select Update.
  5. Update the required information:
    • Administrative Distance: Enter 0, 1, or 2 to specify the administrative distance of the route. The administrative distance indicates the priority of a route. The highest priority is 0. When multiple routes to a destination exist, the route with the highest priority is used. When multiple routes with the highest priority exist, all those routes are used.
    • IP Address Prefix: Enter the IP address prefix, in CIDR format, of the destination network that you want to specify the route to. The destination IP address prefix can be either another IP network, or an external network or host.
    • Next Hop vNICset: Select the vNICset that you want to use to route packets to the specified destination. When a vNICset containing multiple vNICs is used in a route, Equal Cost Multipath (ECMP) anycast routing is implemented. Traffic routed by that route is load balanced across all the vNICs in the vNICset. Using vNICsets with multiple vNICs also ensures high availability for traffic across the specified vNICs.
    • Description: Update the description for the route, if required.
    • Tags: Update the list of tags associated with the route, if required.

  6. Click Update.
    The route is updated.

To update a route using the CLI, use the opc compute route update command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To update a route using the API, use the PUT /network/v1/route/name method. See REST API for Oracle Cloud Infrastructure Compute Classic.

Deleting a Route

If you no longer need to use a specified route to a destination, you can delete the route. If no routes to a destination are specified, the default route will be used.

Prerequisites

  • To complete this task, you must have the Compute_Operations role. If this role isn’t assigned to you or you’re not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud Infrastructure Classic Console. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Note:

You should always use your orchestrations to manage resources that you’ve created using orchestrations. Don’t, for example, use the web console or the CLI or REST API to delete an object that you created using an orchestration. This could cause your orchestration to either attempt to re-create the object and associated resources, or to go into an error state.

If you created the object using orchestration v1, then you can delete the object by terminating the orchestration. See Terminating an Orchestration v1.

If you created the object using an orchestration v2, then you can delete the object by suspending, terminating, or updating the orchestration. See Suspending an Orchestration v2, Terminating an Orchestration v2, or Updating an Orchestration v2.

  1. Sign in to the Compute Classic console. If your domain spans multiple sites, select the appropriate site. To change the site, click the Site menu near the top of the page.
  2. Click the Network tab.
  3. In the Network drop-down list, expand IP Network, and then click Routes.
  4. Identify the route that you want to delete. From the menu icon menu, select Delete.

To delete a route using the CLI, use the opc compute route delete command. For help with that command, run the command with the -h option. For the instructions to install the CLI client, see Preparing to Use the Compute Classic CLI in CLI Reference for Oracle Cloud Infrastructure Compute Classic.

To delete a route using the API, use the DELETE /network/v1/route/name method. See REST API for Oracle Cloud Infrastructure Compute Classic.