-->

Previous | Table of Contents | Next

Page 167

must connect to a specific (static, or fixed) IP address, you'll need to remove the noipdefault option from the pppd command line, and change the $REMOTE_IP string to the IP address provided by your ISP (you can do this in the pppd command line or further up in the script in the $REMOTE_IP variable).

Finally, make sure that the ppp-on and ppp-on-dialer scripts are executable by checking with ls -l, or modifying with the chmod program:


# chmod +x /etc/ppp/ppp-on*

You're now ready, assuming that your modem is connected to your computer, and your phone line is connected to your modem, to try a connection.

Starting and Stopping PPP Connections

This section shows you how to connect to your ISP and start your Internet session. There are several ways to do this. The first way you'll see is the most basic, simplest way to connect with the minicom program without using the scripts you just created. Then you'll learn how to use your PPP connection script, ppp-on.

JUST A MINUTE
The minicom program, discussed in Hour 9, is a communications program you can use to dial out and connect to other computers or information services, such as bulletin board systems, or BBSs. See the minicom manual page for more information.

Using minicom to Connect

Using minicom to connect with your ISP has an advantage because your account infor-
mation and password aren't recorded in the system logs under the /var/log directory. You can use minicom each time you want to use the Internet, but you may find the process tedious. I'm showing you this approach first, because you may find it useful in verifying that the login and password entries you've specified in your ppp-on-dialer script will work.

Here is the step-by-step method. You can do this because minicom can quit without resetting your modem. This means you can use minicom to dial out, connect, and then quit, allowing you to start your PPP session with the pppd daemon. Here's how:

  1. Run minicom.
  2. Type ATDT, followed by your ISP's modem number.
  3. Wait for the connection, your ISP's prompt, then log in with your username and password. Note whether the login and password prompts are different. If so,

Page 168

    write them down so you'll have the information you need to edit the chat program options in your ppp-on-dialer script.
  1. Press Ctrl+Q to exit minicom without a modem reset.
  2. From the command line, type the following:

# pppd -d detach /dev/modem &

After a second or so, you're connected! (Well, you should check first—try some of the programs discussed later.)

Using Your ppp-on Script to Connect

Using the ppp-on script to establish your PPP connection is easy. Make sure that you're logged in as root, and type the following to start the connection:


# /etc/ppp/ppp-on

You'll notice that you have to type the entire pathname to the script. If you find your connection works, you can move the script to the /usr/local/bin directory, or make a symbolic link to the script with (you can call it whatever you want; just don't use pppd)


# ln -s /etc/ppp/ppp-on /usr/local/bin/start-ppp

After you start the script, you should hear your modem connect to your phone line, dial out, then connect with your ISP's modem. After several seconds, you should be connected!

JUST A MINUTE
If you don't like the sound of your modem or find it disruptive (especially if you have to work in a quiet environment), use your modem's AT command set to turn off the modem's speaker. Run minicom, type ATM0, press Enter, type AT&W, and then press Enter again to save the settings. Now you can start stealth PPP connections!

Stopping the PPP Connection

To stop your PPP session, use the ppp-off script, found in the /etc/ppp directory. To use it, type


# /etc/ppp/ppp-off

This script works by finding your network interface, ppp0, which you can test by using some of the programs in the next section and then using the kill command to kill the process ID of ppp0 (the kill command is discussed in the next hour).

Page 169

JUST A MINUTE
If you're interested in the details on setting up other serial-line connections, such as Serial-Line IP, or SLIP, look under the /usr/doc/slip-login-2.1.0.6 directory.

Checking the Connection

You can diagnose, troubleshoot, or get more information about your PPP connection in a number of ways. You can use networking utility programs during your connection to test, time, and diagnose the ppp0 interface. You can also examine system logs to look for any problems occurring during startup, connecting, and disconnecting.

This section introduces you to a few of these networking programs, and shows you where to look in your system logs for more information.

Using the ifconfig Command

Although the ifconfig command, found under the /sbin directory, is generally used in network administration by the root operator to configure network interfaces (a skill not covered in this book; see the Linux Network Administrators Guide), you can use ifconfig to see the status of your PPP connection.

This command can also be helpful when you're running programs, such as newsreaders, which may appear "frozen," but are actually sending and receiving data, but not displaying updates on your screen. To use ifconfig, just enter


# ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0

          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1

          RX packets:17257 errors:0 dropped:0 overruns:0

          TX packets:17257 errors:0 dropped:0 overruns:0



ppp0      Link encap:Point-Point Protocol

          inet addr:207.226.80.52  P-t-P:207.226.80.4

Mask:255.255.255.0

          UP POINTOPOINT RUNNING  MTU:1500  Metric:1

          RX packets:676 errors:0 dropped:0 overruns:0

          TX packets:545 errors:0 dropped:0 overruns:0

The command will list the current, active network interfaces. Look at the ppp0 listing and you can see the number of bytes received and transmitted (in the form of packets) over your PPP interface. Calling the program intermittently from another console or terminal window under X will show you the progress of data being sent and received.

Using the netstat Command

Previous | Table of Contents | Next