LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Listen Print Subscribe to Linux Subscribe to Newsletters
Linux & Unix > Excerpts >
Living Linux

Connecting to the Internet

06/27/2000

There are several ways of connecting a home Linux box to the Internet: Digital Subscriber Line (DSL) service, cable modems, and dial-up connections with ISDN or analog modems. Each of these services has its own hardware and software requirements.

This week's column shows where to get the latest Linux documentation for these services and how to set up and use a PPP ("Point-to-Point Protocol") dial-up connection -- long the de facto means of connecting a computer to the Internet over a dial-up line.

Getting the HOWTOs

To get up-to-date, detailed instructions for using these services on Linux-based systems, the relevant HOWTOs published by the Linux Documentation Project remain the definitive guides:

  • "ISP Hookup HOWTO" by Egil Kvaleberg
  • "ADSL HOWTO for Linux Systems" by David Fannin
  • "Cable Modem Providers HOWTO" by Vladimir Vuksan

They're installed on most Linux systems as compressed text files in either the /usr/doc/HOWTO or /usr/share/doc/HOWTO directory; you can read them with the zless tool.

Setting up a dial-up PPP connection

Here's how to configure PPP for a regular dial-up connection, where your system is assigned a dynamic IP address (the norm for home Internet access). You'll have to be root (the superuser) to edit the PPP configuration files, and you'll need the standard connection information from your ISP: the dial-up number to use, the IP addresses for their nameservers, and your username and password for accessing their system.

First, customize the file /etc/chatscripts/provider:


ABORT        BUSY
ABORT        "NO CARRIER"
ABORT        VOICE
ABORT        "NO DIALTONE"
""           ATDT5551010,,
ost         PPP
ogin        smith
word         \qsecret\q

In this example, the ISP's dial-up number is "5551010." (Some systems need one or two commas after the number to signify pauses for the modem; only do this if you cannot get a good connection with just the telephone number in this space.) The username is "smith" and the password, which appears between two "\q" strings, is "secret." The line above the username is the "host" line: this is an optional line used with some ISPs whose connection line contains a choice of services that you must select before entering your username and password. (Some ISPs offer SLIP and shell access along with the standard PPP.)

Next, edit the file /etc/ppp/peers/provider so that it contains these lines:


connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
defaultroute /dev/modem 57600 persist

The last line in this file should include the device name of the modem to use and the maximum connect speed to try; the example above uses /dev/modem as the device name of the modem, and 57,600 bps as the maximum connect speed to use. (A rule of thumb is to use the highest connect speed your modem supports; you can always go lower when a connection is made but you can never raise the speed above what is given here.)

Finally, edit the file /etc/resolv.conf so that it contains the following, using the two nameserver IP addresses given to you by your ISP:


     search .
     nameserver      NAMESERVER ADDRESS 1
     nameserver      NAMESERVER ADDRESS 2

Once you've done these things, you should now be able to start and stop PPP connections to the Internet. (The complete documentation for setting up PPP is in the /usr/share/doc/ppp directory.)

To give a non-root user permission to start and stop PPP, use the adduser tool to give them membership in the "dialout" group.

For example, to add user "leo" to the dialout group, type:


$ adduser leo dialout RET

Controlling PPP connections

After PPP has been installed and configured, use the pon tool to start a PPP connection to the Internet. It calls the number of your ISP with your modem, sends the appropriate login information, and starts the PPP connection.

To start a PPP connection, type:


$ pon RET

To make PPP automatically start when the system first boots, rename the file /etc/ppp/no_ppp_on_boot to /etc/ppp/ppp_on_boot.

To output the last few lines of the PPP logfile, type plog. This is useful to check the progress of your PPP connection when it first dials.

Use the poff tool to stop a PPP connection. It disconnects from your ISP and hangs up the modem.

To stop a PPP connection, type:


$ poff RET

Next week: tips for browsing the Web on a Linux box.

Michael Stutz was one of the first reporters to cover Linux and the free software movement in the mainstream press.


Read more Living Linux columns.




Tagged Articles

Be the first to post this article to del.icio.us

Recommended for You

  1. Cover of High Performance Linux Clusters with OSCAR, Rocks, OpenMosix, and MPI
    High Performance Linux Clusters with OSCAR, Rocks, OpenMosix, and MPI
    Print: $39.95
    Ebook: $31.99
  2. Cover of Linux Multimedia Hacks
    Linux Multimedia Hacks
    Print: $29.95
    Ebook: $23.99
  3. Cover of POSIX.4 Programmers Guide
    POSIX.4 Programmers Guide
    Print: $39.95
  4. Cover of Book of VMware
    Book of VMware
    Print: $39.95

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2010, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com