Question

How to update firewall to allow all the traffic with php api

Hey, I am trying to update a firewall via the API, I have read the documents (https://developers.digitalocean.com/documentation/v2/#update-a-firewall) and did not find how to allow all the incoming traffic from “All IPv4” and “All IPv6” this is the data that i send (PHP array)

$data = array(
	  "name" => "firewall123",
	  "inbound_rules" => [
		[
		  "protocol" => "tcp",
		  "ports" => "444",
		  "sources" => [
			"addresses" => [
			  "18.0.0.0/8"
			]
		  ]
		],
		[
		  "protocol" => "tcp",
		  "ports" => "443",
		  "sources" => [
			"addresses" => [
			  "All IPv4",
			  "All IPv6"
			]
		  ]
		]
	  ],
	  "droplet_ids" => [
		1234567
	  ]
	);

This is the response that I received :

{ “id”: “unprocessable_entity”, “message”: “invalid address”, “request_id”: “7b93c71d-fe51-40ca-9321-3a1dbce54321” }


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @d1r2a3g4o5n6,

I see that you’ve mentioned you’ve found the solution. Having said that, I’ll recommend allowing access only from that certain IP rather than to everyone.

If you are using your laptop, allow only your IP address, or if you are using another Droplet to make the API request allow just that one. Avoid giving access to the whole world wherever possible.

nvm iv got them from the firewall page with the network tap 0.0.0.0/0 ::/0