Skip to content

Ports CLI reference

See https://docs.openstack.org/ocata/cli-reference/neutron.html.

These commands allow you to manage ports in your cloud environment, including creating, listing, showing details of, updating, and deleting ports. The <port_id_or_name>, <network_id_or_name>, and <security_group_id_or_name> in the commands are placeholders that should be replaced with the actual IDs or names of the ports, networks, and security groups.

List ports

Bash
openstack port list

Show port details

Bash
openstack port show <port_id_or_name>

Create a port

Bash
openstack port create --network <network_id_or_name> <port_name>
  • Additional options can be specified, such as --fixed-ip ip-address=<ip_address> to assign a specific IP address.

Update a port

Bash
openstack port set --fixed-ip ip-address=<new_ip_address> <port_id_or_name>
  • Other options can be used to update security groups, device owner, or other port attributes.

Delete a port

Bash
openstack port delete <port_id_or_name>

Add a security group to a port

Bash
openstack port set --security-group <security_group_id_or_name> <port_id_or_name>

Remove a security group from a port

Bash
openstack port unset --security-group <security_group_id_or_name> <port_id_or_name>

Bind a port to a host

Bash
openstack port set --host <host_id> <port_id_or_name>
  • This is used to bind the port to a specific host, typically in advanced networking scenarios.