第 47 章 port


本章论述了 port 命令下的命令。

47.1. 端口创建

创建新端口

使用方法:

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

Expand
表 47.1. 表格式
概述

--print-empty

如果没有要显示数据,则打印空表。

--max-width <integer>

最大显示宽度 <1 来禁用。您还可以使用 CLIFF_MAX_TERM_WIDTH 环境变量,但参数具有优先权。

--fit-width

适合显示宽度的表。如果 --max-width 大于 0,则意味着。将环境变量 CLIFF_FIT_WIDTH=1 设置为 always 启用

Expand
表 47.2. 位置参数
概述

<name>

此端口的名称

Expand
表 47.3. 输出格式器
概述

output formatter options-f {json,shell,table,value,yaml}, --format {json,shell,table,value,yaml}

输出格式,默认为 table

-c COLUMN, --column COLUMN

指定要包含的列,可以重复

Expand
表 47.4. JSON Formatter
概述

--noindent

是否禁用缩进 json

Expand
表 47.5. 可选参数
概述

--enable

启用端口(默认)

--no-security-group

没有安全组与这个端口关联

--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]

添加与这个端口关联的 allowed-address 对: ip-address=<ip-address>[,mac-address=<mac-address>](用于设置多个 allowed-address 对)

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

此端口所需的 ip 和/或子网(名称或 id):subnet=<subnet>,ip-address=<ip-address> (用于设置多个固定 IP 地址)

--disable-port-security

禁用此端口的端口安全性

--enable-port-security

为此端口启用端口安全性(默认)

--device-owner <device-owner>

这个端口的设备所有者。这是使用端口的实体(如 network:dhcp)。

--network <network>

此端口所属网络(名称或 id)

--device <device-id>

端口设备 ID

--vnic-type <vnic-type>

该端口的 vNIC 类型(直接)

direct-physical

macvtap

normal

baremetal

virtio-forwarder,默认:常规)

-h, --help

显示帮助信息并退出

--disable

禁用端口

--project-domain <project-domain>

项目所属的域(名称或 id)。这可在项目名称之间有冲突时使用。

--mac-address <mac-address>

此端口的 MAC 地址(仅管理员)

--no-tag

没有与端口关联的标签

--binding-profile <binding-profile>

要传递的自定义数据:profile. 数据可能会作为 <key>=<value> 或 JSON 传递。(重复选项可设置多个绑定:profile 数据)

--security-group <security-group>

与这个端口关联的安全组(名称或 ID)(重复选项来设置多个安全组)

--qos-policy <qos-policy>

将 qos 策略附加到此端口(名称或 id)

--project <project>

所有者的项目(名称或 id)

--tag <tag>

要添加到端口的标签(重复选项来设置多个标签)

--description <description>

这个端口的描述

--no-fixed-ip

没有这个端口的 ip 或 subnet。

--host <host-id>

在主机 <host-id> 分配端口(仅限id)

--dns-name dns-name

Expand
表 47.6. shell Formatter
概述

格式化 UNIX shell 可以解析(variable="value")--prefix PREFIX

为所有变量名称添加前缀

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat