Vultr Firewall groups allow you to create rules that filter incoming network traffic to an instance. Firewall rules define the network ports and services to control, filter, and secure network connections to the instance.
Follow this guide to enable a Vultr Firewall group on a Vultr Cloud Compute instance using the Vultr Customer Portal, API, or CLI.
Navigate to Products and click Compute.
Click your target Vultr Cloud Compute instance to open its management page.
Navigate to the Settings tab.
Click Firewall on the left navigation menu.
Click the Firewall drop-down to select a new firewall group.
Click Update Firewall Group to enable the firewall group on the instance.
Send a GET
request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET
request to the List Firewall Groups endpoint to list all available firewall groups.
$ curl "https://api.vultr.com/v2/firewalls" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH
request to the Update Instance endpoint to attach a firewall group to the instance.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"firewall_group_id" : "<firewall-id>",
}'
List all available firewall groups and note the target firewall group's ID.
$ vultr-cli firewall group list
List all available instances and note your target instance's ID.
$ vultr-cli instance list
Attach the firewall group to the instance.
$ vultr-cli instance update-firewall-group --instance-id <instance-id> --firewall-group-id <firewall-id>