[Samba] shares availability defferented by interface

Zhuchenko Valery zvn at belkam.com
Fri Jul 26 07:08:31 UTC 2024


Hi, all

Samba server have two interfaces eth0 = 192.168.1.1 and eth1 = 192.168.2.2

Need client connected to eth0 = 192.168.1.1 can see all shares and 
connected to eth1 = 192.168.2.2 can see only share2

My settings is:

/etc/samba/browseable-no.conf
browseable = no
available = no

/etc/samba/browseable-yes.conf
browseable = yes
available = yes

/etc/samba/browseable-yes-192.168.1.1.conf is symlink to 
/etc/samba/browseable-yes.conf


/etc/samba/smb.conf contain next lines:

interfaces = eth0 eth1 lo
bind interfaces only = yes
include = /etc/samba/browseable-no.conf
include = /etc/samba/browseable-yes-%i.conf

[share1]
...
[share2]
include = /etc/samba/browseable-yes.conf

I think when client connects to eth0 = 192.168.1.1 it includes 
/etc/samba/browseable-yes-192.168.1.1.conf (after 
/etc/samba/browseable-no.conf) and can see all shares, and when client 
connects to eth1 = 192.168.2.2 it includes only 
/etc/samba/browseable-no.conf (because 
/etc/samba/browseable-yes-192.168.2.2.conf doesn't exists), and 
/etc/samba/browseable-yes.conf for share2 only


Does not work, because %i first time is 0.0.0.0
How can I resolve this?

Best regards,
Valery




More information about the samba mailing list