I’m working on a network application that manages IPs/ARP tables etc.
Currently my application works by opening a raw socket (http://man7.org/linux/man-pages/man7/packet.7.html) on relevant interfaces. The application handles all ingress/egress traffic on each “bound” interface.
I want to deploy my application as part of a swarm cluster. In this cluster I want to have a single network that is managed by my application. My initial though was that all I will need to do is to set the network IPAM driver to some null driver. Without a IPAM driver that will allocate IPs the network will be created, i.e the all the namespaces/veths etc will be created and connected to all the relevant the containers. Now that I have all the networks I can allocate IPs manually, manipulate the ARP table as I please etc.
Sadly I wasn’t able to achieve this goal. From what I could find in the documentation only one IPAM driver is available - the default driver, which doesn’t support the behavior that I want. More than that it seems like if docker is unable to allocate an IP for a container in a network it will refuse to connect the container to that network.
Currently I’m using pipework (https://github.com/jpetazzo/pipework) to achieve the wanted behavior. Is there a better way to do this?
Cheers,
Kfir.