Traefik not binding IPv6 when using network_mode: host

Why does Traefik not bind IPv6 when using network_mode: host?
I did set up two simple Docker compose test-examples to illustrate (see below).
I have other Docker Services (e.g. Syncthing) running with network_mode: host which binds to IPv6 without any issue.
Any ideas are very welcome.

IPv6 working (without network_mode: host)

compose.yml:

services:
  traefik:
    image: traefik:latest
    container_name: traefik-test
    command:
      - "--log.level=DEBUG"
      - "--entryPoints.web.address=[::]:80"
    ports:
      - "80:80"
docker compose up Output (Debug):
# docker compose up
[+] Running 1/1
 ✔ Container traefik-test  Created                                                                                                                                                                                                                     0.0s
Attaching to traefik-test
traefik-test  | 2025-11-21T14:53:27Z INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:108 > Traefik version 3.6.2 built on 2025-11-18T16:12:58Z version=3.6.2
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/cmd/traefik/traefik.go:114 > Static configuration loaded [json] staticConfiguration={"entryPoints":{"web":{"address":"[::]:80","forwardedHeaders":{},"http":{"maxHeaderBytes":1048576,"sanitizePath":true},"http2":{"maxConcurrentStreams":250,"maxDecoderHeaderTableSize":4096,"maxEncoderHeaderTableSize":4096},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}}},"global":{"checkNewVersion":true},"log":{"format":"common","level":"DEBUG"},"providers":{"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200},"tcpServersTransport":{"dialKeepAlive":"15s","dialTimeout":"30s"}}
traefik-test  | 2025-11-21T14:53:27Z INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:636 >
traefik-test  | Stats collection is disabled.
traefik-test  | Help us improve Traefik by turning this feature on :)
traefik-test  | More details on: https://doc.traefik.io/traefik/contributing/data-collection/
traefik-test  |
traefik-test  | 2025-11-21T14:53:27Z INF github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:73 > Starting provider aggregator *aggregator.ProviderAggregator
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:237 > Starting TCP Server entryPointName=web
traefik-test  | 2025-11-21T14:53:27Z INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:219 > Starting provider *traefik.Provider
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:220 > *traefik.Provider provider configuration config={}
traefik-test  | 2025-11-21T14:53:27Z INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:219 > Starting provider *acme.ChallengeTLSALPN
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:220 > *acme.ChallengeTLSALPN provider configuration config={}
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:386 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/semconv.go:40 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=SemConvServerMetrics
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/entrypoint.go:37 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=TracingEntryPoint
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/semconv.go:40 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=SemConvServerMetrics
traefik-test  | 2025-11-21T14:53:27Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/entrypoint.go:37 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=TracingEntryPoint

ss -tulpn Output:

tcp  LISTEN 0  4096  0.0.0.0:80  0.0.0.0:*  users:(("docker-proxy",pid=225868,fd=4))
tcp  LISTEN 0  4096  [::]:80     [::]:*     users:(("docker-proxy",pid=225874,fd=4))

Not working (with network_mode: host)

compose.yml:

services:
  traefik:
    image: traefik:latest
    container_name: traefik-test
    network_mode: host
    command:
      - "--log.level=DEBUG"
      - "--entryPoints.web.address=[::]:80"
docker compose up Output (Debug):
# docker compose up
[+] Running 1/1
 ✔ Container traefik-test  Created                                                                                                                                                                                                                     0.0s
Attaching to traefik-test
traefik-test  | 2025-11-21T14:51:25Z INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:108 > Traefik version 3.6.2 built on 2025-11-18T16:12:58Z version=3.6.2
traefik-test  | 2025-11-21T14:51:25Z DBG github.com/traefik/traefik/v3/cmd/traefik/traefik.go:114 > Static configuration loaded [json] staticConfiguration={"entryPoints":{"web":{"address":"[::]:80","forwardedHeaders":{},"http":{"maxHeaderBytes":1048576,"sanitizePath":true},"http2":{"maxConcurrentStreams":250,"maxDecoderHeaderTableSize":4096,"maxEncoderHeaderTableSize":4096},"transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"idleTimeout":"3m0s","readTimeout":"1m0s"}},"udp":{"timeout":"3s"}}},"global":{"checkNewVersion":true},"log":{"format":"common","level":"DEBUG"},"providers":{"providersThrottleDuration":"2s"},"serversTransport":{"maxIdleConnsPerHost":200},"tcpServersTransport":{"dialKeepAlive":"15s","dialTimeout":"30s"}}
traefik-test  | 2025-11-21T14:51:25Z INF github.com/traefik/traefik/v3/cmd/traefik/traefik.go:636 >
traefik-test  | Stats collection is disabled.
traefik-test  | Help us improve Traefik by turning this feature on :)
traefik-test  | More details on: https://doc.traefik.io/traefik/contributing/data-collection/
traefik-test  |
traefik-test  | 2025-11-21T14:51:25Z INF github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:73 > Starting provider aggregator *aggregator.ProviderAggregator
traefik-test  | 2025-11-21T14:51:25Z DBG github.com/traefik/traefik/v3/pkg/server/server_entrypoint_tcp.go:237 > Starting TCP Server entryPointName=web
traefik-test  | 2025-11-21T14:51:25Z INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:219 > Starting provider *acme.ChallengeTLSALPN
traefik-test  | 2025-11-21T14:51:25Z DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:220 > *acme.ChallengeTLSALPN provider configuration config={}
traefik-test  | 2025-11-21T14:51:25Z INF github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:219 > Starting provider *traefik.Provider
traefik-test  | 2025-11-21T14:51:25Z DBG github.com/traefik/traefik/v3/pkg/provider/aggregator/aggregator.go:220 > *traefik.Provider provider configuration config={}
traefik-test  | 2025-11-21T14:51:25Z DBG github.com/traefik/traefik/v3/pkg/server/configurationwatcher.go:227 > Configuration received config={"http":{"serversTransports":{"default":{"maxIdleConnsPerHost":200}},"services":{"noop":{}}},"tcp":{"serversTransports":{"default":{"dialKeepAlive":"15s","dialTimeout":"30s"}}},"tls":{},"udp":{}} providerName=internal
traefik-test  | 2025-11-21T14:51:26Z DBG github.com/traefik/traefik/v3/pkg/tls/tlsmanager.go:386 > No default certificate, fallback to the internal generated certificate tlsStoreName=default
traefik-test  | 2025-11-21T14:51:26Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/semconv.go:40 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=SemConvServerMetrics
traefik-test  | 2025-11-21T14:51:26Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/entrypoint.go:37 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=TracingEntryPoint
traefik-test  | 2025-11-21T14:51:26Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/semconv.go:40 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=SemConvServerMetrics
traefik-test  | 2025-11-21T14:51:26Z DBG github.com/traefik/traefik/v3/pkg/middlewares/observability/entrypoint.go:37 > Creating middleware entryPointName=web middlewareName=tracing middlewareType=TracingEntryPoint

ss -tulpn Output:

tcp  LISTEN 0  4096  *:80        *:*        users:(("traefik",pid=228836,fd=3))

Are you sure it’s not listening on IPv6? Not just a command display and interpretation issue? We had some discussions on the Docker forum.

1 Like

Thank you for your quick reply!
It seems you are right.
I just tested with curl (should have done before).

With the network_mode: host configuration I get an IPv6 connection:

# curl -v [::1]
*   Trying [::1]:80...
* Connected to ::1 (::1) port 80
> GET / HTTP/1.1
> Host: [::1]
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Fri, 21 Nov 2025 18:56:41 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host ::1 left intact

and with the other configuration I get the same result:

# curl -v [::1]
*   Trying [::1]:80...
* Connected to ::1 (::1) port 80
> GET / HTTP/1.1
> Host: [::1]
> User-Agent: curl/8.5.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Fri, 21 Nov 2025 18:58:27 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host ::1 left intact

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.