[techtalk] smbclient and winpopup
Almut Behrens
almut_behrens at yahoo.com
Wed Jul 18 07:51:05 EST 2001
On Thu, Jul 12, 2001 at 02:00:41PM +0000, Subba Rao wrote:
>
> I am trying to broadcast a message to a Windows NT server. When I try to:
>
> --------------------------------------------------------------------------
> (0)subba9 at myhost:~ => smbclient -M NTHOST
> added interface ip=10.25.234.4 bcast=10.25.234.255 nmask=255.255.255.0
> added interface ip=10.68.42.10 bcast=10.68.42.255 nmask=255.255.255.0
> Unable to resolve name NTHOST
>
> (1)subba9 at myhost:~ => ping nthost
> PING nthost.mydom.com (10.25.234.1): 56 data bytes
> 64 bytes from 10.25.234.1: icmp_seq=0 ttl=128 time=0.5 ms
> 64 bytes from 10.25.234.1: icmp_seq=1 ttl=128 time=0.5 ms
>
> --- nthost.mydom.com ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max = 0.5/0.5/0.5 ms
> (0)subba9 at myhost:~ =>
> --------------------------------------------------------------------------
>
> I can ping NTHOST fine. From NTHOST, I can mount the samba shares onto the
> explorer as well.
>
> How can I send a broadcast Winpop message to the NTHOST? What am I missing
> here?
...looks like a problem related to the resolution of NetBIOS names to me.
Basically, there are the following ways to have samba resolve NetBIOS
names:
* WINS (Windows Internet Name Service)
Once set up, this is highly automatic, as all the clients do register
themselves. The WINS server can run on the Windows side, or you can
make samba (i.e. the nmbd daemon, to be more precise) act as a WINS
server, if you don't have one set up on the Windows side.
* the "hosts" method
This means using the standard unix name resolution services /etc/hosts,
NIS or DNS, as typically configured by /etc/host.conf, /etc/nsswitch.conf
and /etc/resolv.conf
* "lmhosts" file
This means using a samba-side replication of the LAN Manager's LMHOSTS
file. This is something like a /etc/hosts counterpart for Windows --
thus static and tricky to maintain.
* UDP broadcasts
Here, the requested machine responds itself. Tends to bog down larger
networks. Also, typically does not work across subnets, because routers
by default block broadcasts.
In any nontrivial net I'd recommend using WINS. The other methods have
various subtle disadvantages like not supporting machine resource types
or being static and thus hard to maintain.
The "name resolve order" option in the smb.conf file specifies which
ones of those methods to use and in which order, for example
name resolve order = wins lmhosts hosts bcast
To make samba use an existing WINS server, specify its IP address in
the smb.conf file's '[global]' section:
wins server = AAA.BBB.CCC.DDD
Or, to make samba act as a WINS server, specify
wins support = yes
for *exactly one* of the samba machines/nmbd's.
Do not use both "wins server" and "wins support=yes" simultaneously --
in particular, don't set "wins server = <your samba-side WINS's IP>"!
Also, don't forget to set the option "interfaces" if you have several
interfaces/subnets.
interfaces = <IP-address>/<netmask> ...
The config options mentioned here are of course nicely explained in
the smb.conf manpage, which I'd warmheartedly recommend reading (not
necessarily from beginning to end -- it's >200k in size ;)
For a quite good and short introduction to NetBIOS name resolving
issues, start with the file docs/textdocs/BROWSING-Config.txt that
comes with the samba distribution (it has that somewhat misleading
filename, because it's primarily addressing a different topic). Also
useful are: NetBIOS.txt and BROWSING.txt (though somewhat detailed),
and, for anyone able to read german, kurs.pdf. Moreover, the complete
O'Reilly book "Using SAMBA" comes with the samba distribution (html)
docs/htmldocs/using_samba/index.html
or can be downloaded in PDF format form their website:
http://www.oreilly.com/catalog/samba/chapter/book/indexpdf.html
(personally, though, I'd rather buy the hardcopy version -- IM(H)O,
O'Reilly is one of the publishers worth supporting)
For diagnosing purposes using broadcasts, the 'nmblookup' program of
the samba suite can be quite useful.
Good luck,
- Almut
More information about the Techtalk
mailing list