"xx-xx is not a valid port. The port number must be between 0 and 65535" error when creating a NAT rule in VMware Cloud Director 10.2.x, 10.3.x and 10.4 versions
search cancel

"xx-xx is not a valid port. The port number must be between 0 and 65535" error when creating a NAT rule in VMware Cloud Director 10.2.x, 10.3.x and 10.4 versions

book

Article ID: 325653

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Symptoms:
  • Creating a NAT rule in VMware Cloud Director 10.2.x,10.3.x and 10.4 versions fails with:
xx-xx is not a valid port. The port number must be between 0 and 65535
  • Unable to configure the range of an external port in an NSX-T backed Cloud Director environment.


Environment

VMware Cloud Director 10.x

Cause

This is a UI defect affecting VMware Cloud Director 10.2.x,10.3.x and 10.4 versions.

Resolution

This is a known issue affecting VMware Cloud Director 10.2.x,10.3.x and 10.4 versions.
This issue will be resolved in a later release of Cloud Director.

For a workaround, please use the workaround specified in the Workaround section.


Workaround:
  1. Identify the gateway ID to be updated.This can be retrieved from the URL, in the Provider Portal > Resources > Cloud Resources Edge Gateways > Click on the Edge Gateway > On the URL of the UI,look for urn:vcloud:gateway:XXXXXX
  2. Open the Swagger UI from the Provider Portal > click the question mark icon at the top right hand side of the screen > API Explorer or follow https://developer.vmware.com/docs/14139/getting-started-with-vmware-cloud-director-openapi.
  3. Identify the ID of the NAT rule to be updated. Execute the API request GET /1.0.0/edgeGateways/{gatewayId}/nat/rules to get the list of all the NAT rules on the edge. Note the "id" value and the details of the rule to be updated from the output.
  4. Execute the request PUT /1.0.0/edgeGateways/{gatewayId}/nat/rules/{ruleId}.
  5. Edit the body as required. In the "dnatExternalPort" field of the body, the port ranges can be specified. Example: 

    {
        "name": "test-nat-D",
        "description": null,
        "enabled": true,
        "type": "DNAT",
        "externalAddresses": "xxx.xxx.x.xxx",
        "internalAddresses": "xxx.xx.xxx.xx",
        "logging": false,
        "priority": 0,
        "firewallMatch": "MATCH_INTERNAL_ADDRESS",
        "applicationPortProfile": null,
        "dnatExternalPort": "xx-xx",
        "id": "xxxxx"
    }

  6. Add the gatewayId identified in Step 1 and ruleId identified in Step 3 into the text box. Click Execute.
  7. UI should be updated accordingly.