DigitalOcean's Cloud Firewalls sit outside the Droplet, so there's nothing to install and nothing on the server to get wrong. What I didn't know is how long a change takes to reach the traffic, whether the API tells you when it has, and what happens to connections that are already open when you take a rule away. So I measured it.
The setup
Two s-1vcpu-1gb Droplets in fra1 running Ubuntu 24.04. Droplet A ran a small TCP echo server on port 8080. Droplet B probed it two ways:
- A new TCP connection to port 8080 every 50 ms, each with a 1 second timeout, logging when it started and whether it connected.
- One long-lived connection that sent a number every 100 ms and logged each echo, so I could see what a firewall change does to a connection that's already open.
The firewall always allowed SSH in and everything out. The only thing I changed was whether port 8080 was reachable from B. I timed six kinds of change through the API, from my laptop:
- adding an allow rule for port 8080 from B, and removing it again (5 times each)
- attaching the firewall to Droplet A, and detaching it (5 times each)
- adding and removing a tag on A, with a second firewall that targeted that tag (3 times each)
Then I compared each API request with B's probe log. The two clocks were matched over SSH, which leaves about 0.3 seconds of uncertainty in every number below.
Two to five seconds, and a clean switch
Every change reached the traffic in 1.3 to 5 seconds, except one detach that took 8.2. The medians:
| Change | Median | Range | Trials |
|---|---|---|---|
| Add an allow rule | 2.0 s | 1.3–4.2 s | 5 |
| Remove the rule | 2.1 s | 1.8–5.0 s | 5 |
| Attach the firewall to the Droplet | 2.5 s | 2.0–3.5 s | 5 |
| Detach it | 2.5 s | 2.1–8.2 s | 5 |
| Add the tag the firewall targets | 3.2 s | 2.8–3.3 s | 3 |
| Remove the tag | 2.9 s | 2.8–3.1 s | 3 |
The switch was clean every time. Once the first probe saw the new state, every probe after it saw the same thing. Nothing flapped between allowed and blocked while the change spread.
Blocked traffic is dropped, not refused. Every probe that didn't connect timed out after its full second. None got a connection reset. From the outside, a closed port looks the same as a dead server.
The status doesn't tell you when it's done
A firewall has a status field that goes from waiting to succeeded. I polled it about once a second during every change.
For rule changes and attach or detach, the status turned succeeded 2.5 to 10.6 seconds after the request. By then the traffic had already changed, 1.0 to 3.1 seconds earlier. So waiting for the status is safe, just a bit slow.
For tag changes, it's no use at all. The status already read succeeded at my first check, 0.5 to 0.7 seconds after the request, and the traffic changed 2.1 to 2.7 seconds after that. Tagging a Droplet doesn't change anything on the firewall object, so there's nothing for the status to report. If a script tags a Droplet and then trusts the firewall status, it's about three seconds early.
Removing a rule doesn't close connections that are already open
This was the part I got wrong. Cloud Firewalls are stateful: a reply to a connection you allowed gets back through without a matching rule. I expected that removing the allow rule would also cut the connections it had let in. It didn't.
The long-lived connection was opened while the rule existed. Then I removed the rule five times, detached the firewall four times and reattached it three, and added and removed the tag on the second firewall three times. New connections were blocked within seconds every time. The open connection kept echoing through all of it, more than 6,000 echoes without a single gap.
If you remove a rule to lock someone out, anyone already connected stays connected. I didn't test what does cut them off.
A connection opened with no firewall gets frozen, not closed
The other direction behaved differently. The very first firewall I attached went onto a Droplet that already had the long-lived connection open, and that connection stopped getting echoes 4.5 seconds later.
To check this wasn't something about the first firewall ever attached, I did it again at the end. I detached the firewall, opened a fresh long-lived connection while A had none, and attached the firewall again. That connection went silent 3.5 seconds after the attach and came back 4.8 seconds after I detached it.
It looks like the firewall only lets through connections it saw being opened. A connection that started while no firewall was attached isn't one of them, so once a firewall is attached, its packets are dropped like any other unsolicited traffic.
Neither connection was closed. The socket stayed open, the sender kept retrying, and nothing on either end got an error. To the application, it looks like the other side stopped answering. When I added the allow rule after the first freeze, new connections got through 1.3 seconds later, but the frozen one took 9.3 seconds, because TCP had been waiting longer and longer between retries.
What I got wrong
I expected removing an allow rule to cut the connections it had let in. It doesn't, and I only noticed because the long-lived connection was there for a different reason.
I expected the firewall status to be a reliable "done" signal. For rule and attach changes it is, just late. For tag changes it means nothing.
My first run crashed halfway. You can't create a firewall that targets a tag that doesn't exist yet: the API returns 422 "tag fwt does not exist". I created the tag first and ran the tag tests on their own.
And my clock matching is rough. I measured the offset between my laptop and Droplet B over SSH with a 0.5 second round trip, so anything below about half a second in this post is noise.
Caveats
One region, two of the smallest Droplets, one port, TCP only. Five trials for each rule and attach change, three for each tag change, and one 8.2 second outlier I can't explain. I polled the firewall status about once a second, so the status times are only accurate to about a second. All of it was IPv4. The Droplets ran for about 18 minutes and cost under a cent. Cloud Firewalls themselves are free.
What I'd take from it
- Expect a firewall change to apply in two to five seconds, and test it with real traffic rather than trusting the status, especially for tag-based firewalls.
- Removing a rule stops new connections only. Connections already open stay open.
- Attaching a firewall to a Droplet with connections already open freezes them without an error. Do it before traffic starts, or expect clients to hang.
- A blocked port times out instead of refusing, so a client that's being blocked waits for its full timeout.

Top comments (1)
This is the same lesson I keep learning on the data center floor: a status saying the change is done is not the same as traffic actually moving. After any change I test with real traffic before I close the ticket, because a link can show up while nothing is really passing. The frozen-connection part hit home too — a session that stays open with no error is the hardest kind of fault to write up in a ticket.