11. Getting Connected to the Internet
This chapter explains how to use Linux to connect to remote servers. First, it
explains how to use wvdial, a program that makes it easy to connect to the
Internet via a PPP connection provided by an ISP. Then, the chapter explains
basic TCP/IP network concepts that you must know in order to administer a
Linux system connected to the Internet or a local area network. So that you
can use your knowledge of TCP/IP effectively, the chapter explains how to
use pppconfig to configure and administer a system that connects to a
local area network and to a remote server via PPP. Next, the chapter
describes several popular network client applications available under Linux,
including a web browser and an FTP client. The chapter then describes the
use of minicom and seyon, which provide dial-out capabilities like those
of Window's hyperterminal. Finally, the chapter shows how to make a
PPP connection manually, by using minicom.
11.1 Connecting to the Internet
Most Internet service providers (ISPs) offer two primary types of service:
shell accounts and PPP (point-to-point protocol) accounts. Shell accounts
were more popular before the advent of the Web. A shell account lets you
use your computer much as if it were a virtual console associated with a
remote computer. You can type commands, which are interpreted by the
remote computer, and view the resulting output on your computer. Although
a few web browsers, such as Lynx, can operate via a shell account, they
don't generally support the highly graphical, multimedia pages which web
surfers have come to expect.
In contrast, a PPP account connects your computer directly to the Internet.
While your computer is connected to the Internet, you can use it to surf the
Web with your favorite browser. If your ISP allows, you can even run a web
server, providing pages that can be viewed by others around the world.
You can compare the two types of Internet accounts - shell and PPP - with
two kinds of postal service. Imagine that no mail carrier actually comes to
your home to pick and deliver mail. Instead, every time you want to conduct
Table 11.1: Command to Create /dev/modem
DOS Modem
Device
Linux Modem
Device
Command
Table 11.1: Command to Create /dev/modem
DOS Modem
Device
Linux Modem
Device
Command
COM1 ttyS0
ln -sf /dev/ttyS0
/dev/modem
COM2 ttyS1
ln -sf /dev/ttyS1
/dev/modem
COM3 ttyS2
ln -sf /dev/ttyS2
/dev/modem
COM4 ttyS3
ln -sf /dev/ttyS3
/dev/modem
11.3 Using wvdial
ISPs use a variety of dialogs to make a PPP connection. Often the most
difficult part of configuring your computer to make a PPP connection is
specifying dialog options consistent with those required by your ISP, which
may not be especially helpful in explaining the necessary options to you.
The ping command should report that echo packets were successfully
received from the server. If not, check your nameserver configuration.
When you want to log off your ISP, issue the following command:
killall wvdial
11.4 PPP Client
The Linux PPP client lets your Linux system connect to the Internet via a
PPP server, much the same way Dial-Up Networking lets your Microsoft
Windows system do so. Behind the scenes, wvdial calls on the services of
the PPP client to connect to a PPP server. However, it's possible to use the
Linux PPP client directly, without the aid of wvdial. Doing so gives you
access to the many options provided by PPP, which can prove helpful if your
networking needs are too sophisticated to be met by wvdial's simple fire-
and-forget mechanism. Even if you're content with wvdial, you'll benefit
from understanding the PPP client. For example, you'll find it much easier to
troubleshoot PPP problems if you understand the functions performed by the
PPP client on behalf of wvdial.
11.4.1 Specifying PPP Options
The Linux PPP client requires several configuration files. Rather than build
these files manually, you can use pppconfig, a program that leads you
through a dialog and then creates the proper configuration files based on
your responses. Login as root, and issue the command:
pppconfig
Figure 11.1 shows pppconfig's main menu, which the program displays
whenever you start it. Notice that pppconfig lets you create a
connection - the term by which it refers to a complete set of configuration
parameters - but it does not let you edit an existing connection. To change a
connection, you must edit the configuration files manually. It's usually
simpler to forego editing a connection, creating a new connection instead.
Figure 11.1: The pppconfig main menu
ISP may have several dial-up numbers. Each way of connecting to an ISP
can be configured as a distinct pppconfig connection.
Figure 11.5: Specifying the connection (provider) name
Next, pppconfig asks what method your ISP uses to authenticate your
access to its network, as shown in Figure 11.6. PAP (Password
Authentication Protocol) is currently the most popular method; however,
some ISPs continue to use other methods. The technical support staff of
many ISPs cannot tell what authentication method their system uses. So, you
may have to guess; if so, initially guess PAP. If you find you cannot
establish a connection, you can try the alternative values. Select the desired
authentication method and press Enter.
Figure 11.6: Specifying the authentication method
Next, you must specify your login password, as shown in Figure 11.7. Type
the password and press Enter.
Figure 11.7: Specifying the password
Next, pppconfig asks you to specify some basic connection properties.
Press Enter to exit the Configuration screen and the Manager User
Configuration screen, shown in Figure 11.8, appears. Type the login
username assigned to you by your ISP and press Enter. Your login
username may differ from your actual username, so be sure to use your login
username.
Figure 11.8: Specifying the username
Next, you must specify the device that corresponds to your modem, as
shown in Figure 11.9. Type the name of the device file, paying careful
attention to capitalization, and press Enter.
Figure 11.9: Specifying the modem device