Antony Sargent
2007-Feb-09 18:50 UTC
[Samba] name query returning all ip addresses for server instead of primary one
Our server is multihomed, and I've been finding that sometimes clients doing a NetBIOS Name Service (NBNS) query to our samba server sometimes end up getting and using one of the non-primary addresses. I used ethereal to look at the actual NBNS response from the server and notice that all of its ip addresses are listed, with the primary one first but all the others as well. I guess the client somehow picks randomly among them? Clients picking the wrong one seems to happen particularly often on vpn connections via the pptpd server running on the same machine. I've perused the samba o'reilly book, online documentation, and the mailing list archives, and I had thought that the "interfaces" and "bind interfaces only" commands in smb.conf should restrict the samba server to only vending the ip address of the primary interface eth0, but that doesn't seem to work. Does anyone know how to get samba to only reply with one of its ip addresses to NBNS queries? Thanks! Antony System info: CentOS 4, Linux 2.6.9-42.0.3.ELsmp Samba rpm's installed: samba-common-3.0.10-1.4E.9 samba-3.0.10-1.4E.9 Here is our smb.conf: (I've changed the actual server name changed to "servername", and workgroup changed to "serverworkgroup") [global] netbios name = servername server string workgroup = serverworkgroup encrypt passwords = yes domain master = yes local master = yes preferred master = yes os level = 33 security = user domain logons = yes # We set these to empty so that we don't use roaming profiles logon path logon home time server = yes admin users = root wins support = yes # only bind to the loopback and first ethernet interfaces interfaces = lo eth0 bind interfaces only = yes socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 [home] path = /home/ veto files = /lost+found/ writeable = yes browseable = yes guest ok = no
Chris Smith
2007-Feb-09 19:11 UTC
[Samba] name query returning all ip addresses for server instead of primary one
On Friday 09 February 2007, Antony Sargent wrote:> ? ?# only bind to the loopback and first ethernet interfaces > ? ?interfaces = lo eth0 > ? ?bind interfaces only = yesBack on 10/15/06 I posted about an issue - titled: "nmbd problems with secondary lo". No responses were received. It's not the same problem you have but they might be related. The workaround I posted then was to use an IP address in place of an interface name. You might want to try that. Ex: ----------------------------------------- interfaces = 192.168.1.2, 127.0.0.1 bind interfaces only = Yes hosts allow = 192.168.1. 127. ----------------------------------------- Chris
Chris Smith
2007-Feb-09 19:16 UTC
[Samba] name query returning all ip addresses for server instead of primary one
On Friday 09 February 2007, Antony Sargent wrote:> ? ?# only bind to the loopback and first ethernet interfaces > ? ?interfaces = lo eth0 > ? ?bind interfaces only = yesAnd one more thought. Always use testparm to see what's really being set. One time I had made some changes but further down in the conf file the change was being reversed by the distros default conf entry that I missed when skimming the file. So if you had: ----------------------------------- bind interfaces only = yes ... ... bind interfaces only = no ----------------------------------- The "no" entry is coming after the "yes" entry and therefore "no" will take precedence, which testparm would confirm, eliminating a skimming error and guesswork. Chris