A Heterogeneous Linux/Windows 95 Home Network

by Chirakkal Easwaran

With more than one computer common in many households, the need to network all machines and provide Internet access is important. Linux offers a stable network environment that can enable different operating systems (UNIX, Windows and Macintosh) to work together, and is quite easy to set up and administer. Such networks facilitate convenient file and print sharing and centralized backups. I will describe my home network configuration (see Figure 1) which is a mixture of Linux and Windows systems.

Figure 1. Network Configuration

I will assume you have basic knowledge of Linux installation and administration, and that PPP is set up on your Linux box. I will explain in detail how to network the Windows 95 machine named “ancho” with the Linux server named “serrano”. Adding other machines to the network is essentially a repetition of this process. I will also briefly discuss setting up the Linux client and NFS.

The Linux machine serrano is the file and print server for the Windows 95 and Linux clients, and connects to the outside world through a PPP dial-up connection. It also acts as a firewall; all other machines can reach the outside world through it. The CD-ROM drive on serrano is also available to the other machines on the network.

Hardware

My hardware consists of 486 DX2/66 machines with 32MB RAM, and a Pentium 100 notebook which is used both on and off the network. I use NE2000 network cards (Realtek PnP, about $15) and coaxial 10Base-2 cables. If you have PCI boards (and I certainly hope you do), setup is easier, but the networking particulars still apply.

The Linux kernel probes address 0x300 for NE2000 cards, so the jumpers on the card are set for this I/O address on the Linux machine. On the Windows 95 machines, the network card jumpers are set for Plug-and-Play mode. When you network the machines with coaxial cables, make sure you use 50-ohm terminators (about $3 at Radio Shack) at the ends.

Software Installation and Configuration

I installed Red Hat Linux 5.2 off a CD. Installing everything took about 500MB of disk space. I have used Linux for a while now, so this part was painless. I was able to get X working nicely, PPP configured and a printer set up.

If you have a machine with a CD-ROM drive, Windows 95 installation should also be easy. I had to install Windows 95 from a parallel port CD-ROM drive. That was tricky, and took several tries.

The first goal in the networking effort is to establish communication between the Linux machine serrano and the Win95 machine ancho.

All the network configurations on serrano can be done from the Red Hat control panel (Network Configurator). Read the Net-3.HOWTO for more information on Linux networking. Basically, you need to have the eth0 interface with IP 192.168.1.1 (or something like that) attached to it. To do this manually, execute the following command as root:

/sbin/ifconfig eth0 192.168.1.1 netmask\
255.255.255.0 up

The IP addresses chosen correspond to class C addresses. Typically, these are used for intranet networks. I had to explicitly put in a route:

route add -net 192.168.1.0 eth0
This routing command says all packets to the 192.168.1.0 network should be sent to the eth0 interface. This line is appended to the /etc/rc.local file, so that the route is set up at boot time.

On serrano, set up the host table /etc/hosts in a manner similar to this:

192.168.1.1     serrano    loghost
192.168.1.3     jalapeno   #Linux machine
192.168.1.100   piquin     #Linux/Windows
192.168.1.2     ancho      #Windows machine
127.0.0.1       localhost

To confirm that the eth0 interface is working, type /sbin/ifconfig eth0. The output from this command will look like Listing 1. If you then type more /proc/net/dev, the output will look like Listing 2. If PPP is up, you will see an additional line for the ppp0 interface. This should take care of serrano.

Listing 1

Listing 2

Now we proceed to the network configuration of ancho, the Windows 95 machine. You should have Windows 95 installed, the network card detected and drivers installed. At the time of network card installation, you will be asked for a machine name and a workgroup name. Give the machine name “ANCHO”, workgroup “WORKGROUP” and some optional comment like “My Compaq 486 machine”.

Go to the Control Panel and select “Networking”. Under “The following network components are installed”, you should see your network card (mine says “Realtek RTL8019 PnP LAN Adaptor or compatible”). You may see NetBEUI and IPX/SPX and TCP/IP in the same window. If you do not see TCP/IP, choose “Add”, then “Protocol”, click on “Add”, choose “Microsoft”, then choose “TCP/IP” and click “OK”. This should add TCP/IP to the installed components window. Once TCP/IP is added, if you highlight it, you will be able to choose “Properties”. When you click “Properties”, you will see a dialog containing several tabs. Pick these tabs, and assign the following:

IP Address

  IP Address: 192.168.1.2
  Subnet Mask: 255.255.255.0
Gateway (
  192.168.1.1
DNS Configuration
  Enable DNS
  Host name: ancho
  DNS Server search order: 192.168.1.1
WINS Configuration
  Leave it Disabled.

You may leave the DNS disabled, or add your ISP's DNS server IP address. The important items here are your gateway and IP address. After you specify these and click “OK”, the machine will reboot.

After reboot, open a DOS window and type ping 192.168.1.1. After a short pause, you should get a response like “Reply from 192.168.1.1: bytes=32 time=4ms TTL=64”, repeated four times. If this fails, your network setup was not successful.

Now go to serrano and type ping -c2 ancho. If it can find ancho, you should get these two messages:

64 bytes from 192.168.1.3: icmp_seq=0 ttl=32 time=3.9 ms
64 bytes from 192.168.1.3: icmp_seq=1 ttl=32 time=2.3 ms

The -c2 argument to ping sends two packets. Without it, ping will have to be terminated with CTRL-C.

If this works, congratulations—the Linux machine and the Windows 95 machine can find each other.

Samba Setup

To enable file and print sharing between Linux and Windows 95 machines, you need the Samba suite, which is installed as part of the Red Hat installation.

I wanted to use serrano as a file server so I can install all my Windows 95 software on serrano. Under my home directory on serrano, I created a directory called samba, which will be used to install all my Windows 95 software. I will make this directory (/home/easwaran/samba) visible from ancho as its D: drive. In addition I have a DeskJet 540 printer, attached to serrano, that I want to use to print from ancho. I also want to access the CD-ROM drive on serrano from ancho. My CD-ROM mount point on serrano is /mnt/cdrom, and I would like ancho to see this as the E: drive.

Samba is configured via the file /etc/smb.conf. Read the Samba documentation available at http://www.samba.org/ for more details. My smb.conf file is shown in Listing 3. Samba gives many other options: the original /etc/smb.conf file has many good examples. Also check the Samba documentation (/usr/doc/HOWTO/SMB-HOWTO or http://www.samba.org/).

Listing 3

Mounting Directories from the Linux Machine

Using the smb.conf file, I have made my serrano home directory (/home/easwaran) and the /tmp directory on serrano visible to the Windows 95 machine. The names in square brackets, [easdir] and [cdrom], are the names under which /home/easwaran/samba and /mnt/cdrom will be available to ancho and seen under “Network Neighborhood”. The line

log file = /var/log/samba-log.%m

toward the beginning of smb.conf file directs Samba to log in to /var/log/samba-log.serrano. In case of trouble, this will be quite useful.

Once you have modified /etc/smb.conf, stop and restart Samba:

/etc/rc.d/init.d/smb stop
/etc/rc.d/init.d/smb start

In the following instructions, I assume your Windows 95 logon password is the same as your login password for serrano. If they are not the same, you will get a password prompt when you try to mount a directory from serrano on ancho. I make the passwords the same to avoid the hassle, but this may not be a good idea in other situations.

At this point, if you click on “Network Neighborhood” on the Windows 95 machine ancho, you should see serrano listed. Double-click on serrano, and you should see the directories cdrom, easdir, tmp, easwaran, lp and others you may have shared. Open a DOS window and type

net use d: \\serrano\easdir

You should then see “command completed successfully”, which means that /home/easwaran/samba is available to you on ancho as your D: drive. You can install software and do whatever you want in this directory.

The command

net use e: \\serrano\cdrom

will mount the CD-ROM on serrano as your E: drive on ancho. Make sure your CD is mounted on serrano as /mnt/cdrom—you may have to do this manually. When I installed Red Hat 5.0, initially only root had mount permission for the CD-ROM drive, so that had to be changed.

To have these drives automatically mounted each time you boot your Windows 95 machine, you can put the net use commands in your Startup folder. To do this, look for Windows 95 help under Startup. Alternatively, you could open the “Network Neighborhood”, select the machine and the directory and click the right mouse button. This will give you an option to “Map Network Drive”. Here, you can specify the drive letter for that directory to be mounted under, and whether this drive is to be mapped at logon time.

Printer Setup

Installing the printer correctly on the Linux machine is easy to do from the Red Hat control panel. We need to make this printer the default printer for ancho. Go to ancho's Control Panel, click “Printers”, then “Add Printer”. Choose “Remote Printer, Browse”. At this point, you should see your printer on serrano listed as lp. Select it, click “OK” and follow the instructions. You will have to load the driver for your printer. (Check the Windows 95 CD or the printer manufacturer's disks or find it on the Web.) Print a test page, and make this your default printer.

Sharing Windows 95 Directories

The next task is to make the C: drive on ancho visible to serrano and other machines on the network. Click on “Network” in the Control Panel and make sure you have “Client for Microsoft Networks” installed (if not, install it). Under “File and Print Sharing”, click on “want to be able to give others access to my files” and “OK”. This may install some more files from the Windows 95 CD. If you now go to “My Computer”, click on “C:” and pull down “Properties”, you should see “Sharing” in the menu; click on it. Then click on “Shared as” and give a share name, “C-Ancho” with Access Type: Full. Type in an access password; I use the same one as my Windows login password. Click “OK”. Now your C: drive on ancho is available to any machine on the network under the name C-Ancho. The icon for the C: drive under “My Computer” will have a blue hand holding the drive.

There is an FTP-like interface that allows you to mount the C: drive from ancho on serrano. If you type smbclient -L ancho on serrano, you should get a listing of shared resources on ancho similar to the one shown in Listing 4.

Listing 4

If you type smbclient \\ancho\C-ANCHO on serrano, you will be prompted for the password (the one you gave ancho to share its C: drive) and you will get an smb> prompt. If you type ls, you will see the files and directories on ancho's C: drive. Read the SMB-HOWTO documentation in /usr/doc/HOWTO for more information.

IP Masquerade Installation—Reaching the Outside World

I have a PPP account at my school that assigns an IP address each time I connect through the ppp0 device, which is my default gateway.

To enable machines behind the firewall to communicate with the outside world, you can install IP masquerade. This requires support for the firewall to be built into the kernel. Detailed instructions on how to recompile your kernel with IP firewall support is in the IP-masquerade HOWTO (www.linuxdoc.org/HOWTO/IP-Masquerade-HOWTO.html), available at the LDP (Linux Documentation Project) site. The Red Hat's 5.0 kernel has this support already compiled in. You need to enable IP forwarding on the firewall machine serrano. On Red Hat, this is done by setting FORWARD_IPV4=yes in the /etc/sysconfig/network file and restarting network services. Then execute

ipfwadm -F -p deny
ipfwadm -F -a m -S 192.168.1.0/24 -D 0.0.0.0/0

as root, or place these commands in your /etc/rc.d/rc.local file for automatic execution. For explanation of the commands, read the IP-Masquerade-HOWTO.

You can play with the ipfwadm command to selectively grant access to the machines on your network to the outside world. Once this is done, you can open a DOS window on your Windows 95 machine and ping a machine on the Internet. If this works, you can access any machine on the Internet from any machine on your network. To the outside machines, all of the TCP/IP packets will appear to come from your firewall machine.

Configuring the Linux Client

The Linux client (piquin, 192.168.1.100) should be set up with the server 192.168.1.1 as its default gateway. This is done with the route command

route add -net default gw 192.168.1.1

File sharing between two Linux machines is done easily with NFS. The NFS dæmon, nfsd, is usually started at boot time. We would like to make directories on serrano available to other Linux clients via NFS. To do this, specify the directories to be exported in the /etc/exports file. I have the following /etc/exports files on serrano:

/home           jalapeno(rw) piquin(rw)
/home/easwaran  jalapeno(rw) piquin(rw)
/mnt/cdrom      jalapeno(rw) piquin(rw)
This allows the /home, /home/easwaran and /mnt/cdrom to be exported to jalapeno and piquin, with read and write permission. Reboot the machine after you modify this file, or use these two commands:
kill -HUP rpc.nfsd
kill -HUP rpc.mounted
On the Linux client, piquin, one needs to edit the /etc/fstab file to enable mounting of remote directories. On piquin, the /etc/fstab file has this entry:
serrano:/home/easwaran /home/easwaran/serrano\
nfs defaults,rw,user,noauto 1 1
This command allows any user to mount /home/easwaran from serrano on piquin as the directory /home/easwaran/serrano. If auto is used instead of noauto, this remote directory would be automatically mounted at boot time. To mount this NFS directory manually, type mount /home/easwaran/serrano. In this case, because the directory mount point is easwaran's home, easwaran can use the mounted directory as can anyone with permissions to easwaran's subdirectory, serrano. easwaran has read and write permissions on /home/easwaran/serrano.
Linux Remote Printing

To enable the client Linux machine piquin to print on serrano, we need to configure the lp print dæmon lpd. See the Printing-HOWTO (/usr/doc/HOWTO/Printing-HOWTO.gz or visit LDP) for additional documentation and alternatives to lp. On serrano, create an /etc/hosts.lpd file listing the machines allowed to print on it. I added piquin to this file.

Printing with lpd is controlled via the /etc/printcap file. On serrano, the file looks like this:

# /etc/printcap file
lp|dj:\
        :sd=/var/spool/lpd/lp:\
        :mx#0:\
        :sh:\
        :lp=/dev/lp1:\
        :if=/var/spool/lpd/lp/filter:

lp and dj are names for the printer; sd is the spool directory; the mx line means there is no maximum size for files printed; sh suppresses headers; lp is the actual line printer device; and if is a magic filter shell script that deals with staircase effects when printing text files and other special processing that files need. On Red Hat Linux, the control panel has a print configuration tool that allows easy configuration of printers.

On piquin, the /etc/printcap file should look like this:

lp|dj:\
      :sd=/var/spool/lpd/dj:\
      :rm=serrano:\
      :rp=lp:\
      :lp=/dev/null:\
      :sh:

rm defines a remote machine; rp defines the name of the remote printer; and sd is the local spool directory. Make sure the spool directory exists. After making changes to the /etc/printcap file, restart the lpd dæmon or reboot. Now, if you print on piquin, it should appear on the printer attached to serrano.

Backing Up Windows Files on a Linux Box

Listing 5

My Linux server serrano has a tape drive, so I back up all files on my network to tape. To back up the files on the Windows 95 machine ancho, I first use Samba and a Perl script in which I specify a file called MANIFEST-SMB that contains all directories and files on ancho to be backed up. Then I use the Perl script shown in Listing 5. In that script, ****** is my Samba password to connect to C-Ancho. The manifest file can contain blank lines and comments—the first line in the while loop deals with this. It backs up files on ancho specified in MANIFEST-SMB into my Linux machine's /tmp directory. Then I run another script to back up to tape.

This network has provided me with a stable and efficient home work environment for more than a year.

email: easwaran@mcs.newpaltz.edu

Dr. Chirakkal Easwaran (easwaran@mcs.newpaltz.edu) is a professor of computer science at the State University of New York at New Paltz. He has worked with Linux since 1994. His research interests are in TCP/IP networks and scientific computation. He thanks the National Science Foundation for a grant that made a Linux laboratory possible at New Paltz.

Load Disqus comments