Overview of additional packages: AdditionalPackages
Samba
From www.samba.org: "Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients."
In simple terms: You can access files on USB memory devices connected to the WL-500g to Windows clients in the same way you access files on your local harddisk.
Samba consists of two key programs, plus a bunch of other stuff that we'll get to later. The two key programs are smbd and nmbd. Their job is to implement the four basic modern-day CIFS services, which are:
Features
- File & print services
- Authentication and Authorization
- Name resolution
- Service announcement (browsing)
Background
File and print services are, of course, the cornerstone of the CIFS suite. These are provided by smbd, the SMB Daemon. Smbd also handles "share mode" and "user mode" authentication and authorization. That is, you can protect shared file and print services by requiring passwords. In share mode, the simplest and least recommended scheme, a password can be assigned to a shared directory or printer (simply called a "share"). This single password is then given to everyone who is allowed to use the share. With user mode authentication, each user has their own username and password and the System Administrator can grant or deny access on an individual basis.
The Windows NT Domain system provides a further level of authentication refinement for CIFS. The basic idea is that a user should only have to log in once to have access to all of the authorized services on the network. The NT Domain system handles this with an authentication server, called a Domain Controller. An NT Domain (which should not be confused with a Domain Name System (DNS) Domain) is basically a group of machines which share the same Domain Controller.
The NT Domain system deserves special mention because, until the release of Samba version 2, only Microsoft owned code to implement the NT Domain authentication protocols. With version 2, Samba introduced the first non-Microsoft-derived NT Domain authentication code. The eventual goal, of course, it to completely mimic a Windows NT Domain Controller.
The other two CIFS pieces, name resolution and browsing, are handled by nmbd. These two services basically involve the management and distribution of lists of NetBIOS names.
Name resolution takes two forms: broadcast and point-to-point. A machine may use either or both of these methods, depending upon its configuration. Broadcast resolution is the closest to the original NetBIOS mechanism. Basically, a client looking for a service named Trillian will call out "Yo! Trillian! Where are you?", and wait for the machine with that name to answer with an IP address. This can generate a bit of broadcast traffic (a lot of shouting in the streets), but it is restricted to the local LAN so it doesn't cause too much trouble.
The other type of name resolution involves the use of an NBNS (NetBIOS Name Service) server. (Microsoft called their NBNS implementation WINS, for Windows Internet Name Service, and that acronym is more commonly used today.) The NBNS works something like the wall of an old fashioned telephone booth. (Remember those?) Machines can leave their name and number (IP address) for others to see.
Hi, I'm node Voomba. Call me for a good time! 192.168.100.101
It works like this: The clients send their NetBIOS names & IP addresses to the NBNS server, which keeps the information in a simple database. When a client wants to talk to another client, it sends the other client's name to the NBNS server. If the name is on the list, the NBNS hands back an IP address. You've got the name, look up the number.
Clients on different subnets can all share the same NBNS server so, unlike broadcast, the point-to-point mechanism is not limited to the local LAN. In many ways the NBNS is similar to the DNS, but the NBNS name list is almost completely dynamic and there are few controls to ensure that only authorized clients can register names. Conflicts can, and do, occur fairly easily.
Finally, there's browsing. This is a whole 'nother kettle of worms, but Samba's nmbd handles it anyway. This is not the web browsing we know and love, but a browsable list of services (file and print shares) offered by the computers on a network.
On a LAN, the participating computers hold an election to decide which of them will become the Local Master Browser (LMB). The "winner" then identifies itself by claiming a special NetBIOS name (in addition to any other names it may have). The LMBs job is to keep a list of available services, and it is this list that appears when you click on the Windows "Network Neighborhood" icon.
In addition to LMBs, there are Domain Master Browsers (DMBs). DMBs coordinate browse lists across NT Domains, even on routed networks. Using the NBNS, an LMB will locate its DMB to exchange and combine browse lists. Thus, the browse list is propagated to all hosts in the NT Domain. Unfortunately, the synchronization times are spread apart a bit. It can take more than an hour for a change on a remote subnet to appear in the Network Neighborhood.
Download
Samba is by default included in the custom firmwares from Oleg: v1.7.5.6 CR4 and up.
A pre-compiled package can be downloaded here:
http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/
Source
The source code can be downloaded here:
http://us3.samba.org/samba/download/
Compiling
(Some info on compiling the source should come here...)
Installation
By default the Samba package is not activated in the custom firmwares. This is a precautionary feature because: using Samba is done at your own risk !
Firmware releases as of 1.9.2.7-5a work just fine, use the web interface to set a host name under the "IP Config" menu (e.g. "WL500g"), then reboot the router, then use the "Samba" option under "USB Application" in the web interface and enable demo mode, then save and reboot the router. You should be able to access it from a windows pc by clicking start, then run then typing in "\\192.168.1.1" and click OK. The sharenames "share" and "share$" are created, share$ appears hidden and is writable. You can verify samba is running by telneting to the router and issuing the command "ps -ax" and you should see smbd and nmbd running. You can adjust the samba shares by editing /etc/smb.conf (and save your changes somehow too)
Previous installation instructions follow:
If you still want to go ahead and experience the power of Samba:
First of all you are recommended to migrate to the Flashfs-boot method of configuring your WL-500g if you haven't done so yet. Info on Flashfs-boot can be found here: FlashfsBoot. However, the old BootCmd's configuring method can still be used, look here:
http://wl500g.dyndns.org.
- The "Host name" of the WL-500g has to be set. This can be done using the webinterface of the router under menu "IP Config"
Add the following lines to the /usr/local/init/post-boot script:
/usr/sbin/smbd -D
/usr/sbin/nmbd -D- Save the changes to the Flashfs-boot by issuing the following commands: flashfs save and flashfs commit. Reboot the router to get Samba running.
By default /mnt/usbfs/ can be reached read-only at: //WORKGROUP/WL500g/share. A read/write enabled share is a hidden share and can be reached at: //WORKGROUP/WL500g/share$.
Note 1: Samba requires a valid /etc/hosts file to be present in the file system, which is by default not available in access point mode. In order to run Samba in AP mode you should either prepare your own /etc/hosts file or launch /init/rc.dnsmasq . There are log files available for Samba: /var/log/nmb and /var/log/smb
Note 2: Be careful with what you share to your lan: the shares have no username/password access restrictions.
Customizing samba config
That's very simple. If you need to change /etc/smb.conf only, then you just need to add this file to /usr/local/.files using this command (this command should be executed only once):
echo /etc/smb.conf >> /usr/local/.files
To list the files which are already in the list to be saved type this command:
cat /usr/local/.files
Once you've finished editing /etc/smb.conf commit your changes using: flashfs save and flashfs commit and reboot.
Related links
Topics on Chupa.nl Forum:
- Samba on WL-500g can you finde in Asus forum
http://wl500g.info - Samba problem with big files
http://wl500g.info
Elsewhere:
- (description) (url)
Known problems
- Some users have reported problems with transferring large files when the router is low on free RAM.
