1

I have an usb ethernet adapter that I use to test network configuration, a Raspberry pi is at the other end of the cable.

I'm trying to setup ipv6 connectivity, but a link-local address is never set. On my local machine:

$ ip -br a
ip a
enxa0cec855bd4d  DOWN 
$ sudo ip -6 addr add "fc00:7500:6700::1/64" dev enxa0cec855bd4d 
$ ip a
enxa0cec855bd4d  DOWN           fc00:7500:6700::1/64 
# Power up raspberry so iface comes up
$ ip a
enxa0cec855bd4d  UP             fc00:7500:6700::1/64

There is no fe80:: address :(, let's try will the iface is up from the beginning:

$ ip -br a
ip a
enxa0cec855bd4d  UP 
$ sudo ip -6 addr add "fc00:7500:6700::1/64" dev enxa0cec855bd4d 
$ ip a
enxa0cec855bd4d  UP           fc00:7500:6700::1/64 

There is no link-local address.

My main internet iface correctly gets an ipv6 link-local and global addr, I have the following sysctl

net.ipv6.conf.enxa0cec855bd4d.accept_dad = 1
net.ipv6.conf.enxa0cec855bd4d.accept_ra = 0
net.ipv6.conf.enxa0cec855bd4d.addr_gen_mode = 1
net.ipv6.conf.enxa0cec855bd4d.autoconf = 1
net.ipv6.conf.enxa0cec855bd4d.disable_ipv6 = 0

Why this iface not getting a link-local addr?

2
  • Was there no link-local address when you initially connected the adapter? If I remember correctly, one is added when the interface is created, not every time it's brought up. Commented Apr 9, 2022 at 16:12
  • I just tried, even if the raspberry network interface is up before I plug in the usb adapter, no ipv6 (or ipv4) appears
    – izissise
    Commented Apr 9, 2022 at 18:16

2 Answers 2

2

I found that my RPI had addr_gen_mode set to 1, and I was not running network-manager, so nothing setup the address. I restored it to 0 in sysctl.conf, and it worked. This article helped me understand this: https://medium.com/opsops/how-to-restore-link-local-ipv6-address-in-linux-737666a505f3

sysctl -w net.ipv6.conf.eth0.addr_gen_mode=0
3
  • If this answers your question please accept it so the community is aware.
    – Blindspots
    Commented Jul 31, 2023 at 19:29
  • Link only answers get deleted. Please add the essential steps here. Commented Jul 31, 2023 at 20:41
  • This is probably the solution to the problem
    – izissise
    Commented Aug 3, 2023 at 13:26
-1

After multiples tries and fails, I have been able to fix this issue by issuing the two following commands:

sudo ip -6 addr flush dev enxa0cec855bd4d scope link
sudo ip -6 link set enxa0cec855bd4d up

It works even when the iface is down, a link-local address will be correctly assigned when it comes up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .