16 IP Address Prefix Set

This section describes the Compute Classic CLI commands you can use to add, delete, update, and view IP address prefix sets.

An IP address prefix set lists IPv4 addresses in the CIDR address prefix format.

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-prefix-set add

Adds an IP address prefix set to Compute Classic.

An IP address prefix set lists IPv4 addresses in the CIDR address prefix format. After creating an IP address prefix set, you can specify it as a source or destination for permitted traffic while creating a security rule. See security-rule add.

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-prefix-set add name [--ip-address-prefixes CIDR-IPv4-prefixes-list] [--description description] [--tags tags]

Example

opc -f json compute ip-address-prefix-set add /Compute-acme/jack.jones@example.com/ipaddressprefixset1 --ip-address-prefixes '192.168.0.0/16' 

Sample Output

Some lines have been truncated with ellipses (...) for readability. When you run the command in your environment, you'll see the full output.

{
 "ipAddressPrefixes": ["192.168.0.0/16"],
 "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipaddressprefixset/Compute-acme/jack.jones@example.com/ipaddressprefixset1",
 "description": null,
 "tags": [],
 "name": "/Compute-acme/jack.jones@example.com/ipaddressprefixset1"
}

ip-address-prefix-set get

Retrieves details of the specified IP address prefix set.

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-prefix-set get name

Example

opc -f json compute ip-address-prefix-set get /Compute-acme/jack.jones@example.com/ipaddressprefixset1

Sample Output

{
 "ipAddressPrefixes": ["192.168.0.0/16"],
 "uri": "https://api-z999.compute.us0.oraclecloud.com/network/v1/ipaddressprefixset//Compute-acme/jack.jones@example.com/ipaddressprefixset1",
 "description": null,
 "tags": [],
 "name": "/Compute-acme/jack.jones@example.com/ipaddressprefixset1"
}

ip-address-prefix-set update

Updates the description, tags, and IP address prefixes in an IP address prefix set.

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-prefix-set update name [--ip-address-prefixes CIDR-IPv4-prefixes-list] [--description description] [--tags tags]

Example

The following example shows how to update an IP address prefix set, /Compute-acme/jack.jones@example.com/ipaddressprefixset1 by adding another IP address prefix to the existing IP address prefix set.

opc -f json compute ip-address-prefix-set update /Compute-acme/jack.jones@example.com/ipaddressprefixset1 --description 'Updating an IP address prefix set'

Sample Output

Some lines have been truncated with ellipses (...) for readability. When you run the command in your environment, you'll see the full output.

{
  "name": "/Compute-acme/jack.jones@example.com/ipaddressprefixset1",
  "uri": "https://api-z999.compute.us0.oraclecloud.com:443/network/v1/ipaddressprefixset/Compute-acme/jack.jones@example.com/ipaddressprefixset1",
  "description": "Updating an IP address prefix set",
  "tags": [],
  "ipAddressPrefixes": [
    "192.168.0.0/16",
    "172.120.0.0/24"
  ]
}

ip-address-prefix-set delete

Deletes the specified IP address prefix set. 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-prefix-set delete name

Example

opc compute ip-address-prefix-set delete /Compute-acme/jack.jones@example.com/ipaddressprefixset2

ip-address-prefix-set list

Retrieves details of all the IP address prefix sets that are available in the specified container.

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-prefix-set list container

Example

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

Sample Output

Some lines have been truncated with ellipses (...) for readability. When you run the command in your environment, you'll see the full output.

{
  "result": [
    {
      "name": "/Compute-acme/jack.jones@example.com/ipaddressprefixset2",
      "uri": "https://api-z999.compute.us0.oraclecloud.com:443/network/v1/ipaddressprefixset/Compute-acme/jack.jones@example.com/ipaddressprefixset2",
      "description": "Sample IP address prefix set",
      "tags": [
        
      ],
      "ipAddressPrefixes": [
        "178.120.0.0/24"
      ]
    },
    {
      "name": "/Compute-acme/jack.jones@example.com/ipaddressprefixset1",
      "uri": "https://api-z999.compute.us0.oraclecloud.com:443/network/v1/ipaddressprefixset/Compute-acme/jack.jones@example.com/ipaddressprefixset1",
      "description": "updating an IP address prefix set",
      "tags": [
        
      ],
      "ipAddressPrefixes": [
        "192.168.0.0/16",
        "172.120.0.0/24"
      ]
    }
  ]
}