15 IP Address Association Used in IP Network

This section describes the Compute Classic CLI commands you can use to add, delete, update, and view IP address associations that are used in IP Networks.

IP Address Association is the association between an IP address reservation and a virtual NIC of an instance. Among all the IP address associations on a single virtual NIC, all the reachable IP address prefixes must be non-overlapping (excluding the 'default' prefix), and at most one IP address pool may have the 'default' reachable IP address prefix.

Before running the CLI commands described in this section, make sure that you've installed the CLI client and set up the required environment variables as described in Preparing to Use the CLI.

ip-address-association add

Creates an IP address association for IP networks in Compute Classic.

Required Role

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.

Syntax

opc compute ip-address-association add name [--description description] [--tags tags] [--ip-address-reservation ip-address-reservation] [--vnic vnic]

Example

opc -f json compute ip-address-association add /Compute-acme/jack.jones@example.com/ipassociation1 --vnic /Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth0 --ip-address-reservation /Compute-acme/jack.jones@example.com/ipreservation1

Sample Output

{
  "name": "/Compute-acme/jack.jones@example.com/ipassociation1",
  "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipassociation/Compute-acme/jack.jones@example.com/ipassociation1",
  "description": null,
  "tags": [],
  "vnic": "/Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth0",
  "ipAddressReservation": "/Compute-acme/jack.jones@example.com/ipreservation1"
}

ip-address-association list

Retrieves details of the IP address associations that are available in the specified container. This command is for IP address associations used in IP networks..

Required Role

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.

Syntax

opc compute ip-address-association list container

Example

opc -f json compute ip-address-association list /Compute-acme/jack.jones@example.com

Sample Output

{
"result":[
{
  "name": "/Compute-acme/jack.jones@example.com/ipassociation1",
  "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipassociation/Compute-acme/jack.jones@example.com/ipassociation1",
  "description": null,
  "tags": [],
  "vnic": "/Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth0",
  "ipAddressReservation": "/Compute-acme/jack.jones@example.com/ipreservation1"
}
]
}

ip-address-association get

Retrieves details of the specified IP address association.

You can use the get command to verify whether add and update operations were completed successfully.

Required Role

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.

Syntax

opc compute ip-address-association get name

Example

opc -f json compute ip-address-association get /Compute-acme/jack.jones@example.com/ipreservation1

Sample Output

{
  "name": "/Compute-acme/jack.jones@example.com/ipassociation1",
  "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipassociation/Compute-acme/jack.jones@example.com/ipassociation1",
  "description": null,
  "tags": [],
  "vnic": "/Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth0",
  "ipAddressReservation": "/Compute-acme/jack.jones@example.com/ipreservation1"
}

ip-address-association update

You can update the description, tags, virtual NIC, and IP address reservation of an IP association used in IP networks.

Required Role

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.

Syntax

opc compute ip-address-association update name [--description description] [--tags tags] [--ip-address-reservation ip-address-reservation] [--vnic vnic]

Example

The following example shows how you can update the description, virtual NIC, and IP address reservation of an IP association used in IP networks.

opc -f json compute ip-address-association update /Compute-acme/jack.jones@example.com/ipassociation1 --description 'Updated description for IP association' --ip-address-reservation /Compute-acme/jack.jones@example.com/ipreservation2 --vnic /Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth1

Sample Output

{
  "name": "/Compute-acme/jack.jones@example.com/ipassociation1",
  "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipassociation/Compute-acme/jack.jones@example.com/ipassociation1",
  "description": "Updated description for IP association",
  "tags": [],
  "vnic": "/Compute-acme/jack.jones@example.com/2e6627de-6842-49bc-9c28-21da524c297d/eth1",
  "ipAddressReservation": "/Compute-acme/jack.jones@example.com/ipreservation2"
}

ip-address-association delete

Deletes the specified IP address association. No response is returned.

Required Role

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.

Syntax

opc compute ip-address-association delete name

Example

opc compute ip-address-association delete /Compute-acme/jack.jones@example.com/ipassociation1