Docker Community Forums

Share and learn in the Docker community.

Unable to assign specefic mac address to a windows container


#1

Hi all,

I’m having trouble understanding why certain MAC addresses can’t be assigned to containers. AFAIK 4b:b0:5f:a1:23:c2 is a valid mac address. However, when I try assign it to either windows or Linux containers I get errors which I’ve never had a problem with before.

I was hoping someone could shed some light on why this might be happening?

Thanks in adv.

Nick

See below:

docker run:

docker run --mac-address="4b:b0:5f:a1:23:c2" library/hello-world

outcome on windows containers:

22292414fadd4a79c3d1f7ba8433c731740d96b5dd06deacd998b79eca968f18

docker: Error response from daemon: container 22292414fadd4a79c3d1f7ba8433c731740d96b5dd06deacd998b79eca968f18 encountered an error during Start: failure in a Windows system call: The parameter is incorrect. (0x57).

oucome on linux containers:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"process_linux.go:385: running prestart hook 0 caused \\\"error running hook: exit status 1, stdout: , stderr: time=\\\\\\\"2019-01-03T11:22:21Z\\\\\\\" level=fatal msg=\\\\\\\"failed to add interface veth65a0f39 to sandbox: error setting interface \\\\\\\\\\\\\\\"veth65a0f39\\\\\\\\\\\\\\\" MAC to \\\\\\\\\\\\\\\"4b:b0:5f:a1:23:c2\\\\\\\\\\\\\\\": cannot assign requested address\\\\\\\"\\\\n\\\"\"": unknown.