Where Nothing Else Will Do LG #28

#### "Linux Gazette...making Linux just a little more fun!"

# Where Nothing Else Will Do

#### By Chris Gonnerman

### Introduction

Long, long ago I was hired for my first paying job, working on a Tandy 16B running XENIX. It had about a meg of RAM (if I remember right), a total of 30 Mb of hard drive (two 15 Mb SCSI-1 external drives), and it actually served three users at the same time!

Some years later I joined the Air Force, and because I knew Unix (and liked it), I was assigned to program and administer a pair of Unix-based Motorola computers. Wow! Four meg of RAM, 60 Mb of hard disk, and 32 serial ports each, running Unix System V Release 3. I thought I was in heaven! (Note, Windows 3.0 was just about to be released...)

Well, to make a long story short, several years later I have my own company, New Century Computers, selling and servicing Intel and compatible PC equipment. Most of these computers run Windows 95, and while I have always liked the interface, I have always missed Unix. The Motorola's I worked with were shut down every six months (whether they needed it or not) and cleaned and serviced. Crashes? Only in the early stages, when we were debugging the vendor's tape drivers.

I don't remember when I first heard of Linux, but after browsing the book section at WaldenBooks I bought "Linux SECRETS" by Naba Barkakati (printed by IDG Books). I installed Linux on a spare 486 and played around with it. Still, my customers want Windows, so I sell them Windows.

But sometimes, Linux is the only choice. Nothing else will do.

### Evil DOS Programs

One of my oldest customers is the Juvenile Office in Adair County, Missouri. When the chief Juvenile Officer called me one day and said he needed to run Lotus Notes on his network, I started sweating bullets.

A few years ago (before I started doing business with them), the JO purchased a custom written DOS program called "Juvenile Court Records." The programmer wrote it using the Clarion database manager, and he was not much of a programmer. They ran it on a LANtastic network.

This "evil DOS program" requires 615Kb of conventional memory. It actually only runs right in 620 or more Kb. They did this under DOS using a QEMM (the Quarterdeck Expanded Memory Manager) feature called VIDRAM. VIDRAM remaps the color text screen to the monochrome address range, and adds the color text memory region to the conventional memory pool, resulting in 784 Kb of total conventional RAM. After DOS boots and the LANtastic TSR's load, they still had 630 Kb or so.

Anyway, this program will not run under Windows 95. No way, no how. Windows 95 will never allow enough conventional RAM, and VIDRAM won't work there (blows up very nicely). I knew this, and so I began to sweat bullets. What Mike (the chief Juvenile Officer) expected to see was a Windows 95 window with JCR in it on the same screen as a Lotus Notes window.

Why is keeping JCR running so important? First, because all of their records regarding the disposition of juvenile cases for the last five or six years are in it. We can't get the Clarion source code; the programmer has evaporated. We could probably rewrite the program from scratch, but the State of Missouri (Office of State Courts Administrator, or OSCA) has stated that they will be providing a case-management program "in about two years." Spending to rewrite the program would cost more than keeping it running (at this point), and would be wasted money when OSCA delivers their solution. So, they are stuck with this boat-anchor program.

Enter Linux. I had been searching for an answer for most of a month when I remembered DOSEMU. I fired up XDOS on my Linux box and looked at the conventional RAM total.

627Kb free. Hallelujah!

We sold them a new file server, a Pentium 166 with 16 Mb RAM, running Debian Linux. I installed DOSEMU 0.66.7, straight from the CD, and then configured it with Windows 95 DOS. While OpenDOS is supposed to get an extra K free (628 Kb), since Windows 95 comes with a new system, I just used it. After SYSing the diskimage with Win95, I basically installed the minimum DOS commands needed to run the JCR program and work with the filesystem. I copied the EXITEMU command to the names LOGOUT and LOGOFF. I also set up "conventional" file sharing via Samba. Then the work began.

First, several DOS machines had to be upgraded to Windows 95, which of course required RAM for most, hard drives for some, and new mainboards for a few. To access the server from these Windows 95 machines, we elected to use NCD PC-Xware. Of all the commercial X Servers for Windows 95, it is the simplest (and cheapest) I have found. It makes "shortcut" icons for connections automatically after you go through the Connection Wizard, and it works well with XDM.

As an aside, telnet would have worked, but getting a usable color telnet is hard. The JCR program is written like many DOS programs, using a broad range of colors. XDOS over PC-Xware also makes all the function keys work.

Now, Mike (and the other JO employees) can see Lotus Notes and the JCR program at the same time, on the same system. No rebooting. The total price tag for PC-Xware was higher than the cost of the equipment, but the customer is happy.

### Unexpected ISP Problems

The Paris R-II School District (in Paris, Missouri; I'm not international yet) is another regular customer. In the High School, they have a well-stocked lab of Windows 95 computers with a Windows NT 3.51 server. MORENet, a state contractor, provides them Internet service at a subsidized rate, and the High School and Elementary are connected via fiberoptics. The whole Internet connection setup was a bargain (as these things go) since the school district received a lot of donated labor and discounted materials.

Unfortunately, the Junior High is across town. After looking into leasing a line between the two locations, and considering even radio frequency networking, the Superintendent hit upon a better idea. He approached several ISP's in neighboring towns (Paris had no ISP at that time) and offered them co-location on school district property. One of them, MCM Systems in Moberly, Missouri agreed: In return for unlimited free rent of a closet, the Junior High would receive unlimited free Internet access. MCM Systems installed a dial-up router in the closet of the Band Room and we ran Ethernet cable from there to the Computer Lab. MCM is providing Internet access in the Paris area for the cost of the leased line and equipment only, and they are happy (as far as I can tell).

So, I arrived one day to set up the Computer Lab. After installing all the net cards and connecting everything, I called MCM Systems to get the IP address range we were to use.

The tech I spoke to informed me that we had a range of ten IP addresses available. Oops. In the Junior High they already had about 25 computers to connect to the Internet. We had a problem.

This time it took me only a few minutes to decide on Linux. My mandate was to "make it work," and outside of the costs already bid the district didn't have a lot of money to spend to do it. I selected a computer in the Junior High lab with a Pentium 75 mainboard, transferred a larger (1.6 Gb) hard drive from another computer, and started installing Slackware Linux. I copied a full install set from the Internet to a DOS partition on the 1.6 Gb drive, created and booted from the boot/root set, and got to work setting everything up.

Naturally the whole purpose of this exercise was to use IP Masquerade, and this was my first time using this feature. I installed a second NE2000 compatible, set up a private network address (10.0.0.1) on the "inside" network adapter, and the first assigned Internet address on the "outside" adapter. So far, so good. I tested the installation from a Windows 95 computer using 10.0.0.2 (assigned through the network control panel), and it worked great!

The problem started when I installed ISC (Internet Software Consortium) dhcpd and tried to set it up. It configured and compiled fine, and I set the broadcast route as described in the README, but when I tried to start it I got an error message:

`The standard socket API can only support hosts with a single network interface. If you must run dhcpd on a host with multiple interfaces, you must compile in BPF or NIT support. If neither option is supported on your system, please let us know.`

I did some research, and learned that in this version of dhcpd, any system lacking Berkley Packet Filter and Network Interface Tap technology (such as Linux) can't run dhcpd with more than one network interface (PPP and SLIP excepted). I examined the program closely, and hacked it to hard-code the interface name I wanted to support. After all, I didn't want to support both interfaces; the outside interface doesn't need DHCP.

Later, in the privacy of my office, I tore apart another copy of dhcpd. Instead of hard-coding the interface name, I added a command to the dhcpd.conf file. I also refined the lease-time format. Here is a sample:

dhcpd.conf
`server-identifier 10.0.0.10; interface "eth0"; subnet 10.0.0.0 netmask 255.0.0.0 { option domain-name "paris.mcmsys.com"; default-lease-time 3 days 12 hours; max-lease-time 7 days; option subnet-mask 255.0.0.0; range 10.0.1.20 10.0.1.250; }`

Previously, the *-lease-time commands used a single number, as seconds, as in:

`default-lease-time 302400;`

I think my way is more readable.

Later still I took this code to the school and implemented it. It worked fine, so I called the installation done. For the cost of labor and one extra net card, we converted a workstation into a capable server and solved an Internet connection problem.

We are running Apache on that system now, not so much for web services as for its web proxy. Twenty-five students on a single 56Kbps line is kind of slow, but with the proxy the performance is acceptable. It is also used as a file server via Samba.

I submitted my dhcpd patches to ISC, and received an email back from Ted Lemon telling me that my patch doesn't do what I think it does. Hmm. So I studied his explanation and concluded that my patch is not a good all-around solution. However, the BPF/NIT problem with Linux has apparently been fixed somewhere along the line, and ISC's version 2.0 dhcpd (now in final beta) handles it. I highly recommend ISC's dhcpd; it seems solid (even the pre-1.0.0 beta I originally used).

I have also uploaded my patches to Sunsite, as dhcpdpatch-1.0.0.tar.gz, in case someone would like to try the *-lease-time feature.

### When Linux is the Best Choice

I love Linux. I am addicted to the features, the power, and the configurability. I especially like that I can work directly with the source for almost any program, fixing bugs and adding features as I need or want to.

The power of Linux is flexibility, stability, and economy... the ability to run a real OS on older or inexpensive hardware.

For my average customer (home users and small businesses with a single computer), Linux is not presently the best choice. These users don't have the depth of understanding to work with Linux as we do. (Frankly, few of them have any real understanding of Windows 95 either). The average user expects to be able to purchase anything off the shelf at Wal-Mart and have it work for them. Someday, maybe, Linux will be a good choice for these users, if we (the entire Linux community) keep supporting and improving it.

##### Copyright © 1998, Chris Gonnerman
Published in Issue 28 of Linux Gazette, May 1998