Max number of IPs for each firewall rule

In the DO firewall documentation I read that firewalls are limited to 50 rules.

However, how many IPs (or IP ranges) I can insert in a firewall rule?

For example, if I want to block a list of hundreds/thousands of IPs (blacklist), can I do that?

Probably you should also clarify that in the official docs if a limit exists.

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 Marco. Thanks for the question. I’ve consulted with one of the engineers on our Cloud Firewalls team:

  • Unfortunately, you can’t really do an IP blocklist at all, because the firewall product blocks everything by default, and requires you to specify allow rules only. There is no syntax for a negative set (“allow anything NOT in this list of IPs”).
  • There is a size limit for firewall rules, but it’s not easy to specify the limit as an exact number of IPs, as it is affected by the particulars of your setup. With a very simple rule set, this engineer found the limit was around 20k IPs.
  • A large rule set like this can negatively impact your network performance, even if it does avoid the size limit.