# Docker UFW container access on private interface

**URL:** <https://forums.docker.com/t/docker-ufw-container-access-on-private-interface/80476>\
**Category:** General\
**Created:** [August 29, 2019, 2:57pm UTC](https://forums.docker.com/t/docker-ufw-container-access-on-private-interface/80476 "2019-08-29T14:57:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![olikdsfjgsod](https://avatars.discourse-cdn.com/v4/letter/o/8e8cbc/32.png) [@olikdsfjgsod](https://forums.docker.com/u/olikdsfjgsod)\
**Post date:** [August 29, 2019, 2:57pm UTC](https://forums.docker.com/t/docker-ufw-container-access-on-private-interface/80476/1 "2019-08-29T14:57:13Z")

</div>

I’m running `Docker` and I control my firewall using `ufw`.

What I want to achieve is to permit inbound access to my container, but to not permit the container to have outbound access to either the Internet or any other container.

I start my `Docker` daemon with `"iptables": false`.

I have `ufw` configured with `DEFAULT_FORWARD_POLICY="ACCEPT"` and `Anywhere ALLOW IN 192.168.1.0/24` with the intention of allowing access from my local subnet.

I start a container to test `docker run -d -p 1234:80 nginx:alpine`, however if I try to access `nginx` on port 1234, the connection times out for both `127.0.0.1:1234` and the local IP address of `192.168.1.10:1234`. I can however access nginx via the `docker0` interface of `172.17.0.2:80`.

Can someone help me with what `iptables` (I assume) command I need to run to permit access to the container on both `127.0.0.1` and the private interface `192.168.1.10` over port 1234?
