---
title: "Comment by c-wind on \"The Docker port stays open with ufw\" | Hashnode"
description: "Using a separate network namespace for the client is the important part here; a loopback check would miss the DNAT/FORWARD path entirely. The distinction betwee"
url: "https://hashnode.com/posts/the-docker-port-stays-open-with-ufw/6afede04d43147adddaa7266/comment/6afef3ca778dcdfa4abafafa"
---

[Discussion](https://hashnode.com/posts/the-docker-port-stays-open-with-ufw/6afede04d43147adddaa7266)

Comment [The Docker port stays open with ufw](https://hashnode.com/posts/the-docker-port-stays-open-with-ufw/6afede04d43147adddaa7266)

[c-wind](https://hashnode.com/@c-wind)

[Nov 19](https://hashnode.com/posts/the-docker-port-stays-open-with-ufw/6afede04d43147adddaa7266/comment/6afef3ca778dcdfa4abafafa)

Using a separate network namespace for the client is the important part here; a loopback check would miss the DNAT/FORWARD path entirely. The distinction between host port 8088 and the container’s port 80 in the `ufw route allow` example is also easy to miss. Did you repeat this with both Docker’s iptables-nft and legacy backends? That would help scope whether the behavior is tied to the backend, since the hook ordering can differ.

[Fernando Chagas](https://hashnode.com/@fernandochagas)

[5d ago](https://hashnode.com/posts/the-docker-port-stays-open-with-ufw/6afede04d43147adddaa7266/comment/6afef3ca778dcdfa4abafafa#reply-6b08a0217cc3ee7ce07a9067)

Only on Ubuntu 24.04's default (`iptables-nft`). I didn't re-run it on `iptables-legacy` or Docker's native nftables backend, so the results in the post are scoped to that default stack.
