• No results found

NETWORK SETUP AND CONFIGURATION

3.2 Configuring Network Interface for PPP Communication

At the command prompt of the Linux Operating System, choose one of the machines as a 'server' and the other one as client. Then configure the serial port of both machines with the “setserial” command of Linux.

#setserial /dev/cua0

setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using. During the normal bootup process, only COM ports 1- 4 are initialized, using the default I/O ports and IRQ values. In order to initialize any additional serial ports, or to change the COM 1-4 ports to a nonstandard configuration, the setserial program should be used. Typically it is called from an rc.serial script, which is usually run out of /etc/rc.local. The cua0 tells Linux that it should use the first serial connector or port. Since there is no parameters given, this implies that, setserial will print out the port type (i.e., 8250, 16450, 16550, 16550A, etc.), the hardware I/O port, the hardware IRQ line, its "baud base," and some of its operational flags.

The next stage is to start pppd on both systems. The PPP Daemon (pppd) is a freely available implementation of the Point-to-Point Protocol (PPP) that runs on many Unix/Linux systems. The syntax of the pppd command is:

# pppd[device] [speed] [options]

device is the name of the serial port over which the PPP protocol operates and speed is the transmission speed of that port in bits per second. The complexity of this command comes not from these simple parameters but from the large number of options that it supports. There are so many options, in fact, that they are often stored in a file. There are three options files that can be used with pppd: the /etc/ppp/options file, which is used to set systemwide pppd options; the ~/.ppprc file, which is used by an individual to set personal pppd options; and the /etc/ppp/options.device file, which sets options for a serial device, e.g., /etc/ppp/options.cua0 sets options for cua0. The order of precedence for options is that those specified in the /etc/ppp/options.device file are the highest priority, followed by those defined on the command line, then those in the ~/.ppprc file, and, finally, those defined in the /etc/ppp/options file. Some options that relate to system security, once defined in the /etc/ppp/options file, cannot be overridden by the user through the command line or the ~/.ppprc file. This is done by executing the command on both machines.

#pppd –detach crtscts lock <local IP> :<remote IP> /dev/cua0 38400 &

This will bring up the link - but as yet you have no routing specified. You can test the link by pinging to and fro to each machine. If this works, bring down the link by killing one of the pppd processes.

Ping will check whether the connection is established between the two computers or not. This is done by sending a packet to the receiver and listen for a reply through a time to live (TTL) time out. If the link is established then the receiver sends a reply with the time it took for the sender to get a reply. This implies that the link is established and one can go to the next stage [16].

The options for pppd include the following:

Table 3.1: Parameters options to add to pppd configuration

-detach Allows pppd to run as a background process Crtscts Enables hardware flow control (RTS/CTS).

Lock Tells the system to use a UUCP-style lock file to ensure that pppd has exclusive access to the serial device

Proxyarp Tells the system to enable proxy ARP. This adds a proxy ARP entry for the remote system to the local system's ARP table.

local IP IP address of host computer remote IP IP address of remote computer

passive Tells the system to wait for a Link Control Protocol (LCP) packet from the remote system even if that system does not reply to the initial LCP packet sent by the local system. Without this option, the local system aborts the connection when it does not receive a reply. The passive option can also be written as -p.

local Tells the system to ignore the DCD (Data Carrier Detect) and DTR (Data Terminal Ready) modem control lines.

defaultroute Defines the PPP link as the default route. The route is removed when the connection is closed

persists Tells the system to reopen the connection if it was terminated by a SIGHUP signal.

netmask Defines the subnet mask.

38400 Speed in bits per second. This can be up to the maximum value of 115200 for serial port communication

cua0 The port number for the serial port one

The routing you need will of course depend on exactly what you are trying to do. Generally, one of the machines will be connected to an Ethernet (and beyond) and so the routing required is exactly the same as for a PPP server and client.

So on the Ethernet equipped machine, the pppd command would be...

# pppd –detach crtscts lock proxyarp <local IP>:<remote IP> /dev/cua0 38400 &

and on the other machine ...

Related documents