Learn how to get a specific NAT Gateway firewall rule in Vultr.
Retrieving a firewall rule displays its complete configuration, including the protocol, port range, subnet, and action type. Review rule details before modifying them or to verify security policies.
Follow this guide to get a NAT Gateway subscription firewall 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 Firewall section.
The firewall rules table displays the following information for each rule:
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 Firewall Rules endpoint to retrieve firewall 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/firewall-rules" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
The output displays all firewall rules for the gateway. Each rule includes an id, port, protocol, subnet, and notes field. Note the id field for the rule you want to retrieve.
Send a GET request to the Get NAT Gateway Firewall Rule endpoint. Replace VPC_ID, NAT_GATEWAY_ID, and FIREWALL_RULE_ID with your values.
$ curl "https://api.vultr.com/v2/vpcs/VPC_ID/nat-gateway/NAT_GATEWAY_ID/global/firewall-rules/FIREWALL_RULE_ID" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
The output displays the complete firewall rule configuration. The response includes the id, action, protocol, port, subnet, subnet_size, and notes fields for the specified rule.