[Samba] Different configs for different network interfaces

Robert Marcano robert at marcanoonline.com
Mon Feb 14 14:41:32 UTC 2022

On 2/14/22 9:50 AM, Arne Zachlod via samba wrote:
> Hi,
> I have a Win 2000 legacy guest in a KVM I want to print and share files 
> from in the production network.
> My plan was to have a separate VM on the same host providing DHCP, 
> printer share and SMB1 file share with guest access to the windows 2000 
> machine, and a separate config providing the same share, but accessed 
> via SMB2 and 3 , and authenticated users only, for the normal production 
> network.

Not with multiple VMs but on a single Samba instance. You can include 
extra configuration options based on the client IP address for example 
in you global section:

   include = /etc/samba/extra/ip-%I.conf

and the have a file named:

/etc/samba/extra/ip- for the IP with the 
following contents:

   server min protocol = NT1

I have to do it for someone using a very expensive scanner that only 
support SMBv1.

Take into account that SMBv1 code could be removed in following 
releases, depending on the SAMBA developers decision, so if you plan to 
use this long term, search for a distribution with a very far end of 
support date so they maintain with fixes an old SAMBA without moving you 
to a new modern one without SMBv1, when that happens.

> My question now is, did anyone here set something similar up already? 
> I'm trying to find out what is better: to have a samba server per 
> interface, or configure samba server differently per IP space to handle 
> the connections? That should be possible with `include = %I.conf`
> If anyone wants to share some experience or opinion on this it would be 
> highly appreciated.
> Arne

More information about the samba mailing list