Container with dedicated internal IP accessible from entire network

this is a challenging problem due to the way networking works in general.

the network adapter listens for traffic on its mac address.
a container on the same network would have a different mac address. and the host adapter would not be listening for traffic on the containers mac. you can (technically, but not practically) set the host adapter to promiscuous mode (is some environments) so that the host adapter can listen for traffic on ANY (also ALL) mac addresses… in almost all production environments this is a security violation

if you don’t want DHCP support for the container, its a ‘little’ easier…

we have been dicsussing this here
%How to set up a container just like a virtual machine in bridge mode? (meaning, the container gets its own external ip)

short net

  1. create a docker network in address range u want
  2. generate a mac for the container
  3. select an ip address for the container in the range of the network (using dhcp is a problem)
  4. on docker run set the network, mac and ip address for the container

but, at some point you will need promiscuous mode on the host to make this work.

it works on my physical box with ubuntu
it does NOT work on VMWARE instances on this same host with promiscuous mode on. (used to but haven’t figured it out)
it works on my virtual ubuntu under vmware on windows
it does NOT work on my virtual mac on the same vmware on windows
it does NOT work on docker on windows.