Chapter 47. port
This chapter describes the commands under the port
command.
47.1. port create
Create a new port
Usage:
openstack port create [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--fit-width] [--print-empty] [--noindent] [--prefix PREFIX] --network <network> [--description <description>] [--device <device-id>] [--mac-address <mac-address>] [--device-owner <device-owner>] [--vnic-type <vnic-type>] [--host <host-id>] [--dns-name dns-name] [--fixed-ip subnet=<subnet>,ip-address=<ip-address> | --no-fixed-ip] [--binding-profile <binding-profile>] [--enable | --disable] [--project <project>] [--project-domain <project-domain>] [--security-group <security-group> | --no-security-group] [--qos-policy <qos-policy>] [--enable-port-security | --disable-port-security] [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]] [--tag <tag> | --no-tag] <name>
Value | Summary |
---|---|
--print-empty | Print empty table if there is no data to show. |
--max-width <integer> | Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence. |
--fit-width | Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable |
Value | Summary |
---|---|
<name> | Name of this port |
Value | Summary |
---|---|
output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} | The output format, defaults to table |
-c COLUMN, --column COLUMN | Specify the column(s) to include, can be repeated |
Value | Summary |
---|---|
--noindent | Whether to disable indenting the json |
Value | Summary |
---|---|
--enable | Enable port (default) |
--no-security-group | Associate no security groups with this port |
--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>] | Add allowed-address pair associated with this port: ip-address=<ip-address>[,mac-address=<mac-address>] (repeat option to set multiple allowed-address pairs) |
--fixed-ip subnet=<subnet>,ip-address=<ip-address> | Desired ip and/or subnet for this port (name or id): subnet=<subnet>,ip-address=<ip-address> (repeat option to set multiple fixed IP addresses) |
--disable-port-security | Disable port security for this port |
--enable-port-security | Enable port security for this port (default) |
--device-owner <device-owner> | Device owner of this port. this is the entity that uses the port (for example, network:dhcp). |
--network <network> | Network this port belongs to (name or id) |
--device <device-id> | Port device id |
--vnic-type <vnic-type> | Vnic type for this port (direct |
direct-physical | macvtap |
normal | baremetal |
virtio-forwarder, default: normal) | -h, --help |
Show this help message and exit | --disable |
Disable port | --project-domain <project-domain> |
Domain the project belongs to (name or id). this can be used in case collisions between project names exist. | --mac-address <mac-address> |
Mac address of this port (admin only) | --no-tag |
No tags associated with the port | --binding-profile <binding-profile> |
Custom data to be passed as binding:profile. data may be passed as <key>=<value> or JSON. (repeat option to set multiple binding:profile data) | --security-group <security-group> |
Security group to associate with this port (name or ID) (repeat option to set multiple security groups) | --qos-policy <qos-policy> |
Attach qos policy to this port (name or id) | --project <project> |
Owner’s project (name or id) | --tag <tag> |
Tag to be added to the port (repeat option to set multiple tags) | --description <description> |
Description of this port | --no-fixed-ip |
No ip or subnet for this port. | --host <host-id> |
Allocate port on host <host-id> (id only) | --dns-name dns-name |
Value | Summary |
---|---|
a format a UNIX shell can parse (variable="value")--prefix PREFIX | Add a prefix to all variable names |
47.2. port delete
Delete port(s)
Usage:
openstack port delete [-h] <port> [<port> ...]
Value | Summary |
---|---|
<port> | Port(s) to delete (name or id) |
Value | Summary |
---|---|
-h, --help | Show this help message and exit |
47.3. port list
List ports
Usage:
openstack port list [-h] [-f {csv,json,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--fit-width] [--print-empty] [--noindent] [--quote {all,minimal,none,nonnumeric}] [--sort-column SORT_COLUMN] [--device-owner <device-owner>] [--network <network>] [--router <router> | --server <server> | --device-id <device-id>] [--mac-address <mac-address>] [--long] [--project <project>] [--project-domain <project-domain>] [--fixed-ip subnet=<subnet>,ip-address=<ip-address>] [--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]] [--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
Value | Summary |
---|---|
--print-empty | Print empty table if there is no data to show. |
--max-width <integer> | Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence. |
--fit-width | Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable |
Value | Summary |
---|---|
--quote {all,minimal,none,nonnumeric} | When to include quotes, defaults to nonnumeric |
Value | Summary |
---|---|
output formatter options-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml} | The output format, defaults to table |
-c COLUMN, --column COLUMN | Specify the column(s) to include, can be repeated |
--sort-column SORT_COLUMN | Specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated |
Value | Summary |
---|---|
--noindent | Whether to disable indenting the json |
Value | Summary |
---|---|
--project-domain <project-domain> | Domain the project belongs to (name or id). this can be used in case collisions between project names exist. |
--mac-address <mac-address> | List only ports with this mac address |
--not-any-tags <tag>[,<tag>,…] | Exclude ports which have any given tag(s) (comma- separated list of tags) |
--router <router> | List only ports attached to this router (name or id) |
--tags <tag>[,<tag>,…] | List ports which have all given tag(s) (comma- separated list of tags) |
--long | List additional fields in output |
--project <project> | List ports according to their project (name or id) |
--any-tags <tag>[,<tag>,…] | List ports which have any given tag(s) (comma- separated list of tags) |
--device-owner <device-owner> | List only ports with the specified device owner. this is the entity that uses the port (for example, network:dhcp). |
--network <network> | List only ports connected to this network (name or id) |
--fixed-ip subnet=<subnet>,ip-address=<ip-address> | Desired ip and/or subnet for filtering ports (name or ID): subnet=<subnet>,ip-address=<ip-address> (repeat option to set multiple fixed IP addresses) |
--not-tags <tag>[,<tag>,…] | Exclude ports which have all given tag(s) (comma- separated list of tags) |
-h, --help | Show this help message and exit |
--device-id <device-id> | List only ports with the specified device id |
--server <server> | List only ports attached to this server (name or id) |
47.4. port set
Set port properties
Usage:
openstack port set [-h] [--description <description>] [--device <device-id>] [--mac-address <mac-address>] [--device-owner <device-owner>] [--vnic-type <vnic-type>] [--host <host-id>] [--dns-name dns-name] [--enable | --disable] [--name <name>] [--fixed-ip subnet=<subnet>,ip-address=<ip-address>] [--no-fixed-ip] [--binding-profile <binding-profile>] [--no-binding-profile] [--qos-policy <qos-policy>] [--security-group <security-group>] [--no-security-group] [--enable-port-security | --disable-port-security] [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]] [--no-allowed-address] [--data-plane-status <status>] [--tag <tag>] [--no-tag] <port>
Value | Summary |
---|---|
<port> | Port to modify (name or id) |
Value | Summary |
---|---|
--enable | Enable port |
--no-security-group | Clear existing security groups associated with this port |
--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>] | Add allowed-address pair associated with this port: ip-address=<ip-address>[,mac-address=<mac-address>] (repeat option to set multiple allowed-address pairs) |
--fixed-ip subnet=<subnet>,ip-address=<ip-address> | Desired ip and/or subnet for this port (name or id): subnet=<subnet>,ip-address=<ip-address> (repeat option to set multiple fixed IP addresses) |
--disable-port-security | Disable port security for this port |
--enable-port-security | Enable port security for this port |
--name <name> | Set port name |
--no-binding-profile | Clear existing information of binding:profile.specify both --binding-profile and --no-binding-profile to overwrite the current binding:profile information. |
--device-owner <device-owner> | Device owner of this port. this is the entity that uses the port (for example, network:dhcp). |
--device <device-id> | Port device id |
--qos-policy <qos-policy> | Attach qos policy to this port (name or id) |
-h, --help | Show this help message and exit |
--disable | Disable port |
--data-plane-status <status> | Set data plane status of this port (active |
down). Unset it to None with the port unset command (requires data plane status extension) | --mac-address <mac-address> |
Mac address of this port (admin only) | --no-tag |
Clear tags associated with the port. specify both --tag and --no-tag to overwrite current tags | --binding-profile <binding-profile> |
Custom data to be passed as binding:profile. data may be passed as <key>=<value> or JSON. (repeat option to set multiple binding:profile data) | --security-group <security-group> |
Security group to associate with this port (name or ID) (repeat option to set multiple security groups) | --vnic-type <vnic-type> |
Vnic type for this port (direct | direct-physical |
macvtap | normal |
baremetal | virtio-forwarder, default: normal) |
--tag <tag> | Tag to be added to the port (repeat option to set multiple tags) |
--description <description> | Description of this port |
--no-fixed-ip | Clear existing information of fixed ip addresses.Specify both --fixed-ip and --no-fixed-ip to overwrite the current fixed IP addresses. |
--host <host-id> | Allocate port on host <host-id> (id only) |
--no-allowed-address | Clear existing allowed-address pairs associatedwith this port.(Specify both --allowed-address and --no- allowed-addressto overwrite the current allowed- address pairs) |
--dns-name dns-name | Set dns name to this port (requires dns integration extension) |
47.5. port show
Display port details
Usage:
openstack port show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN] [--max-width <integer>] [--fit-width] [--print-empty] [--noindent] [--prefix PREFIX] <port>
Value | Summary |
---|---|
--print-empty | Print empty table if there is no data to show. |
--max-width <integer> | Maximum display width, <1 to disable. you can also use the CLIFF_MAX_TERM_WIDTH environment variable, but the parameter takes precedence. |
--fit-width | Fit the table to the display width. implied if --max- width greater than 0. Set the environment variable CLIFF_FIT_WIDTH=1 to always enable |
Value | Summary |
---|---|
<port> | Port to display (name or id) |
Value | Summary |
---|---|
output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml} | The output format, defaults to table |
-c COLUMN, --column COLUMN | Specify the column(s) to include, can be repeated |
Value | Summary |
---|---|
--noindent | Whether to disable indenting the json |
Value | Summary |
---|---|
-h, --help | Show this help message and exit |
Value | Summary |
---|---|
a format a UNIX shell can parse (variable="value")--prefix PREFIX | Add a prefix to all variable names |
47.6. port unset
Unset port properties
Usage:
openstack port unset [-h] [--fixed-ip subnet=<subnet>,ip-address=<ip-address>] [--binding-profile <binding-profile-key>] [--security-group <security-group>] [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]] [--qos-policy] [--data-plane-status] [--tag <tag> | --all-tag] <port>
Value | Summary |
---|---|
<port> | Port to modify (name or id) |
Value | Summary |
---|---|
--all-tag | Clear all tags associated with the port |
--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>] | Desired allowed-address pair which should be removed from this port: ip-address=<ip-address> [,mac-address =<mac-address>] (repeat option to set multiple allowed-address pairs) |
--data-plane-status | Clear existing information of data plane status |
--qos-policy | Remove the qos policy attached to the port |
--security-group <security-group> | Security group which should be removed this port (name or ID) (repeat option to unset multiple security groups) |
--fixed-ip subnet=<subnet>,ip-address=<ip-address> | Desired ip and/or subnet which should be removed from this port (name or ID): subnet=<subnet>,ip-address =<ip-address> (repeat option to unset multiple fixed IP addresses) |
-h, --help | Show this help message and exit |
--binding-profile <binding-profile-key> | Desired key which should be removed from binding:profile(repeat option to unset multiple binding:profile data) |
--tag <tag> | Tag to be removed from the port (repeat option to remove multiple tags) |