Docker: how to connect two bridges

To connect container2 to container1 you can also connect it to bridgeB

$ docker network connect bridgeB container1

This will allow container1 to connect to container2 by IP address, DNS names would still have to be updated manually afaik.

More information in the Docker networking guide here.


You can try making use of the veth peer so that you can connect two bridges. Make sure you are rename and names respectively with the one you configured.

ip link add veth0 type veth peer name veth1
ifconfig veth0 up
ifconfig veth1 up
brctl addif <D1-A-Bridge> veth0
brctl addif <D2-A-Bridge> veth1