Debian – How to Manually Set Link-Local Address

ip addressipv6link-local

I'm trying to use manually assigned link-local addresses to have more meaningful routing tables. I disabled auto configuration for all interfaces in /etc/sysctl.conf

net.ipv6.conf.all.autoconf=0

and configured all addresses in /etc/network/interfaces

allow-hotplug eth1
iface eth1 inet manual
iface eth1 inet6 static
    address fe80::A dev eth1
    netmask 64

iface eth1 inet6 static
    address 2002:db8::A
    netmask 64
    gateway fe80::B
    dns-server 2002:db8::C

When I ifup the interface however, not only I get second – auto generated – link-local address, there is also an error message displayed:

Waiting for DAD... Error: inet6 prefix is expected rather than "fe80::A dev eth1/64".
Error: inet6 prefix is expected rather than "fe80::A dev eth1/64".
Done

Is it possible to achieve what I want, or am I forced to stick with EUI-64?

Best Answer

First of all, disabling autoconfiguration of link-local addresses doesn't seem to be working in stretch, so the autoconfigured address needs to be removed. Below is the working /etc/network/interfaces config

allow-hotplug eth1
iface eth1 inet manual
iface eth1 inet6 static
    address fe80::a
    netmask 64

iface eth1 inet6 static
    address 2001:db8::a
    netmask 64
    gateway fe80::b
    dns-server 2001:db8::c

    post-up ip address del fe80::a:b:c:d/64 dev eth1