docker network inspect prod-net
"7926d6c3e74c3fe11823f2497d82680b85cce93e67b3fffdf4ffd36c6bf89f5b": {
"Name": "mongo",
"EndpointID": "d6f4bc568b35d27e79e3737e2ad5384021fab6f0ed8195c17bfa5aa6d5bf0c13",
"MacAddress": "02:42:ac:13:00:08",
"IPv4Address": "172.19.0.8/16",
"IPv6Address": ""
},
"665a547e8feb7a5cfbc936281133c6d7b4665a8e7ed4c1186664f64900c36fd7": {
"Name": "analytics",
"EndpointID": "3a2a62064e6d7ec50da28e81eae197cd4e99a7c920fcb79fa579e1f7d41f390a",
"MacAddress": "02:42:ac:13:00:08",
"IPv4Address": "172.19.0.18/16",
"IPv6Address": ""
},
Container analytics
and mongo
join network prod-net and have same mac address 02:42:ac:13:00:08. Therefore, container prod-analytics cannot connect to mongo
while other containers can.
I have not been able to reproduce the exact error, but I have encountered it three times. The causes may include:
Restarting the server
Restarting Docker services"
Ubuntu 22.04, docker 25.0.0
Has anyone encountered this error yet? Please provide me with some comments !.
mskyttner
(Markus Skyttner)
June 5, 2024, 10:01am
2
Yes, I just encountered this and found this post.
In the article at https://macaddress.io/faq/how-to-recognise-a-docker-container-by-its-mac-address an algorithm for mac address generation is described.
I guess it can return duplicated MacAddresses sometimes? Perhaps it can happen occasionally when starting up several containers simultaneously. For me the consequence was that sometimes some containers could not ping each other within the docker network (SDN).
Quite annoying if this is the case, there should be some uniqueness checks for this?
wtanzer
(Wtanzer)
October 7, 2024, 8:14pm
3
I faced the same issue and opened a bug today
opened 04:55PM - 07 Oct 24 UTC
status/0-triage
kind/bug
area/networking
version/27.3
### Description
Two containers got after a docker service restart the same MAC … address. This caused a lot of network issues.
it happened only twice after the restart. Not always
Containers are in the same bridge network
### Reproduce
Restart of host or docker service
### Expected behavior
Each container should have it’s own MAC address
### docker version
```bash
Client: Docker Engine - Community
Version: 27.3.1
API version: 1.47
Go version: go1.22.7
Git commit: ce12230
Built: Fri Sep 20 11:41:11 2024
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 27.3.1
API version: 1.47 (minimum version 1.24)
Go version: go1.22.7
Git commit: 41ca978
Built: Fri Sep 20 11:41:11 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.22
GitCommit: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
runc:
Version: 1.1.14
GitCommit: v1.1.14-0-g2c9f560
docker-init:
Version: 0.19.0
GitCommit: de40ad0
```
### docker info
```bash
Client: Docker Engine - Community
Version: 27.3.1
Context: default
Debug Mode: false
Plugins:
compose: Docker Compose (Docker Inc.)
Version: v2.29.7
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 11
Running: 10
Paused: 0
Stopped: 1
Images: 11
Server Version: 27.3.1
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: journald
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
runc version: v1.1.14-0-g2c9f560
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.0-26-amd64
Operating System: Debian GNU/Linux 12 (bookworm)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 7.58GiB
Name: DietPi
ID: 9fb2b93b-d4a0-470f-bfb8-c5496e5161db
Docker Root Dir: /mnt/dietpi_userdata/docker-data
Debug Mode: false
Username: wtanzer
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
```
### Additional Info
_No response_