Re: In RedHat 9.0 modem keeps giving "no carrier"
"Philip Beattie" <[email protected]> Sun, 9 May 2004 20:08:24 +0100
| Newsgroups | gmane.linux.redhat.ppp |
|---|---|
| Message-ID | <[email protected]> |
Hi Guvenc, You don't say which version of Red Hat you are using. This how-to will help you set up a dial on demand with Red Hat 8 I don't know whether this list will accept attachments or not - but here goes Regards, Philip ----- Original Message ----- From: "Guvenc GULCE" <[email protected]> To: <[email protected]> Sent: Sunday, May 09, 2004 4:59 PM Subject: In RedHat 9.0 modem keeps giving "no carrier" Hi all, I would really appreciate any input regarding this problem. I have recently installed RedHat on my laptop and everything seems to be ok except the fact that I can not connect to internet using my dialup modem. I have installed the driver of the modem(Smart Link 56K) successfully. I used kppp, wdial or even the ppp command line.. no joy ! I can hear the modem dialing the number.. I hear the expected modem negotiation noise.. but after 5 seconds or so.. I see the error "No Carrier" (kppp "Query Modem" also indicates no problem) What on earth is the carrier ? I tweaked ppp/options, I changed PAP/CHAP.. etc.. no luck.. (searched in google, tried several suggestions from there but no joy) I will just drive crazy.. I installed the linux with great enthusiasim and I had the hope to switch to the linux completely in my home use.. but man.. forget it.. If I need to search the web for hours for every single change in the OS, how can I work efficiently.. is this the exaggerated linux bubble ? (Please dont tell me man pages, I am sorry but man and help pages are no help, I know how to use them) and guess what? my redhat's kde desktop freezes almost everday ? It is somehow pathetic to tell this but my W2K desktop works without freezing for a month.. (ok that one also gets some annoying worms but at least somehow stable) summary: linux is far from replacing end user desktops and is not that stable as it is said to be.. ahh.. pls dont forget to give your ideas regarding the "no carrier" issue, I just still want to feel the joy of surfing in internet using dialup and linux.. :-) even it is hard.. Thanks & Regards Guvenc Gulce ------------------------------------------------ AIESEC.net e-mail Powered by Hewlett-Packard _______________________________________________ Redhat-ppp-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/redhat-ppp-list _______________________________________________ Redhat-ppp-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/redhat-ppp-list
wvdial-pppd-dod.html
(text/html, 20 KB)
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title xmlns="http://www.w3.org/1999/xhtml">Dial On Demand with wvdial and pppd</title><link xmlns="http://www.w3.org/1999/xhtml" rel="stylesheet" href="/site.css" type="text/css"/><meta xmlns="http://www.w3.org/1999/xhtml" name="generator" content="DocBook XSL Stylesheets V1.54.1"/></head><body><div xmlns="http://www.w3.org/1999/xhtml" class="article"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h1 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="id2828872"/>Dial On Demand with wvdial and pppd</h1></div><div xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="author"><h3 class="author">David Pashley</h3><div xmlns="http://www.w3.org/1999/xhtml" class="affiliation"><span xmlns="http://www.w3.org/1999/xhtml" class="jobtitle">Systems Administrator<br/></span><span xmlns="http://www.w3.org/1999/xhtml" class="orgname">Parguild Ltd.<br/></span></div></div></div><div xmlns="http://www.w3.org/1999/xhtml"><p xmlns="http://www.w3.org/1999/xhtml" class="copyright">Copyright © 2002 David Pashley</p></div><div xmlns="http://www.w3.org/1999/xhtml"><div xmlns="http://www.w3.org/1999/xhtml" class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="2"><b>Revision History</b></th></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">Revision 0.3</td><td align="left">29 June 2002</td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left" colspan="2">Corrected "pppd chat dod" to "pppd call dod" as
pointed out by Giovanni Pardini <[email protected]></td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">Revision 0.2</td><td align="left">24 May 2002</td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left" colspan="2">Changed to Docbook source</td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left">Revision 0.1</td><td align="left">17 May 2002</td></tr><tr xmlns="http://www.w3.org/1999/xhtml"><td align="left" colspan="2">First draft in HTML</td></tr></table></div></div><hr xmlns="http://www.w3.org/1999/xhtml"/></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="#id2779445">Install wvdial and pppd</a></dt><dt><a href="#id2779539">Setup wvdial to dial your ISP</a></dt><dt><a href="#id2828852">Change wvdial to be used as a chat replacement</a></dt><dt><a href="#id2779265">Edit the peers file to run with dial-on-demand</a></dt></dl></div><div xmlns="http://www.w3.org/1999/xhtml" class="abstract"><p xmlns="http://www.w3.org/1999/xhtml" class="title"><b>Abstract</b></p><p xmlns="http://www.w3.org/1999/xhtml">
If you asked most people how to get Linux to do dial on demand,
they would tell you to use <a href="http://diald.sourceforge.net" target="_top">diald</a>. However
there is a simpler way of getting it working. This tutorial
will show you how to get dial-on-demand working using <a href="http://open.nit.ca/wvdial/" target="_top">wvdial</a> and <a href="http://www.samba.org/ppp/" target="_top">pppd</a>. This is based
on a Debian sid machine. This is also based on wvdial 1.53 and
pppd 2.4.1. Most of the instruction should apply to other
distributions. I assume that you want to connect to the
Internet, but everything should apply to any other dial-up PPP
connection. This document explains the several steps needed to
getting this working.
</p></div><div xmlns="http://www.w3.org/1999/xhtml" class="sect1"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="http://www.w3.org/1999/xhtml" id="id2779445"/>Install wvdial and pppd</h2></div></div><p xmlns="http://www.w3.org/1999/xhtml">
The first step is to download and install wvdial and pppd. On Debian this
can be done by using apt-get: First we make sure that we have the most
recent meta-data available:
</p><pre class="screen">
david root% <b><tt>apt-get update</tt></b>
Hit http://nonus.debian.org unstable/non-US/main Packages
Hit http://nonus.debian.org unstable/non-US/main Release
Hit http://nonus.debian.org unstable/non-US/contrib Packages
Hit http://nonus.debian.org unstable/non-US/contrib Release
Hit http://nonus.debian.org unstable/non-US/non-free Packages
Hit http://nonus.debian.org unstable/non-US/non-free Release
Hit http://http.us.debian.org unstable/main Packages
Hit http://http.us.debian.org unstable/main Release
Hit http://http.us.debian.org unstable/contrib Packages
Hit http://http.us.debian.org unstable/contrib Release
Hit http://http.us.debian.org unstable/non-free Packages
Hit http://http.us.debian.org unstable/non-free Release
Hit http://http.us.debian.org unstable/main Sources
Hit http://http.us.debian.org unstable/main Release
Hit http://http.us.debian.org unstable/contrib Sources
Hit http://http.us.debian.org unstable/contrib Release
Hit http://http.us.debian.org unstable/non-free Sources
Hit http://http.us.debian.org unstable/non-free Release
Reading Package Lists... Done
Building Dependency Tree... Done </pre><p xmlns="http://www.w3.org/1999/xhtml">
Now we install wvdial and ppp. We don't want to auto-configure wvdial,
because we will be doing that in the next stage
</p><pre class="screen">
david root% <b><tt>apt-get install ppp wvdial</tt></b>
Reading Package Lists... Done
Building Dependency Tree... Done
The following NEW packages will be installed:
ppp wvdial
0 packages upgraded, 2 newly installed, 0 to remove and 42 not upgraded.
Need to get 332kB of archives. After unpacking 1032kB will be used.
Get:1 http://http.us.debian.org unstable/main ppp 2.4.1.uus-4 [243kB]
Get:2 http://http.us.debian.org unstable/main wvdial 1.53.0.1 [89.4kB]
Fetched 318kB in 42s (7416B/s)
Reading changelogs...
Selecting previously deselected package ppp.
(Reading database ... 69086 files and directories currently installed.)
Unpacking ppp (from .../ppp_2.4.1.uus-4_i386.deb) ...
Selecting previously deselected package wvdial.
Unpacking wvdial (from .../wvdial_1.53.0.1_i386.deb) ...
Setting up ppp (2.4.1.uus-4) ...
Setting up wvdial (1.53.0.1) ...
WVDIAL AUTOCONFIGURATION
WvDial includes a program called wvdialconf, which can automatically
detect your modem and create a /etc/wvdial.conf file.
Autodetection may cause problems on some computers.
Do you want to configure wvdial now? [Y/n] n
Okay. You can run wvdialconf later or create /etc/wvdial.conf manually.
david root% </pre></div><div xmlns="http://www.w3.org/1999/xhtml" class="sect1"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="http://www.w3.org/1999/xhtml" id="id2779539"/>Setup wvdial to dial your ISP</h2></div></div><p xmlns="http://www.w3.org/1999/xhtml">
Before we can attempt to get dial-on-demand working, we need to make sure
that we can dial up our ISP. The easiest way to make a configuration is to
use <tt xmlns="http://www.w3.org/1999/xhtml">wvdialconf</tt>. Don't worry about any warnings about not finding
<tt xmlns="http://www.w3.org/1999/xhtml">/etc/wvdial.conf</tt>. This is normal and
<b xmlns="http://www.w3.org/1999/xhtml">wvdialconf</b> will create it.
</p><pre class="screen">
david root% <b><tt>wvdialconf /etc/wvdial.conf</tt></b>
Scanning your serial ports for a modem.
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 4800 baud
ttyS0<*1>: ATQ0 V1 E1 -- OK
ttyS0<*1>: ATQ0 V1 E1 Z -- OK
ttyS0<*1>: ATQ0 V1 E1 S0=0 -- OK
ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- ERROR
ttyS0<*1>: Modem Identifier: ATI -- 128K
ttyS0<*1>: Speed 9600: AT -- OK
ttyS0<*1>: Speed 19200: AT -- OK
ttyS0<*1>: Speed 38400: AT -- OK
ttyS0<*1>: Speed 57600: AT -- OK
ttyS0<*1>: Speed 115200: AT -- OK
ttyS0<*1>: Max speed is 115200; that should be safe.
ttyS0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
Found a modem on /dev/ttyS0.
/etc/wvdial.conf<Warn>: Can't read config file /etc/wvdial.conf: No such file or directory
Modem configuration written to /etc/wvdial.conf.
ttyS0<Info>: Speed 115200; init "ATQ0 V1 E1 S0=0 &C1 &D2"
david root% </pre><p xmlns="http://www.w3.org/1999/xhtml">
This produced the following
<tt xmlns="http://www.w3.org/1999/xhtml">/etc/wvdial.conf</tt>. You will have a similar file.
</p><pre class="screen">
[Dialer Defaults]
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
ISDN = 0
Modem Type = Analog Modem
; Phone = <Target Phone Number>
; Username = <Your Login Name>
; Password = <Your Password> </pre><p xmlns="http://www.w3.org/1999/xhtml">
You can now fill in your ISP's phone number, your username and password.
You should now be able to run wvdial and connect to the Internet. Type
wvdial and you should see several lines scroll past and will stop after
starting pppd. To stop the connection, press <ctrl> - C. Refer to
<a href="http://open.nit.ca/wvdial" target="_top">the wvdial homepage</a> if you can
not connect. Some things to check are that wvdialconf detected the right
modem init strings for your modem. You should be able to find sensible
init strings by looking at any MS Windows inf files for your
modem. <a href="http://www.56k.com" target="_top">www.56k.com</a> may be of some help.
</p><p xmlns="http://www.w3.org/1999/xhtml">
I recommend that you re-arrange your wvdial.conf to separate the modem
configuration from any ISP account details. Read the wvdial documentation
for more information. Here is a similar file to my own.
</p><pre class="screen">
[Dialer Defaults]
Modem = /dev/ttyS0
Baud = 115200
Init1 = ATZ
Init2 = AT &FE0x7
Init3 = AT B40
Init4 = AT S84.4=1
Init5 = AT S7=60 S50=0 L1 M1 &K3 &K44 &H3
Init6 = AT S87.2=0
Dial Command = ATDI
Auto DNS = off
; use analogue modem
[Dialer modem]
Modem = /dev/ttyS1
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0
Init3 =
Init4 =
Init5 =
Init6 =
; display modem information
[Dialer info]
Init9 = AT&V
; Prevent wvdial reconnecting after being disconnected
[Dialer noreconnect]
Auto Reconnect = off
; BT Connect Lite service
[Dialer ConnectLite]
; BT are stupid. See the man page for details
Stupid Mode = on
Phone = 08089933024
Username = [email protected]
Password = password
; BT OpenWorld service
[Dialer btopenworld]
; BT are stupid. See the man page for details
Stupid Mode = on
Phone = 08089933001
Username = [email protected]
Password = password </pre><p xmlns="http://www.w3.org/1999/xhtml">
I use a ISDN TA
and have 2 ISP accounts I have also included a few useful sections. This
allows me to use a modem if I need to or show information about the
current device. You may want to include an option to turn the modem's
speaker off.
</p><i xmlns="http://www.w3.org/1999/xhtml">TODO: explain the result of these
commands</i><pre class="screen">david root% <b><tt>wvdial connectlite</tt></b>
david root% <b><tt>wvdial btopenworld modem info</tt></b>
david root% <b><tt>wvdial connectlite noreconnect</tt></b>
</pre></div><div xmlns="http://www.w3.org/1999/xhtml" class="sect1"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="http://www.w3.org/1999/xhtml" id="id2828852"/>Change wvdial to be used as a chat replacement</h2></div></div><p xmlns="http://www.w3.org/1999/xhtml">
Normally wvdial invokes pppd to negotiate the PPP connection after it has
setup to the dial-up connection. We need pppd to invoke wvdial to setup
the dial-up connection before it negotiates the PPP connection.
Fortunately, wvdial has the ability to behave like the traditional way of
using pppd, chap scripts. Unfortunately, when using wvdial normally, it
passes various options to pppd on the command line, but as pppd is
running wvdial, we can not do this. The solution is to put the options
wvdial normally passes on the command line into an options file in
<tt xmlns="http://www.w3.org/1999/xhtml">/etc/ppp/peers</tt>. If you look in this directory, you should find a file called wvdial. Make a copy of this file ad call it something like dod.
</p><pre class="screen">david root% <b><tt>cd /etc/ppp/peers/</tt></b>
david root% <b><tt>ls</tt></b>
provider wvdial wvdial-pipe
david root% <b><tt>cp wvdial dod</tt></b>
david root% <b><tt>ls</tt></b>
dod provider wvdial wvdial-pipe
david root%
</pre><p xmlns="http://www.w3.org/1999/xhtml">
We need to find out what options wvdial passes to pppd. We can do that by
running wvdial and then looking at pppd's command line. We can grep the
output of <b xmlns="http://www.w3.org/1999/xhtml">ps auxw</b>
</p><pre class="screen">router root% <b><tt>wvdial connectlite &</tt></b>
[1] 1567
--> WvDial: Internet dialer version 1.53
router root% --> Initializing modem.
--> Sending: ATZ
OK
--> Sending: AT &FE0x7
AT &FE0x7
OK
--> Sending: AT B40
OK
--> Sending: AT S84.4=1
OK
--> Sending: AT S7=60 S50=0 L1 M1 &K3 &K44 &H3
OK
--> Sending: AT S87.2=0
OK
--> Modem initialized.
--> Sending: ATDI08089933024
--> Waiting for carrier.
CONNECT 64000/NONE/PPP
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Fri May 17 00:26:42 2002
--> pid of pppd: 1568
router root% <b><tt>ps auxw | grep pppd</tt></b>
root 1568 0.0 0.1 2068 928 tts/0 S 00:26 0:00 /usr/sbin/pppd 115200 \
modem crtscts defaultroute usehostname -detach call wvdial \
user [email protected] noipdefault idle 0 logfd 6
router root% <b><tt>killall wvdial</tt></b>
Caught signal #15! Attempting to exit gracefully...
router root% --> Disconnecting at Fri May 17 00:27:23 2002
</pre><p xmlns="http://www.w3.org/1999/xhtml">
We need to put all the command line arguments in the /etc/ppp/peers/dod
file. We do not need to put the <tt xmlns="http://www.w3.org/1999/xhtml">-detach</tt> or the
<tt xmlns="http://www.w3.org/1999/xhtml">call
wvdial</tt> section in the file. <tt xmlns="http://www.w3.org/1999/xhtml">-detach</tt> prevents pppd from
going into the background and we probably want pppd to go into the
background. The <tt xmlns="http://www.w3.org/1999/xhtml">call wvdial</tt> section reads options from the
/etc/ppp/peers/wvdial file, but as we copied the file we already have all
the options that file contains.
</p><p xmlns="http://www.w3.org/1999/xhtml">
We also need to add an option so that pppd knows to call wvdial. Add the following line, changing the target for wvdial.
</p><pre class="screen">
connect "/usr/bin/wvdial --chat connectlite" </pre><p xmlns="http://www.w3.org/1999/xhtml">
We should now have a file that looks something like:
</p><pre class="screen">
noauth
name wvdial
connect "/usr/bin/wvdial --chat connectlite"
/dev/ttyS0
115200
modem
crtscts
defaultroute
usehostname
user [email protected]
noipdefault
idle 0
logfd 6 </pre><p xmlns="http://www.w3.org/1999/xhtml">
You can now check that you can still dial up using:
</p><pre class="screen">david root% <b><tt>pppd call dod</tt></b> </pre><p xmlns="http://www.w3.org/1999/xhtml">or</p><pre class="screen">david root% <b><tt>pon dod</tt></b> </pre><p xmlns="http://www.w3.org/1999/xhtml">
where dod is the name of the file in
<tt xmlns="http://www.w3.org/1999/xhtml">/etc/ppp/peers</tt>. You can
stop the connection using <b xmlns="http://www.w3.org/1999/xhtml">poff</b>.
</p></div><div xmlns="http://www.w3.org/1999/xhtml" class="sect1"><div xmlns="http://www.w3.org/1999/xhtml" class="titlepage"><div xmlns="http://www.w3.org/1999/xhtml"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title" style="clear: both"><a xmlns="http://www.w3.org/1999/xhtml" id="id2779265"/>Edit the peers file to run with dial-on-demand</h2></div></div><p xmlns="http://www.w3.org/1999/xhtml">
We now have pppd bringing up the link when we run
<b xmlns="http://www.w3.org/1999/xhtml">pon</b> and tearing down the link when we run
<b xmlns="http://www.w3.org/1999/xhtml">poff</b>. We now have to make a few changes to
the <tt xmlns="http://www.w3.org/1999/xhtml">/etc/ppp/peers/dod</tt>
file to make the link dial-on-demand. The first change is to tell pppd to
start and create the interface, but only dial up when we first need to
send a packet over that interface. To do this we add the
<tt xmlns="http://www.w3.org/1999/xhtml">demand</tt>
option the the file.
</p><p xmlns="http://www.w3.org/1999/xhtml">
We now have a link that dials on demand, but we still have the link on
permanently after it first dials. The solution is to get pppd to stop the
connection after an idle period, i.e. no packets have left the interface
for a number of seconds. We need to add the <tt xmlns="http://www.w3.org/1999/xhtml">idle</tt> option to the
file. This option requires a argument specifying the number of seconds
of idle before tearing down the link. If you specify 0, the link will
stay up permanently. You will probably find that wvdial used
<tt xmlns="http://www.w3.org/1999/xhtml">idle
0</tt> and that therefore already have an idle option in the file. Just
change the value to a suitable value. 300 will wait 5 minutes. You may
want to use a shorter timeout, especially if you have expensive phone
bills.
</p><p xmlns="http://www.w3.org/1999/xhtml">
The final problem is that normally, once pppd has closed the link, it
exits. This means that once the link has come up and down once, the link
will not work until someone runs <b xmlns="http://www.w3.org/1999/xhtml">pon</b> again.
Fortunately, pppd has the <tt xmlns="http://www.w3.org/1999/xhtml">persist</tt> option which prevents pppd form exiting after closing the connection.
</p><p xmlns="http://www.w3.org/1999/xhtml">
We should finally end up with a
<tt xmlns="http://www.w3.org/1999/xhtml">/etc/ppp/peers/dod</tt> file similar to:
</p><pre class="screen">
noauth
name wvdial
connect "/usr/bin/wvdial --chat connectlite"
/dev/ttyS0
115200
modem
crtscts
defaultroute
usehostname
user [email protected]
noipdefault
idle 300
persist
demand
logfd 6
</pre><p xmlns="http://www.w3.org/1999/xhtml">
You should now find that the link will be dial-on-demand and can be started
by running <b xmlns="http://www.w3.org/1999/xhtml">pon dod</b> and stopped by
<b xmlns="http://www.w3.org/1999/xhtml">poff</b>. You could put
those in a crontab to start the dial-on-demand link in the morning and turn
it off in the evening, so that you don't waste money by the link dialling due
to an Internet application (like IRC) being accidentally left open.
</p><p xmlns="http://www.w3.org/1999/xhtml">
<a href="http://validator.w3.org/check/referer" target="_top">
<span class="inlinemediaobject"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!"/></span>
</a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_top">
<span class="inlinemediaobject"><img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/></span>
</a>
</p></div></div></body></html>