I’m in the midst of a project that made to convert an existing VOIP legacy system into a dockerized form. The existing system consists of 5 different Linux machines, each machine is having 2 different network interfaces - one exposed to the public WAN, and the other is a private Lan network. I plan on creating a docker compose file for setting up the orchestration.
The network roughly looks like this:
Server #1 Eth0: IP 192.168.0.200/24 Eth1: IP X.X.X.65/27
Server #2 Eth0: IP 192.168.0.201/24 Eth1: IP X.X.X.66/27
Server #3 Eth0: IP 192.168.0.202/24 Eth1: IP X.X.X.87/27
Server #4 Eth0: IP 192.168.0.203/24 Eth1: IP Y.Y.Y.240/27
Server #5 Eth0: IP 192.168.0.204/24 Eth1: IP Y.Y.Y.241/27
Servers 1-3 are part of the same subnet, so are servers 4-5.
I am trying to find the best way to convert this network setup into docker networks, I want every container to preserve his public IP (the one on Eth1, meaning that traffic generated from the container will keep the same public IP it had on the original server), but also to be able to communicate with every other docker container on the same private net, while also keeping it easily managable and having the least overhead possible.
Would it be possible to mix between a Bridge network and connect every docker container to it, while also having a Macvlan network for each docker container which will bind to a different network interface on host level?
Can I create only 2 network interfaces for the host machine, each for a different subnet, while maintaining the different IP addresses on them (one network interface will consist of 2 IPs, the other one of 3, and each interface will have a corresponding Macvlan docker network)?
Is there a better way to make this work?