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


Direct Cable Connection between Win95 and Linux

By


Abstract
A serial connection at 115200 baud can be set up between Win95 and Linux. The transfer rate is about 10k/sec which approaches the speed achieved with a PLIP connection.

Copyright 1999 Thomas P. Smyth
You may copy this document as is without any alterations.

Disclaimer
Use this information at your own risk. The author will not be liable for any damages that occur as a result of using this document.
 


1. Introduction

This document details how I set up a direct serial cable PPP connection between a Windows 95 PC and a Linux machine. Essentially, the trick is to make the Linux machine emulate a modem to the Windows 95 PC. This allows the standard Windows 95 Dial-up networking tools to be used to make the connection. I achieved transfer rates of 10k/sec on ftp transfers.

2. Serial Cable

You need a null modem cable which has DSR linked to DCD at each connector. I used a cable connected as follows:-
Txd Rxd
Rxd Txd
RTS CTS
CTS RTS
GND GND
DTR DSR & DCD
DSR & DCD DTR

See the Serial-HOWTO Chapter 8 for more information.

3. Linux Serial Port Configuration

On the Linux machine (I am using Redhat 5.2 on a Pentium 200MMX) set up a terminal connection to your serial port. In /etc/inittab put

S1:2345:respawn:/sbin/getty ttyS1 DT115200 ansi

and in /etc/gettydefs put

# 115200 fixed baud Dumb Terminal entry
DT115200# B115200 CS8 CLOCAL CRTSCTS # B115200 SANE -ISTRIP CLOCAL CRTSCTS #@S login: #DT115200

This is a copy of the 38400 entry with all 38400’s changed to 115200.

Run telinit q to reread /etc/inittab.

Using a terminal program (ie. Hyperterminal) you should be able to login to the Linux machine over the serial cable. Remember to set the communication parameters to 8N1 and 115200 baud with ansi emulation.

See the Serial-HOWTO Chapter 8 for more information.

4. Linux PPP Configuration

Create a user ppp95 on the Linux machine, make the shell pppd by editing the /etc/passwd entry as follows:-

ppp95:  ........ your password, etc ...........  :/home/ppp95:/usr/sbin/pppd

In /home/ppp95 put a file named .ppprc with contents:-

connect '/usr/sbin/chat -v ATH OK AT OK ATE0V1 OK ATX3 OK ATDT CONNECT'
-detach
modem
crtscts
lock
:192.168.100.4

The IP number is the address to use for the Win95 computer. The chat script mimics a modem so that Win95 can start the PPP connection. See the file /usr/doc/ppp-2.3.5/README.linux for information on setting up Linux PPP. It is important to setuid the pppd daemon (chmod u+s /usr/sbin/pppd).

5. Windows 95 Configuration

On the Windows 95 computer (using version 4.00.950 B) create a new Dial-up networking connection. Put the following settings into it:-
 
Telephone Number  1
Connect Using Standard Modem
Modem Configuration COM1 with speed 115200 at 8N1, & no wait for dial tone. Use Hardware flow control only. Bring up terminal window before dialing.
Server Type PPP
Advanced Options  Software Compression only
Network Protocols TCP/IP only. Settings: Server assigned IP address, Server assigned name server. Use IP header compression, use default gateway.

6. Connecting

To connect double click the new Dial-up Networking connection icon, and press Connect. The terminal screen should appear - login as ppp95, and press F7. The dialog box should indicate dialing, and then verifying username, etc. Finally, there should be an indication that you have successfully logged in to the network.

From an MSDOS prompt you should be able to ping your Linux machine (using the IP address, not the URL), and from your Linux machine ping 192.168.100.4. See /usr/doc/ppp-2.3.5/README.linux for other checks of the PPP connection.

In order to allow telnet and ftp to work, I changed /etc/hosts.allow to

ALL: LOCAL, 192.168.100.4

You may wish to be more restrictive in the services you allow here. You should now be able to telnet from Win95 to your linux machine using the IP address.

7. X Windows

To run X Windows on your Win95 computer, get the free MI/X server from http://www.sunsite.auc.dk/tucows/xwinserver95.html. Install The MI/X server. To get it going:- run the MI/X server, and from a DOS box telnet your linux machine. Login as your normal user name, and type the following:-

 DISPLAY=192.168.100.4:0.0
 export DISPLAY
 xterm &

This should make an xterminal appear in the MI/X server. The interface is a bit slow, but it works.

For more information see Running Remote X Sessions on Windows 95/98/NT/Mac/PPC Clients by Ron Jenkins in Issue 32 of Linux Gazette, September 1998.

8. Other services

I also have a ftp server and Apache on my Linux machine - if you run Netscape on the Win95 computer and put in the location http://192.168.100.1, you will reach Apache, or ftp://192.168.100.1 - you will reach your ftp server.

9. Shutdown of the Link

To shut down the PPP link, disconnect the dialup connection - it hangs for a while because Win95 is sending reset commands for a modem, but these are being received by the Linux getty as login/passwords. It disconnects after a short while, and Linux does not seem to mind.



If you have any comments, please email me at 


Copyright © 1999, Thomas Smyth
Published in Issue 41 of Linux Gazette, May 1999


[ TABLE OF CONTENTS ] [ FRONT PAGE ]  Back  Next