LINUX GAZETTE

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]

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


Making a Simple Linux Network Including Windows 9x

By Juraj Sipos


I decided to write this article because often, when I read some howtos or general help texts, I find it difficult to navigate myself in the sea of information due to the fact that I often need only a little to know. Instead, I'm compelled to read hundreds of pages of texts to find an answer.

I will give you an example. This article will help you make a simple network between two computers, but I haven't been able to mail between the two machines. The sendmail configuration is very complicated and before I find a solution, I have to read many pages of texts. But I actually need only few words, something like: "Put this in sendmail configuration file and you're done". I do not want to say that I will not be able to solve this, but time is money and I often have to do other things for living. People like me like examples that can be applied without problems. So I also give such examples in my article. I will not tell you to put 20.0.0.0 in your /etc/hosts, as some authors write about configuring a home network, because this is not a private network IP number. I will give you the numbers and expressions I have and use with assurance that it works with me. Please do not email me with questions like "my Linux doesn't see a parallel port", "I cannot connect to another machine from second parallel port..." or questions that are answered in this article, but mail me with how to configure a sendmail!

This article also expects some work and study to be done on your part assuming you will not use some prehistoric kernels or hardware.

I would like to comment the following "Help Wanted" question from Linux Gazette, August 2000.

Hi there, My name Sergey, I use Slackware 7.0. I have read a document about serial connection between Win95 and Linux, but never have seen about parallel. Help me, tell me how can I use my parallel NULL modem. Is lp0 the LPT1 port? Thanks, Sergey

I successfully connected my two computers with PLIP Install HOWTO (which is very well written), but I found some problems that I had to solve using my own creativity. Furthermore, the part of "kernel reconfiguration" in the PLIP HOWTO may be misleading for newbies, because reconfiguration is not necessary. So here I will give you some more detailed info on connecting two Linux machines with PLIP or network-card interfaces, and I will also mention connecting a Windows machine with Linux box.

I use RedHat 6.0 because it looks to be the most stable Linux on my computer configuration. I have quite a difficult configuration, I use FreeBSD, Linux, DOS-Windows, Zip Drive, and other things that are quite complicated (for example, my C Drive is totally encrypted, so I boot with a password and then a boot manager is started). I have 8 OS's on two hardisks including OS/2 and BEOS and loop boot disk files (Linux booting from a large file). I tested network (PLIP and NE2000 Network Cards and compatibles) connection on RedHat 6.0, 6.1, 6.2 and SuSE 6.4.

PLIP

If you have the above-mentioned systems, you don't have to compile a kernel to use PLIP. This may also work for Mandrake, but I haven't tested it. Linux generic kernel is sufficient (the one you have after Linux is installed). To make a PLIP connection, do the following:

  1. get a laplink parallel cable
  2. install Linux on both machines (I hope you have two machines:) with appropriate network services (inet, etc.)
  3. open /etc/hosts with your favorite text editor on both computers and put the following lines there:
    127.0.0.1               localhost localhost.localdomain
    10.0.0.1                one
    10.0.0.2                two
    
    10.0.0.0 is a private network IP address that will not interfere with your Internet connection.
  4. Go to BIOS setup of the second computer and change "Halt on all Errors" to "halt on all Errors except Keyboard".
  5. edit /etc/rc.d/rc.local on the second computer and put there this somewhere at the end:
    modprobe plip
    ifconfig plip0 two pointopoint one up
    

(Linux will automatically assign plip0 service to lp0 or LPT1, so you never have to use lp0 in plip connection configuration. But if you want to use a printer, issue "ifconfig plip0 down", then remove the plip module from kernel with rmmod command. Don't mail me with questions about printer problems.)

Thus, the second computer will start automatically, without keyboard, with plip interface. Restart it to see if it boots. You do not worry about looking in it, you will be able to telnet, ftp or ssh to it from another computer. But you can attach a keyboard to it. The important thing is that it will be able to boot with Linux. Here is a problem where the PLIP HOWTO did not help me: The command "modprobe plip" did not work and the system gave me something like "unresolved symbols" "...device busy". I realized that the problem was in Linux's inability to assign IRQ number to my PLIP interface. I solved the issue with the following command:

echo 7 > /proc/parport/0/irq

This command will put the IRQ number to kernel processes directory (/proc) and plip will be working. But first you must run the "modprobe plip" command anyway because it will make a parport directory in the /proc directory. Now change the IRQ number to 7 in /proc/parport/0/irq. Then run the "modprobe plip" command again. The second running of the modprobe command will install plip. This also worked on my SuSE system. So if you receive, on the second computer, an error like "unresolved symbols...", "the device busy", put this command in your /etc/rc.d/rc.local:

modprobe plip
echo 7 > /proc/parport/0/irq
ifconfig plip0 two pointopoint one up
Obviously, the same command must be also issued on the first computer, but you will have to change the order of "ifconfig plip0 two pointopoint one up" to "ifconfig plip0 one pointopoint two up", so on the first computer you will issue:
modprobe plip
echo 7 > /proc/parport/0/irq
ifconfig plip0 one pointopoint two up
You can run this manually; you can put it in rc.local, or make a script for these commands (for use on your computer ONE). Now you should be able to telnet, ssh, ping, ftp or lynx, if Apache server is running, to the second machine and telnet back from the second machine to the first machine. But first check you have working network daemons running. Then try "telnet two" or "telnet 10.0.0.2".

NOTE: Because telnet does not allow you to login as root, create another user without root privileges on both systems.

Connecting Windows machine and Linux box

PLIP

There is a plip driver for DOS/Windows: ftp://ftp.crynwr.com/drivers/plip.zip. The problem with this driver is that it does not work with Windows 9x (it supposed to work with DOS), but you may give it a try. This issue remains open for a software development and I was not successful to make a link between Linux and Windows machines via a parallel cable.

If you have a computer with Windows 9x you do not want to tamper with, try a Linux emulator like Bochs - to install Linux under Windows (ftp.bochs.com, www.bochs.com), or make a loop boot file. A howto for making a file with booting abilities is included in Linux Howto Documentation with "Loopback-Root-FS" title. It is an excellent article. Then you will do just the same I described here to your loop file.

Network Cards

I would suggest using a thinnet because it is the cheapest network in the price of a good and long parallel cable. This network is officially called 10Base 2. You need a coaxial cable with BNC connectors, tees and terminators. Tees look something like T where the bottom of the tee is put to NIC (Network Card Interface), and the ends opposite each other are used for connecting to computers and terminators.

 here you will              > ------|------  <        here you will
 put a coaxial cable                |              put a terminator
 going to another computer          |
                                    |
The bottom of the TEE will be connected to NIC in your computer.

If you have two computers, you have to use a terminator to put it in the tee on both computers (one end of the tee is already in the NIC, one end of the upper part of the tee is used for connection to other computer, another end of the upper part of the tee is used for connection to other computer, too, or for connection to a terminator). If you have 5 computers in this order "1comp 2comp 3comp 4comp 5comp", the 1comp and 5comp must have terminators in their tees, but 2comp, 3comp and 4comp will have coaxial cables in both sides of their tees. Your network will not work without terminators.

Generally, there are three types of widely used networks:

10Base 5  - it is a little bit old
10Base 2  - the one I write about here, the coaxial cable may be 185
meters long;
            you may have a network with 30 computers per one segment
10Base 10 - requires a hub and may be expensive for you.

I would suggest buying NE2000 cards (10Mbit) or compatibles. I have had not problems with them so far. You may buy each for less than 10 dollars. Do the same as I already said - put your network information in /etc/hosts file:

127.0.0.1               localhost localhost.localdomain
10.0.0.1                one
10.0.0.2                two
Make sure the NIC's are well seated in their slots. Run a diagnostic program (rset8029.exe in my case). Change configuration from 10Base 10 (which is default) to 10Base 2 on both network cards. Restart. Put this command in computer one:
modprobe ne2k-pci
ifconfig eth0 one
Put this command in computer two:
modprobe ne2k-pci
ifconfig eth0 two
Now you should see something like this on both computers:
eth0    Link encap:Ethernet  HWaddr 52:54:AB:1F:7A:51
          inet addr:10.0.0.1  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          Interrupt:11 Base address:0xe800
I read some network howtos that recommended using the "route add" command, but it appeared irrelevant using it here.
[2.2 kernels don't need "route add". 2.0 kernels do. 2.2 kernels automatically add the standard route; i.e., the route necessary for this IP to connect to its local network. -Ed.]

This network with two computers works just fine. Now you may telnet, ssh, ping, ftp to the second machine and vice versa. If you want to use NFS, read the NFS Howto. Or simply read my instructions: install nfs daemon. Edit /etc/exports file or create it if it is not there. Put the following line there:

/ two (rw)
Run rpcinfo -p to check if it works. You should see something like:
program vers proto   port
  100000    2   tcp   110   rpcbind
  100000    2   udp   111   rpcbind
  100024    1   udp   903   status
  100024    1   tcp   905   status
  100011    1   udp   914   rquotad
  100011    2   udp   914   rquotad
  100005    1   udp   924   mountd
  100005    1   tcp   926   mountd
  100005    2   udp   929   mountd
  100005    2   tcp   931   mountd
  100005    3   udp   934   mountd
  100005    3   tcp   936   mountd
  100003    2   udp   2049  nfs
If you do not see mountd or nfs, you badly installed the nfs package (install the package knfsd* and netkit-base-*, which contains inetd). Every change to /etc/exports file must be followed by "exportfs -av" command. Run it and then simply run: mount -t nfs two:/ /mnt -o rsize=8192,wsize=8192,nolock and you should have a working NFS. Just peek in the /mnt directory. You should see your second machine there. If you have problems with write permissions, give permissions on your second computer to everybody (for one directory only; this must be done by telnet).

Communication between Linux and Windows

Linux and Windows (and other systems too) can communicate each other via network cards. Do the following: Windows will install your network card automatically, if not, open Control Panel, Add Hardware. Click to add hardware. I had problems with PCI Steering, where Windows assigned a different IRQ number to my NIC than BIOS, so my card didn't work, and Windows appeared as a total zero dollar crap where simple users would be completely lost. Check the IRQ number in the system icon in Control Panel. If it is different from the one BIOS assigned to your card, remove PCI steering. Here Linux is much more flexible. If Windows sees your network card, appropriate network drivers should be installed automatically. If installed, open Control Panel, Network, and edit TCP/IP > Realtek RTL8029 Ethernet Adapter and Compatibles (or other NIC, if you have one) in Properties. Click "Specify an IP Address" and change the IP on the IP Address Tab to 10.0.0.1, Subnet Mask should be 255.255.255.0. That's all. Restart computer. Windows contains C:\windows\lmhosts.sam and C:\windows\hosts.sam in its directory. Copy them or create new files in C:\windows - hosts, lmhosts. Put the following lines in both of them:

c:\windows\hosts
c:\windows\lmhosts
127.0.0.1               localhost localhost.localdomain
10.0.0.1                one
10.0.0.2                two
Now, if you telnet to Linux machine from the Windows machine, you can run Linux commands and programs - you will have Linux running in Windows. I had not time to test X Server, but most console commands work. If you have Apache Server running on Linux, you can http to Linux box from Netscape using this command:
http://two
If you have a user but not anonymous ftp access to your Linux box, you can ftp to Linux from Netscape by using this command: ftp://user:password@two (where "user" is a working user you added to your Linux box; it cannot be root).

The parallel cable, if too long, may be quite expensive. Cheap network cards I mentioned here may be only a little more expensive. And if bought as second-hand, they may be even cheaper than a long parallel laplink cable. So I would suggest using the network cards similar to mine to have a simple and working home network. Such connection is considerably faster than using parallel port cable.

If you're in a trouble, you may always look in Linux howtos like PLIP, NET, etc. If something doesn't work, consider testing your hardware under a different OS.

BTW, does anybody out there know how to configure sendmail to use mail in our home network?


Copyright © 2000, Juraj Sipos
Published in Issue 57 of Linux Gazette, September 2000

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]