moby / moby/libnetwork

MacVLAN. A network locks the gateway ip preventing to assign it

Open
#1,447 15 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

I am excited about the features you have made in 1.12, so please let me say: thank you guys 😗

Now the lettuce... ;)

First of all, this is the network I have created

docker network rm vlan150
docker network create -d macvlan \
    --subnet=10.150.0.0/24 \
    --gateway=10.150.0.254 \
    -o macvlan_mode=bridge \
    -o parent=eth0.150 vlan150

Let me say here, the 10.150.0.254 does not exists in the network.

Now let's start a container on that network:

docker run --net=vlan150 --ip 10.150.0.254\
  -it --name server --rm alpine /bin/sh
docker: Error response from daemon: Address already in use.

This is not true. That address is not in use.. So let's circumnavigate that, this way:

docker run --net=vlan150 --cap-add NET_ADMIN \
  -it --name server --rm alpine /bin/sh
/ # ifconfig eth0 10.150.0.254 netmask 255.255.255.0

Now that container has the right gateway and every container connected to the vlan150 simply uses that as default gateway and everything work.

Am I missing something basic here? I saw pipeworks but I think it is too much for this simple use case.

Best regards.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing the docker network create and docker run commands for the macvlan network, then trace how the requested gateway address is checked; done means a valid unused gateway IP can be assigned without a false address-conflict error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.