|Linux Know-How provides a collection of introductory texts on often needed Linux skills.|
|Home Newbie Guide Administrator FAQ Networking Configuring the PPP Dial-Out Connection|
|See also: Network administration tools|
|Search the VIAS Library | Index|
Configuring the PPP Dial-Out Connection
GUI. If I were you, I would install kde and use kppp. kppp is really easy to configure and run. To set up your ppp dial out, run kppp (it is under the "K" menu "Internet, or you can run it from the xterm by typing kppp), press the "setup" button, create an account, and fill out the information required: telephone number, authentication protocol, and your Internet Service Provider's (ISP) domain name and the Domain Name Server (DNS) number of your ISP. All this information should have been provided to you by your ISP.
ls -l /dev/modem
ln -s /dev/ttyS1 /dev/modem
ttyS1 should work if your modem is on the port that DOS calls COM2. Use ttyS0 for COM1 and ttyS2 for COM3 and ttyS3 for COM4. The modem will not dial at all if a wrong port is chosen. For non-standard serial port setups, see the command setserial.
With old versions of kppp, you may get an error message complaining about a "lock". The solution then is to make sure that the file /etc/ppp/options is empty by editing it (as root):
and deleting the word "lock", then saving the file. This problem does not exist in the more recent versions of kppp.
RedHat 6.0 required one additional step: setting the "suid" ("substitute user id") so that "kppp" runs with the effective user id of root (because it needs to access hardware directly). Without it, kppp complains that "it was not properly set up" and "can't create lock file". This has to be done as root:
chmod a+s kppp
Troubleshooting. If your modem refuses to dial on the port that you are positive is chosen properly, maybe the modem is not set up properly (or maybe it is a "winmodem"? Then throw it away and buy a proper modem).
For example, in one instance, I had to run kppp setup, edit the "modem commands" and input ATZ1 as the "initialization string" (instead of the default ATZ for a standard Hayes-compatible modem). This particular modem would not dial unless it initialized with this atypical string "ATZ1".
If your telephone line requires pulse dialing (instead of the default touch-tone dialing), you may need to change the modem dialup command from "ATDT" (="ATtantion Dial Touchtone") to "ATDP" (="ATtantion Dial Pulse"). These commands work with any standard Hayes-compatible modem.
For some combinations of hardware on your computer, one may need to set up the modem on ttyS2 or ttyS3 (instead of the typical ttyS1, while ttyS0 is typically taken by mouse) because of interrupt conflict, e.g., with a network card. This can be achieved by setting the modem hardware (jumpers on your modem may need to be removed or repositioned, you have to look into the modem manual for specifics) and placing in the file /etc/rc.d/rc.local a line like this:
setserial /dev/ttyS3 irq 3
The standard PC settings for serial ports are:
port address of i/o port irq
/dev/ttyS1 0x03f8 4
/dev/ttyS1 0x02f8 3
/dev/ttyS2 0x03e8 4
/dev/ttyS3 0x02e8 3
I may use other, non-standard combinations or irq and i/o addresses to avoid conflicts with other hardware I might have. See man setserial for good a overview. Modem with unacceptable setup of irq and input-output address will not dial.
If your modem dials correctly and you are able to connect, but your authentication fails, perhaps your Internet Service Provider (ISP) uses a different authentication protocol. Call them and ask what authentication protocol they use. Or try "pap", "terminal-based" or "chap" (in your kppp setup) until you find the one which works with your ISP. "Terminal-based" always works for me if I only remember the password correctly.
In one instance, I had a problem with the reliability of establishing a connection (the error would pop up saying something like: "time-out for the pppd startup", and the connection would establish only once every few trials). The problem was solved by changing the "flow control" option (in the kppp "setup" under "device") from "CRTSCTS" to XON/XOFF. (Still CRTSCTS is the recommended flow control method in most cases.) In another case, opposite happened: communications was painfully slow because I did not set "flow control" to "hardware".
Random disconnects (after some time of correct connection) can have many causes. (1) They may be caused by "glitchy" drops of "data terminal ready" (DTR) signal or "carrier" signal. e.g., due to a noisy line. Most modems respond to that by hanging up. To change this default behaviour, you may need to add to your "modem initialization string" something like S10=50 . This sets the duration of DTR loss (in 0.01 s) after which hangup is executed (check your modem manual, "US Robotics" modems may need something like S25=200). (2) Call-waiting feature on your phone line may disconnect you when somebody tries to call you. (3) Old phone cables and dirty or corroded phone plugs or sockets are a common source of problems. Check the connections, replace the cables. Run the cables further away from sources of great electrical noise. (4) Too high modem speed for your village long and noisy phone cables. Drop the modem speed (or move to a city). (5) Many ISPs will diconnect you after some period of inactivity (30 min?).
If you keep having problems setting up ppp, you may want to try minicom to see if you can get your modem working from there. minicom is something like PROCOMM for Linux. It should be present on your system if you chose to install it during your RedHat initial setup. Here is a post from a newsgroup comp.os.linux.help which explains how to start ppp manually using minicom (edited for space):
From: mark <firstname.lastname@example.org> Subject: Re: pppd problem with kppp
>>Also, for an experiment, try using minicom to connect to your ISP, start ppp manually ... this can prove buggy scripts. >how would u do that?
Easy!! If your ISP doesn't allow a manual logon then you might be in trouble. Every ISP I've ever used does allow this, so.. 1. Start minicom. 2. dial your ISP. 3. Log in. 4. After your ISP starts PPP, quit minicom with ALT-Q (or whatever the sequence is to 'quit without reset'). 5. start pppd, eg:
pppd -d -detach /dev/modem 115200 &
OK, PPP will be running. Try pinging your ISP or another known IP address. That will test everything is OK. BTW, this is all in the PPP-HOWTO. If you can get PPP running this way, then you have a scripting problem. If PPP doesn't work, you have a PPP configuration problem. Cheers.
Command line. If you would like to start your ppp from the command line, run netconf (as root) to configure your first ppp interface (ppp0). The information you must enter is similar to what you entered when setting up kppp (have a look above!): the proper device for the modem port, modem initialization and dialup strings, the telephone number of your Internet Service Provider (ISP), the proper authentication protocol (by entering the login name and password into the right slot). In older versions, the netconf utility lacked a place to enter the IP addresses of my ISP DNS server, so I edited the file /etc/ppp/pap-secrets (I use PAP authentication protocol) and added the two DNS IP addresses at the end of the setup line which was created by netconf so it looked like this:
# added by linuxconf
my_login_name ppp0 my_password 188.8.131.52 184.108.40.206
When done with the settings, I could start my ppp0 interface using the command (as root, unless I specified in netconf that normal users can start the interface):
and shut it down with
Setting up the command line ppp was not more difficult on my machine than running kppp and the connection is more convenient to bring up from me from the command line than from a gui. There is lots of command line scripts to start/stop ppp, but they apparently are not so easy to set up and use, and many newbies seem to have problems with them. For example, in one instance, "ifup ppp0" would not start the interface (no dialing) because no device was associated with the interface "ppp0", I edited the file /etc/sysconfig/network-scripts/ifcfg-ppp0 to include this line:
Badly misfired ppp connections can be terminated without rebooting by killing the pppd daemon (as root):
If this minimalistic setup of ppp does not work for you, here are some useful links:
Roderick A. Anderson < email@example.com > wrote:
I have a web page on setting up diald to work with RedHat Linux 5.x that works for me every time. It is at http://home.altoplanos.net/~raanders/diald.html
Bill Unruh < firstname.lastname@example.org > wrote:
I just wanted to bring your attention to the page http://axion.physics.ubc.ca/ppp-linux.html for detailed instructions for setting up ppp. This is especially for cases in which the remote side uses (perhaps without the ISP even telling you) PAP or CHAP. While kppp is useful, there are a number of situations where it can fail.
|Home Newbie Guide Administrator FAQ Networking Configuring the PPP Dial-Out Connection|