On 30-May-99 [EMAIL PROTECTED] wrote:
> I'm trying to setup diald and have run into a major question. Does diald 
> support PAP or CHAP authentication? All examples I have seen refer to 
> script based logins, in which diald is searching for --name: and word:
> fields
> (or derivations thereof). Since PAP is used on Cornell's dialup pool, I
> can 
> login using pppd from the command line (and included files like
> /etc/ppp/pap-secrets) but this does not seem to cut it for the diald 
> configurations. Any advice, tips or tricks would be appreciated!

I am using it this way. The tip is that the connect script returns just
after it receives "CONNECT" string from modem (with exit code of 0, I
think). Diald will then start pppd, and pppd will authenticate with PAP or
CHAP, depending what is needed. Of course, there must be pap or chap secret
files. As an example, here is my connect script in attachment (which is
somewhat non-standard because I have modem with stupid STOP! answer).

----------------------------------
Milan P. Stanic

**********************************
* Stop the bombing of my country *
**********************************
#!/bin/sh
# Copyright (c) 1996, Eric Schenk.

# This script is intended to give an example of a connection script that
# uses the "message" facility of diald to communicate progress through
# the dialing process to a diald monitoring program such as dctrl or diald-top.
# It also reports progress to the system logs. This can be useful if you
# are seeing failed attempts to connect and you want to know when and why
# they are failing.

# This script requires the use of chat-1.9 or greater for full
# functionality. It should work with older versions of chat,
# but it will not be able to report the reason for a connection failure.

# This script is modified (trimmed down) by Milan P. Stanic of original
# version, intended for AUTO_PPP servers on remote side, so all
# user identification and authentication is accomplished through 
# PPP PAP or CHAP identifications and authentication.
# The STOP message in chat parameters are for use with modems which have
# that "nice" feature. Script even can be expanded to reset such modems
# via some external hardware (maybe parallel port).

# Configuration parameters

# The initialization string for your modem

MODEM_INIT="ATL3X7"

# The phone number to dial
PHONE_NUMBER="011683787"

# The string to wait for to see that the protocol on the remote
# end started OK. If this is empty then no check will be performed.
#START_ACK="Switching to PPP."

# Pass a message on to diald and the system logs.
function message () {
[ $FIFO ] && echo "message $*" >$FIFO
logger -p local2.info -t connect "$*"
}

# Initialize the modem. Usually this just resets it.
message "Initializing Modem"
chat TIMEOUT 5 "" $MODEM_INIT TIMEOUT 45 OK ""
if [ $? != 0 ]; then
    message "Failed to initialize modem"
    exit 1
fi

# Dial the remote system.

message "Dialing system"
chat \
        TIMEOUT 65 \
        ABORT "NO CARRIER" \
        ABORT BUSY \
        ABORT STOP \
        ABORT "NO DIALTONE" \
        ABORT ERROR \
        "" ATDT$PHONE_NUMBER \
        CONNECT ""
case $? in
   0) message Connected;;
   1) message "Chat Error"; exit 1;;
   2) message "Chat Script Error"; exit 1;;
   3) message "Chat Timeout"; exit 1;;
   4) message "No Carrier"; exit 1;;
   5) message "Busy"; exit 1;;
   6) message "STOP!"; exit 1;;
   7) message "No DialTone"; exit 1;;
   8) message "Modem Error"; exit 1;;
   *)
esac

# Success!
# why to wait even few milliseconds
#message "Connected -- Protocol started"

Reply via email to