On 06/07/2024 at 10:53, Marc Haber wrote:
On Sat, Jul 06, 2024 at 12:09:09AM +0200, Pascal Hambourg wrote:

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.

Why would you need to do this ? AFAICS entering the plain link-local IPv6
address without the interface suffix creates the expected default route.

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

Not if the interface is specified in the command adding the route. E.g.

# ip route add default fe80::1 dev enp2s0

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

Yes, but AFAICS the Debian installer netcfg allows to select and 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.

Reply via email to