Infoblox Docker IPAM Driver
The ipam-driver is a Docker libnetwork IPAM driver that interfaces with Infoblox to provide centralized IP Address Management services. libnetwork is the library provided by Docker that allows third-party plugins for container networking
NOTE: Docker 1.12 introduced Swarm Mode but with a limitation where legacy IPAM plugins were not supported. As a result this ipam-driver cannot be used in that configuration, although the driver still works in a traditional Docker Swarm. Infoblox is working to enable it’s ipam plugin to support Swarm Mode.
For detailed installation and configuration instructions, see https://github.com/infobloxopen/docker-infoblox
After successfully pulling the image, you use the
docker run command to run the driver. For exampe:
docker run -e DOCKER_API_VERSION=1.22 -v /var/run:/var/run -v /run/docker:/run/docker infoblox/ipam-driver --grid-host=192.168.124.200 --wapi-username=cloudadmin --wapi-password=cloudadmin --local-view=local_view --local-network-container="192.168.0.0/20,184.108.40.206/22" --local-prefix-length=25 --global-view=global_view --global-network-container="172.18.0.0/16" --global-prefix-length=24
Note that the -v options are necessary to provide the container access to the specified directories on the
host file system.
To start using the dirver, a docker network needs to be created specifying the driver using the --ipam-driver option:
sudo docker network create --ipam-driver=infoblox priv-net
This creates a docker network called "priv-net" which uses "infoblox" as the IPAM driver and the default "bridge" driver as the network driver. A network will be automatically allocated from the list of network containers specified during driver start up.
By default, the network will be created using the default prefix length specified during driver start up. You can override this using the --ipam-opt option. For example:
sudo docker network create --ipam-driver=infoblox --ipam-opt="prefix-length=24" priv-net-2
Additionally, if you are deploying containers in a cluster, you can specify "network-name" using the --ipam-opt option. This will be used as an identifier so that docker networks created on different docker hosts can share the same IP address space. For example:
sudo docker network create --ipam-driver=infoblox --ipam-opt="network-name=blue" blue-net
This will allocate a network, say, 192.168.10.0/24, from the default address pool. Additionally, the network will be tagged in Infoblox with the network name "blue". Should the same command be issued on a different host, the driver will look for a network on Infoblox tagged with the same name, "blue", and will share the same network, 192.168.10.0/24, instead of allocating a new one.
After the network is created, Docker containers can be started attaching to the "priv-net" network created above. For example, the following command run the "ubuntu" image:
sudo docker run -i -t --net=priv-net --name=ubuntu1 ubuntu
When the container comes up, verify using the "ifconfig" command that IP has been successfully provisioned from Infoblox.