Skip to content

Commit

Permalink
Listen on 0.0.0.0 instead of 127.0.0.1 (#6755)
Browse files Browse the repository at this point in the history
Binding `127.0.0.1` means that Zebra will accept inbound connections
coming only from the loopback network interface. This is desirable as
long as Zebra runs on a native machine.

When Zebra runs inside a Docker container, incoming connections coming
from the host machine don't come from the container's loopback
interface. In order to be able to connect to Zebra from the host
machine, we can listen on `0.0.0.0` so Zebra accepts inbound connections
coming from any interface. Users then can limit inbound connection to
the loopback of their host by

```bash
docker run -p 127.0.0.1:8232:8232 zfnd/zebra:1.0.0-rc.8
```
  • Loading branch information
upbqdn authored May 24, 2023
1 parent 3706ff6 commit 5421447
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,18 @@ RUN set -ex; \
{ \
echo "[network]"; \
echo "network = '${NETWORK}'"; \
echo "listen_addr = '127.0.0.1'"; \
echo "listen_addr = '0.0.0.0'"; \
echo "[consensus]"; \
echo "checkpoint_sync = ${CHECKPOINT_SYNC}"; \
echo "[state]"; \
echo "cache_dir = '/zebrad-cache'"; \
echo "[rpc]"; \
[ -n "$RPC_PORT" ] && echo "listen_addr = '127.0.0.1:${RPC_PORT}'"; \
[ -n "$RPC_PORT" ] && echo "listen_addr = '0.0.0.0:${RPC_PORT}'"; \
echo "parallel_cpu_threads = 0"; \
echo "[metrics]"; \
echo "#endpoint_addr = '127.0.0.1:9999'"; \
echo "#endpoint_addr = '0.0.0.0:9999'"; \
echo "[tracing]"; \
echo "#endpoint_addr = '127.0.0.1:3000'"; \
echo "#endpoint_addr = '0.0.0.0:3000'"; \
} > "${ZEBRA_CONF_PATH}"


Expand Down

0 comments on commit 5421447

Please sign in to comment.