Skip to content

[BUG] gw_priority is ignored on ipv4 network if service also joins an ipv6 network without priority #13511

@stavros-k

Description

@stavros-k

Description

Not sure if this is "as intended", if so, it might worth documenting it.

As mentioned in comments like:
docker/roadmap#658 (comment)

Steps To Reproduce

networks:
  lan_access:
    name: lan_access
    driver: macvlan
    enable_ipv6: false
    enable_ipv4: true
    driver_opts:
      parent: eth0
    ipam:
      driver: default
      config:
        - subnet: 192.168.10.0/24
          gateway: 192.168.10.1

  databases:
    name: databases
    driver: bridge
    enable_ipv6: true
    enable_ipv4: true

services:
  postgres:
    image: postgres:18.1@sha256:bfe50b2b0ddd9b55eadedd066fe24c7c6fe06626185b73358c480ea37868024d
    networks:
      databases: {}
  home-assistant:
    image: ghcr.io/home-operations/home-assistant:2025.12.5@sha256:6be0843b06ad82233639e56f261b2377f78df140e3d16d2d08b2c29c8889b697
    networks:
      databases: {}
      lan_access:
        ipv4_address: 192.168.10.18
        gw_priority: 1000 

databases will be the default gw.
Forcing databases to disable ipv6 it will make lan_access the default gw.

Compose Version


Docker Environment

Client: Docker Engine - Community
 Version:    28.3.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.25.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.38.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 29
  Running: 29
  Paused: 0
  Stopped: 0
 Images: 32
 Server Version: 28.3.1
 Storage Driver: overlay2
  Backing Filesystem: zfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2 nvidia
 Default Runtime: nvidia
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.12.33-production+truenas
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 62.63GiB
 Name: truenas
 ID: af416a29-e97e-48c4-a294-35253e26efb6
 Docker Root Dir: /mnt/.ix-apps/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Default Address Pools:
   Base: 172.16.0.0/12, Size: 24

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions