-->

Previous | Table of Contents | Next

Page 161

Hour 10

Connecting to the Internet

In this hour, you'll learn how to set up your Linux system to connect to the Internet by using the serial line Point-to-Point Protocol, known as PPP. After following the directions in this lesson, you should be able to connect to the Internet through your Internet service provider (ISP) to do email, Web browsing, or file transfers. This hour's lesson not only shows you how to do this in the simplest, most basic way possible, but also points you to sources of information for more details so that you can troubleshoot or fine-tune your connection.

I'm recommending that you use a PPP connection for several reasons:

Page 162

This hour starts by listing some of the hardware and software prerequisites for Linux, and then asking you for some necessary information you'll need from your ISP. With that information, you'll create a set of customized scripts you can use to start or stop your connection. You'll also learn about some handy utilities you can use to diagnose your connection, and some other programs you can use to monitor your sessions.

Hardware You'll Need

You probably already have all the hardware you need: a modem, a modem cable if your modem is external, and a phone line. But there are other considerations, such as your serial port or modem speed.

One great thing about Linux is that it runs well, even on older computers. Although graphics-intensive applications such as X can tax the capabilities of older, slower PCs, you don't need X, a fancy display monitor, or a 16MB VRAM accelerated 3D video card to use PPP. You will, however, need a serial card to support First-In-First-Out serial buffering.

If you can use your modem under Linux to dial out and connect by using the minicom program or C-Kermit, chances are you won't have any problems. If you're using a PC Card modem, and the cardmgr PCMCIA device manager recognizes and initializes your modem, you should be OK. One way to check is to use the dmesg program, which displays the file
/var/log/dmesg created when you start Linux. Run the dmesg program (piped through the less command), and look for lines in the output similar to the following:


# dmesg | less

....

tty00 at 0x03f8 (irq = 4) is a 16550A

tty01 at 0x02f8 (irq = 5) is a 16550A

tty03 at 0x02e8 (irq = 3) is a 16550A

....

Another consideration is your modem's speed. Some of you may remember when 2400 or 9600-baud modems were the greatest innovation since touch-tone dialing. If you're still using a 9600 or 14.4 modem, and refuse to upgrade to the newer 56K modems until the industry protocols shake out and model prices drop to $25, you can still connect to the Internet with PPP, as your modem will autosynchronize with the newer models lodged in your ISP's modem bank.

If you want to listen to radio stations, watch live video, or upgrade your Red Hat Linux system through your phone connection, you'll want the fastest modem you can afford. Although I don't advocate that you try to get any work done through a 1200 or (shudder) 300-baud connection (which borders on masochism, but can be done, as ATM machines prove), you can use email, FTP, and text-only Web browsing at 9600 speeds.

Page 163

It's up to you—besides, isn't freedom of choice what Linux is all about?

Linux Software You'll Need

To set up your PPP connection, you need to make sure that your Linux kernel supports PPP. You may have PPP support compiled into the kernel or loaded as a module when you start Linux. One way to check to see whether PPP support exists on your system is to again use dmesg:


# dmesg | less

...

PPP: version 2.2.0 (dynamic channel allocation)

TCP compression code copyright 1989 Regents of the University of California

PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.

PPP line discipline registered.

...

You should see similar lines. If you don't, you must recompile the kernel with built-in PPP support, or build the PPP module and use the insmod command to load the driver. You'll also need networking support enabled, especially TCP/IP.

Another piece of software you'll need is the chat program, found under the /usr/sbin directory, and part of the pppd daemon software package. The chat program is used during the dialing process to dial out and connect to your ISP's modem. Along with chat, you need the pppd daemon, also installed in the /usr/sbin/ directory. If pppd is installed, you should find a ppp directory under the /etc directory containing some or all of the following files:


# ls /etc/ppp

chap-secrets     options          ppp-on-dialer

connect-errors   pap-secrets      ppp-on

ip-up            ppp-off



If you don't see the ppp-on or ppp-on-dialer files, you can copy them from the /usr/doc/ppp-2.2.0f-3/scripts directory.

The setup you'll learn during this hour will require you to make changes to the ppp-on file, which is an executable script. Next, you may want to check to see if the file resolv.conf exists under the /etc directory. If it doesn't, don't worry, because it's a short file containing one or two lines.

Finally, you may want to see if you have the ifconfig, minicom, netstat, ping, or route commands on your system. You'll use these later to run some tests on your connection.

Information You'll Need from Your ISP

To connect to the Internet by using PPP through your ISP, you should first, obviously, have a PPP account. When you sign up for your service, your ISP account representative will most likely assume that you want a setup and software for a Windows or Macintosh system.

Previous | Table of Contents | Next