[Samba] Specifying an IPv6 wildcard in the interfaces directive?

Jeff Morris jeffm966 at nullmodem.org
Sat Apr 20 19:12:08 UTC 2019


My network uses reserved IPv4 addresses (192.168.2.0/24) behind a NAT 
firewall, but public IPv6 addresses behind a filtering firewall.

My ISP (Comcast) assigns both IPv4 and IPv6 addresses dynamically.

As a result, the IPv4 address of my internal Samba server is statically 
assigned, but its IPv6 address is dynamically assigned.

The server has multiple IPv4 addresses assigned to it, all on interface 
enp3s0. One of these I'd like to use for Samba, but the other is used as 
a proxy address for another device on my network, so I do NOT want Samba 
to bind to it , as it would conflict with SMB services on the proxied 
device.

How would I go about configuring Samba so it will bind to ALL IPv6 
addresses on the server, but only ONE IPv4 address?

I currently have the following lines in smb.conf:

bind interfaces only = yes
interfaces = lo 192.168.2.3 ::/0

I was hoping that by specifying ::/0 (all IPv6 addresses) it would do 
what I want, but this doesn't seem to work; netstat shows that Samba is 
only binding to IPv6 on the loopback interface:

# netstat -plnt | grep mbd
tcp        0      0 127.0.0.1:139           0.0.0.0:* LISTEN      18876/smbd
tcp        0      0 192.168.2.3:139         0.0.0.0:* LISTEN      18876/smbd
tcp        0      0 127.0.0.1:445           0.0.0.0:* LISTEN      18876/smbd
tcp        0      0 192.168.2.3:445         0.0.0.0:* LISTEN      18876/smbd
tcp6       0      0 ::1:139                 :::* LISTEN      18876/smbd
tcp6       0      0 ::1:445                 :::* LISTEN      18876/smbd

If I remove the "interfaces" directive from the config, then samba binds 
to whatever IPv6 address is assigned to the interface, but also binds to 
both IPv4 addresses.

I've tried several other variations of "interfaces" that also don't do 
what I need:

(1) Binds to all IPv6 and all IPv4 addresses on enp3s0:
interfaces = lo enp3s0 192.168.2.3

(2) Likewise, binds to all IPv6 and all IPv4 addresses on enp3s0:
interfaces = lo enp3s0

(3) Doesn't bind to any IPv6 address on enp3s0:
interfaces = lo 192.168.2.3

Is there a way to get Samba to do this?

Thanks!




More information about the samba mailing list