Samba: Recipes to Configure Stable Network Browsing on a SOHO LAN
AKA Settings for the Samba Configuration File, smb.conf, to achieve stable network name resolution.
This is a page of recipes with little explanation. The explanation and discussion is on a separate page. If you need to use these recipes you probably should read the explanations page.
These are the configuration options for the SOHO workgroup LAN:
Really new users might wonder where the GUI tool to edit the Samba configuration file is. There's an ultra-mini tutorial on that in the last paragraph
Using the lmhosts file:
File /etc/samba/smb.conf
Files /etc/samba/lmhosts in Linux and %SystemRoot%\system32\drivers\etc\lmhosts in Windows are exactly the same:
In Windows TCPIP settings at Control panel --> network connection --> properties --> Internet protocol TCPIP --> properties --> advanced --> WINS: Make these adjustments:
Similar settings should be made in the Linux GUI. Here's some pics of the equivalent situation from Yast in Suse 10.2:
Using a Linux Local Master Browser
Here's the file /etc/samba/smb.conf for the machine chosen as LMB, in this example with hostname and NetBIOS name both set to fileserver.
The LMB doesn't have to have a fixed IP address. If you choose too give your LMB a fixed IP address then configure the network card as shown pictorially in Plate#2 above. If however you choose dynamic IP addressing by DHCP then use the pictorial guide shown below in Plate#3.
Using A WINS Server
Here's the file /etc/samba/smb.conf for the WINS server:
A wins server has a fixed IP address so you would use the style of Plate#2 to configure the network card.
Here's the file /etc/samba/smb.conf for a Linux WINS client:
A wins Linux client (a standard browsing computer) can have either a fixed or a dynamically assigned IP address. You would use the style of Plate#2 to set up the network card in the static case and Plate#3 in the dynamic (DHCP) case.
Plate#4 shows the nettwork card setup for Windows clients, for the cases of fixed IP (4A) and dynamic IP (4B). This is for the windows wins client so the IP address of the wins server must be encoded as in 4C.
Well folks I hope I've covered most common options and cases. But as always constructive criticism is welcomed on my weblink address. In finishing, here's a recipe for new users to edit files owned by root, like lmhosts, hosts, smb.conf and so on.
HowTo Edit the Samba Configuration File (or for that matter, any file owned by root):
There's an easy way and a hard way. The easy way is to issue a command in a non-root terminal that essentially says "open the file in a text editor". The hard way is to navigate in Konqueror (KDE) or Nautilus (Gnome) to the file, R-click it, select to open it and then select which application will do the job.
The easy way in Gnome is to issue this command in a terminal window:
The easy way in KDE is to issue this command in a terminal window:
This is how you do it the hard way in KDE: The same principles go for Gnome but there you'd use Nautilus and Gedit instead of Konqueror and Kwrite. Open the file manager Konqueror in super user mode. You'll find it in Suse at Kmenu --> System --> File manager --> File manager super user mode. Supply the root password when asked.
Navigate to the file at /etc/samba/smb.conf: use ↑ to find / --> /etc --> /etc/samba --> scroll to samba.conf. R-click and select "open with". Then if you see Kwrite in a list (or Kate if you prefer) then select it. If you don't see it in the list then select "other" and you'll find Kwrite in the ensuing graphical list under utilities --> editor --> kwrite. Select Kwrite BUT ALSO tick the box "remember application association for this type of file" so you don't have to hunt like this in the future. OK smb.conf will open in superuser version of Kwrite and you can edit it.
I reckon it's time to stop with total dependence on things GUI.
Be well. Swerdna 08 February 2007.