Home » , , » Setting Up Dial-up Networking in Linux

Setting Up Dial-up Networking in Linux

Written By Sajib Barua on Sunday, August 19, 2012 | 4:32 AM

previous Networking in Linux

With the rise in popularity of both DSL and cable networks, dial-up networking is becoming a thing of the past. That said, this section outlines the important features to know about dial-up for those who live in areas where DSL or cable are not available.

Dial-up networking refers to connecting a PC to a remote network through a dial-up modem. If you’re ancient enough to remember the days of dialing up with Procomm or some serial communications software, realize that there’s a significant difference between dial-up networking and the old days of serial communication. Both approaches use a modem to dial up a remote computer and to establish a communication path, but the serial communication software makes your computer behave like a dumb terminal connected to the remote computer. The serial communication software exclusively uses a dial-up connection. You can’t run another copy of the communication software and use the same modem connection, for example.

In dial-up networking, both your PC and the remote system run network protocol (called TCP/IP) software. When your PC dials up and sets up a

communication path, the network protocols exchange data packets over that dial-up connection. The neat part is that any number of applications can use the same dial-up connection to send and receive data packets. So your PC becomes a part of the network to which the remote computer belongs. (If the remote computer isn’t on a network, dial-up networking creates a network that consists of the remote computer and your PC.)

Setting up a TCP/IP network over a dial-up link involves specifying the protocol — the convention — for packaging a data packet over the communication link. Point-to-Point Protocol (PPP) is such a protocol for establishing a TCP/IP connection over any point-to-point link, including dial-up phone lines. Linux supports PPP, and it comes with the configuration tools you can use to set up PPP so that your system can establish a PPP connection with your ISP.

Here’s what you have to do to set up dial-up networking in Linux:

  1. Install an internal or external modem in your PC. If your PC didn’t already come with an internal modem, you can buy an external modem and connect it to the PC’s serial or USB port.
  2. Connect the modem to the phone line and power up the modem and the computer.
  3. Get an account with an ISP. Every ISP provides you a phone number to dial, a username, and a password. Additionally, the ISP gives you the full names of servers for e-mail and news. Typically, your system automatically gets an IP address.
  4. Run a GUI tool (if available) to set up a PPP connection. If you can’t find a GUI tool, type wvdialconf /etc/wvdial.conf at the shell prompt. (If this program isn’t installed yet, use your distribution’s installation tools or type apt-get install wvdial in the shell prompt of Ubuntu, Debian, or Xandros.) The wvdialconf program automatically detects the modem and sets up the configuration file /etc/wvdial.conf. Now use a text editor to edit the file /etc/wvdial.conf and enter the ISP’s phone number as well as the username and password of your Internet account with the ISP. (Look for fields labeled Username, Password, and Phone.)
  5. Use a GUI tool (if available) to activate the PPP connection to connect to the Internet. If no GUI tool is available, log in as root and type wvdial to establish the PPP connection.

I briefly go over these steps in the following sections.

Connecting the modem

The word modem is a contraction of modulator/demodulator — a device that converts digital signals (strings of 1s and 0s) into continuously varying analog signals that transmit over telephone lines and radio waves. Thus, the modem is the intermediary between the digital world of the PC and the analog world of telephones. Figure 1-7 illustrates the concept of a modem.

A modem bridges the digital world of PCs and the analog world of telephones 

Figure 1-7: A modem bridges the digital world of PCs and the analog world of telephones.

Inside the PC, 1s and 0s are represented with voltage levels, but signals carried over telephone lines are usually tones of different frequencies. The modem sits between the PC and the telephone lines and makes data communication possible over the phone lines. The modem converts information back and forth between the voltage/no voltage representation of digital circuits and different frequency tones that are appropriate for transmission over phone lines.

Before you can dial out using an external modem, you have to make sure that the modem is properly connected to one of the serial or USB ports of your PC.

Winmodems: They do only Windows

A quick word of caution about the Winmodems that come with many new PCs and laptops: Winmodems are software-based internal modems — different from the traditional hardware modems. Also known as Windows modems or software modems (softmodem for short), they work only with special driver software (which in turn works only with Microsoft Windows). With Winmodems and Linux, you’re pretty much on your own, but you can find some useful guidance online at the Linux Winmodem Support home page at www.linmodems.org.

If you have an external modem, make sure that your modem is properly connected to the power supply and that the modem is connected to the telephone line. Buy the right type of cable to connect the modem to the PC. You need a straight-through serial cable to connect the modem to the PC. The connectors at the ends of the cable depend on the type of serial connector on your PC. The modem end of the cable needs a male 25-pin connector. The PC end of the cable often is a female 9-pin connector. You can buy modem cables at most computer stores. Often, you can find 9-pin-female-to-25-pinmale modem cables sold under the label AT modem cable. Connect USB modems by using a USB cable.

If your PC has an internal modem, all you have to do is connect the phone line to the phone jack at the back of the internal modem card. If your PC has a Winmodem, you still connect the phone line, but you also have to do a bit of research on the Internet and download a driver that makes the Winmodem work in Linux. After you install a working Linux driver for a Winmodem, it works just like the older serial port modems. See the sidebar, “Winmodems: They do only Windows,” for more information.

Setting up and activating a PPP connection

Most ISPs provide PPP dial-up access to the Internet through one or more systems that the ISP maintains. If you sign up for such a service, the ISP provides you the information that you need to make a PPP connection to the ISP’s system. Typically, this information includes the following:

  • The phone number to dial to connect to the remote system.
  • The username and password that you must use to log in to the remote system.
  • The names of the ISP’s mail and news servers.
  • The IP address for your PPP connection. Your ISP doesn’t provide this address if the IP address is assigned dynamically (which means the IP address may change every time that your system establishes a connection).
  • IP addresses of the ISP’s DNS. The ISP doesn’t provide these addresses if it assigns the IP address dynamically.

Of this information, the first two items are what you need to set up a PPP connection. The exact steps for setting up and using a PPP connection depend on the distribution. For distributions with a GUI Internet connection tool, you can easily figure out where to enter your ISP account information — the phone number, username, and password. I point out a few distributionspecific approaches for configuring PPP next.

Debian has a GUI tool to set up a PPP connection, and the tool uses wvdial, which isn’t installed by default. Type apt-get install wvdial to install it. Then you can use the GUI tool to configure and activate the dial-up PPP connection.

The most recent versions of Ubuntu do not support dial-up modems, but drivers can be installed that can enable the use of these modems. For more information, consult Ubuntu’s Help menu.

Configuring CHAP and PAP authentication

The PPP server on your system has to authenticate itself to the ISP’s PPP server before the PPP connection can get fully up and running. Authentication requires proving that you have a valid account with the ISP, essentially providing a username and a secret (that is, a password). PPP specifies two ways of exchanging the authentication information between the two ends of the connection:

  • Challenge Handshake Authentication Protocol (CHAP) requires the remote end to send a randomly generated challenge string along with the remote server’s name. The local system looks up the secret, using the server’s name; then it sends back a response that includes its name and a value that combines the secret and the challenge, using a one-way hash function. The remote system then checks that value against its own calculation of the expected hash value. If the values match, the authentication succeeds; otherwise, the remote system terminates the connection. In this case, the name and secret are stored in the /etc/ppp/chap-secrets file.

    The remote system can repeat the CHAP authentication any time while the PPP link is up.

  • Password Authentication Protocol (PAP) is like the normal login process. When using PAP, the local system repeatedly sends a username (name) and password (secret) until the remote system acknowledges the authentication or ends the connection. The name and secret are stored in the /etc/ppp/pap-secrets file.

    The username and password are sent in the clear (unencrypted).

The Linux PPP server supports both types of authentication. For PAP and CHAP, the information that the PPP server needs is a name and a secret — a username and password pair. This authentication information is stored in the following configuration files:

  • /etc/ppp/chap-secrets stores the information for CHAP. Here’s what a typical chap-secrets file looks like:
    # Secrets for authentication using CHAP
    # client server secret IP addresses
    “edulaney” * “mypassword”
  • /etc/ppp/pap-secrets stores the information for PAP. Here’s a typical pap-secrets file:
    # Secrets for authentication using PAP
    # client server secret IP addresses
    “edulaney” * “mypassword”

As you can see, the formats of the entries are the same for both chapsecrets and pap-secrets. Four fields are in each line, in the following order:

  • client: This field contains the name that’s used during authentication. You get this name from the ISP.

  • server: This field contains the name of the remote system to which you’re authenticating the local system. If you don’t know the server’s name, type an asterisk to indicate any server.

  • secret: This field is the secret that your system’s PPP server has to send to the remote system to authenticate itself. You receive this password from the ISP.

  • IP addresses: This optional field can contain a list of the IP addresses that the local system may use when connecting to the specified server. Typically, this field is left blank because the local system usually gets a dynamic IP address from the server and (therefore) doesn’t know what IP address it uses.

next Setting Up a Local Area Network in Linux

Share this article :

0 comments:

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Linux - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger