Hardware

Grokking the Linux configuration tools: rp3-config and rp3

Have you ever struggled with a chap-secrets file in hopes of getting your Linux box connected to your ISP? Well, struggle no more! With the newer configuration tools, such as rp3-config, getting online with Linux is as easy as 95-98-2000!

You've configured networking, printing, and users in Linux and now it's time you tackled the modem. For the longest time, getting a network connection (with a modem) in Linux was a task best left to the kernel hackers and script writers. Until some of the later releases, you had to create your own pap-secrets,chap-secrets, /etc/network, and ifup-ppp files. This was an enormously difficult endeavor and turned a great number of possible users away.

Fortunately, the open source community realized the importance of this issue and set forth to change it by adding modem configuration tools, one of which is rp3 from the Red Hat distribution. I am going to teach you how to configure your modem with this simple tool.

Initial setup with rp3-config
Although any user can run rp3, the configuration tool, rp3-config, must be run as root. The rp3-config tool is a graphical front end for the wvdial tool. When you run rp3-config for the first time, it generates an /etc/wvdial.conf file, which will hold all the configuration settings. So let's get on with it.

As root, run the command rp3-config; a splash screen will appear (see Figure A). Click Next to begin your configuration. The rp3-config application will begin searching for a modem on your system (see Figure B). Once a modem is found, a new window will report the modem’s location (see Figure C). In this example, no modem was discovered on my test system (because there is no modem on my test system).

Figure A
Even Linux is rife with wizards! In this case, the Internet Connection Wizard.


Figure B
Like finding a needle in a haystack, some would say!


Figure C
If no modems are detected, you are given the option to manually configure a modem.


If, for some reason, your modem was not detected, you will have to enter the information (assuming you have a modem installed on your machine). Typically, modems are set to /dev/ttyS0, but that is completely dependent on your system.

Once you've chosen the location, baud rate, modem volume, and dial type, click Next; the Phone Number And Name screen will appear (see Figure D). Here, you will be asked to name your connection, add any prefix (if you have to dial a 9 to get an external line, for example), an area/country code, and a phone number.

Figure D
Pretty simple stuff, this wizard!


Click Next to move on to the username/password section—the only information you will be asked for here is the username and password required for your ISP connection. Click Next. The Other Options screen (see Figure E) asks you to select your ISP from a list of providers. This list consists of two entries: Normal ISP and AT&T Global Network Services. Unless you know you are a part of the AT&T Global Network, select Normal ISP. The only difference between the two is the use of Stupid mode. Stupid mode is configured within the /etc/wvdial.conf file and is either on (1) or off (0). If Stupid mode is on, wvdial does not attempt to interpret any prompts from the terminal server and starts pppd immediately after the modem connects. When you set up AT&T Global Network Services, Stupid mode is set to on.

Figure E
Stupid mode on or Stupid mode off—it's your choice!


Once you select your ISP and click Next, you will be greeted with a verification screen. All the information you supplied will be displayed and you must either click Finish (to complete the setup) or Back to edit the information.

After you click Finish, the Internet Connections window will appear. From the Accounts tab, you can Add, Edit, Delete, Copy, and Debug your connections. From the Modems tab, you can Add, Edit, and Delete modems from your account.

Having the ability to debug an account is quite handy. When you select an account and choose debug, rp3 will attempt to connect to the account and display all output from the connection within the debug screen. If your connection fails, you will immediately know why.

Connecting with rp3
Now that your connection is configured, you are ready to start the account. We'll start the rp3 connection tool via command line since menus vary from distribution to distribution. (Not only is the rp3 application named differently from distribution to distribution, it's never located in the same submenu.) Open a command line and enter the command rp3; you will see something similar to Figure F.

Figure F
In the rp3 Choose window, you see your configured dial-up accounts, along with all Ethernet connections and the loopback device.


In this window, you will select the connection you wish to bring up (in our case, My_Account) and then click OK. You will be asked whether you want to start the interface. Click Yes and you will hear the sweet sounds of your modem chime throughout the room. Once the connection is established, the Choose window will be replaced by a new window, which will include a continually updating connection meter, two tiny traffic indicators, and a button you can click to stop the connection.

The wvdial configuration file
As I said, rp3 is just a graphical front end for the wvdial application. When you run rp3, it is reading the /etc/wvdial.conf file generated by rp3-config.

The /etc/wvdial.conf file has a fairly straightforward syntax. The /etc/wvdial.conf file will consist of a Dialer Defaults section and as many specific Dialer sections as you have configured connections. For the example above, the dialer defaults will look like this:
[Dialer Defaults]
Modem = /etc/ttyS0
Baud = 57600
Init1 = ATZ
SetVolume = 0
Dial Command = ATDT


and a Dialer Test section will look like this:
[Dialer Test]
Username = haversham
Password = happenstance
Phone = 5551212
Inherits = Dialer Defaults
Stupid mode = 1


On the wvdial man page, you will see a number of other keywords for the wvdial configuration, including Login, Login Prompt, Password, Password Prompt, Remote Name (should your ISP use PAP or CHAP authentication), Auto Reconnect, and many others. Even though the rp3-config tool writes this file, you can still open wvdial.conf in your favorite text editor and edit till your hacker heart is content!

Conclusion
Linux has come a long, long way from the days when we had to use tools like minicom to bring up a dial-up connection. No longer are you required to roll your own PAP and CHAP files! Gone are the days of late-night script writing and debugging. These days, getting your Linux box online is as Microsoftian as the great Gates himself!

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

0 comments

Editor's Picks