Heterogeneous network with Samba

From Mandriva Community Wiki

Jump to: navigation, search


This page is a translation/adaptation from that one

Increasingly, it is common to find multiple computers in a home. The reasons can be many: purchase of more powerful equipment, a machine dedicated to the children, etc. The question of how best to share these resources arises very quickly. The desire to make best use of, say, a Macintosh and its printer with 2 PCs and a scanner is not an unusual scenario. Described below is the implementation of a small domestic network. We will not dwell on the technical standards; the purists will certainly not blame me and the newcomers will be happy to find a simple user guide. We will handle some aspects of the network using the native tools that are graphic utilities in Mandriva.
Please note!
  • No access to the console will be necessary -- all will be done with graphical tools.
  • This tutorial is based on a real-world example. It will, of course, be necessary for you to adapt the details to your specific case.


Contents

Theoretical preparation

Please note!
Several notes give additional information about some config settings. One can ignore them, at least the first time.

Actually, this page is only talking about elementary shares config on mandriva hosts. The windows shares config is widely described on the web.

For the scanners shares, one can see Image:Scannerdrake-icon.png Scannerdrake.


Hardware

  • Mac under OS X with graphical network utilities
  • PC IBM under Windows XP SP2 with graphical network utilities
  • PC Dell under Mandriva Spring (2007.1) with graphical network utiilties and external USB hard disc
  • Epson Stylus C64 Printer
  • Epson Perfection 1260 Scanner
  • Internet Access via ADSL Livebox
Please note!
The printer is connected to the mandriva computer via a USB cable. We want it to work as a network printer. In fact, the entire computer + printer will form a network printer !


Goal

We want to be able to access the Internet, print, and scan from each client machine. We also want to securely share the USB hard disc. The first step toward network design should be done with paper and pencil. This will help save money and force us to think through a design that will work for us. It will not be set in stone, but this design will help guide us through the process. For our small network, this job should be simple.

Procedure

Choose the network protocol

It is necessary for very different operating systems like Linux, MacOSX and XP to communicate with one another over the network. There is one application that is (almost) perfect for this role: Samba, which is an implementation of the Server Message Block (SMB) protocol recognized by all 3 operating systems.

Please note!
Protocol: SAMBA


Identify the router

A network needs a router, i.e. a network component which "routes" the right information packets to the right machine. For example when 2 stations are connected on the Web, it is not necessary for the pages required by one machine to be posted on the screen of the other. Any modem from an internet service provider can make the connection, its routing is entirely transparent.

Please note!
The current xxxBox may offer a storage space available on disk in most cases via the smb protocol (samba). This is an additional share, may be adequate if the requirements are not too important. In which case the rest of this page would be of little interest! But if you want to configure your own shares then the following can be a good start!
Please note!
Router: Livebox (for instance)


Choose the server

The "server" is the machine which will provide its resources to the other machines. My main PC is entirely appropriate given its design features and its easily configurable Mandriva Linux operating system.

Please note!
Server: the Dell PC


Name the workgroup

The "workgroup" the common space in which each machine of the network will find its network-related and shared resources. Simply choose a name. In this case, the name is "STSELVE".

Please note!
Workgroup: STSELVE


Name the computers

Each machine must have a "hostname" to identify it on the network. One can also assign a fixed “ipaddress” to a network location. IP addresses are groups of 4 numbers separated by decimal points or periods or full stops, depending on where you're from. On our network the router requires that the internal addresses be in the form 192.168.1.xxx. The modem has the address 192.168.1.1

Computer
Hostname
IP address
Dell PC
pc-dell
192.168.1.2
My Partner's Mac
mac
192.168.1.10
IBM PC
pc-ibm
192.168.1.11
A laptop
(occasional guest)
laptop
192.168.1.12

Identify the users who must share resources

In our case, only 2 users will be logging onto the network. They may log onto any of these machines.


  • My partner: on the Mac her real name is Caroline and her username is macuser (the Mac OS was installed that way)
  • Myself: real name Gilles and username is Gilles. No need to complicate the things!


Having specified all this information, we can begin the great operation.

Preparation

Plugging in

  • Attach the shared peripherals to the server PC (here the PC-DELL)
  • the printer
  • the scanner
  • and the external USB drive.
  • Connect the network cables (Ethernet) to the modem.
Tip !
There will be at least one cable per computer. If there aren't enough network plugs on your router, you can connect the computers to an “Ethernet plug-multiplier” (a switch) which itself will be connected to the modem.

Configure settings on the client computers

  1. Mac configuration
    • Enter the name of the machine: “mac”
    • Register the name in the work group STSELVE (thanks to the tool “directory format”)
    • In “System preferences”
    => sharing: Enable the service “Windows sharing” (Samba)
    => network: Define a fixed IP
    => users: Create the Gilles/gilles
  2. PC-IBM configuration
    • Same operations as for mac but with the Windows tools


Configuration of the server under Mandriva : PC-DELL

Starting from an existing installation, the installation of Mandriva is presented in it's own page in this Wiki. You can refer to the following links :


DrakWizard

Once the system is installed, login a session as a regular user and launch the Mandriva Control Center which will be useful through this tutorial. You will need the root password.


Caution !
In the “Options” menu, it is necessary to select the expert mode. If you forget to do so, some wizards won't be displayed and especially the ones we will be using.


You need to install the following administrative tools packages

  • drakwizard (installs wizards for the network configuration),
  • samba-client,
  • samba-server,
  • and smb4k (allows access to the network).
Drakwizard installation

Restart the Mandriva Control Center to load Drakwizard.

Please note!
Since the 2010.2 release, drakwizard is not necessary if we stick to Samba but is still useful for other network tools.

Create user accounts

The users are configured by Image:Userdrake-icon.png Userdrake in the Mandriva Control Center.

Adding a linux user
Please note!
a user with no account on the Linux box will be, in the default configuration, considered as anonymous guest with restricted rights. It only has access to shares explicitly defined as authorized for guests.


One must also add them to the Samba users. This is simple thanks to the Samba configuration module in the Mandriva Control Center

Adding a user to Samba

Configure fixed network addresses

Network and Internet > Configure a network interface, to the static ipaddress of the server.

Setting of a fixed IP

Icon To modify some Internet settings Set the hostname of the machine.

Setting of the hostname


Samba configuration

We will enter the various parameters SAMBA. All is done in the Mandriva Control Center in some screens. Browse through Mandriva Control Center > Network sharing > Share drives and directories with Windows (SMB) systems

To configure an SMB file server

If it is not already, it is proposed to install the package 'samba-server'. When done, a wizard offers to configure a simple server. Is life not beautiful? If the wizard does not start automatically, in the case of a new configuration for example, simply click on the menu samba server / configure.


To point the wizard to the server…

To choose an autonomous server

…and the name of the workgroup…

To name the workgroup

…then to accept the other default settings. To create an external USB drive sharing: thumbnail : File share .

Creating a network share for users
We want to reserve the right of writing to Caroline button : modify
Modifying the network share

As of this point, my partner will be able to save files in her home directory! A last adjustment remains to be made: it is necessary to deal with the firewall to allow Samba to connect.

Firewall

Security > Fire wall Check the box corresponding to Samba and then save settings.


Peripherals

  • This is just as simple: the Epson printer connected to PC-DELL is recognized by Mandriva and is automatically installed and shared, and the other machines in the workgroup have access to it.
  • To share a scanner, you simply have to open Image:scannerdrake-icon.png scannerdrake and indicate that you want to share the scanner.

Conclusion

While following a simple, logical and rigorous procedure, and with the native tools provided by Mandriva, creating a small network is very simple. If that does not work the first time, do not hesitate to ask for help in the forums.


Other Links

Note : these pages may be outdated.

Personal tools