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 fileservices. It also includes a small print utility that allows you to print to Novell print queues.

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 ncpfs package was designed to be built against the version 1.2.13 kernel or kernels later than 1.3.53 so you if you are not using a kernel in either of these categories it then you should obtain one and use it. There were problems with the version 1.3.0-1.3.52 kernels that broke the IPX support.

You can obtain the ncpfs package by anonymous ftp from Volker's home site at: linux01.gwdg.de or sunsite.unc.edu or mirror sites. The current version at the time of writing was: ncpfs-0.11.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 appopriate 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-0.9.tgz

Make the ncpfs software

The software should compile cleanly with no configuration necessary:

# make

Copy the IPX tools to somewhere useful.

After the make has completed you should find all of the tools you need in the ncpfs/bin directory. I recommend you copy these tools to your /usr/local/sbin directory as shown:

# cd bin
# for i in ipx* ncp* slist nprint pqlist; do cp $i /usr/local/sbin; done

Copy the ncpfs.o module somewhere useful.

After the make has completed you should also find a file ncpfs.o in the ncpfs/bin directory. 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.54++.

If you intend using kernel version 1.3.53 then be warned that while 1.3.53 includes support for ncpfs that it doesn't work. Use 1.3.54 or newer.

If you intend using a kernel that is version 1.3.54 or newer then the ncpfs code has been included in the kernel source. 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 IPX tools. Note you will need to make a small change to the Makefile. The change is explained the file, but in short you need to make the following change to your Makefile:

# SUBDIRS += kernel-1.2/src
# INCLUDES = -I$(TOPDIR)/kernel-1.2
Those two defines are only required when compiling for 1.2.* kernels.

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 mount to mount login to fileserver ACCT_FS01 as user 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 accessable 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 work 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 logon 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. I recommend you place them in your /etc/rc.local file if you have one. I have placed them in a file called NetWare in my /etc/init.d directory and created appropriate symbolic links into my /etc/rc2.d directory to cause it to be started. 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.
#
# Usre 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


Previous Next Contents