1

I have two Raspberry Pis (running the 2016-27-5 Raspbian) and i'm trying to set them up to use IPv6 ULA addresses for communications restricted inside my LAN.

Everything is fine but one very important detail: if i connect from one to the other, using the ULA (unique local address) and i print the source address at the destination, the "Global" one is shown. So somehow that is being selected as the source address.

I have read these two guides and tried various things to no avail:

Everything inside /etc/gai.conf is commented.
I'd consider removing the Global address completely too, if only i knew how. I mean preventing the system from getting one in the first place, removing it afterwards is not a viable solution.
Removing the eth0:1 stanza and instead directly assigning the ULA to eth0 with ifconfig eth0 inet6 add fc00::6666/64 works. Perhaps this is because the source address selection algorithm is now correctly using the smallest scope available. It seems that using an alias interface somehow screws up the source address selection algorithm. Perhaps it can be solved using route -6?

/etc/network/interfaces

<--- IPv4 ellipsized --->
auto eth0:1
iface eth0:1 inet6 static
address fc00::6666
netmask 64
autoconf 1

Current prefixes and routes:

# ip addrlabel list
prefix ::1/128 label 0 
prefix ::/96 label 3 
prefix ::ffff:0.0.0.0/96 label 4 
prefix 2001::/32 label 6 
prefix 2001:10::/28 label 7 
prefix 3ffe::/16 label 12 
prefix 2002::/16 label 2 
prefix fec0::/10 label 11 
prefix fc00::/7 label 5 
prefix ::/0 label 1 

# route -6
Kernel IPv6 routing table
Destination                    Next Hop                   Flag Met Ref Use If
::1/128                        ::                         U    256 0     0 lo
2001:760:XXXX:XXXX::/64        ::                         U    202 0     0 eth0
fc00::/64                      ::                         U    256 0     0 eth0
fe80::/64                      ::                         U    256 0     0 eth0
::/0                           fe80::210:WWWW:WWWW:WWWW   UG   202 1     8 eth0
::/0                           ::                         !n   -1  1     9 lo
::1/128                        ::                         Un   0   2     2 lo
2001:760:YYYY:YYYY:YYYY:YYYY:YYYY:YYYY/128 ::                         Un   0   1     0 lo
fc00::6666/128                 ::                         Un   0   1     0 lo
fe80::ba27:ZZZZ:ZZZZ:ZZZZ/128  ::                         Un   0   2     2 lo
ff00::/8                       ::                         U    256 1    35 eth0
::/0                           ::                         !n   -1  1     9 lo
2

Aliases were used to allow multiple addresses, prior to IPv6. Multiple addresses are a key part of IPv6, so aliases are now obsolete.

I don't know specifically why they would cause confusion here, but since you've identified that they do, the solution is not to use aliases.

You should be able to literally replace eth0:1 with eth0 in your configuration and it will work. (There's also a more manual alternative with script hooks).

https://wiki.debian.org/NetworkConfiguration#iproute2_method


Critique: obviously your addresses are missing the U part of UL.


Example of working /etc/network/interfaces:

auto lo
iface lo inet loopback

allow-hotplug eth0
iface eth0 inet static
address aaa.aaa.aaa.aaa
netmask 255.255.255.0
broadcast aaa.aaa.aaa.255
gateway aaa.aaa.aaa.254
dns-nameservers aaa.aaa.aaa.254
post-up /etc/firewallup.sh

auto eth0
iface eth0 inet6 static
address fc00::6666
netmask 64
autoconf 1
  • This is not a solution i really want: i want to fix this address in a config file to be absolutely sure i'd be getting it. Now i have to rely on a post-up script since IPv6 takes time to be useable. And i don't trust this because of god knows which timing issues may arise under different circumstances and networks. Partially systemd's fault also i'm sure. – ppparadox Jul 13 '16 at 14:41
  • 1
    Reading comprehension. Again, take your posted config file and replace eth0:1 with eth0. EDIT: comment had them the wrong way round, fixed. – sourcejedi Jul 13 '16 at 14:43
  • I can't believe it was so simple! I never thought it would have worked. What do you mean my addresses are missing the U? – ppparadox Jul 13 '16 at 14:53
  • 1
    The network prefix is fc00:0000:0000:0000::/64. The 5 bytes after fc are supposed to be chosen randomly (then you can organize the next 3 how you like). I can say with high probability that these weren't :). It's a prefix in the ULA range, but calling it a ULA is optimistic. – sourcejedi Jul 13 '16 at 15:04
  • 1
    @ppparadox I find it a good idea to get into good habits even when you don't strictly have to, just so that you don't have bad habits when it really matters. – Michael Hampton Jul 13 '16 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.