You are not logged in.

#1 2010-11-09 08:17:17

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

[Solved] NetBIOS names confuse Samba; works when using straight IPs.

I've been chasing this problem for a couple of days now and I have no idea whats wrong. I don't have the slightest clue as to what's wrong. I have two computers, Snotrocket, a server/wireless access point, and Scrotzilla, my netbook. Samba is running and configured on both machines and I can connect to each and see each other's shares when I use smbclient with raw IPs. Same through nautlius.

However, when I start using NetBIOS names, everything gets wonky.

Snotrocket (server) sees Scrotzilla (netbook), but can't enumerate it's shares. nmblookup of scrotzilla on the server fails.  It thinks, wrongly, that Scrotzilla is sitting at 0.0.0.0, when in fact, its at 10.0.0.97

% smbtree -d3 -N
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
added interface wlan0 ip=10.0.0.1 bcast=10.0.0.255 netmask=255.255.255.0
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
tdb(unnamed): tdb_open_ex: could not open file /var/cache/samba/gencache.tdb: Permission denied
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
name_resolve_bcast: Attempting broadcast lookup for name __MSBROWSE__<0x1>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
WORKGROUP
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
    \\SNOTROCKET             Downstairs
Connecting to host=SNOTROCKET
resolve_lmhosts: Attempting lmhosts lookup for name SNOTROCKET<0x20>
resolve_wins: Attempting wins lookup for name SNOTROCKET<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name SNOTROCKET<0x20>
Connecting to 127.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
        \\SNOTROCKET\HP_PSC_1500_series    HP PSC 1500 series
        \\SNOTROCKET\music              Shared music
        \\SNOTROCKET\video              Shared video
        \\SNOTROCKET\software           Shared software
        \\SNOTROCKET\torrents           Incoming torrents
        \\SNOTROCKET\IPC$               IPC Service (Downstairs)
    \\SCROTZILLA             Scrotzilla's Server
Connecting to host=SCROTZILLA
resolve_lmhosts: Attempting lmhosts lookup for name SCROTZILLA<0x20>
resolve_wins: Attempting wins lookup for name SCROTZILLA<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name SCROTZILLA<0x20>
resolve_hosts: getaddrinfo failed for name SCROTZILLA [Name or service not known]
name_resolve_bcast: Attempting broadcast lookup for name SCROTZILLA<0x20>
cli_start_connection: failed to connect to SCROTZILLA<20> (0.0.0.0). Error NT_STATUS_BAD_NETWORK_NAME

Scrotzilla can see Snotrocket, and nmblookup of both names returns correct IPs: Scrotzilla = 10.0.0.97 and Snotrocket = 10.0.0.1. However, it doesn't enumerate Snotrocket's shares. Instead it finds Scrotzilla again. Note "\\SNOTROCKET\IPC$               IPC Service (Scrotzilla's Server)"

% smbtree -N -d 3
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
added interface wlan0 ip=10.0.0.97 bcast=10.0.0.255 netmask=255.255.255.0
tdb(unnamed): tdb_open_ex: could not open file /var/cache/samba/gencache.tdb: Permission denied
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
name_resolve_bcast: Attempting broadcast lookup for name __MSBROWSE__<0x1>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Connecting to 10.0.0.1 at port 139
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
WORKGROUP
resolve_lmhosts: Attempting lmhosts lookup for name WORKGROUP<0x1d>
name_resolve_bcast: Attempting broadcast lookup for name WORKGROUP<0x1d>
Got a positive name query response from 10.0.0.1 ( 10.0.0.1 )
Connecting to host=10.0.0.1
Connecting to 10.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
    \\SNOTROCKET             Downstairs
Connecting to host=SNOTROCKET
resolve_lmhosts: Attempting lmhosts lookup for name SNOTROCKET<0x20>
resolve_wins: Attempting wins lookup for name SNOTROCKET<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name SNOTROCKET<0x20>
Connecting to 127.0.0.1 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
        \\SNOTROCKET\IPC$               IPC Service (Scrotzilla's Server)
        \\SNOTROCKET\shared             My Shared Data
    \\SCROTZILLA             Scrotzilla's Server
Connecting to host=SCROTZILLA
resolve_lmhosts: Attempting lmhosts lookup for name SCROTZILLA<0x20>
resolve_wins: Attempting wins lookup for name SCROTZILLA<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name SCROTZILLA<0x20>
Connecting to 127.0.0.1 at port 445
Connecting to 127.0.0.1 at port 139
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
        \\SCROTZILLA\IPC$               IPC Service (Scrotzilla's Server)
        \\SCROTZILLA\shared             My Shared Data

I'm at a loss as to what's causing this phenomena and any help would be appreciated.

Relevant IP table rules:

iptables -A open -p udp -m udp -d 10.0.0.255 -i $ROUTER -j ACCEPT
iptables -A open -p tcp -m tcp --dport 445 -i $ROUTER -j ACCEPT
iptables -A open -p tcp -m tcp --dport 139 -i $ROUTER -j ACCEPT
iptables -A open -p udp -m udp --dport 137:138 -i $ROUTER -j ACCEPT

Snotrocket's smb.conf: http://paste.pocoo.org/show/288198/
Scrotzilla's smb.conf: http://paste.pocoo.org/show/288197/

Last edited by simongmzlj (2010-11-09 17:07:24)

Offline

#2 2010-11-09 10:50:50

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: [Solved] NetBIOS names confuse Samba; works when using straight IPs.

This looks like a name resolution issue.  Make sure you can ping by host name rather than just IP - If not you need to fix that first.  There is some decent info here :
http://www.samba.org/samba/docs/man/Sam … works.html
and here :
http://oreilly.com/catalog/samba/chapte … 07_03.html

Offline

#3 2010-11-09 16:11:37

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

Re: [Solved] NetBIOS names confuse Samba; works when using straight IPs.

Okay, thanks for the resources. I'll do some reading.

On the server, "ping <server>" resolves to 127.0.0.1 and "ping <netbook>" can't resolve the name. On the netbook, "ping <server>" also resolves to 127.0.0.1 and "ping <netbook>" resolves to 8.15.7.107! This isn't anywhere on my network.

EDIT: 8.15.7.107 actually, it seems, is a result of Rogers hijacking DNS failed requests.

Last edited by simongmzlj (2010-11-09 16:15:24)

Offline

#4 2010-11-09 17:07:00

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

Re: [Solved] NetBIOS names confuse Samba; works when using straight IPs.

Okay, didn't manage to figure out what exactly was wrong, but moving from dnsmasq to dhcpd fixed my problems.

Offline

#5 2010-11-11 00:17:19

simongmzlj
Member
From: Canada
Registered: 2008-11-06
Posts: 135

Re: [Solved] NetBIOS names confuse Samba; works when using straight IPs.

Okay, I figured the issue out after the fact. I'm posting this now in case anyone else gets a similar issue and ends up here.

I solved the problem by moving from dnsmasq to dhcpd. Dnsmasq was caching netbios names. The client was getting caches IPs that were meant for the server.

Offline

Board footer

Powered by FluxBB