Cover V10, I11

Article
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5

nov2001.tar

Integrating Macintosh Computers into Your Network

Edward L. Haletky

How do you network a disparate group of computers that are using distinctly different communication protocols? How do you join Appletalk, TCP/IP, and Appleshare to organize a file-sharing server usable by Apple Macintosh computers when the file-sharing server is not from Apple? How do you take Appletalk printers and allow them to be used from your network of disparate computers?

History

I started with a Macintosh network and I soon branched out to UNIX workstations, Linux servers, and Windows platforms. My simple network evolved into a nightmare of cabling and integration problems. Because the network started as a Macintosh network, it was easy to think of the network from that perspective, but it caused some problems as solutions to the file-sharing problem began to appear. The following products were tried and rejected due to performance issues, uptime issues, or general misconceptions by me or the program authors.

Item Performance Uptime Misconception

Orange Micro's PC Card for Macintosh *** ***

Insignia Solution's Softwindows *** ***

Tenon Intersystems's MachTen *** ***

Columbia Appletalk Package (CAP) ***

The first three options above were Macintosh-centric; the last one, CAP, was UNIX-centric, yet did not meet my changing needs. It was the most effective of the programs until the needs of the network changed on me. The misconceptions marked above were:

  • The package lacked the ability to perform a networking function between the product and the host Macintosh (Softwindows).
  • The package lacked the ability to handle a CD-ROM, floppy, or hard disk that contains a Hierarchical Filesystem (HFS) that is a part of the Macintosh Operating System (CAP).
Problem Revision

The network changed to include all the major UNIX workstations, a few Apple Macintosh computers, and several Windows PC computers. Additionally, an Apple Macintosh Duo laptop was introduced into the mix. UNIX workstations can share files using Network File System (NFS) and Windows machines can share files amongst themselves and with UNIX workstations using Common Internet File System (CIFS) on the Windows machines and Samba on the UNIX machines. Yet the use of Macintosh computers still provided a file-sharing problem. The fact that an Apple Macintosh Duo does not have a floppy or CD-ROM drive means that the needs of the network change even further. Lastly, access to the Okidata OL610e/PS LED postscript printer was a necessity. This printer could either connect directly to the Duo or be accessed via Appletalk, which was the current form of access.

Given all the above, the solution had to include access to Appletalk to share the printer and access the Macintosh networked computers, as well as support for Appleshare to share files between the Apple computers and the rest of the network. Furthermore, because of the unique features of the Macintosh Duo computer, native file system support for HFS was required because there needed to be some way to read Macintosh CDs across the network.

Only one machine could satisfy all those requirements. This machine runs the Linux operating system. Granted, you now can get access to the same functionality via FreeBSD, but years ago when I first started the project, only Linux had what was required. Linux remains my preferred solution for integration and interoperability problems of Apple Macintosh, UNIX, and Windows computers.

The Solution

Hardware

To implement the solution, a little bit of hardware is necessary to properly configure the network to accept the Apple Macintosh Duo Laptop and Okidata Appletalk LED Printer. This hardware is illustrated in Figure 1.

Because the Macintosh Duo has no SCSI or Ethernet adapter, extra hardware was required. While modern Apple computers do not suffer this, my older Duo exhibits this deficiency.

  • Newer Technology SCSI Micro Dock -- Providing the DUO with SCSI disk (external CD-ROM), and Apple Desktop Bus (ADB port for a keyboard and power).
  • Dayna Pocket SCSI/Link Ethernet Adapter -- Providing the DUO with an Ethernet connection to the central 10baseT hub.

To connect the Appletalk printer to the TCP/IP network, a bridge is required. The following hardware is what I used, but other bridging and cabling hardware can be used. The hardware has never really been the issue because current Apple computers support Appletalk to TCP/IP bridging capability, but sometimes a bit of creativity is required for legacy computers.

  • Farallon PhoneNet connectors -- Providing a network bridge to the Okidata LED printer.
  • Dayna Mini Etherprint -- Providing the actual bridge between the Appletalk network and the Ethernet network.

Some of this hardware is difficult to find or non-existent, but there is always something available to perform the same tasks. Farallon has many different adapters that replace the now non-existent Dayna products.

The Software

It initially took a while to find all the necessary RPMS and kernel to build a proper Linux Appleshare Server; however, now they are all available off the Standard Red Hat 7.0 base and PowerTools installation media. To make an Appleshare server, you will need the Red Hat Package Management (RPM) packages that follow:

  • Kernel Source -- The Kernel Source provides the device drivers for the HFS and other necessary filesystem and networking protocols. These modules will need to be compiled into your kernel. All the HFS drivers are considered experimental.
  • hfsutils -- Hierarchical File System tools provide the ability to read and write to Macintosh CDROM and floppy disks.
  • Netatalk -- Open Source Appletalk/Appleshare tool suite for accessing Apple Macintosh Appletalk peripherals and other Apple Macintosh hardware.

When you put all this software together, you get a server that will speak Appletalk over TCP/IP or Ethertalk protocols. Additionally, the server will understand HFS, Appleshare, and various other filesystem protocols. This is the solution we want.

Detailed Configuration

Kernel Configuration

I use kernel source 2.4.x that comes as an RPM package with the 7.0 base installation CDs. When I upgraded to 7.1, the kernel version upgraded to 2.4.2-2. Here are the steps for configuration of the kernel to handle the Appletalk and HFS protocols. First, assume that the package is already installed. Second, assume you know how to build a kernel. If not, the README in the kernel source directory will help you to follow the steps below:

cd /usr/src/linux
make clean; make menuconfig
Select networking options using the down arrow key (see Figure 2). Turn on the Appletalk protocol support module (see Figure 3). Select exit to return to the main menu by using the tab key. Select File systems by using the down arrow key (see Figure 4).

Select the Experimental Apple Macintosh file system support module (see Figure 5). Then use the Tab key to select exit, then the tab key to select exit once more, and you will be presented with a question about whether to save the kernel configuration. Select the Yes option. Run the following commands:

make dep
make bzImage
make modules
make modules_install
Now your kernel is built with the proper Appletalk and HFS support.

Copy over the kernel files to /boot, modify /etc/lilo.conf, execute lilo, and reboot your machine per the README file in the /usr/src/linux directory.

Filesystem Configuration

There is not much software configuration necessary for us, but what little there is, is crucial. What follows is the configuration required for the Appletalk support using netatalk.

First you will need to configure the /etc/fstab file to include a mount point for all necessary CD file systems by making directories /mnt/cdrom/cdfs and /mnt/cdrom/hfs. Modifying /etc/fstab makes mounting CDs convenient. If I want to mount an HFS disk, I can mount it directly using the command mount /mnt/cdrom/hfs, and the proper filesystem driver and mount arguments will be used. The following lines were added to the /etc/fstab file:

/dev/cdrom  /mnt/cdrom/cdfs iso9660 noauto,ro       0 0
/dev/cdrom  /mnt/cdrom/hfs  hfs noauto,fork=netatalk,ro,case=asis 0 0
Netatalk Configuration

In addition to the above configurations, Netatalk is configured to print using entries in the /etc/printcap file as well as a .paprc file naming the Appletalk printer located in the printer spool directory specified by the sd= field of the printer stanza in the /etc/printcap file. My /etc/printcap file, including the filters for printing postscript over the Appletalk link (pap), are shown here:

lp|ps|OL610e:\
:sd=/var/spool/lpd/lp:\
:lp=/dev/null:\
:pl#63:\
:pw#85:\
:mx#0:\
:lf=/var/spool/lpd/lpd-errs:\
:if=/usr/lib/atalk/filters/ifpaprev:\
:of=/usr/lib/atalk/filters/ofpap:\
:tf=/usr/lib/atalk/filters/tfpaprev:
The :if is a filter to run on each file. Specifying ifpaprev shows that the :if filter is an input filter for pap that will reverse the print order. :of is an output filter for the pap. :tf specifies what to use for troff or manual page output; the tfpaprev filter will reverse the pages after doing some conversion to Postscript. Running the man printcap command will give more information on the file and its contents. The directory specified by the :sd symbol contains a .paprc file, which in turn has the contents below which is just the name of the printer in Appletalk language:

OL610e/PS:LaserWriter
To determine this name, you can run the following command and get similar output. The nbplkup command will display the machines on the Appletalk network. Once your machines are all connected and Netatalk is running, you can issue this command to determine if everything can be found:

# nbplkup
                    secretariat:netatalk    65280.87:4
                    secretariat:Workstation 65280.87:4
                      OL610e/PS:LaserWriter 21253.82:128
Starting up Netatalk is quite simple because the command is the same to start any daemon -- /etc/rc.d/init.d/atalkd start. You can edit the /etc/atalk/config file to make it so the atalkd command will not background any daemons. This way allows you to see errors as they happen. I have mine set up this way, which provides more information but a slower computer startup. As you can see, the configuration is pretty simple. PAPD is the printer daemon for the Appletalk protocol, AFPD is the Appleshare daemon, and ATALK_BRGROUND says whether to run the daemons on startup in the background. When you have to troubleshoot the system, you should run them in the foreground:

# Appletalk configuration
# Change this to increase the maximum number of clients that can connect:
AFPD_MAX_CLIENTS=5
# Change this to set the machine's atalk name:
ATALK_NAME='echo ${HOSTNAME}|cut -d. -f1'
# Set which daemons to run:
PAPD_RUN=yes
AFPD_RUN=yes
# Control whether the daemons are started in the background
ATALK_BGROUND=no
After configuring the printers, I then configure the Appleshare volumes to share /mnt/cdrom and home directories by editing the /etc/atalk/AppleVolumes.default file to add an entry for /mnt/cdrom and each user directory that has access to the Appleshare volumes. I use the simplest entries in the file to specify which directories to share, however, you can and more options for passwords and codepage support as necessary. Entries in the /etc/atalk/AppleVolumes.default file look like the following:

~             "User Home"
/mnt/cdrom    "CDROM Directories"
A neat trick is to make the same mappings available to Samba, so that Windows and Macintosh computers can share the same data without needing a sneaker net, or any other form of file movement. /etc/atalk/AppleVolumes.system can be used to list those shares that are mounted whenever connected. These shares will never require passwords because they are system-level shares.

Troubleshooting is simple because the tools will tell you if something is wrong. If you get errors, check to make sure the cabling is correct, everything is powered on, and that the atalkd daemon is running. If that is not running, then there was a startup problem that can be identified by investigating the /var/log/messages log file.

Because my computer is a gateway, it has more than one Ethernet adapter. Thus, a problem I encountered is that my default network adapter does not connect to the Appletalk network, so I have to modify the /etc/atalk/atalkd.conf file to specify which Ethernet card to use when speaking Appletalk over the network. The modification I made is shown below:

eth1 -seed -phase 2
In turn, atalkd modified the file to its final form shown below. I let atalkd handle the hard part of determining all the necessary numbers, including the address to use:

0eth1 -seed -phase 2 -net 0-65534 -addr 65280.87
One thing to note is that the netatalk version 1.5 that ships with the PowerTools 7.1 CDROM did not work for printing. The programs kept core dumping prematurely, so I went back to use the 1.4b2-asun2.1.3 version supplied on the PowerTools 7.0 CD-ROM, which works just fine. However, the 1.4b2-asun2.1.3 version has a problem in its /usr/lib/atalk/filters directory. You must go to that directory and re-symbolic link all the files to the proper locations. The following shows the current files:

ifmpap@     ifwmpap@     ofmpap@   tfmpap@     tfwmpap@
ifmpaprev@  ifwmpaprev@  ofpap@    tfmpaprev@  tfwmpaprev@
ifpap@      ifwpap@      ofwmpap@  tfpap@      tfwpap@
ifpaprev@   ifwpaprev@   ofwpap@   tfpaprev@   tfwpaprev@
I wrote the following script to make the necessary adjustments to the installed files and now everything works as expected. I run the script specifying an argument of *pap* to captures all the files to be relinked:

#!/bin/bash
cd /usr/lib/atalk/filters
for x in $*
do
    rm -f $x
    ln -s ../../../sbin/psf $x
done
Conclusion

The above discusses how to integrate legacy and new Macintosh equipment into an existing TCP/IP-based network. Linux provides the native support for all the necessary protocols and file systems required to support a Macintosh Duo and Appletalk printers while allowing access to the network so that to a Macintosh, the network works and looks like a bunch of Macintosh computers.

Edward L. Haletky graduated from Purdue University in 1988 with a degree in Aeronautical and Astronautical Engineering. Since then, he has worked programming graphics and other lower-level libraries on various UNIX platforms. He currently works for Compaq Computer Corporation in the High Performance Computing Expert Team, dealing with Tru64 and Linux Clustering technologies and environments.