#875308 linklocal ipv6 addresses in debian-installer netcfg

Package:
debian-installer
Source:
debian-installer
Description:
Debian Installer documentation
Submitter:
Michael Gebhard
Date:
2024-07-07 19:03:04 UTC
Severity:
normal
#875308#5
Date:
2017-09-10 15:02:29 UTC
From:
To:
When entering link local ipv6 addresses with interface suffixes
as gateway during the network configuration in the debian installer,
the installer detects the address to be malformed.

Error message:
"The IP address you provided is malformed. It should be in the form
x.x.x.x where each 'x' is no larger than 255 (an IPv4 address), or a
sequence of blocks of hexadecimal digits separated by colons (an IPv6
address). Please try again."

Preseed file from attempting to use the debian installer with
its network console to reproduce the error:

d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
d-i debconf/priority select critical
d-i auto-install/enabled boolean true
d-i netcfg/choose_interface select eth0
d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_nameservers string dead:beef:aaaa:aaaa::2
d-i netcfg/get_ipaddress string dead:beef:aaaa:aaaa::1
d-i netcfg/get_netmask string ffff:ffff:ffff:ffff::
d-i netcfg/get_gateway string fe80::1%eth0
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string somehostname
d-i netcfg/get_domain string somedomain
d-i network-console/password password <password>
d-i network-console/password-again password <password>

Entering the same ip address netmask and gateway manually produces the same error.

Configuring the same from a shell in the installer with:
ip a add dead:beef:aaaa:aaaa::1 dev eth0
ip l set dev eth0 up
ip r add default via fe80::1 dev eth0
Produces a functioning network configuration.

I suggest the debian installer should be able to deal with link local ipv6 addresses.

Cheers,
Michael

#875308#10
Date:
2017-09-10 16:48:44 UTC
From:
To:
You redacted your link-local address to be dead:beef::. I suppose what
you actually mean is one with a fe80:: prefix? (I.e. it'd have been more
helpful to redact the MAC/actual address.)

Kind regards
Philipp Kern

#875308#15
Date:
2017-09-10 22:53:43 UTC
From:
To:
A server with a public ipv6 address,
A vm on this server with another public ipv6 address,
connected to the outside via a bridge on the server.
Server-side:
ip link add br0 type bridge
ip address add fe80::1 dev br0
ip link set dev br0 up
ip rourte add dead:beef:aaaa:aaaa::1/68 dev br0
VM-side:
set up with virt-manager to use bridge br0
ip a add dead:beef:aaaa:aaaa::1 dev eth0
ip l set dev eth0 up
ip r add default via fe80::1 dev eth0

So fe80::1%eth0 is the address of the bridge seen from the vm,
the redacted address is my vms public ipv6 address.

I admit, not the simplest test setup, but this has no influence
on netcfg not accepting <address>%<zone_id> type addresses

Cheers,
Michael

#875308#20
Date:
2024-07-05 19:00:48 UTC
From:
To:
Control: severity -1 important
thanks

This bug is still present in the current installer. Can we please allow
to install Debian in the most common IPv6 network setup in 2024?

Greetings
Marc

#875308#27
Date:
2024-07-05 22:09:09 UTC
From:
To:
Why would you need to do this ? AFAICS entering the plain link-local
IPv6 address without the interface suffix creates the expected default
route.

#875308#32
Date:
2024-07-06 08:53:20 UTC
From:
To:
That's a common misconception. Since link local addresses are from the
same network (fe80::/64) on all interfaces, a route pointing to a
link-local address, such as the VERY common fe80::1, is ambiguous and
therefore MUST be written like fe80::1%enp2s0 which D-I does not allow.
In theory, on systems with only one interface, this could be omitted but
it would break immediately when a second interface is added.

At the time when the default gateway is entered, we are configuring ONE
interface with its name already known, so D-I would be able to add the
interface by itself automatically, but sadly it not only does not do
this, doing so manually fails the buggy plausibility check that was
implemented.

While we're at it, on a system with more than one interface, does D-I
allow to leave the default gateway field empty?

Greetings
Marc

#875308#37
Date:
2024-07-07 08:54:39 UTC
From:
To:
Not if the interface is specified in the command adding the route. E.g.

# ip route add default fe80::1 dev enp2s0
configure only one "primary" interface, so the question seems irrelevant.

I made a few quick tests with the Debian 12.6 installer in expert mode.

With one interface, just entering fe80::1 in the gateway field produces
the expected result: "ip -6 route" shows the correct default route via
fe80::1 on the interface.

With two interfaces, "ip -6 route" show that the default route is
correctly configured as above on the selected interface. The other
interface is set down.

In both cases, the expected working /etc/network/interfaces is generated:

iface <interface> inet6 static
	address <address>/<prefixlength>
	gateway fe80::1

So I see no need to append the interface suffix to a link-local IPv6
gateway address.

The only issue I see is if you enter a DNS IPv6 link-local address: the
interface suffix is required in /etc/resolv.conf so it should be
appended there. Additionnally, either netcfg should append it in
/etc/network/interfaces dns-nameservers, or ifupdown should append it
when passing the address to resolvconf, or resolvconf should append it
when generating /etc/resolv.conf.

I did not check the configuration generated for NetworkManager nor other
supported network managers.

#875308#42
Date:
2024-07-07 18:34:57 UTC
From:
To:
Hi Pascal,

thanks for looking into this again. I can reproduce your results. I
don't know why it didn't work in the tests I did last week.

It is still what an experienced IPv6 person will intuitively do and be
confused if the input is rejected.

I think the least that could be done is to document that a link local
address can be used as the gateway without specifying the interface as
it's added automatically.

It would be however nicer to have the Installer just do the right thing
for the common way to write things.

I am downgrading this bug again. Sorry for the noise.

Greetings
Marc