Requester: Bob Counts
Email: rcounts@mail.cswnet.com
Request Made: Sun, Jun 21, 1998
Author: Chuck Mead <chuck.mead@moongroup.com>

Releases:  all
Platform:  all
Category:  System Services and Daemons
Category Listing: How do I get Linux to talk to my Windows peer-to-peer network 


Issue

    I have a peer-to-peer network and I would like to have my Linux 
    machine talk over the network to my other machines. I am running 
    Red Hat 5.0 and I have just installed it but I can't find any docs 
    on a peer-to-peer network. Linux is installed in a machine by 
    itself with no partitioning for other 

Response

    What you want is Samba. It is on your CD ( if you have the boxed 
    set from RedHat. If not it is freely available as an RPM from the 
    Contrib sections at ftp://ftp.redhat.com and also from 
    ftp://sunsite.unc.edu. I am sure it's available in many 
    other places as well.
    
    Samba is actually two daemons; smbd and nmbd.
    
    From the man page on smbd (man smbd):
    
    "smbd  is  a server that can provide most SMB services. The
    server provides filespace and printer services to  clients
    using  the  SMB protocol. This is compatible with the Lan-
    Manager protocol,  and  can  service  LanManager  clients.
    These  include  MSCLIENT  3.0  for  DOS, Windows for Work-
    groups, Windows 95, Windows NT, OS/2, DAVE for  Macintosh,
    and smbfs for Linux."
    
    From the man page on nmbd (man nmbd):
    
    "nmbd is a server that understands and can reply to netbios
    name service requests, like those produced  by  LanManager
    clients. It also controls browsing."

    "LanManager clients, when they start up, may wish to locate
    a LanManager server.  That is, they wish to know what IP
    number a specified host is using."

    "This program simply listens for such requests, and if its
    own name is specified it will respond with the IP number
    of the host it is running on.  Its "own name" is by
    default the name of the host it is running on, but this
    can be overriden with the -n option (see "OPTIONS" below)."

    "nmbd can also be used as a WINS (Windows  Internet  Name
    Server) server.  What this basically means is that it will
    respond to all name requests that it receives that are not
    broadcasts, as long as it can resolve the name.  Resolv-
    able names include all names in the netbios hosts file (if
    any, see -H below), its own name, and any other names that
    it may have learned about from other browsers on the net-
    work.  A change to previous versions is that nmbd will now
    no longer do this automatically by default." 
    
    I believe the latest release is samba-1.9.18p7-2.i386.rpm, 
    or at least that's the one I'm running on several Linux boxen as 
    of 7-28-98. 
    
    If you're unfamiliar with rpm commands for manual 
    installation install it this way: 
    
    1. download the file to "some-dir" 
    2. cd to "some-dir" 
    3. as root issue rpm -Uvh samba-1.9.18p7-2.i386.rpm 
    
    The basic installation is complete. 
    
    Now... on to the next step: You need to edit the file /etc/smb.conf
    as root. This file is extremely well commented but the 
    keys for peer to peer networking are in the global section.
    
    Assumedly your peer to peer network has a Workgroup name so in 
    the Global Section put that name like so:
    
    workgroup = "WORK_GROUP_NAME" 
    (without the quotes but in caps) 
    
    server string = "NAME_OF_SAMBA_HOST" 
    (again without the quotes but in caps. This is the equivalent of
    the NETBios machine name which shows in the Network Neighborhood 
    on the Microsoft hosts)
    
    ;hosts allow = x.x.x.x (where x.x.x.x= the TCP/IP addresses you 
    wish to allow access) This should be commented out with a semi-colon
    unless you have security concerns with a live network connection. If 
    all you have is a PPP connection for a home network it's of little 
    concern.  Here's an example:
    
    hosts allow = 192.168.1. (This would allow all hosts from the 
    192.168.1.0 network to access the samba host.)
    
    If you're unfamiliar with TCP/IP networking this is a network 
    address range which has been reserved for private networking and 
    would contain 256 possible addresses from 0 to 255.  The 0 address 
    denotes (and is reserved for) the network itself and the 255 is 
    reserved as the network's broadcast address.  This leaves all the
    numbers from 1 to 254 for use as host addresses.  Putting 
    192.168.1. as the value for "hosts allow" is the same as saying:
    "allow all hosts with network address 192.168.1.x to access this 
    machine".
    
    There are a million other options but these are the basics. Once 
    you've done these issue the following command as root: 
    
    "/etc/rc.d/init.d/smb restart" 
        
    This forces the Samba daemon (smbd) to re-read the smb.conf file 
    and implements your changes. It takes a few minutes for things to 
    start working but, assuming that all your network clients are in 
    the same subnet, it's gonna work. The reason that they need to be 
    in the same subnet is that NetBios packets, won't route (i.e. move
    across a router to a different network) without being "tunneled",
    but that's a story for another time <grin>!

References

Online (local):  "man smb.conf", "man smbd", "man nmbd"

Print: "Samba : Integrating Unix and Windows" by John D. Blair 
    http://www.amazon.com/exec/obidos/ASIN/1578310067/moongroupconsult/002-8688174-0814807

    This is *the* authoritative book on Samba. I own it and recommend 
    it to anyone serious about the subject matter! You can get it at 
    the link I've included above! 
    
