-->

Previous | Table of Contents | Next

Page 164

If you say "Neither. I'm using Linux," and the response you get is a blank stare, dead air on the phone, or "What's Linux?" don't panic!

You may get lucky. As Linux grows in popularity, many ISPs in the U.S. and around the world recognize and support Linux users. If your ISP is aware of Linux, ask for the minimum system requirements, any setup guides, or install tips. The CD-ROM with this book contains the latest, stable releases of the software you need, so you won't have to worry anyway.

Assuming that your ISP doesn't know about Linux, here's what you need from your ISP:

Finally, ask for the Uniform Resource Locator, or URL, of your ISP's World Wide Web home page, if it exists. You may find technical bulletins, help files, or other information that may help in troubleshooting connections.

Setting Up a PPP Connection

Armed with this information, you'll now learn how to specify your ISP's DNS server and how to create or edit your connection script, ppp-on. Although specifying your ISP's DNS

Page 165

server(s) isn't necessary to initiate or maintain your connection, you'll need this information in place during the next hour, when you learn about Internet email.

Editing the resolv.conf File

This is a simple process. First, make sure that you're logged in as the operator. Then look in the /etc directory for a file called resolv.conf. If it's there, open it with your favorite text editor (see Hour 14, "Text Processing") and add the IP addresses of your ISP's DNS servers. If your ISP has only one, that's okay. If your ISP has more than one, that's okay, too. Enter the lines, using this format:


nameserver 205.198.114.1

nameserver 205.198.114.20

Then close the file. That's all there is to do! Next, you'll create or edit a script you can use to start a PPP connection.

Editing the PPP Connection Scripts

Before you start, you should know that using this script is only one way to start a PPP connection. You can use this approach, which requires you to be logged in as the root operator; a much simpler approach, which I'll show you later; or other, more complex approaches, using wrapper programs or setting options in pppd's /etc/ppp/options file (which is parsed when the pppd daemon first starts).

I won't go into the detailed methods, because I want to outline the simplest approaches for you and get you on line quickly. But when you get a working connection, I suggest that you look at pppd's manual pages, Robert Hart's PPP-HOWTO under the /usr/doc/HOWTO directory, Al Longyear's PPP-FAQ under the /usr/doc/FAQ directory, or pertinent sections in the Linux Network Administrators Guide.

The first thing you should do is to make sure that you're logged in as the root operator. Then, look in the /etc/ppp directory for a file called ppp-on. If it's there, make a copy (you can call it anything you want), or rename ppp-on to ppp-on.org. If ppp-on isn't there, copy it from the /usr/doc/ppp-2.20f-3/scripts directory. Listing 10.1 shows you parts of the script, written by Al Longyear:

Listing 10.1. The ppp-on connection script.

...

TELEPHONE=555-1212     # The telephone number for the connection

ACCOUNT=username        # The account name for logon (as in `George Burns')

PASSWORD=password     # The password for this account (and `Gracie Allen')

LOCAL_IP=0.0.0.0     # Local IP address if known. Dynamic = 0.0.0.0

REMOTE_IP=0.0.0.0     # Remote IP address if desired. Normally 0.0.0.0

...

DIALER_SCRIPT=/etc/ppp/ppp-on-dialer

...

exec /usr/sbin/pppd lock modem crtscts /dev/modem 57600 \



Page 166


     asyncmap 20A0000 escape FF $LOCAL_IP:$REMOTE_IP \

     noipdefault netmask $NETMASK defaultroute connect \

        $DIALER_SCRIPT &

You need to change several parts of this script. For the most part, you need to make only a few changes. Some of the critical elements are

Listing 10.2. The ppp-on-dialer dialing script.

...

exec chat -v                                            \

        TIMEOUT         3                               \

        ABORT           `\nBUSY\r'                      \

        ABORT           `\nNO ANSWER\r'                 \

        ABORT           `\nRINGING\r\n\r\nRINGING\r'    \

        `'              \rAT                            \

        `OK-+++\c-OK'   ATH0                            \

        TIMEOUT         30                              \

        OK              ATDT$TELEPHONE                  \

        CONNECT         `'                              \

        login:            $ACCOUNT                        \

        password:        $PASSWORD

Next, examine the pppd command line in the ppp-on script, and change /dev/modem to match the device your modem is connected to. If you want, you can use the approach outlined in Hour 9, "Using Communications Programs," to make a symbolic link from your modem's serial port to /dev/modem. Here's a tip: If you have a 14.4 modem, use 19200 as the numeric value; if you have a 28.8 or 33.6 modem, try 57600. You may be able to connect at a faster speed, especially with newer modems.

TIME SAVER
If your ISP assigns IP addresses automatically (dynamic IP addresses, or addresses that may be different each time you log in), you're all set. But if you

Previous | Table of Contents | Next