KatharaFramework / NetworkPlugin

Docker Network Plugin used by Kathará to create pure L2 networks.
https://www.kathara.org/
Apache License 2.0
17 stars 7 forks source link

Add driver option for MAC address #9

Closed nsychev closed 1 year ago

nsychev commented 1 year ago

Hi!

I tried to connect several Katharà networks to a single container. It seems that the only way to do this is to create container with one network, and then connect others. CLI command docker network connect doesn't allow custom MAC address to be set, but Engine API endpoint /networks/{id}/connect seems to accept MacAddress parameter.

Unfortunately, even if option is set via API, req.Interface.MacAddress in CreateEndpoint is empty anyway. It seems Docker Engine doesn't support this option.

Here I added a feature to set address via network driver option org.kathara.katharanp.mac. It can be used via both CLI and API:

Skazza94 commented 1 year ago

Hi @nsychev, since 2 weeks have passed since I requested the changes, I merged you PR in the develop branch and applied them by myself. So, now, the correct option name is kathara.mac_addr if you want to use it!

Cheers and thanks again for the PR, Mariano.