This document explains how to connect one windows machine and a linux machine without using network interface cards. There can be many reasons to do this, for fun, understanding and cheapness. However the file just provides an quick but comprehensive overview of the steps required to perform the job and is not a substitute for manual pages or HOWTOs.
The Document is distributed under the terms of the GPL (GNU Public License).
The document will be updated as periodically as possible on the Kir@Net and associated mirrors.
A Redhat Linux box and a Windows box. My Linux box had Celeron366 with 90MB RAM while the Windows box was Celeron266 with 128MB RAM. Machine specs shouldn't matter as long as it can run the desired OS properly and RS-232 ports with NS16550A or better UART is present.
Null Modem cable is required to connect the two computers. Diagram can be found here. Make sure that the cable length is well within limits.
First check that ppp is installed using
rpm -q ppp
If ppp is not installed, get the RPM from CD or internet. RPM can be installed using
rpm -ivh ppp-<ver>.rpm
Also make sure that the kernel has
ppp support built in or as module. Most distribution come with this by default
so don't bother unless you are stuck.
The file /etc/ppp/options contains all the parameters to the pppd program. These options can also be passed as command line arguments to the pppd.
Following option can be used to specify local and remote addresses.
<local IP address> : <remote IP address>To set the local and/or remote interface IP addresses. Either one may be omitted. The IP addresses can be specified with a host name or in decimal dot notation (e.g. 150.234.56.78). The default local address is the (first) IP address of the system . You must enter one if the machine does not have any ethernet or other interface configured. The remote address will be obtained from the peer if not specified in any option. Thus, in simple cases, this option is not required.
If a remote IP address is specified
with this option, pppd will not accept a different value from the peer in the
IPCP negotiation or you must ask the windows client to obtain IP address from
the Linux server.
If you do not specify local IP address then the remote machine should not belong
to the current IP subnet. or there should not be route to the remote network
in the local machine's remote network. If this case is to be violated (i.e.
the remote machine belongs to the same network) the remote must be authenticated
using any of the available scheme (PAP, CHAP).
As said earlier, /etc/ppp/options file contains all the configuration options for pppd. In addition to options file, you may create files with names such as options.ttyxx which can contain options that are to be used when connected using interface ttyxx. If no such files are present then options is the only file consulted, else, options file is used as common setting for all other terminals. Parameters in the file should be kept one on a separate line. List of parameters can be found in pppd manual. We will discuss only minimaly required options here.
You need to install Dial-Up Networking in Windows. This can be done from Control Panel>>Add Remove Programs>>Windows Components>>Communication.
Next you need to install "Communication cable between two computers" as your serial port modem. This is available only in Win98 and higher versions.
Next create a new dial-up connection with following parameters
Keep rest of the options to their default values.
Windows2000 users follow these steps
PPP daemon can be started from command line as well as from the /etc/inittab
to start pppd with line speed of 115200 (it should match with the one specified in the client's configuration) and on serial port 1 (ttyS0) give following command
pppd ttyS0 -detach 115200
or add following to the /etc/inittab (sustitute x with a free ID as required by inittab syntax
x:2345:respawn:/usr/sbin/pppd -detach ttyS0 115200 2&> /var/log/pppd.msg
This redirects the error and status messages into a file /var/log/pppd.msg which can be viewed if required. Make sure you change runlevels if you add it to the /etc/inittab file. Also substitute the right COM port device name on t command line.
Once the pppd is started on the server, dial the newly created connection for the windows machine. You should be able to connect direclty. Windows will give you a confirmation about newly connected connection either in the taskbar or using a dialog box.
Once you are connected you can issue fllowing command on the linux shell prompt
ifconfig
You should get something similar to following
ppp0 Link encap:Point-Point Protocol inet addr:<your IP address> P-t-P:<client's IP address> Mask:255.255.255.0 UP POINTOPOINT RUNNING MTU:552 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 TX packets:0 errors:0 dropped:0 overruns:0
This should mean that the pppd is working quite correctly. Similarly you can use following commands on the Windows machines (On windowsNT)
ipconfig /all
or (On Windows9x)
winipcfg
Next you can see a new route added into both machine's routing tables. Following command can be used on both of the machine
netstat -r
Now you can issue ping command to the other end to see the ip connectivity. If this works, it means you have successfully connected both machines. After this you can issue usual network commands as if the machines are connected through Network Inteface Cards.
You can have many ways to transfer files between the two computers. Some of them are listed below
This can be useful if you can get away with slow speed. This kind of ppp connection usually gives 8-12KB/S transfer rate which is sufficient if the files are moderate in size.
Data compression can increase the throughput by some amount. To enable data compression on the connection you can add deflate or bsdcomp option in the options file. The syntax is
bsdcomp nr, nt or
deflate nr, nt
where nr and nt are the code size in bytes to be used for reception and transmission respectively. These values must be within 9 and 15. A value of 0 disables the compression in the specified direction. Another option nobsdcomp or nodeflate disables compression altogether.