How to Update a NAT Gateway Port Forwarding Rule

Updated on 05 February, 2026

Learn how to update NAT Gateway port forwarding rules and enabled status.


Updating a port forwarding rule modifies its configuration to reflect changes in service ports, internal destination addresses, protocols, or enabled status. Adjust rules as your infrastructure evolves to maintain accurate traffic routing and security posture.

Follow this guide to update a NAT Gateway subscription port forwarding rule using the Vultr Customer Portal or API.

  • Vultr Customer Portal
  • Vultr API
  1. Navigate to Products, expand the Network drop-down and select VPC Networks.

  2. Select your target VPC Network with NAT Gateway connectivity.

  3. Scroll to the NAT Port Forwarding section.

  4. Locate your target port forwarding rule in the list.

  5. To enable or disable the rule, click the toggle switch next to the rule name.

  6. Click the Edit icon (pencil icon) for the rule you want to modify.

    The Edit Port Forwarding Rule panel opens with the current configuration:

    • Rule Name: Modify the rule name if needed.
    • Protocol: Change the protocol (TCP, UDP, or Both).
    • External Port: Update the port number on the NAT Gateway's public IP.
    • Internal IP: Change the private IP address of the target instance.
    • Internal Port: Modify the port number on the target instance.
    • Note (optional): Update the description or note.
  7. Click Save Changes.

  1. Send a GET request to the List VPCs endpoint to retrieve available VPCs.

    console
    $ curl "https://api.vultr.com/v2/vpcs" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    

    The output displays all VPCs in your account. Note the id field for the target VPC.

  2. Send a GET request to the List NAT Gateway subscriptions endpoint to retrieve the gateway ID. Replace VPC_ID with the ID from the previous step.

    console
    $ curl "https://api.vultr.com/v2/vpcs/VPC_ID/nat-gateway" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    

    The output displays NAT Gateway subscriptions for the VPC. Note the id field for the target gateway.

  3. Send a GET request to the List NAT Gateway Port Forwarding Rules endpoint to retrieve port forwarding rule IDs. Replace VPC_ID and NAT_GATEWAY_ID with your values.

    console
    $ curl "https://api.vultr.com/v2/vpcs/VPC_ID/nat-gateway/NAT_GATEWAY_ID/global/port-forwarding-rules" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    

    The output displays all port forwarding rules for the gateway. Each rule includes an id, name, external_port, internal_ip, and internal_port field. Note the id field for the rule you want to update.

  4. Send a PUT request to the Update NAT Gateway Port Forwarding Rule endpoint. Replace VPC_ID, NAT_GATEWAY_ID, and PORT_FORWARDING_RULE_ID with your values. Specify the fields you want to update in the request body, including name, protocol (tcp, udp, or both), external_port, internal_ip, internal_port, enabled status, and description.

    console
    $ curl "https://api.vultr.com/v2/vpcs/VPC_ID/nat-gateway/NAT_GATEWAY_ID/global/port-forwarding-rules/PORT_FORWARDING_RULE_ID" \
        -X PUT \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "name": "ssh-to-webserver-updated",
            "protocol": "tcp",
            "external_port": 2223,
            "internal_ip": "10.0.0.10",
            "internal_port": 22,
            "enabled": true,
            "description": "SSH access - port updated to 2223"
        }'
    

    Verify that the response contains the updated port forwarding rule configuration. The changes apply immediately and affect how traffic routes through the NAT Gateway to the internal destination.

Comments