Skip to content

IPv6 only: macvlan and ipvlan drivers#48299

Merged
robmry merged 8 commits intomoby:masterfrom
robmry:v6only/macvlan_ipvlan
Sep 13, 2024
Merged

IPv6 only: macvlan and ipvlan drivers#48299
robmry merged 8 commits intomoby:masterfrom
robmry:v6only/macvlan_ipvlan

Conversation

@robmry
Copy link
Copy Markdown
Contributor

@robmry robmry commented Aug 7, 2024

- What I did

Allow creation of macvlan/ipvlan networks with no IPv4 address, and with no IPv4 or IPv6 address.

- How I did it

For each driver:

  • Only check for IPv4 IPAM if IPv4 is needed.
  • If there's no IPv4 address, use a random mac address (as it's not possible to base a MAC address on an IPv6 address).
  • Stop docker_gwbridge from being created/connected if no address is assigned.
  • Add integration tests for v6-only and no address.
  • (Fix some error types for the API.)

- How to verify it

New tests.

With --experimental ...

# docker network create -d macvlan -o parent=eth0 --ipv6 -o com.docker.network.enable_ipv4=false mvnet

- Description for the changelog

- Allow creation of macvlan and ipvlan networks without IPv4 address assignment, and with no IP address assignment.

@robmry robmry added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny area/networking Networking impact/changelog area/networking/ipv6 Networking area/networking/d/ipvlan Networking area/networking/d/macvlan Networking labels Aug 7, 2024
@robmry robmry added this to the 28.0.0 milestone Aug 7, 2024
@robmry robmry requested review from akerouanton and corhere August 7, 2024 09:28
@robmry robmry self-assigned this Aug 7, 2024
Copy link
Copy Markdown
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'll wait for the other PR to be merged to add my green stamp.

Copy link
Copy Markdown
Contributor

@corhere corhere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread libnetwork/drivers/macvlan/macvlan_endpoint.go Outdated
@robmry robmry force-pushed the v6only/macvlan_ipvlan branch 2 times, most recently from 7b02ce9 to c169841 Compare August 12, 2024 15:14
@robmry robmry force-pushed the v6only/macvlan_ipvlan branch from c169841 to 18071a0 Compare August 12, 2024 15:28
@robmry
Copy link
Copy Markdown
Contributor Author

robmry commented Aug 12, 2024

Rebased (to get rid of the DNS commits), and updated the comment Cory commented on.

robmry added 6 commits August 13, 2024 11:46
An address can be assigned in the container (maybe by DHCP).
DNS lookups work once there's an address and a route, before
that, there's no source address for lookups made by the
internal resolver from the container's network namespace.

In this case, don't want to hook it up to docker_gwbridge, so
disable it in joinInfo - this currently means no DNS entry for
the container's name is set up in the internal DNS. (Even once
the interface has a user-assigned address, there won't be an
internal-DNS entry for the container until it's connected to
a with-IPAM network as well.)

Signed-off-by: Rob Murray <[email protected]>
Signed-off-by: Rob Murray <[email protected]>
An address can be assigned in the container (maybe by DHCP).
DNS lookups work once there's an address and a route, before
that, there's no source address for lookups made by the
internal resolver from the container's network namespace.

In this case, don't want to hook it up to docker_gwbridge, so
disable it in joinInfo - this currently means no DNS entry for
the container's name is set up in the internal DNS. (Even once
the interface has a user-assigned address, there won't be an
internal-DNS entry for the container until it's connected to
a with-IPAM network as well.)

Signed-off-by: Rob Murray <[email protected]>
Signed-off-by: Rob Murray <[email protected]>
@robmry robmry force-pushed the v6only/macvlan_ipvlan branch from 18071a0 to 771377f Compare August 13, 2024 10:51
@robmry robmry merged commit 7156bfa into moby:master Sep 13, 2024
@robmry robmry mentioned this pull request Nov 4, 2024
18 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking/d/ipvlan Networking area/networking/d/macvlan Networking area/networking/ipv6 Networking area/networking Networking impact/changelog kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants