Previous Next Contents

8. Configuring your Linux machine as an NCP client.

If you are a user of a mixed technology network that comprises both IP and IPX protocols it is likely that at some time or another you have wanted to have your Linux machine access data stored on a Novell fileserver on your network. Novell have long offered an NFS server package for their fileservers that would allow this, but if you are a small site or have only a small number of people interested in doing this it is difficult to justify the cost of the commercial package.

Volker Lendecke <lendecke@namu01.gwdg.de> has written a Linux filesystem kernel module that supports a limited subset of the Novell NCP that will allow you to mount Novell volumes into your Linux filesystem without requiring any additional products for your fileserver. The software causes Linux to emulate a normal Novell workstation for file services. It also includes a small print utility that allows you to print to Novell print queues. Because this is a limited subset it does not work very well with any of the Novell fileserver emulators described later in this document.

Volker has called the package ncpfs and derived the necessary information mainly from the book "Netzwerkprogrammierung in C" by Manfred Hill and Ralf Zessin (further details of the book are contained within the README file in the ncpfs package). Volker also used the IPX tools written by Greg Page <greg@caldera.com>.

8.1 Obtaining ncpfs.

The latest ncpfs package was designed to be built against the version 1.2.13 kernel or kernels later than 1.3.71 so you if you are not using a kernel in either of these categories it then you should obtain one and use it.

You can obtain the ncpfs package by anonymous ftp from Volker's home site at: ftp.gwdg.de or sunsite.unc.edu or mirror sites. The current version at the time of writing was: ncpfs-2.0.6.tgz

8.2 Building ncpfs for kernels 1.2.*.

Build a kernel with Ethernet and IPX support

The first thing you need to do is ensure that your kernel has been built with IPX support enabled. In the 1.2.13 version kernel you need only ensure that you have answered Y to the question: 'The IPX protocol' as illustrated:

 ...
 ...
Assume subnets are local (CONFIG_INET_SNARL) [y] 
Disable NAGLE algorithm (normally enabled) (CONFIG_TCP_NAGLE_OFF) [n] 
The IPX protocol (CONFIG_IPX) [n] y
*
* SCSI support
 ...
 ...
You will also need to ensure that you include an appropriate driver for your Ethernet card. If you do not know how to do this then you should read the Ethernet-HOWTO.

You can then proceed to build your kernel. Make sure you remember to run lilo to install it when you have finished.

Untar the ncpfs software

# cd /usr/src
# tar xvfz ncpfs-2.0.6.tgz
# cd ncpfs

Check the Makefile

If you intend to use kerneld to autoload the ncpfs kernel module then you must uncomment the line in the Makefile that refers to: KERNELD. If you are unsure what this means then you should read the Kernel-HOWTO to familiarise yourself with kernel module configuration.

Make the ncpfs software

The software should compile cleanly with no configuration necessary:

# make

Copy the IPX tools somewhere useful if you don't already have them.

After the make has completed you should find all of the tools you need in the ncpfs/bin directory. You can use make install to install the tools in Volkers choice of directories. If you are running on an ELF based system then you will need to rerun ldconfig -v to ensure that the shared library is able to be found.

Copy the ncpfs.o module somewhere useful if necessary.

If you are compiling for a 1.2.* kernel then you will find a file called ncpfs.o in the ncpfs/bin directory after the make has completed. This is the ncpfs kernel module. You should copy this somewhere useful. On my debian system I have copied it to the /lib/modules/1.2.13/fs directory and added ncpfs to the /etc/modules file so that it will be automatically started at boot time. If you are using some other distribution you should find where it keeps its modules and copy it there, or just copy it to your /etc directory. To load the modules manually you need to use the command:

# insmod ncpfs.o

8.3 Building ncpfs for kernels 1.3.71++.

For the latest version of ncpfs you must use kernel 1.3.71 or newer. If you want to use older 1.3.* kernels then you must locate a version of ncpfs like ncpfs-0.12.tgz.

If you intend using a kernel that is version 1.3.71 or newer then the ncpfs kernel code has been included in the standard kernel distribution. You need only answer Y to:

 ...
 ...
The IPX protocol ?
 ...
 ...
NCP filesystem support (to mount NetWare volumes) ?
 ...
 ...

You will still need to follow the instructions for building for kernels 1.2.* so that you can build the tools but there will not be a module file for you to install.

8.4 Configuring and using ncpfs.

Configure the IPX network software

There are two ways of configuring the IPX network software. You can manually configure all of your IPX network information or you can choose to let the software determine for itself some reasonable settings. In most installations the automatic method will work ok. If it doesn't work for you then read the 'IPX tools' section below to configure your software manually:

# ipx_configure --auto_interface=on --auto_primary=on

Test the configuration

After your IPX network is configured you should be able to use the slist command to see a list of all of the Novell fileserver on your network:

# slist
If the slist command displays a message like: ncp_connect: Invalid argument then your kernel probably does not support IPX. Check that you have actually booted off the appropriate kernel. If the slist command does not list all of your fileservers then you may need to use the manual network configuration method.

Mount a Novell(tm) volume.

If your IPX network software is working ok you should now be able to mount a Novell fileserver volume into your Linux filesystem. The ncpmount command is used for this purpose and requires that you specify at least the following information:

  1. The fileserver name
  2. The fileserver login id. If it has a password you will also need that.
  3. The mount point ie. where you want the mount to go.

An example command to mount fileserver ACCT_FS01, with a login id of guest with no password, under the /mnt/Accounts directory might look like the following:

# ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -n
Note the use of the -n option to indicate that no password is required for the login. The same login specifying a password of secret would look like:
# ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -P secret
If you don't specify either the -n or the -P options you will be prompted for a password.

Check the mount

If the mount is successful you will find the volumes accessible to the userid used for login listed as directories under the mount point. You should then also be able to traverse the directory structure to find other files. Because NCP does not provide uid or gid ownership of files, all of the files will have the permission and ownership assigned to the mount point directory, keep this in mind when sharing mounts between Linux users.

Test printing

You can test to see if printing works using the nprint command. The nprint command allows you to print to a file to a NetWare print queue. The pqlist command allows you the list the available print queues on a NetWare server. Both commands require that you supply username and password so you might normally consider building some shell scripts to make the task of printing easier. An example might look like:

# pqlist -S ACCT_FS01 -U guest -n
# nprint -S ACCT_FS01 -q LASER -U guest -n filename.txt
The login syntax is similar to the ncpmount command. The examples above assume that fileserver ACCT_FS01 has a guest account with no password, that a print queue called LASER exists and that guest is allowed to print to it.

Configure mounts to be automatically performed.

If you have some need to permanently have an ncp mount then you will want to configure the commands above into your rc files so that they occur automatically at boot time. If your distribution doesn't already provide some way of configuring IPX like debian then I recommend you place them in your /etc/rc.local file if you have one. You might use something like:

#
# Start the ncp filesystem
/sbin/insmod /lib/modules/1.2.13/fs/ncpfs.o

# configure the IPX network
ipx_configure --auto_interface=on --auto_primary=on

# guest login to the Accounting fileserver
ncpmount -S ACCT_FS01 /mnt/Accounts -U guest -n

#
There is another means of configuring NCP mounts and that is by building a $HOME/.nwclient file. This file contains details of temporary or user specific NCP mounts that would be performed regularly. It allows you to store the details of mounts so that you can recreate them without having to specify all of the detail each time.

Its format is quite straightforward:

# The first entry is the 'preferred server' entry and is
# used whenever you do not specify a server explicitly.
#
# User TERRY login to DOCS_FS01 fileserver with password 'password'
DOCS_FS01/TERRY password
#
# Guest login to the ACCT_FS01 fileserver with no password.
ACCT_FS01/GUEST -
To activate these mounts you could use:
$ ncpmount /home/terry/docs
to mount: DOCS_FS01 with a login of TERRY under the /home/terry/docs directory. Note that this entry was chosen because no fileserver was specified in the mount command. If the following command were used:
$ ncpmount -S ACCT_FS01 /home/terry/docs
then a GUEST login to ACCT_FS01 would be mounted there instead.

Note: for this mechanism to work the permissions of the $HOME/.nwclient file must be 0600 so you would need to use the command:

$ chmod 0600 $HOME/.nwclient
If non-root users are to be allowed to use this mechanism then the ncpmount command must be Set Userid Root, so you would need to give it permissions:
# chmod 4755 ncpmount

Try out the nsend utility

a utility to send messages to Novell users is also included in the package, it is called nsend and is used as follows:

# nsend rod hello there
would send the message "hello there" to a logged in user "rod" on your "primary" fileserver (the first one appearing in your .nwclient file. You can specify another fileserver with the same syntax as for the ncpmount command.

8.5 An overview of the user and adminstration commands

Recent versions of Volker's package include a range of user and administration commands that you might want to use. Detailed information is available in the supplied man pages. A brief summary of the commands is as follows;

User commands.

ncopy

Network Copy - allows efficient file copies to be performed by using a Netware function rather than a copy across the network.

nprint

Network Print - allows you to print a file to a Netware print queue on a Netware server.

nsend

Network Send - allows you to send messages to other users on a Netware server.

nwbols

List Bindery Objects - allows you to list the bindery contents of a Netware server.

nwboprops

List Properties of a Bindery Object - allows you to the properties of a Netware bindery object.

nwbpset

Set Bindery Property - allows you to set the properties of a Netware bindery object.

nwbpvalues

Print Netware Bindery Objects Property Contents - allows you to print the contents of a Netware bindery property.

nwfsinfo

Fileserver Information - prints some summary information about a Netware server.

nwpasswd

Netware Password - allows you to change a Netware users password.

nwrights

Netware Rights - displays the rights associated with a particular file or directory.

nwuserlist

Userlist - lists the users currently logged into a Netware fileserver.

pqlist

Print Queue List - displays the contents of a Netware print queue.

slist

Server List - displays a list of know Netware fileserver.

Administration tools.

nwbocreate

Create a Bindery Object - allows you to create a Netware bindery object.

nwborm

Remove Bindery Object - allows you to delete a Netware bindery object.

nwbpadd

Add Bindery Property - allows you to set the value of an existing property of a Netware bindery object.

nwbpcreate

Create Bindery Property - allows you to create a new property for an existing Netware bindery object.

nwbprm

Remove Bindery Property - allows you to remove a property from a Netware bindery object.

nwgrant

Grant Trustee Rights - allows you to assign trustee rights to a directory on a Netware fileserver.

nwrevoke

Revoke Trustee Rights - allows you to remove trustee rights from a directory on a Netware fileserver.


Previous Next Contents