Duplicate mac addresses among containers in docker network

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 !.

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?