Learn how to get a specific NAT Gateway port forwarding rule in Vultr.
Retrieving a specific port forwarding rule displays its complete configuration, including the external port, internal destination IP, protocol, and enabled status.
Follow this guide to get a NAT Gateway subscription port forwarding rule using the Vultr Customer Portal or API.
Navigate to Products, expand the Network drop-down and select VPC Networks.
Select your target VPC Network with NAT Gateway connectivity.
Scroll to the NAT Port Forwarding section.
Locate your target port forwarding rule in the table.
The table displays the complete rule configuration:
Send a GET request to the List VPCs endpoint to retrieve available VPCs.
$ 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.
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.
$ 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.
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.
$ 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 retrieve.
Send a GET request to the Get NAT Gateway Port Forwarding Rule endpoint. Replace VPC_ID, NAT_GATEWAY_ID, and PORT_FORWARDING_RULE_ID with your values.
$ curl "https://api.vultr.com/v2/vpcs/VPC_ID/nat-gateway/NAT_GATEWAY_ID/global/port-forwarding-rules/PORT_FORWARDING_RULE_ID" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Verify that the response contains the complete port forwarding rule configuration. The response includes the id, name, protocol, external_port, internal_ip, internal_port, enabled status, description, and timestamp fields for the specified rule.