'Assign multiple existing network interfaces to macvlan bridge inside container

I am using VMware Workstation 16 Pro to host Ubuntu 18.04 server, on this host I have multiple virtual network interfaces which each network interface connected to a host-only network. on top of this host I'm running docker-compose to host the containers of our application.

Our application uses L2 networking which gives me the option to use macvlan or ipvlan.

When trying to create the macvlans I'm getting the following error:

Failed to create network pool1: Error response from daemon: Pool overlaps with other one of this address space

Part of our application, has to assign subnet mask with a specific convention to each virtual network connection. all the virtual network interfaces are configured correctly on the host and I'm trying to connect them via macvlan to one of the containers.

Here's the networks part that fails:

version:2.4
networks:
    pool1:
        driver: macvlan
        driver_opts:
            parent: ens33
            macvlan_mode: bridge
        ipam:
            config:
            - subnet: 172.15.0.0/10
    pool2:
        driver: macvlan
        driver_opts:
            parent: ens34
            macvlan_mode: bridge
        ipam:
            config:
            - subnet: 172.16.0.0/10
    pool3:
        driver: macvlan
        driver_opts:
            parent: ens35
            macvlan_mode: bridge
        ipam:
            config:
            - subnet: 172.17.0.0/10
    pool4:
        driver: macvlan
        driver_opts:
            parent: ens36
            macvlan_mode: bridge
        ipam:
            config:
            - subnet: 172.150.150.0/24

Our virtual host network interfaces configuration:

ens33: 172.15.0.0 mask: 255.192.0.0
ens34: 172.16.0.0 mask: 255.192.0.0
ens35: 172.17.0.0 mask: 255.192.0.0
ens36: 172.150.150.0 mask: 255.255.255.0

each container has to have all the virtual network interfaces but needs to have a specific IP address as well.

How can I solve the pool overlaps problem?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source