# radvd error - can't join ipv6-allrouters on bce0



## adri (May 11, 2017)

I am trying to setup net/radvd on FreeBSD 11.0-p10, but it always gives an error: 
	
	



```
can't join ipv6-allrouters on bce0
```
.
Running `/usr/local/sbin/radvd -d5` gives the following output:


```
May  3 15:04:58 mail radvd[7222]: ioctl(SIOCGIFFLAGS) succeeded on bce0
May  3 15:04:58 mail radvd[7222]: bce0 is up
May  3 15:04:58 mail radvd[7222]: bce0 is running
May  3 15:04:58 mail radvd[7222]: bce0 supports multicast
May  3 15:04:58 mail radvd[7222]: ioctl(SIOCGIFFLAGS) succeeded on bce0
May  3 15:04:58 mail radvd[7222]: bce0 is up
May  3 15:04:58 mail radvd[7222]: bce0 is running
May  3 15:04:58 mail radvd[7222]: bce0 supports multicast
May  3 15:04:58 mail radvd[7222]: can't join ipv6-allrouters on bce0
May  3 15:05:14 mail radvd[7222]: ioctl(SIOCGIFFLAGS) succeeded on bce0
May  3 15:05:14 mail radvd[7222]: bce0 is up
May  3 15:05:14 mail radvd[7222]: bce0 is running
May  3 15:05:14 mail radvd[7222]: bce0 supports multicast
May  3 15:05:14 mail radvd[7222]: can't join ipv6-allrouters on bce0
```

The interface bce0 is configured as:


```
bce0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=c01bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,VLAN_HWTSO,LINKSTATE>
        ether f0:4d:xx:xx:xx:xx
        inet 192.168.0.12 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::xxxx:xxxx:xxxx:xxxx%bce0 prefixlen 64 scopeid 0x1
        inet6 2001:123:4567:89a::1 prefixlen 64
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex,master>)
        status: active
```
Radvd is configured with:


```
interface bce0 {
        AdvSendAdvert on;
        AdvManagedFlag off;
        AdvOtherConfigFlag off;

        prefix 2001:123:4567:89a::1/64
        {
                AdvOnLink on;
                AdvAutonomous on;
        };

        clients
        {
                fe80::xxxx:xxx:xxxx:xxxx;
        };
};
```


The error is generated at device-bsd44.c line 142

```
if (setsockopt(sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
                        &mreq, sizeof(mreq)) < 0) {
                flog(LOG_ERR, "can't join ipv6-allrouters on %s", iface->props.n
ame);
                return (-1);
        }
```
The setsockopt call returns EINVAL!

Has anyone managed to get net/radvd version 2.16 working on FreeBSD 11.0?


----------



## SirDice (May 11, 2017)

Why don't you use rtadvd(8)?


----------



## adri (May 12, 2017)

SirDice said:


> Why don't you use rtadvd(8)?


I'd love use rtadvd, but I don't think it has an option to limit the RA's to a specific list of clients.
I want to use the 'clients' option to prevent the whole network suddenly getting IPv6 addresses though RA+SLAAC.
Do you know of other ways to do 'Router Advertisements', but control which clients are able to get an IPv6 address + gateway?


----------



## SirDice (May 12, 2017)

adri said:


> I'd love use rtadvd, but I don't think it has an option to limit the RA's to a specific list of clients.
> I want to use the 'clients' option to prevent the whole network suddenly getting IPv6 addresses though RA+SLAAC.


Ah, right. That makes sense. As far as I know rtadvd(8) does indeed not have this functionality.


----------



## zapata (Jul 4, 2017)

Does it work if you add anycast to ifconfig_bce0_ipv6 line in /etc/rc.conf? Or add  ipv6_prefix_bce0? Check man rc.conf.


----------



## adri (Jul 5, 2017)

I haven't tried these options.
I have no use for ipv6_prefix_bce0, since the interface only needs 1 ipv6 address with a prefixlen of 64.
Can you explain why adding anycast would solve the problem?
The 'ipv6-allrouters' is the multicast address of ff02::


----------



## zapata (Jul 5, 2017)

Sorry, I am not an IPv6 expert and therefore I cannot give you an explanation. :-( But when I last tried it I got the same error. Only after running 'ifconfig em1 xxxx:xxx:xxx:xxx:xx::/64 anycast alias' the error disappeared and the clients on the LAN received an IPv6 address. At the moment I cannot reproduce this but I'll later reboot my router and try again.


----------



## zapata (Jul 10, 2017)

It no longer works here. I also only get  "can't join ipv6-allrouters on". So please ignore my previous posts!


----------



## adri (Jul 10, 2017)

Hmmmmm....

I think it's time to report a bug. 
The code with gives the error message isn't standard radvd code, but part of a patch file in the port.


----------



## zapata (Jul 10, 2017)

Removing files/patch-device-bsd44.c and rebuilding radvd  => radvd starts without error and works. So this is how I got it working last time!  Have you tried?


----------



## adri (Jul 11, 2017)

You could do that and it probably works kind of.....
By not receiving FF02:: multicast, radvd doesn't get any routing changes information.
It just has the initial information, deduced at startup, to advertise.


----------



## zapata (Jul 11, 2017)

And you are sure it's not working? How can I check? I've tried tcpdump and ktrace -p $pid_of_radvd and it looks OK to me. But as mentioned earlier I am not an expert. My setup is obviously too simple.


----------



## adri (Jul 13, 2017)

I'm not saying radvd doesn't work without the patch.
I just doens't receive any information about router and network changes.
If you have a simple, static IPv6 network, there shouldn't be any router updates, so you probably won't notice any problems.


----------

