home button, 3.8k

Linux

Installing a simple Linux-based ISDN router. This page was last updated 15.4.95.

Contents:

Firewalling is not described in this page because I haven't installed it yet.

Hardware

The Hardware was fairly arbitrarily chosen. Since I have no idea what is considered good and what isn't - there seems to be an enormous amount of Taiwan junk offered - I got some advice I could trust and made sure none of the offered boards were on the warning list in S.u.S.E's Linux handbook that came with the CDs. Here is a shopping list:

Installation was simple, I plugged it all together and turned it on. No jumpers had to be changed. The SVGA board has trouble initializing, I need to reboot Linux once to get it up. I don't know why yet. The whole setup, including a really good deal for a color monitor, cost about DM 2400 (US$ 1700 at the current weak dollar exchange rate).

Software Bringup

The first step is configuring the BIOS setup correctly. The setup program is in a ROM on the motherboard and is sort of a primitive frontend for some NVRAM setups. There wasn't much to do, other than turning off all the powersave features that I was told interfere with Linux.

The next step was making backups from all the driver floppies that came with the various boards. I stuck each floppy in my Indigo and used cat to copy 1.44 MB from /dev/rdsk/fds0d3.3.5hi to disk files. This way I can be sure to get boot blocks and whatever else DOS needs to boot from a floppy. The 5.25" driver floppy that came with the Ethernet board was a problem, it had to be painstakingly copied to a 3.5" disk first.

I know this is supposed to be a family medium and all, but I can no longer delay the obscene parts. There was no way around using MS-DOS to install the SCSI driver. I had a DOS floppy to be able to read the SCSI driver CD, and let the setup program on the driver disk to install the driver on the DOS boot floppy. This involved copying two drivers (doscam.sys and cdrom.sys), called from an automatically installed file config.sys:

   DEVICE=C:\PROSCSI\MINICAM.SYS
   DEVICE=C:\PROSCSI\CDROM.SYS /D:PROCD01
I also had to copy a program mscdex.exe that I found on the Internet with an archie search, and install it in autoexec.bat. After a reboot, the CD-ROM appeared as drive C. I typed "C:" and "setup" to start the Linux installation.

The Linux distribution I installed is a Slackware derivative sold by S.u.S.E GmbH, a German Linux distributor (check out their web server). Their setup utility asks a few simple questions and then starts a miniroot kernel. From there their installation utility, YAST, can be started that handles formatting and partitioning the hard disk, and let me choose the Linux packages I wanted and installed them on the disk. I made a 40 MB swap partition sda2 followed by a single large root partition sda1. I installed a reasonably complete Linux that left about 200 MB available.

Then I rebooted and watched it crash with a kernel panic. It turned out that while the miniroot starter setup.exe can deal with my NCR 53c810 SCSI controller, the kernel installed by default cannot, and I wasn't given a choice. The NCR 53c810 is not compatible with the NCR 5380. This problem was solved by using my other computer to find another kernel on the CD, put it on a DOS floppy, mount the DOS floppy from the Linux miniroot, and installing the kernel on the harddisk. The new kernel must be registered by modifying /etc/lilo.conf on the harddisk and running lilo. Lilo is the Linux Loader.

Why the S.u.S.E distribution? Well, they have put my freeware utilities plan and xmbase-grok on their CDs, and contributors get the CDs for free. Noble. I was happy to use their CDs because independent reviews have always been excellent. I later bought their Motif CD, whose installation was painless.

Oh yes, I never touched that DOS boot floppy again.

Networking

At first, networking didn't work. Pings either way never got to the other system. It turned out that the ethernet board has a RAM area that appears at a certain location in the physical address space. The Linux driver was expecting a different physical address. The solution was to

  1. edit /usr/src/linux-1.2.13/drivers/net/CONFIG and change the WD_OPTS line to read WD_OPTS = -DWD_SHMEM=0xD0000
  2. run make clean, make dep, and make in /usr/src/linux-1.2.13 (this took 20 minutes)
  3. copy the new kernel to /, under a different name
  4. edit /etc/lilo.conf and add another image/root/label triple. Do not change the boot line to sda1.
  5. run /sbin/lilo

After that, networking was no problem. The usual files had to be configured (/etc/hosts, /etc/networks, /etc/exports) on both systems. On the Indigo I started up the daemons, on the Linux box I simply rebooted because it was easier than understanding those rc scripts. After that I could mount disks both ways, start telnet and ftp sessions, and even put X windows on the other system's screen. No problem. The first operation after that was backing up everything on DAT over NFS.

ISDN routing

There are two major ISDN packages available, isdn4linux and Urlichs ISDN. I installed the isdn4linux package, available from ftp.franken.de, because it seemed much more elegant and easier to install. I am using version 0.7.1 with Linux 1.2.13 and a Teles 16.3 board. Many people recommend avoiding the 16.3 version and using 16.0 instead, but Teles doesn't make them anymore and I am sure the development focus will shift to 16.3, and 16.0 will be obsolete eventually.

For someone who is using Linux actively, a better choice would be isdn4linux 0.7.3 and a 1.3 Linux kernel. Beginning with Linux 1.3.80 or so, isdn4linux is part of the kernel itself; earlier versions use a pair of loadable kernel modules (one for ISDN and one for the Teles board). I think if it isn't broken, don't fix it. I am reading the isdn4linux mailing list (subscribe at isdn4linux-request@hub-wue.franken.de), and I got the impression it isn't quite stable enough for me at this time (15/4/96).

To install isdn4linux, I needed to apply the 16.3 patch and compile isdn4linux. There is virtually nothing to configure; in teles/config.c a single line must be modified. Details are available in the README. I use a simple script /etc/rc.d/rc.isdn, called from /etc/rc.d/rc.local:

    #!/bin/sh
    if [ ${1:-start} = start ]; then
	echo -n "Starting ISDN... "
	/sbin/insmod /usr/src/isdn/isdn4linux-0.7/isdn/isdn.o
	/sbin/insmod /usr/src/isdn/isdn4linux-0.7/teles/teles.o\
						id=teles1 io=0xd0000,15,0xd80
	/sbin/telesctrl teles1 1 4
	/sbin/isdnlog -s -m29 /dev/isdnctrl0 >> /var/adm/isdn.log2 2>&1 &

	echo -n " IP..."
	/sbin/isdnctrl addif isdn0
	/sbin/isdnctrl eaz isdn0 MY_PHONE_NUMBER
	/sbin/isdnctrl addphone isdn0 out REMOTE_PHONE_NUMBER
	/sbin/isdnctrl huptimeout isdn0 220
	/sbin/isdnctrl l2_prot isdn0 hdlc
	/sbin/isdnctrl l3_prot isdn0 trans

	/sbin/ifconfig isdn0 -broadcast -multicast -arp MY_IP \
					pointopoint REMOTE_IP metric 2 up
	/sbin/route add default isdn0
	echo "Done."
    else
	echo -n "Stopping ISDN... "
	/sbin/ifconfig isdn0 down
	/usr/bin/sleep 3
	/sbin/route del default
	/bin/killall isdnlog
	/bin/killall isdnmon
	/sbin/isdnctrl hangup isdn0
	/sbin/isdnctrl delif isdn0
	/sbin/rmmod teles
	/sbin/rmmod isdn
	echo "Done."
    fi
The script can be called with either start or stop as its argument, and installs or removes the ISDN modules. Note that later versions may need a different io argument for the second insmod; also note that the Teles documentation is incorrect: the IO address is not 0x180 but 0xd80. The script also starts the ISDN logging tool isdnlog that is part of the isdn4linux distribution. All-caps strings stand for local and remote phone numbers and IP addresses. I talk to my ISP (Internet Service Provider) using the raw HDLC protocol; X75 and PPP support is also available. The -broadcast -multicast -arp options prevent unwanted ISDN dialups; since the ISDN board has no lamps and makes no noise it is easy to go broke over a kernel that has made phone calls every minute for weeks! Frankly I still don't quite trust it and use rc.isdn stop whenever I am not using ISDN.

Finally, I added the remote IP address to /etc/hosts. That was all, it works perfectly. Then again I really have the simplest possible configuration: no incoming calls, no callbacks, and no PPP.

I found that using the isdnmon utility is a bad idea. It is based on Tcl/Tk, and the latter appears to have a memory leak that uses up all available memory and eventually freezes the machine if isdnmon is left running for extended periods of time. A pity really because it's a nifty little monitoring tool.

Conclusion

All in all, this was easier than expected. Total time spent was about two full days. Since I have only a minimum of boards in the system, I was spared the hassles with duplicate I/O address mappings, DMA channels, and IRQ vectors; the ethernet driver patch was the most difficult problem. I continue to be amazed at the incredibly poor hardware and software design of PCs that forces manufacturers to offer an intractable maze of incompatible patchwork solutions. I have to congratulate Linux for hiding this mess rather well. Everything would be so much easier if the first PC had been designed by competent engineers, and if IBM had managed to pick something other than the second most misdesigned CPU on the planet. Well, I guess that's asking too much from IBM.

Linux itself is rather pleasant to use. This is not a flaky hacker's system. It is obvious that there is no coherent marketing force behind it, but this is more an advantage than a problem - while certain shortcomings exist that commercial versions have solved years ago, such as locating the kernel to boot in the root filesystem, Linux usually works the way you expect and would want it to behave, perhaps not quite as polished as commercial Unices but always functional.

Well, compared to my Silicon Graphics Indigo the Linux PC makes me feel claustrophobic, but given the fact that low-end SGI machines cost about five times as much, and midrange systems (like mine was when I bought it) about 20 times as much, a certain difference in sophistication is to be expected. If I didn't have an Indigo, I'd work on a Linux system instead. As it is, I use the Linux box for routing and software porting only.

Using the ISDN link is a pleasure. Dialing takes a fraction of a second, and transfer rates often exceed 7 KB/s. I am also lucky that my ISP here in Berlin, IN-Berlin, has excellent connections and I have never found it busy since I subscribed. I certainly don't want to go back to those slow modems making silly noises and taking forever to connect.

Recommended!


(*) Back to my home page
(*) Tell me if you found this information interesting or useful, or if you have comments.
The URL of this page is http://www.bitrot.de/linux.html. See the copyright notice.