Create docker bridge on existing system bridge.
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 2.2k
- Forks
- 875
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
situation on the Linux box:
ip link create dev br0 type bridge
ip link set dev eth0 master br0
ip link set dev eth0 up
ip address add 10.1.1.254/24 dev br0
ip link set dev br0 up
ip route add default via 10.1.1.1
Now you tell the daemon to use br0 as the default bridge. So far so good. Now you create a container with --ip 10.1.1.249. Works as well. But when you start the container:
Error response from daemon: user specified IP address is supported on user defined networks only
Not nice.
When you create a different network with a bridge, then the bridge is created but it does NOT contain a host interface that would allow real bridging to work. Based on the information provided here: https://docs.docker.com/engine/reference/commandline/network_create/#usage there doesn't seem to be a way to add one.
If you create a different network with a bridge and name it "br0" as well, then docker starts to mess with the system's network configuration which is a no go.
What I want:
The docker daemon using the existing bridge and allowing containers to be assigned an ip address from the existing network with the help of the --ip configuration option that is available in the create context.
That would allow simple configurations with REAL bridging, WITHOUT iptables and other trickery and to run the container in the local network even with a gateway and internet access. The way bridging is intended to work and what bridges have been designed for in the first place.
I googled and searched on github and it seems the issue is as old as docker while the problem is usually solved by just closing the ticket.
I wonder...
Cu
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the daemon selects its default bridge and how the network create and container create paths handle --ip. Review the linked network-create documentation and reproduce the existing br0 setup before determining the required behavior. Done means containers can use addresses from an existing system bridge without Docker altering that bridge or requiring iptables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100