Update Network Port
/v2.0/ports/{port_id}Update attributes of an existing network port.
Only mutable fields can be changed. Fields such as id, network_id, project_id / tenant_id, and timestamps are read-only.
Request
Path Parameters
port_idstringrequiredID of the port to update.
Body Structure
Top-level JSON object must contain a single port object with one or more updatable attributes.
Updatable Parameters
portobjectrequiredWrapper object containing the fields to update. Provide only the fields you want to change.
namestringHuman‑readable name of the port.
descriptionstringHuman‑readable description (empty string by default).
admin_state_upbooleanAdministrative state: up (true) or down (false).
device_idstringID of the device (server, router, etc.) using this port.
device_ownerstringEntity type using the port (compute:nova, network:dhcp, network:router_interface, etc.).
security_groupsarrayList of security group IDs to apply. Replaces the existing list.
fixed_ipsarrayNew list of fixed IP mappings. Each entry may include subnet_id and/or ip_address. Entire list is replaced if provided. See create docs for allocation logic.
allowed_address_pairsarrayList of objects each with ip_address (required) and optional mac_address. Replaces existing list.
extra_dhcp_optsarrayList of DHCP option objects (opt_name, opt_value). Replaces existing list.
port_security_enabledbooleanEnable/disable security group & anti‑spoofing enforcement.
qos_policy_idstringQoS policy to associate (or null to clear).
binding:host_idstringHost ID where the port resides. Typically set by the system / scheduler; admin override only.
binding:profileobjectBackend‑specific VIF info dict. Use null to reset to {}. May contain device_mac_address for direct-physical binding to override the exposed mac_address.
binding:vnic_typestringDesired vNIC type (normal, macvtap, direct, baremetal, direct-physical, virtio-forwarder, smart-nic, remote-managed). Changing after initial binding may be restricted by deployment.
mac_addressstringPort MAC address. Usually immutable after creation except in specific binding scenarios (e.g. with direct-physical and device_mac_address).
dns_domainstringDNS domain to associate.
dns_namestringDNS name (hostname) to associate.
hintsobjectAdmin-only mechanism driver hints (e.g. {"openvswitch": {"other_config": {"tx-steering": "hash"}}}). Max length 4095 chars serialized.
numa_affinity_policystringNUMA affinity policy: none, required, preferred, or legacy.
propagate_uplink_statusbooleanWhether uplink status propagation is enabled.
mac_learning_enabledbooleanEnable MAC learning on the port.
port_trusted_vifbooleanTrusted VIF status. Reflected within binding:profile.
allowed_address_pairs[*].ip_addressstringrequiredIP address or CIDR.
allowed_address_pairs[*].mac_addressstringMAC address; defaults to port MAC if omitted.
Note: Omitted fields are left unchanged. For list‑type attributes (e.g.
security_groups,allowed_address_pairs,fixed_ips), supplying a list replaces the entire existing list.
Example Request
curl -ks -X PUT -H 'Content-Type: application/json' \
-H 'X-Auth-Token: gAAAAA<...>' \
-d '{
"port": {
"name": "dhcp-port",
"device_owner": "network:dhcp",
"device_id": "dhcpe52a9a47-9f6a-5406-9193-a4d7333f9889-f858b8d1-e66b-4a48-bc2e-3f16483b1b58"
}
}' \
https://<node_IP_addr>:9696/v2.0/ports/c85ae844-9ff5-4866-97da-546c3bf0144b
Response
Response Parameters
If successful the API returns a single updated port object with all current attributes.
portobjectrequiredPort object wrapper.
idstringrequiredPort ID.
namestringrequiredPort name.
network_idstringrequiredID of the attached network.
tenant_idstringrequiredProject ID (legacy field).
project_idstringrequiredOwning project ID.
mac_addressstringrequiredMAC address (may be overridden for direct-physical).
admin_state_upbooleanrequiredAdministrative state.
statusstringrequiredPort status: ACTIVE, DOWN, BUILD, or ERROR.
device_idstringrequiredID of the attached device.
device_ownerstringrequiredEntity type using the port.
fixed_ipsarrayrequiredList of {subnet_id, ip_address} for the port.
allowed_address_pairsarrayrequiredAllowed address pairs.
extra_dhcp_optsarrayrequiredExtra DHCP option objects.
security_groupsarrayrequiredSecurity group IDs.
descriptionstringrequiredDescription.
binding:vnic_typestringrequiredvNIC type.
binding:profileobjectrequiredBackend-specific VIF info ( {} if none ).
binding:host_idstringrequiredHost ID where the port resides.
binding:vif_typestringrequiredMechanism driver type or unbound / binding_failed.
binding:vif_detailsobjectrequiredAdditional info (port_filter, ovs_hybrid_plug, etc.).
port_security_enabledbooleanrequiredWhether port security is enabled.
qos_policy_idstringrequiredQoS policy applied directly (or null).
qos_network_policy_idstringrequiredQoS policy of the network (or null).
resource_requestobjectPlacement resource groups / traits requested.
tagsarrayrequiredTag list.
created_atstringrequiredCreation timestamp (ISO 8601).
updated_atstringrequiredLast update timestamp (ISO 8601) or null.
revision_numberintegerrequiredRevision number.
ip_allocationstringrequiredAllocation mode (immediate, deferred, or none).
dns_assignmentobjectrequiredInternal DNS assignment (hostname, ip_address, fqdn).
dns_domainstringrequiredDNS domain.
dns_namestringrequiredDNS name.
hintsobjectrequiredOVS Userspace Tx packet steering hints (admin-only) if present.
numa_affinity_policystringNUMA affinity policy.
propagate_uplink_statusbooleanrequiredUplink status propagation flag.
mac_learning_enabledbooleanWhether MAC learning is enabled.
port_trusted_vifbooleanrequiredTrusted VIF status.
data_plane_statusstringrequiredUnderlying data plane status if reported.
Status Codes
Success
| Code | Reason |
|---|---|
| 200 - OK | Request was successful. |
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 could not be found. |
| 409 - Conflict | Operation conflicted with another operation on this resource. |
| 412 - Precondition Failed | A request precondition (header) was not met. |
Example Response
Response body
{
"port": {
"id": "2d74fa0c-3e43-4fd9-a234-cbb4996cc684",
"name": "dhcp-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": "dhcpe52a9a47-9f6a-5406-9193-a4d7333f9889-f858b8d1-e66b-4a48-bc2e-3f16483b1b58",
"device_owner": "network:dhcp",
"fixed_ips": [
{
"subnet_id": "adffaac8-2261-43f7-9e4f-6044230f65f1",
"ip_address": "192.168.1.12"
}
],
"allowed_address_pairs": [],
"extra_dhcp_opts": [],
"security_groups": [
"e1c1aa83-7302-4493-9cf4-43c2407e8074"
],
"description": "",
"binding:vnic_type": "normal",
"port_security_enabled": true,
"qos_policy_id": null,
"qos_network_policy_id": "dfc42ced-02c8-4b1f-bbe6-14cc014f259d",
"tags": [],
"created_at": "2025-10-08T08:05:12Z",
"updated_at": "2025-10-08T08:21:32Z",
"revision_number": 3,
"project_id": "f33507157a634f1cac71e06a70fb558e"
}
}