Read an Excerpt
Chapter 22: Connecting Linux to the InternetThe subject of connecting a Linux system (or any computer system, for that matter) to the Internet is a complex one and a subject that can require a thorough knowledge of that system's network environment.
Still, for many users, this process is simple enough that both X Windows and Linux work on the first attempt.
This chapter starts with a quick look at PPP and its role in the Internet world. It reviews the hardware and software requirements for connecting to the Internet and then walks you through the mechanics of manually making a PPP connection. Finally, this chapter wraps up by explaining how to automate these connections.
What Is PPP?Most Internet users are probably familiar with the acronym PPP, simply because the type of account they have with their Internet service provider (ISP) is a PPP account. Many users, though, really don't understand what PPP is all about.
PPP stands for Point-to-Point Protocol and is designed to provide a method by which TCP/IP is extended across an analog modem connection. In this way, when you are connected to the Internet using PPP, you become part of your ISP's network, you are an actual host on the Internet, and you have an IP address.
Traditionally, dial-up Internet connections were done using terminal software and Unix shell accounts on central servers. In this environment, the terminal software on the client system merely acted as a display for the server, and only the server had an IP address on the Internet. This contrasts sharply with today's PPP connections, which bring the Internet right up to your modem.
The great flexibility of Internet connection technologies allows for a wide variety of PPP connection types. You can have PPP connections with fixed or dynamic IP addresses. Connections can use special authentication protocols such as PAP (Password Authentication Protocol) or CHAP (Challenge Handshake Authentication Protocol). They can even use standard clear-textbased prompt-and-response mechanisms. Connections can be made manually or can be made automatically as needed.
This chapter discusses the most common Internet connection scenario: connecting by modem to an ISP that offers PPP connections with dynamically assigned IP addresses.
"PPP" and "ISP connections" are used interchangeably in this chapter. However, PPP connections are not limited to connections through ISPs. In fact, PPP is also a common way to connect to corporate or educational networks.
Required Hardware and SoftwareIn order to make PPP work properly, some preparation is needed. Hardware and software needs to be in place and configured before you can get PPP to work properly. Three key components need to be considered:
- A modem needs to be installed, configured, and working.
- PPP support needs to be compiled into the Linux kernel.
- PPP software needs to be installed.
The ModemBecause PPP is designed for dial-up connections, a modem is an essential piece of the PPP puzzle.
Chapter 18, "Using Peripherals," discusses modems and how to install them, test them, and get them working. Refer to that chapter to get your modem up and running and to make a test connection to be sure everything is in order.
To configure PPP, you need to know the speed of your modem connection and which device it uses in Linux (probably
/dev/modem or one of
PPP in the KernelThe Linux kernel is designed to be highly flexible. It can be compiled to include (or exclude) support for numerous technologies ranging from serial mice right up to networking facilities such as PPP.
In order to make a PPP connection with Linux, it is necessary for the kernel to include PPP support. You can check to see if support is there by watching the messages that scroll by while the operating system is booting. If you see a series of lines like these
PPP generic driver version 2.4.0 PPP Deflate Compression module registered PPP BSD Compression module registered
then PPP is compiled into your kernel. If you find that the messages scroll by too quickly, you can use the dmesg command to see the part of the start-up messages that should include the PPP messages:
$ dmesg I less
If you find that you need to recompile your kernel to include PPP support, refer to Chapter 20, "Recompiling the Linux Kernel," which discusses the steps involved in recompiling your kernel.
Installing PPP SoftwareRed Hat Linux 7.1 installs PPP software with a complete or default installation.
Two programs are used to establish a PPP connection:
/usr/sbin/chat. In Red Hat Linux 7.1, these are part of the ppp-2 .4 .0-2 package, and you can see if these are installed by using the rpm command:
$ rpm -q ppp
If you find that you are lacking either pppd or chat, you need to install a new set of PPP software before continuing. Mount the Red Hat CD-ROM at a suitable location (such as /mnt/cdrom) and then install the package ppp-2.4.0-2.i386.rpm:
$ rpm -i /mnt/cdrom/RedHat/RPMS/ppp-2.4.0-2.i386.rpm
Alternatively, you can download the latest sources for PPP from the pppd home page at the Samba download mirror site at
ftp://ftp.samba.org/pub/ppp/. The current version of PPP is 2.4.1 and the filename is ppp-2.4.1.tar.gz.
You need to expand the archive in a suitable location such as /tmp with the command
$ tar xzvf ppp-2.4.l.tar.gz
and then read through the README .linux file carefully. Installing a new PPP package involves not only compiling the software but also upgrading your Linux kernel source files and recompiling the Linux kernel to match the version of the PPP software being installed.
Describing the details of this process would take up a whole chapter, so it is best left to the documentation....