port

port

A port is a connection point for attaching a single device, such as the NIC of a server, to a network. The port also describes the associated network configuration, such as the MAC and IP addresses to be used on that port.

Network v2

port create

Create new port

openstack port create
    --network <network>
    [--description <description>]
    [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
    [--device <device-id>]
    [--device-owner <device-owner>]
    [--vnic-type <vnic-type>]
    [--binding-profile <binding-profile>]
    [--host <host-id>]
    [--enable | --disable]
    [--mac-address <mac-address>]
    [--security-group <security-group> | --no-security-group]
    [--dns-name <dns-name>]
    [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]]
    [--qos-policy <qos-policy>]
    [--project <project> [--project-domain <project-domain>]]
    [--enable-port-security | --disable-port-security]
    [--tag <tag> | --no-tag]
    <name>
--network <network>

Network this port belongs to (name or ID)

--description <description>

Description of this port

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

--device <device-id>

Port device ID

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

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

--host <host-id>

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

--enable

Enable port (default)

--disable

Disable port

--mac-address <mac-address>

MAC address of this port

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

--dns-name <dns-name>

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

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

--qos-policy <qos-policy>

Attach QoS policy to this port (name or ID)

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

--enable-port-security

Enable port security for this port (Default)

--disable-port-security

Disable port security for this port

--tag <tag>

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

--no-tag

No tags associated with the port

<name>

Name of this port

port delete

Delete port(s)

openstack port delete
    <port> [<port> ...]
<port>

Port(s) to delete (name or ID)

port list

List ports

openstack port list
    [--device-owner <device-owner>]
    [--router <router> | --server <server>]
    [--network <network>]
    [--mac-address <mac-address>]
    [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
    [--long]
    [--project <project> [--project-domain <project-domain>]]
    [--tags <tag>[,<tag>,...]] [--any-tags <tag>[,<tag>,...]]
    [--not-tags <tag>[,<tag>,...]] [--not-any-tags <tag>[,<tag>,...]]
--device-owner <device-owner>

List only ports with the specified device owner. This is the entity that uses the port (for example, network:dhcp).

--router <router>

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

--server <server>

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

--network <network>

List only ports attached to this network (name or ID)

--mac-address <mac-address>

List only ports with this MAC address

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

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

--tags <tag>[,<tag>,...]

List ports which have all given tag(s)

--any-tags <tag>[,<tag>,...]

List ports which have any given tag(s)

--not-tags <tag>[,<tag>,...]

Exclude ports which have all given tag(s)

--not-any-tags <tag>[,<tag>,...]

Exclude ports which have any given tag(s)

port set

Set port properties

openstack port set
    [--description <description>]
    [--fixed-ip subnet=<subnet>,ip-address=<ip-address>]
    [--no-fixed-ip]
    [--device <device-id>]
    [--device-owner <device-owner>]
    [--vnic-type <vnic-type>]
    [--binding-profile <binding-profile>]
    [--no-binding-profile]
    [--host <host-id>]
    [--qos-policy <qos-policy>]
    [--enable | --disable]
    [--name <name>]
    [--mac-address <mac-address>]
    [--security-group <security-group>]
    [--no-security-group]
    [--enable-port-security | --disable-port-security]
    [--dns-name <dns-name>]
    [--allowed-address ip-address=<ip-address>[,mac-address=<mac-address>]]
    [--no-allowed-address]
    [--data-plane-status <status>]
    [--tag <tag>] [--no-tag]
    <port>
--description <description>

Description of this port

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

--device <device-id>

Port device ID

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

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

--host <host-id>

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

--qos-policy <qos-policy>

Attach QoS policy to this port (name or ID)

--enable

Enable port

--disable

Disable port

--name

Set port name

--mac-address

Set port’s MAC address (admin only)

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

--dns-name <dns-name>

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

--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 associated with this port. (Specify both –allowed-address and –no-allowed-address to overwrite the current allowed-address pairs)

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

<port>

Port to modify (name or ID)

port show

Display port details

openstack port show
    <port>
<port>

Port to display (name or ID)

port unset

Unset port properties

openstack port unset
    [--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>
--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 from 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 unset 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

<port>

Port to modify (name or ID)

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.