How to specify IPv6 link-local bind address in smb.conf?

Using samba 4.1.17-Debian I have tried the following smb.conf entries to bind samba to the link-local ipv6 addresses

interfaces = fe80::d270:36a5:ac03:37ea%br0 fe80::/10 ::1
bind interfaces only = yes

but checking with netstat only shows smbd listening on ::1

The manual states that besides interface names addresses or address+mask can be specified, so I would expect either approach to work.


Updated config:

# ip addr show dev br0 | grep -c fe80 
1

# smb.conf
bind interfaces only = yes
interfaces = 192.168.0.0/16 ::1 127.0.0.1 fe80::%br0/64

# smbd --version
Version 4.5.12-Debian

# netstat -lnp | grep smb
tcp        0      0 192.168.0.3:139         0.0.0.0:*               LISTEN      17048/smbd          
tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      17048/smbd          
tcp        0      0 192.168.0.3:445         0.0.0.0:*               LISTEN      17048/smbd          
tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      17048/smbd          
tcp6       0      0 ::1:139                 :::*                    LISTEN      17048/smbd          
tcp6       0      0 ::1:445                 :::*                    LISTEN      17048/smbd  

Solution 1:

After hours of struggling, try, error and reading source code.

Everything works well but you have to specify correctly. When using IPv6 LinkLocal addresses you have to specify the interface with the "%" notation AND the prefix length in the end.

Interfaces = {Full-IPv6-address}%{interface}/{prefix length}

smb.conf (SAMPLE):

interfaces = fe80::114%eth0/64

Solution 2:

The best way to deal with IPv6 is not to use link local adresses but unique local instead.

Looks like "bind interfaces only" option makes IPv6 link local address not listened even if correctly written in smb.conf

I've tested successfully the use of IPv6 unique local address on debian linux and windows 10 to exchange files via samba from a linux server to a windows workstation.

In my configuration, the unique local address have been manualy configured in debian and windows so the SLAAC is still working to provide global IPv6 address. No need to use DHCPv6 to use this type of address.