9/23/2023 0 Comments Docker for mac docker subnet![]() ![]() This should ensure unique MAC addresses across the cluster. For example with -fixed-cidr=192.168.1.0/25, IPs for your containers will be chosen from the first half of 192.168.1.0/24 subnet. This range must be and IPv4 range for fixed IPs (ex: 10.20.0.0/16) and must be a subset of the bridge IP range ( docker0 or set using -bridge). fixed-cidr=CIDR - restrict the IP range from the docker0 subnet, using the standard CIDR notation like 172.167.1.0/28. You could evade this by setting a fixed CIDR for the docker server on each host: However two CoreOS hosts (each running one docker server) could potentially choose the same random subnet, resulting in the possibility of duplicated MACs for containers on different hosts. This does reduce entropy for UUID generation, but MAC address collision isn’t possible as IPs must be unique, and the scenario of identical MAC, PID, time and counter in two containers on the same docker server/CoreOS host should not be a possibility. The docker0 bridge’s subnet you have to operate in, usually 255.255.0.0 as per this example of 172.17.42.1/16, has 65,534 routable addresses. From my reading of generateMacAddr function ( edit: answer concerned 1.3.0-dev, but is still correct for 17.05), MAC addresses generated by docker are essentially the IPv4 address of the container’s interface on the docker0 bridge: they are guaranteed to be consistent with the IP address.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |