Skip to content

Could docker network configure the IPAM with already configured bridge addressing ? #20349

@thomas-maurice

Description

@thomas-maurice

Hello !

TL;DR:
When I create a docker network with a bridge that is already configured, Docker overrides the addressing I've set up. Could it be possible that when I create a docker network with an already configured bridge, if I do not supply any additionnal parameters, it configures the IPAM with the in place bridge configuration ?

More details

What I have :

root@machine # ip address show br0
27: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 0c:c4:7a:07:6a:7f brd ff:ff:ff:ff:ff:ff
    inet 172.18.4.1/24 brd 172.18.4.255 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::ec4:7aff:fe07:6a7f/64 scope link 
       valid_lft forever preferred_lft forever

Then I create my network

root@machine # docker network create --driver bridge -o com.docker.network.bridge.name=br0 mynetwork
c228be0db663a5add797899688d9feb8c2699fc4b0a309edd0476a88526e576b
root@machine # docker network inspect c228be0db663a5add797899688d9feb8c2699fc4b0a309edd0476a88526e576b
[
    {
        "Name": "mynetwork",
        "Id": "c228be0db663a5add797899688d9feb8c2699fc4b0a309edd0476a88526e576b",
        "Scope": "local",
        "Driver": "bridge",
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.19.0.0/16",
                    "Gateway": "172.19.0.1/16"
                }
            ]
        },
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.name": "br0"
        }
    }
]
root@machine # ip address show br0
27: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 0c:c4:7a:07:6a:7f brd ff:ff:ff:ff:ff:ff
    inet 172.19.0.1/16 scope global br0
       valid_lft forever preferred_lft forever
    inet6 fe80::ec4:7aff:fe07:6a7f/64 scope link 
       valid_lft forever preferred_lft forever

The bridge addressing went from 172.18.4.0/24 to 172.19.0.0/16. Could it be relevant to use already in place configuration ?

Also, side remark, could the bridge not be deleted if it has not been created with Docker networks ?

Thanks a lot !

Metadata

Metadata

Assignees

Labels

area/networkingNetworkingkind/featureFunctionality or other elements that the project doesn't currently have. Features are new and shiny

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions