Commissioning of IPv6 machine results in incorrect /128 subnets

Bug #1939034 reported by Stéphane Graber
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Alberto Donato

Bug Description

When commissioning a new machine through MAAS on a network that has both IPv4 and IPv6 with IPv6 provided by MAAS through stateful DHCPv6. The resulting network config has the IPv6 subnet set to a specific address/128 rather than the subnet/64. This then requires manual edit for each commissioned machine to set it to the correct subnet and then manual database cleanup to fully delete all those extra /128 subnets.

Related branches

Revision history for this message
Stéphane Graber (stgraber) wrote :
Revision history for this message
Alexsander de Souza (alexsander-souza) wrote :

Hi Stephane,

can you share the DHCP configuration with us?

Changed in maas:
status: New → Incomplete
Revision history for this message
Stéphane Graber (stgraber) wrote :

MAAS is operating the DHCPv6 server. It's just a VLAN with MAAS providing DHCPv4 and DHCPv6.
Attached a screenshot of the DHCP config page not that it shows a whole bunch.
Also grabbed the DHCPv6 config from the MAAS server.

Revision history for this message
Stéphane Graber (stgraber) wrote :
Changed in maas:
status: Incomplete → New
Revision history for this message
Bill Wear (billwear) wrote :

i can't seem to reproduce this. is this real hardware, vm? any additional info you can give me? i seem to always get /64 on bolla (which is same rev level as your screenshot).

Changed in maas:
status: New → Incomplete
Revision history for this message
Stéphane Graber (stgraber) wrote :

Affects real hardware and virtual machines.

Router is configured to advertise the subnet (/64) with the managed-config bit set which then correctly sends the machines to perform DHCPv6. MAAS' dhcp server gives them a dynamic address which then for some reason shows up as a /128.

Changed in maas:
status: Incomplete → New
Revision history for this message
Alberto Donato (ack) wrote :

Stephane, could you please provide the network config for one of the machines that are getting the /128 address?

Changed in maas:
status: New → Incomplete
Revision history for this message
Stéphane Graber (stgraber) wrote :

The bad data is added during commissioning so not as a result of a user entered network config in MAAS.

The most recent example I have is of a Raspberry Pi 4 (using a UEFI firmware on it) that has the most simple gigabit network card you can find. It's connected to a regular switch with a single VLAN which goes to a MAAS managed network.

That network uses 2602:fc62:b:1016::/64 on IPv6 and 172.17.16.0/24 on IPv4, both configured to have MAAS operated DHCP without anything fancy in the config. On the IPv6 side, the gateway provides a router advertisement to announce the default gateway and has the "managed" bit set to tell the clients to request an IPv6 address from MAAS' DHCP.

I've attached the wireshark output for a router advertisement. It looks correct to me, it announces the /64 and shows the managed flag as expected.

Also attached is a bunch of screenshots of the MAAS config.

Revision history for this message
Stéphane Graber (stgraber) wrote :
Revision history for this message
Stéphane Graber (stgraber) wrote :
Revision history for this message
Stéphane Graber (stgraber) wrote :
Revision history for this message
Stéphane Graber (stgraber) wrote :
Changed in maas:
status: Incomplete → New
Revision history for this message
Alberto Donato (ack) wrote :

Could you please attach the output for the 50-maas-01-commissioning script for that machine?

Changed in maas:
status: New → Incomplete
Revision history for this message
Stéphane Graber (stgraber) wrote :

Here you go

Changed in maas:
status: Incomplete → New
Revision history for this message
Alberto Donato (ack) wrote :

Any chance you could grab a tcpdump of dhcp traffic during commissioning?

I can't seem to reproduce the issue locally and AFAICS the dhcp6 config looks correct.
I'm not sure why the machine would get a /128 address.

Also could you add a screenshot of the VLANs tab for the MAAS controller?

Changed in maas:
status: New → Incomplete
Revision history for this message
Alberto Donato (ack) wrote :

I finally managed to reproduce the issue locally.

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → next
Revision history for this message
Alberto Donato (ack) wrote :

So, after further investigation it seems that the behavior WRT network configuration is actually correct.

MAAS is configured to act as a stateful DHCPv6, and looking at the DHCPv6 exchange, dhcpd6 is correctly offering an address from the dynamic range, which according to the RFC [1] must be applied with a /128 netmask from the host.

We could (should?) probably handle this on the MAAS side and fold those /128 addresses in the corresponding /64.
This already happens (see fix_link_addresses()) for /32 and /128 addresses when the node also reports addresses on the wider subnet, but it doesn't in this case because the machine only reports the /128 address.

[1] https://datatracker.ietf.org/doc/html/rfc8415

Alberto Donato (ack)
Changed in maas:
assignee: nobody → Alberto Donato (ack)
Alberto Donato (ack)
Changed in maas:
status: Triaged → In Progress
Changed in maas:
status: In Progress → Fix Committed
Bill Wear (billwear)
Changed in maas:
milestone: next → 3.1.0-beta1
Bill Wear (billwear)
Changed in maas:
status: Fix Committed → Fix Released
Revision history for this message
martheeswaran (marthees) wrote :

hi bill wear,
We are installing maas in ipv6 machine.
MAAS version: 3.2.6

we have provisioned ip address configured in eth0 like below:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 1c:98:ec:13:17:10 brd ff:ff:ff:ff:ff:ff
    inet6 fd17:22:1::1/64 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::1e98:ecff:fe13:1710/64 scope link
       valid_lft forever preferred_lft forever

And the subnet (fd17:22:1::1/64) is enlisted in maas console (screenshots attached), it is ipv6 we may not need dhcp but since we do pxe boot it requires a dhcp server. so we enabled dhcp server in maas and setup the ranges.

And also we create radvd.conf : (contents are attached)

When we boot the idrac by using pxe boot, it assigned /128 ip address instead of /64 ip address and that causes the boot process fail (screenshot attached)

Please find all the screenshots as zip file

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.