此内容没有您所选择的语言版本。

Chapter 51. port


This chapter describes the commands under the port command.

51.1. port create

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-domain dns-domain] [--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>
Copy to Clipboard Toggle word wrap

Create a new port

Expand
Table 51.1. Positional Arguments
ValueSummary

<name>

Name of this port

Expand
Table 51.2. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--network <network>

Network this port belongs to (name or id)

--description <description>

Description of this port

--device <device-id>

Port device id

--mac-address <mac-address>

MAC address of this port (admin only)

--device-owner <device-owner>

Device owner of this port. This is the entity that uses the port (for example, network:dhcp).

--vnic-type <vnic-type>

VNIC type for this port (direct

direct-physical

macvtap

normal

baremetal

virtio-forwarder, default: normal)

--host <host-id>

Allocate port on host <host-id> (id only)

--dns-domain dns-domain

Set DNS domain to this port (requires dns_domain extension for ports)

--dns-name dns-name

Set dns name to this port (requires dns integration extension)

--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)

--no-fixed-ip

No ip or subnet for this 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)

--enable

Enable port (default)

--disable

Disable port

--project <project>

Owner’s project (name or id)

--project-domain <project-domain>

Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.

--security-group <security-group>

Security group to associate with this port (name or ID) (repeat option to set multiple security groups)

--no-security-group

Associate no security groups with this port

--qos-policy <qos-policy>

Attach QoS policy to this port (name or ID)

--enable-port-security

Enable port security for this port (Default)

--disable-port-security

Disable port security for 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)

--tag <tag>

Tag to be added to the port (repeat option to set multiple tags)

--no-tag

Expand
Table 51.3. Output Formatters
ValueSummary

-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

Expand
Table 51.4. Table Formatter
ValueSummary

--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

--print-empty

Print empty table if there is no data to show.

Expand
Table 51.5. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 51.6. shell formatter
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

51.2. port delete

Usage:

openstack port delete [-h] <port> [<port> ...]
Copy to Clipboard Toggle word wrap

Delete port(s)

Expand
Table 51.7. Positional Arguments
ValueSummary

<port>

Port(s) to delete (name or id)

Expand
Table 51.8. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

51.3. port list

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>,ip-substring=<ip-substring>]
                         [--tags <tag>[,<tag>,...]]
                         [--any-tags <tag>[,<tag>,...]]
                         [--not-tags <tag>[,<tag>,...]]
                         [--not-any-tags <tag>[,<tag>,...]]
Copy to Clipboard Toggle word wrap

List ports

Expand
Table 51.9. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--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)

--router <router>

List only ports attached to this router (name or id)

--server <server>

List only ports attached to this server (name or id)

--device-id <device-id>

List only ports with the specified device ID

--mac-address <mac-address>

List only ports with this MAC address

--long

List additional fields in output

--project <project>

List ports according to their project (name or id)

--project-domain <project-domain>

Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.

--fixed-ip subnet=<subnet>,ip-address=<ip-address>,ip-substring=<ip-substring>

Desired IP and/or subnet for filtering ports (name or ID): subnet=<subnet>,ip-address=<ip-address>,ip- substring=<ip-substring> (repeat option to set multiple fixed IP addresses)

--tags <tag>[,<tag>,…​]

List ports which have all given tag(s) (Comma- separated list of tags)

--any-tags <tag>[,<tag>,…​]

List ports which have any given tag(s) (Comma- separated list of tags)

--not-tags <tag>[,<tag>,…​]

Exclude ports which have all given tag(s) (Comma- separated list of tags)

--not-any-tags <tag>[,<tag>,…​]

Exclude ports which have any given tag(s) (Comma- separated list of tags)

Expand
Table 51.10. Output Formatters
ValueSummary

-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

Expand
Table 51.11. Table Formatter
ValueSummary

--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

--print-empty

Print empty table if there is no data to show.

Expand
Table 51.12. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 51.13. CSV Formatter
ValueSummary

--quote {all,minimal,none,nonnumeric}

when to include quotes, defaults to nonnumeric

51.4. port set

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-domain dns-domain] [--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>
Copy to Clipboard Toggle word wrap

Set port properties

Expand
Table 51.14. Positional Arguments
ValueSummary

<port>

Port to modify (name or id)

Expand
Table 51.15. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--description <description>

Description of this port

--device <device-id>

Port device id

--mac-address <mac-address>

MAC address of this port (admin only)

--device-owner <device-owner>

Device owner of this port. This is the entity that uses the port (for example, network:dhcp).

--vnic-type <vnic-type>

VNIC type for this port (direct

direct-physical

macvtap

normal

baremetal

virtio-forwarder, default: normal)

--host <host-id>

Allocate port on host <host-id> (id only)

--dns-domain dns-domain

Set DNS domain to this port (requires dns_domain extension for ports)

--dns-name dns-name

Set dns name to this port (requires dns integration extension)

--enable

Enable port

--disable

Disable port

--name <name>

Set port name

--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)

--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.

--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)

--no-binding-profile

Clear existing information of binding:profile.specify both --binding-profile and --no-binding-profile to overwrite the current binding:profile information.

--qos-policy <qos-policy>

Attach QoS policy to this port (name or ID)

--security-group <security-group>

Security group to associate with this port (name or ID) (repeat option to set multiple security groups)

--no-security-group

Clear existing security groups associated with this port

--enable-port-security

Enable port security for this port

--disable-port-security

Disable port security for 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)

--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)

--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)

--tag <tag>

Tag to be added to the port (repeat option to set multiple tags)

--no-tag

Clear tags associated with the port. specify both

--tag and --no-tag to overwrite current tags

 

51.5. port show

Usage:

openstack port show [-h] [-f {json,shell,table,value,yaml}] [-c COLUMN]

                         [--max-width <integer>] [--fit-width]
                         [--print-empty] [--noindent] [--prefix PREFIX]
                         <port>
Copy to Clipboard Toggle word wrap

Display port details

Expand
Table 51.16. Positional Arguments
ValueSummary

<port>

Port to display (name or id)

Expand
Table 51.17. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

Expand
Table 51.18. Output Formatters
ValueSummary

-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

Expand
Table 51.19. Table Formatter
ValueSummary

--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

--print-empty

Print empty table if there is no data to show.

Expand
Table 51.20. JSON Formatter
ValueSummary

--noindent

Whether to disable indenting the json

Expand
Table 51.21. shell formatter
ValueSummary

--prefix PREFIX

Add a prefix to all variable names

51.6. port unset

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>
Copy to Clipboard Toggle word wrap

Unset port properties

Expand
Table 51.22. Positional Arguments
ValueSummary

<port>

Port to modify (name or id)

Expand
Table 51.23. Optional Arguments
ValueSummary

-h, --help

Show this help message and exit

--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)

--binding-profile <binding-profile-key>

Desired key which should be removed from binding:profile(repeat option to unset multiple binding:profile data)

--security-group <security-group>

Security group which should be removed this port (name or ID) (repeat option to unset multiple security groups)

--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)

--qos-policy

Remove the qos policy attached to the port

--data-plane-status

Clear existing information of data plane status

--tag <tag>

Tag to be removed from the port (repeat option to remove multiple tags)

--all-tag

Clear all tags associated with the port

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat