Hi, Using the %L macro in smb.conf is for me *very* usefull, I can setup as many logical servers as I need and that's great : no need for new machines, I can switch logical servers back and forth, it's a kind of System Administrator dream :-) *But* I've discovered a problem with the %L macro in a subnetted environment : - "hermes" is a Samba 1.9.18p10 server on a hpux 10.20 and is configured like this: netbios name = hermes netbios aliases = tet59 tet30 mc752b tet58 am740b td446 Please note : tet59, tet30, mc752b, tet58, am740b and td446 are also hermes aliases in the DNS. I call thos aliases "fake servers". - I have a service like this : [public] ;fakeserver = tet59 tet30 mc752b tet58 am740b td446 comment = %L Public Zone path = /home/dos/%L/public public = yes writeable =yes create mask = 664 directory mask = 775 that means I have a different "common" service for each fake server. I list the corresponding shared disks below : \\tet59\public \\tet58\public \\tet30\public \\td446\public \\am740b\public \\mc752b\public \\hermes\public - it works from win95 and NT4-SP3 as far as the names are resolved by broadcast, the pc and the server are on the same subnet - but if the client is in another subnet and the name (ie : tet59) is then resolved by DNS, wether you chose \\tet59\public, \\tet58\public, \\tet30\public, \\td446\public, \\am740b\public, \\mc752b\public or \\hermes\public, it connects to \\hermes\public. =====> Actually it seems the %L macro is mapped to the real netbios =====> name of the machine defined by smb.conf "netbios name =" =====> configuration directive when the server is called from a pc =====> resolving the server name with DNS. :-( - using for example "smbclient -L tet59" from a samba box on a different subnet works correctly (shows "tet59 Common Zone" as the service comment) Please note I can't (and don't want to ;-) use WINS nor configure a lmhosts table on the pc's I did not join any log as there are no error status in them @ debug level 3. Please tell me if you need some more information. Another (less important :-) question : is there a maximum number of netbios aliases for a samba server ? Thank you for your help and merry christmas :-) Laurent Menu
On Fri, Dec 25, 1998 at 01:55:59AM +1100, laurent.menu@temic.fr wrote:> Hi, > > Using the %L macro in smb.conf is for me *very* usefull, I can setup as > many logical servers as I need and that's great : no need for new machines, > I can switch logical servers back and forth, it's a kind of System > Administrator dream :-) > > *But* I've discovered a problem with the %L macro in a subnetted > environment : > > - "hermes" is a Samba 1.9.18p10 server on a hpux 10.20 and is configured > like this: > netbios name = hermes > netbios aliases = tet59 tet30 mc752b tet58 am740b td446 > > Please note : tet59, tet30, mc752b, tet58, am740b and td446 are also > hermes aliases in the DNS. I call thos aliases "fake servers". > > - I have a service like this : > [public] > ;fakeserver = tet59 tet30 mc752b tet58 am740b td446 > comment = %L Public Zone > path = /home/dos/%L/public > public = yes > writeable =yes > create mask = 664 > directory mask = 775 > that means I have a different "common" service for each fake server. I list > the corresponding shared disks below : > \\tet59\public > \\tet58\public > \\tet30\public > \\td446\public > \\am740b\public > \\mc752b\public > \\hermes\public > > - it works from win95 and NT4-SP3 as far as the names are resolved by > broadcast, the pc and the server are on the same subnet > > - but if the client is in another subnet and the name (ie : tet59) is then > resolved by DNS, wether you chose \\tet59\public, \\tet58\public, > \\tet30\public, \\td446\public, \\am740b\public, \\mc752b\public or > \\hermes\public, it connects to \\hermes\public. > > > =====> Actually it seems the %L macro is mapped to the real netbios > =====> name of the machine defined by smb.conf "netbios name =" > =====> configuration directive when the server is called from a pc > =====> resolving the server name with DNS. :-( > > > - using for example "smbclient -L tet59" from a samba box on a different > subnet works correctly (shows "tet59 Common Zone" as the service comment) > > Please note I can't (and don't want to ;-) use WINS nor configure a lmhosts > table on the pc's > > I did not join any log as there are no error status in them @ debug level 3. > Please tell me if you need some more information. > > > Another (less important :-) question : is there a maximum number of netbios > aliases for a samba server ? > > > Thank you for your help and merry christmas :-) > > > Laurent Menu >Hi The only solution I see, is to use network aliasing. You'd have to configure as many virtual interfaces as you want virtual servers. Then you start a nmbd & smbd for each interface with "interfaces <one-of-the-logical-interfaces>". Greetings, Florian Pflug
Merry Xmas! Your problem is not with Samba. Here's the issue: Suppose, on an NT machine, you type something like: start \\10.0.0.3 NT does something along the lines of: 1. Query the service list of the IP given. 2. Grep for the relevant hex name that identifies the Netbios Name 3. Connect to the IP using the Netbios Name. This happens, by the way, to be a very good system, and is something I'd like to see smbclient support, although smbclient should do it right and have alias support. Now, 95/98 act very similarly, but can not be fed an IP directly. However, they CAN be configured to lookup NetBIOS names via DNS, at which point they act as above. Note, this means they lost the original identity of the "requested servicename"--Windows SMB has no concept of aliases. (Note--I know nothing of the datastream--it's *very* conceivable that the requested servicename lies somewhere, and thus can be extracted by Samba. Why don't you do a little LAN sniffing and report the results?) The solution given--using virtual addresses--seems rather nightmarish to implement. You'd have to hand-hack the way nmbd and smbd start up to display a different Netbios *NAME* for each interface. I don't know off hand how you'd do that. Now, what MIGHT work would be to remote announce to subnets you wanted to be able to see your server. You may or may not need to remove from DNS too. Note, I've never seen Remote Announce actually work, but we have a funky install around these parts :-) Please post if something I said helped you in any way. --Dan Kaminsky ------ In the works of Spelling, a predominant concept is the distinction between ground and figure. In a sense, the example of textual discourse which is a central theme of Beverly Hills 90210 emerges again in Models, Inc.. Many situationisms concerning the bridge between class and sexual identity may be discovered. ( http://www.cs.monash.edu.au/cgi-bin/postmodern )
Laurent, On Fri, 25 Dec 1998 01:55:48 +1100, laurent.menu@temic.fr wrote:>Using the %L macro in smb.conf is for me *very* usefull, I can setup as >many logical servers as I need and that's great : no need for new machines, >I can switch logical servers back and forth, it's a kind of System >Administrator dream :-)>*But* I've discovered a problem with the %L macro in a subnetted >environment :>- it works from win95 and NT4-SP3 as far as the names are resolved by >broadcast, the pc and the server are on the same subnet>- but if the client is in another subnet and the name (ie : tet59) is then >resolved by DNS, wether you chose \\tet59\public, \\tet58\public, >\\tet30\public, \\td446\public, \\am740b\public, \\mc752b\public or >\\hermes\public, it connects to \\hermes\public.This seems to be a behaviour of the client: It looks like it tries to resolve the name and then does a reverse lookup at the DNS with the IP address it found. What it gets is the first name for that IP adress the DNS server knows about. You should be able to come around this by trying the following: Forbid your client to do DNS lookups. Edit a LMHOSTS file with only one of the aliases in it. Allow the client to use this LMHOSTS file Reboot If that works for you you may try to add the other aliases to LMHOSTS. It is possible that the behaviour returns then (in case the client can do something like a reverse lookup in LMHOSTS).>Please note I can't (and don't want to ;-) use WINS nor configure a lmhosts >table on the pc'sJust for testing. :-)>Another (less important :-) question : is there a maximum number of netbios >aliases for a samba server ?>From what one can see in the sources its determined by the amount of availablememory (its just doing a malloc() for each name it finds) and by the max number a signed integer can represent on your system (my_netbios_names is an array looped over with an int). Hasta la vista, Robert -- --------------------------------------------------------------- Robert.Dahlem@frankfurt.netsurf.de Radio Bornheim - 2:2461/332@fidonet +49-69-4930830 (ZyX, V34) 2:2461/326@fidonet +49-69-94414444 (ISDN X.75) ---------------------------------------------------------------