Create Network Port
/v2.0/portsCreate a network port on a specified network.
Default policy settings allow you to create ports only on networks that belong to your project (unless you have administrative privileges).
Request
Body Structure
Top-level JSON object must contain a single port object with the attributes below.
Parameters
portobjectrequiredA port object (container for all below attributes).
admin_state_upbooleanAdministrative state of the port: up (true) or down (false). Default: true.
allowed_address_pairsarrayZero or more objects each with ip_address (required) and optional mac_address. ip_address may be a single IP or CIDR. If mac_address omitted it defaults to the port MAC. Enables a server to send packets with those source addresses.
binding:host_idstringID of the host where the port should reside.
binding:profileobjectOpaque dict for backend-specific VIF information. Use device_mac_address when binding a direct-physical port to override MAC. Empty object {} by default.
binding:vnic_typestringDesired vNIC type. One of: normal, macvtap, direct, baremetal, direct-physical, virtio-forwarder, smart-nic, remote-managed. Default: normal.
device_idstringID of the device (e.g. server instance or router) that will use this port.
device_ownerstringEntity type using the port (e.g. compute:nova, network:dhcp, network:router_interface).
dns_domainstringValid DNS domain to associate.
dns_namestringValid DNS name (hostname) to associate.
extra_dhcp_optsarrayZero or more DHCP option objects (opt_name, opt_value).
fixed_ipsarrayAssign specific IPs. Each entry may include subnet_id and/or ip_address. Logic: supply both to request a precise address; only subnet_id to auto-allocate from that subnet; only ip_address to allocate if valid on any subnet of the network.
hintsobjectAdmin-only. Mechanism-driver keyed dict (e.g. {"openvswitch": {"other_config": {"tx-steering": "hash"}}}). Max length 4095 chars serialized.
mac_addressstringPort MAC address. Auto-generated if omitted.
namestringHuman-readable name of the port.
network_idstringrequiredID of the network to attach the port to. (Required)
numa_affinity_policystringNUMA affinity policy: none, required, preferred, or legacy.
port_security_enabledbooleanEnable (true) or disable (false) security group & anti-spoofing enforcement. Defaults to network setting.
project_idstringProject ID that will own the port (admin / advsvc only if different from own).
qos_policy_idstringQoS policy ID to apply.
security_groupsarrayList of security group IDs. If omitted defaults to the network's configured default security groups (or none).
tenant_idstringDeprecated alias of project_id.
propagate_uplink_statusbooleanWhether uplink status is propagated (true/false).
descriptionstringHuman-readable description. Default: empty string.
mac_learning_enabledbooleanEnable MAC learning on the port.
port_trusted_vifbooleanTrusted VIF status (true/false). Reflected inside binding:profile.
Example Request
curl -ks -H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"port": {
"name": "private-port",
"network_id": "f858b8d1-e66b-4a48-bc2e-3f16483b1b58",
"fixed_ips": [
{
"subnet_id": "adffaac8-2261-43f7-9e4f-6044230f65f1",
"ip_address": "192.168.1.12"
}
]
}
}' \
https://<node_IP_addr>:9696/v2.0/ports
Response
Response Parameters
If successful the API returns a single port object containing the created resource.
portobjectrequiredPort object.
admin_state_upbooleanrequiredAdministrative state (true or false).
allowed_address_pairsarrayrequiredAllowed address pairs (see request).
binding:host_idstringrequiredID of host where the port resides.
binding:profileobjectrequiredBackend-specific VIF info (empty {} if none).
binding:vif_detailsobjectrequiredAdditional details (e.g. port_filter, ovs_hybrid_plug).
binding:vif_typestringrequiredMechanism driver type (ovs, bridge, macvtap, etc.) or unbound / binding_failed.
binding:vnic_typestringrequiredvNIC type requested / in effect.
created_atstringrequiredCreation timestamp (ISO 8601).
data_plane_statusstringrequiredUnderlying data plane status (deployment-specific).
device_idstringrequiredID of the attached device (empty if none yet).
device_ownerstringrequiredOwner entity type.
dns_assignmentobjectrequiredInternal DNS assignment (hostname, ip_address, fqdn).
dns_domainstringrequiredDNS domain.
dns_namestringrequiredDNS name.
extra_dhcp_optsarrayrequiredExtra DHCP options applied.
fixed_ipsarrayrequiredAssigned IP addresses (list of {subnet_id, ip_address}).
hintsobjectrequiredOVS Userspace Tx packet steering hints if provided.
idstringrequiredPort ID.
ip_allocationstringrequiredAllocation mode (immediate, deferred, or none).
mac_addressstringrequiredMAC address (may be overridden by binding for direct-physical).
namestringrequiredPort name.
network_idstringrequiredNetwork ID.
numa_affinity_policystringNUMA affinity policy.
port_security_enabledbooleanrequiredWhether port security is enabled.
project_idstringrequiredOwning project ID.
qos_network_policy_idstringrequiredQoS policy of the network (if any).
qos_policy_idstringrequiredQoS policy applied directly to the port (if any).
revision_numberintegerrequiredRevision number.
resource_requestobjectPlacement resource groups / traits requested.
security_groupsarrayrequiredSecurity group IDs on the port.
statusstringrequiredPort status: ACTIVE, DOWN, BUILD, or ERROR.
tenant_idstringrequiredProject ID (legacy field).
updated_atstringrequiredLast update timestamp (ISO 8601) or null.
propagate_uplink_statusbooleanrequiredUplink status propagation flag.
descriptionstringrequiredDescription.
mac_learning_enabledbooleanWhether MAC learning is enabled.
port_trusted_vifbooleanrequiredTrusted VIF status.
tagsarrayrequiredTag list.
Status Codes
Success
| Code | Reason |
|---|---|
| 201 - Created | Resource was created and is ready to use. |
Error
| Code | Reason |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 401 - Unauthorized | User must authenticate before making a request. |
| 403 - Forbidden | Policy does not allow current user to do this operation. |
| 404 - Not Found | The requested resource (e.g. network) could not be found. |
Example Response
Response body
{
"port": {
"id": "2d74fa0c-3e43-4fd9-a234-cbb4996cc684",
"name": "private-port",
"network_id": "f858b8d1-e66b-4a48-bc2e-3f16483b1b58",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"mac_address": "fa:16:3e:7f:ae:b2",
"admin_state_up": true,
"status": "DOWN",
"device_id": "",
"device_owner": "",
"fixed_ips": [
{
"subnet_id": "adffaac8-2261-43f7-9e4f-6044230f65f1",
"ip_address": "192.168.1.12"
}
],
"project_id": "f33507157a634f1cac71e06a70fb558e",
"port_security_enabled": true,
"qos_policy_id": null,
"security_groups": [
"e1c1aa83-7302-4493-9cf4-43c2407e8074"
],
"binding:vnic_type": "normal",
"allowed_address_pairs": [],
"extra_dhcp_opts": [],
"description": "",
"qos_network_policy_id": "dfc42ced-02c8-4b1f-bbe6-14cc014f259d",
"tags": [],
"created_at": "2025-10-08T08:05:12Z",
"updated_at": "2025-10-08T08:05:12Z",
"revision_number": 1
}
}