8000 default route for container in multiple user defined networks · Issue #20179 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
default route for container in multiple user defined networks #20179
Closed
@thechile

Description

@thechile

At the moment if you connect a container to multiple user defined networks then the default route used will be the subnet of the last connected network. Is there any way to avoid the order which the container is added to the networks determining which default route is used ? Something like docker network connect backend rose --no-default-route

In the below example, a way to avoid adding the backend network to the container and it automatically becoming the default gw. It would be nice to have the behavior user definable.

docker network create frontend
docker network create backend
docker run -d --name rose --net=frontend busybox top
docker exec rose ip r

default via 172.20.0.1 dev eth0 
172.20.0.0/16 dev eth0  src 172.20.0.2

docker network connect backend rose
docker exec rose ip r

default via 172.21.0.1 dev eth1 
172.20.0.0/16 dev eth0  src 172.20.0.2 
172.21.0.0/16 dev eth1  src 172.21.0.2 

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/networkingkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0