Create Floating IP
POST /v2.0/floatingips
Creates a floating IP.
You can obtain the required floating_network_id and subnet_id from a request to GET /v2.0/networks?provider:physical_network=Public.
The status will change to ACTIVE after a while.
info
Source: create-floating-ip
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| floatingip | body | object | A floatingip object. When you associate a floating IP address with a VM, the instance has the same public IP address each time that it boots, basically to maintain a consistent IP address for maintaining DNS assignment. |
| description (Optional) | body | string | A human-readable description for the resource. Default is an empty string. |
| dns_domain (Optional) | body | string | A valid DNS domain. |
| dns_name (Optional) | body | string | A valid DNS name. |
| tenant_id | body | string | The ID of the project. |
| project_id | body | string | The ID of the project. |
| floating_network_id | body | string | The ID of the network associated with the floating IP. |
| fixed_ip_address (Optional) | body | string | The fixed IP address that is associated with the floating IP. If an internal port has multiple associated IP addresses, the service chooses the first IP address unless you explicitly define a fixed IP address in the fixed_ip_address parameter. |
| floating_ip_address (Optional) | body | string | The floating IP address. |
| port_id (Optional) | body | string | The ID of a port associated with the floating IP. To associate the floating IP with a fixed IP at creation time, you must specify the identifier of the internal port. |
| subnet_id (Optional) | body | string | The subnet ID on which you want to create the floating IP. |
Sample Request
Using curl
curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '{
"floatingip": {
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413"
}
}' https://api.vietnix.cloud:9696/v2.0/floatingips
Using HTTP request
POST https://api.vietnix.cloud:9696/v2.0/floatingips
Content-Type: application/json
X-Auth-Token: gAAAAA<...>
{
"floatingip": {
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413"
}
}
Response
Response Parameters
| Name | In | Type | Description |
|---|---|---|---|
| floatingip | body | object | A floatingip object. When you associate a floating IP address with a VM, the instance has the same public IP address each time that it boots, basically to maintain a consistent IP address for maintaining DNS assignment. |
| id | body | string | The ID of the floating IP address. |
| router_id | body | string | The ID of the router for the floating IP. |
| status | body | string | The status of the floating IP. Values are ACTIVE, DOWN and ERROR. |
| description | body | string | A human-readable description for the resource. |
| dns_domain | body | string | A valid DNS domain. |
| dns_name | body | string | A valid DNS name. |
| port_details | body | string | The information of the port that this floating IP associates with. In particular, if the floating IP is associated with a port, this field contains some attributes of the associated port, including name, network_id, mac_address, admin_state_up, status, device_id and device_owner. If the floating IP is not associated with a port, this field is null. |
| tenant_id | body | string | The ID of the project. |
| created_at | body | string | The date and time when the resource was created. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm. For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00. |
| updated_at | body | string | The date and time when the resource was updated. If the resource has not been updated, this field will be null. The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm. For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In this example, the offset value is -05:00. |
| revision_number | body | integer | The revision number of the resource. |
| project_id | body | string | The ID of the project. |
| floating_network_id | body | string | The ID of the network associated with the floating IP. |
| fixed_ip_address | body | string | The fixed IP address that is associated with the floating IP address. |
| floating_ip_address | body | string | The floating IP address. |
| port_id | body | string | The ID of a port associated with the floating IP. |
| tags | body | array | The list of tags on the resource. |
| port_forwardings | body | array | The associated port forwarding resources for the floating IP. If the floating IP has multiple port forwarding resources, this field has multiple entries. Each entry consists of network IP protocol (protocol), the fixed IP address of internal neutron port (internal_ip_address), the TCP or UDP port used by internal neutron port (internal_port) and the TCP or UDP port used by floating IP (external_port). |
Sample Response
{
"floatingip": {
"id": "4f2038c2-bd8d-4c78-b65d-7d19eb96e3b1",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"floating_ip_address": "45.115.16.162",
"floating_network_id": "79cab11a-122d-43a7-9427-3575d9512413",
"router_id": null,
"port_id": null,
"fixed_ip_address": null,
"status": "DOWN",
"project_id": "f33507157a634f1cac71e06a70fb558e",
"description": "",
"qos_policy_id": null,
"port_details": null,
"tags": [],
"created_at": "2025-09-25T02:02:29Z",
"updated_at": "2025-09-25T02:02:29Z",
"revision_number": 0
}
}
Status Codes
Success
| Status Code | Description |
|---|---|
| 201 - Created | Resource was created and is ready to use. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 404 - Not Found | The requested resource could not be found. |
| 409 - Conflict | This operation conflicted with another operation on this resource. |
Error Details
- 400 - Bad Request may occur if:
- The network is not external (router:external is false).
- The internal networking port is not associated with the floating IP address.
- The requested floating IP address does not fall in the subnet range for the external network.
- The fixed IP address is not valid.
- 404 - Not Found occurs if the
port_idis not valid. - 409 - Conflict may occur if:
- The requested floating IP address is already in use.
- The internal networking port and fixed IP address are already associated with another floating IP.