MAC address conflict since v25 #47146
Labels
area/networking
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
version/25.0
Description
I understand that, unless --mac-address is specified when calling
docker run
that a MAC address will be generated on container start with the prefix02:42:ac
and then the last 3 components being the container's ipv4 address in hex notation.Since v25.0.0 (using the official docker-ce Ubuntu package for 22.04) it seems that "docker start" retains the previous MAC address even when the IP is changed and that this can cause a MAC address conflict.
This behaviour does not occur on 24.x.
Reproduce
docker network create test-network
docker run -d --name server1 --network test-network httpd
docker stop server1
docker run -d --name server2 --network test-network httpd
docker start server1
Now if you “docker inspect” for server1 and server2 they will have the same MAC address but a different IP. Connectivity will be intermittent for both containers.
Expected behavior
Starting a container should assign a unique MAC address if no MAC address was specified when the container was created.
docker version
Client: Docker Engine - Community Version: 25.0.0 API version: 1.44 Go version: go1.21.6 Git commit: e758fe5 Built: Thu Jan 18 17:09:49 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 25.0.0 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: 615dfdf Built: Thu Jan 18 17:09:49 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.27 GitCommit: a1496014c916f9e62104b33d1bb5bd03b0858e59 runc: Version: 1.1.11 GitCommit: v1.1.11-0-g4bccb38 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: