Getting diald to work on Linux
It seems that many people have trouble getting diald to establish a connection with the current
documentation. So if your ppp connection works fine, but diald doesn't - here's the solution in
many cases...
Original post to the diald mailing list:
To: linux-diald@vger.rutgers.edu
Subject: PPP hangs when using diald
Send reply to: osterday@cyberset.com
Date sent: Fri, 15 Aug 1997 16:40:10
I'm using:
Slackware 3.2
kernel 2.0.30
pppd version 2.2 patch level 0
release 0.16 of diald
(I tried to compile pppd 2.3.1 into my kernel, but it died - I've
heard other people had this same problem, but that's a different
topic...)
I can get and maintain a ppp link to my ISP with no problem, but when I try
to use diald the machine dials my ISP, logs in, but then just sits there
and hangs up after 30 seconds.
Here's my messages log output:
Aug 13 17:18:36 machine diald[228]: Running connect (pid = 244).
Aug 13 17:18:37 machine connect: Initializing Modem
Aug 13 17:18:37 machine connect: Dialing system
Aug 13 17:18:57 machine connect: Connected
Aug 13 17:18:57 machine connect: Loggin in
Aug 13 17:18:58 machine connect: Protocol started
Aug 13 17:18:58 machine diald[228]: Running pppd (pid = 253).
Aug 13 17:18:58 machine pppd[253]: pppd 2.2.0 started by root, uid 0
Aug 13 17:18:58 machine pppd[253]: Using interface ppp0
Aug 13 17:18:58 machine pppd[253]: Connect: ppp0 <--> /dev/modem
Aug 13 17:19:28 machine pppd[253]: Connection terminated.
Aug 13 17:19:28 machine pppd[253]: Exit.
When I just use pppd, I get the local and remote IP addresses in the
log after "Connect: ppp0 <--> /dev/modem".
My diald.conf is:
mode ppp
connect /etc/ppp/dial-script
device /dev/modem
speed 115200
modem
lock
crtscts
local nothing.seems.to.work
remote ip.address.of.ISProute
dynamic
defaultroute
include /usr/lib/diald/standard.filter
Another wierd thing is that the docs say I can use my working ppp
script, but that never worked and gave error messages in the log
file. So I use the sample as a basis.
Any ideas???
Response:
Date sent: Sat, 16 Aug 1997 01:38:24 -0700 (PDT)
From: bae@distech.com
To: Pat Osterday
Copies to: linux-diald@vger.rutgers.edu, bae@distech.com
Subject: Re: PPP hangs when using diald (READ!)
On Fri, 15 Aug 1997, Pat Osterday wrote:
> I hope this gets to the mailing list. I subscribed yesterday, but
> have recieved only the into emails. Is this a low frequency list or is
> it down? Anyway...
Hi Pat,
Just like you, I subscribed to the list about yesterday after
pulling my hair out for over a week trying to get diald to
work. I thought I would come here for help. I had EXACTLY the
same problems you are having. I have learned what the problem
is - the hard way. Read on....
> I'm using:
>
> Slackware 3.2
> kernel 2.0.30
> pppd version 2.2 patch level 0
> release 0.16 of diald
My system is
Redhat 4.2
Kernel 2.0.30
ppp-2.2.0f
diald 0.16.4 (with the latest patches)
Read on....
> I can get and maintain a ppp link to my ISP with no problem, but when I
> try to use diald the machine dials my ISP, logs in, but then just sits
> there and hangs up after 30 seconds.
>
> Here's my messages log output:
>
> Aug 13 17:18:36 machine diald[228]: Running connect (pid = 244).
> Aug 13 17:18:37 machine connect: Initializing Modem
> Aug 13 17:18:37 machine connect: Dialing system
> Aug 13 17:18:57 machine connect: Connected
> Aug 13 17:18:57 machine connect: Loggin in
> Aug 13 17:18:58 machine connect: Protocol started
> Aug 13 17:18:58 machine diald[228]: Running pppd (pid = 253).
> Aug 13 17:18:58 machine pppd[253]: pppd 2.2.0 started by root, uid 0 Aug
> 13 17:18:58 machine pppd[253]: Using interface ppp0 Aug 13 17:18:58
> machine pppd[253]: Connect: ppp0 <--> /dev/modem Aug 13 17:19:28 machine
> pppd[253]: Connection terminated. Aug 13 17:19:28 machine pppd[253]:
> Exit.
>
> When I just use pppd, I get the local and remote IP addresses in the log
> after "Using interface ppp0".
>
Like you, my ppp by itself work perfectly when I start it up with
the ppp-on script. Then I decided use diald to bring up and bring
down the ppp link on demand. I started running into EXACTLY the same
problems as you. After hours and days of tracking, I found the problem to
be the following:
Assuming that you are using the "connect" script that comes with the
diald package, diald dials your ISP and logs in to start the ppp
session. Then after logging in to the ISP and starting the remote ppp
session, it then invokes the local pppd which uses the chat script in the
"ppp-on-dialer" script to try and log in again to your ISP to invoke a ppp
session. Of course, this second attempt to log into your ISP confuses the
modem, and the remote ppp and the session is terminated. That is the
problem!
There is something really screwed in the way that diald tries to
bring up the local pppd after it has already started the remote ppp.
It should NOT attempt to log in again.
How did I fix the problem? I did it this way: I went into my ppp-on
script and added the following line to it:
export PPP_ALONE=1
Then in my In my ppp-on dialer script I put the chat command/script
into an if statement as follows:
if [ $PPP_ALONE ]; then # exec this if I invoke ppp from command line
exec chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
'OK-+++\c-OK' ATM0 \
TIMEOUT 60 \
OK ATDT$TELEPHONE \
CONNECT '' \
ogin:--ogin: $ACCOUNT \
assword: $PASSWORD
#
else # exec this if ppp is invoked by diald; don't
# try to log in again because diald has already
# done so.
exec chat -v \
TIMEOUT 3 \
'ABORT' '\nBUSY\r' \
'ABORT' '\nNO ANSWER\r' \
'ABORT' '\nRINGING\r\n\r\nRINGING\r' \
'' ''
fi
That did it for me! Notice how the expect and send strings
are all single quoted. You in the else part of the if
statement. You must do so or diald will not like it. PPP
does not mind.
> My diald.conf is:
>
> mode ppp
> connect /etc/ppp/dial-script
> device /dev/modem
> speed 115200
> modem
> lock
> crtscts
> local nothing.seems.to.work
> remote ip.address.of.ISProute
> dynamic
> defaultroute
> include /usr/lib/diald/standard.filter
My diald.conf looks just like your, so no problem there. One thing
I should mention is that you should ensure that you have your
IP masquerading and IP forwarding and routing tables done right as
well.
> Another wierd thing is that the docs say I can use my working ppp
> script, but that never worked and gave error messages in the log
> file. So I use the sample as a basis.
This is the part that makes me unhappy. The diald documentation on how to
get it working is very misleading!!!!!!!!!! I know Eric has put a lot of
work into creating diald for us. It is a great package and I thank him for
it! The big trouble is that the documentation is out of date and
misleading. For one, it should not say that it is okay to use the PPP
connect scripts (ppp-on/ppp-on-dialer) because they don't work with diald!
It should explain a bit more how diald interacts with pppd when it brings
up the link. In my case, my ISP makes the remote ppp start up automatically
as soon as I log in with username and password.
The documentation is lacking where it matters the most,
particularly for the sake of new users that may not know enough about what
is going on to do troubleshooting. Please consider my criticism as a
constructive one. The package is great. It just needs a bit more reliable
documentation.
> Any ideas???
I hope that helps. I'm still trying to work out all the other kinks in the
set up. If you have questions, please let me know. I have seen far TOO MANY
people running into the exact same problems with diald and ppp and I would
have thought that something would be done about it.
Thanks,
Basie Etukudo
bae@distech.com
=======================================================================
Thanks, Basie!