The CalDAV bridge on my host answered every request I made to it locally, and answered none of the requests that came from a container. Same port, same process, same uptime. From a shell on the box it was instant; from anything inside Docker it hung until it timed out. I spent the first part of that evening convinced I had a CalDAV problem, then an application problem, and only later worked my way back to the actual fault: Docker’s FORWARD chain policy was dropping the packets before they ever reached a socket. I’ve written up the surrounding context in my self-hosting security notes, but this particular failure deserves its own walk-through, because everything about it points you at the wrong layer.
The setup: a service only containers needed
The bridge existed for one reason. A CalDAV client needed to talk to a calendar backend, and the translation layer between them was small enough that I wrote it as a plain service and ran it under systemd. Host process, host port, host supervision. That is the default shape for anything on a Linux box, and I reached for it without thinking, because that is what you do when you have a daemon and a unit file and a machine that boots.
The consumers, though, were containers. The things that actually wanted to read and write calendar data were running inside Docker, on a bridge network, with their own filesystem and their own view of the world. On the host side I had a tidy little service listening on a port. On the container side I had a client that kept failing to connect.
That asymmetry — host service, container consumer — is the whole bug. Not the code, not the config of the bridge itself, not the client. The shape of the deployment. I had put a service on one side of a boundary and its only callers on the other side, and then assumed the boundary was transparent.
What broke, and what it looked like
The symptom was unhelpfully generic. The container’s client reported a connection that never completed. Not refused, not rejected, not denied — no answer at all, which is the worst of the three, because “no answer” is what you also get from a wrong port, a wrong address, a dead process, a saturated backlog, or a firewall. Every one of those produces the same user-visible outcome, and each one lives in a different layer.
So I walked the layers in the wrong order. First I checked the bridge: was it running, was it healthy, was it logging? Yes, yes, and yes — and the logs were the problem. They showed all my host-side test requests and nothing else. No malformed requests from the container, no auth failures, no partial handshakes. A clean log with a client that claims it cannot connect. That combination is easy to read as “the client is broken,” and I read it that way for a while.
Then I checked the obvious: is the container even pointed at the right place? It was. Is DNS resolving the name it uses to reach the host? It was. Can the container reach anything at all — does it have working egress, can it resolve and connect to something on the internet? It could. So the container’s networking stack was fundamentally alive, and the failure was specific to one destination: the host.
That narrowing is what finally made the problem legible. The container was not broken. The path from the container to the host was broken, and it was broken in a way that produced silence rather than an error.
The tell: the service never saw the connection
Here is the diagnostic move I should have made first, and now do make first: when a client times out and the server logs show no connection attempt whatsoever, stop debugging the server. If the server had received a SYN and then choked, you would see something — a half-open connection, a backlog warning, a protocol error when the client gave up. An empty log means the packet died before the socket. There is no application-level explanation for that. It is a routing or filtering problem, full stop.
I had been reading the empty log as evidence that the client never tried. It was evidence that the client tried and the attempt was discarded below the application, by something with no obligation to tell me it had done so. A drop rule is silent by design. That is the point of a drop: it does not advertise the existence of a filter, which is exactly what you want against a scanner and exactly what you do not want against yourself at 11pm.
Why binding to 0.0.0.0 didn’t save it
The first thing I actually changed was the bind address. The bridge had been listening on loopback, which is fine for host-local calls and useless for anything arriving over the network, so I moved it to 0.0.0.0 — all interfaces, every address the host owns. That is the standard fix for “my service is unreachable from elsewhere,” and it did nothing at all. The container still timed out.
That non-result is worth understanding, because it separates two things people routinely conflate. A bind address decides which local addresses a socket is willing to accept connections on. It does not create a path to that socket. By the time the kernel is consulting the listening socket, the packet has already survived routing and filtering. Binding to 0.0.0.0 widens the set of addresses the socket will answer on; it does not widen the set of packets allowed to reach the machine’s network stack in the first place. I had made the socket maximally permissive and left the pipeline in front of it exactly as it was.
The fact that 0.0.0.0 changed nothing was actually useful information, retroactively. It meant the listener was never the constraint. I had already proved, without noticing, that the failure was upstream of the application.
The actual culprit: FORWARD, not INPUT
Docker does not filter traffic the way a normal host firewall does. When it sets up a bridge network it installs its own rules, and it sets the FORWARD chain policy to DROP. That policy is not a mistake — it is how Docker keeps container networks separated from each other and from the host by default, and it is why a container cannot spontaneously reach arbitrary things. Docker then adds accept rules for the traffic it wants to permit: outbound from containers, and inbound to published ports. Everything else falls through to the policy and is dropped.
The gap is container-to-host. Traffic leaving a container aimed at the host’s own address on the Docker gateway does not simply appear as a local delivery. With the bridge netfilter hooks in play, bridged frames get walked through the filtering path, and the container-to-host-gateway flow is evaluated against that FORWARD chain. There is no Docker-generated accept rule covering “container wants to talk to a service the host is running,” because from Docker’s perspective that is not a published port and not container egress to the outside world. So the packets reach the policy, the policy is DROP, and they vanish. No reject, no ICMP, no counter anyone is watching. The client sees a timeout and the service sees nothing, which is exactly the signature I had been staring at.
This is also why the usual firewall check lied to me. On the host, the firewall configuration looked reasonable — nothing obviously hostile to the container subnet. But a host firewall’s default rules govern INPUT and OUTPUT. Container traffic to the host gateway is not a plain INPUT story once bridging is involved; it is a forwarding story. I was auditing the wrong chain and concluding the firewall was innocent, while the firewall’s forwarding policy was the entire problem.
Two fixes, and why only one of them was right
Once the diagnosis landed, there were two honest options. The notes I made at the time reduce to: run the service as a container on the same Docker network, or add a FORWARD accept rule so the packets are permitted. Both work. They are not equivalent.
Option A: punch a hole in FORWARD
Adding an accept rule for the container subnet and the relevant port is the minimal-diff fix. It leaves the architecture alone. The service keeps its systemd unit, its host port, its host lifecycle. You add one rule and the timeouts stop.
What you also get is a permanent, load-bearing exception in the host’s packet filter that exists to serve one client, is easy to forget, and is invisible in every application config. It does not say why it is there. The next person to look at that host — including me, in a few months, with no memory of this evening — sees a forwarding exception and has to reconstruct the reason. And the exception is not scoped to the one consumer that needed it: any container on that network can now reach that host service. I had widened the trust relationship between my container plane and my host plane in order to fix a single client’s connectivity. That is a real cost, paid in a currency I do not like spending.
Option B: make it a container on the same network
The other fix removes the boundary instead of negotiating with it. Put the bridge in a container, attach it to the same Docker network as the thing that consumes it, and let it be addressed by service name. No host port, no forwarding exception, no traffic crossing from the container plane into the host plane at all — the packets stay inside the bridge network, where Docker’s own rules already permit container-to-container traffic.
This is the option I took, and it was not a close call. Three reasons, in the order they mattered to me.
First, the service was only ever consumed by containers. A host systemd unit is the right shape for something the host needs. This was not that. Every caller lived in Docker; the only reason the service lived on the host was that I had written it before I thought about where it belonged. Moving it into the network put it next to its consumers, which is where a dependency belongs.
Second, the fix and the cure were the same action. Option A would have left me with a working service and a standing exception that I would need to remember forever. Option B left me with a working service and one fewer thing to remember. The failure mode of Option A is silent, delayed, and arrives the day someone tightens the firewall; the failure mode of Option B is that the container does not start, which I find out immediately.
Third, it shrank the host’s attack surface rather than growing it. The bridge no longer listens on a host port. Nothing outside the Docker network can reach it, and the host does not have an extra listener to reason about. That is the direction I want every change to move in, and Option A moved the other way.
What changed after the move
The consumer’s config now names a service instead of an address, and the address is resolved inside the network. The bridge has no published port, so there is nothing on the host for a scanner to find and nothing for me to accidentally expose when I next audit. The dependency is visible in the compose topology: if you read the stack, you can see that the consumer needs the bridge, because they are on the same network and one names the other. That is documentation that cannot drift, which is more than I can say for a comment next to a firewall rule.
And the class of failure is gone, not just the instance. The failure was “container cannot reach a host service,” and after the move there is no host service to reach. I did not fix the timeout; I deleted the condition that produced it. When I later hit a different service with the same symptom, the diagnosis took minutes instead of an evening, because I already knew the shape of the answer: the consumer is in a container, so the service should be too, or the forwarding path needs an explicit, documented exception.
What I’d do differently, and a checklist
The mistake was not missing a firewall rule. The mistake was choosing a deployment shape by default instead of by consumer. If the only thing that talks to a service is a container, the service is part of the container stack, and putting it on the host creates a boundary you will then have to fight.
- Before writing a systemd unit, ask who the consumer is. Host consumers want host services. Container consumers want container services.
- When a connection times out and the target’s logs show no attempt at all, treat it as a dropped packet, not a broken client.
- Auditing
INPUTis not auditing Docker. Published ports and container-to-host flows are aFORWARDstory, and Docker’s default policy there isDROP. - Changing a bind address to
0.0.0.0proves nothing about reachability. If it changes nothing, the listener was never the constraint. - Prefer the fix that removes the boundary over the fix that negotiates with it. A firewall exception is a promise you have to keep; a shared network is a fact.
- Keep the exception option in your pocket for services that genuinely must stay on the host — anything touching hardware, or a datastore you are not ready to containerize. Choosing it deliberately, with a note explaining why, is fine. Choosing it because it was the first thing that worked is how you accumulate rules nobody can justify.
The general rule
Docker’s networking defaults are opinionated and mostly good, and the FORWARD DROP policy is one of the better defaults: it is why a compromised container cannot trivially wander into your host or into its neighbours. The cost is that the host itself is not a special case. Your own service on your own machine is just another destination that has to be permitted, and if it is not, you get silence rather than a refusal, because that is what a drop does.
So the useful mental model is not “the container is broken” or “the firewall is blocking me.” It is “there is a boundary here, and I have to decide which side the service belongs on.” Once I framed it that way, the CalDAV bridge stopped being a networking mystery and became an obvious misplacement — a service sitting on the wrong side of a line I had drawn without noticing I was drawing it.
Related
- Docker Compose .env Changes Need Container Recreation
- fail2ban Bans That Quietly Do Nothing on Docker Ports
- The Miner in ps Wasn’t Ollama, It Was a Container
- Fixing ECONNRESET on a Self-Hosted HTTP Bridge
- Don’t Panic Over Docker’s Exec Artifacts
Guides & explainers
Filed under: Home Lab, Docker, Home Lab, Self-Hosting