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.
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.
- 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.
- Click the Network tab.
- In the Network drop-down list, expand IP Network, and then click Routes.
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.
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.
- 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.
- Click the Network tab.
- In the Network drop-down list, expand IP Network, and then click Routes.
- Identify the route that you want to delete. From the 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.