openstack Verified current stable Not installed? Networking

Openstack / Create Port With Fixed Ip

Create Port With Fixed Ip

Create a port on a network with a fixed IP address in OpenStack.

$
Terminal
openstack port create --network <network_id> --fixed-ip subnet=<subnet_id>,ip-address=192.168.1.50 <port_name>

When To Use

During deployment of predetermined network settings where specific IP allocations are necessary.

Pro Tip

Verify subnet availability and IP address validity to avoid allocation conflicts.

Anatomy of Output

Understanding the result

+--------------------------------------+------+----------+-------------------+-----------+ Output Header

Shows port details including fixed IP.

| ID | Name | Network ID | Fixed IP Address | Status | Column Details

Details of the created port including designated IP.

| 34567890-abcd-ef00-3333-445566778899 | fixed-ip-port | 87654321-dcba-9876-5432-abcdef012345 | 192.168.1.50 | ACTIVE | Port Entry

Indicates a successfully created port with a fixed IP.

Troubleshooting

Common pitfalls

Subnet not found (HTTP 404)

Solution: Ensure that the specified subnet ID is correct.

IP address allocation conflict (HTTP 409)

Solution: Choose an unused IP from the specified subnet.

Invalid fixed IP (HTTP 400)

Solution: Ensure the IP address is valid and within the subnet range.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.
<network_id>
network id
The value supplied for network id.
<subnet_id>
subnet id
The value supplied for subnet id.
<port_name>
port name
The port value supplied to this command.
--network
Command Option
Tool-specific option used by this command invocation.
--fixed-ip
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative networking tools for the same job.