Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 1995 18:59:31 +0000 ()
From:      "Eric J. Chet" <ejc@freefall.freebsd.org>
To:        Debuggus Maximus <doplcky@metronet.com>
Cc:        questions@freebsd.org
Subject:   Re: chat script for PPP connect
Message-ID:  <Pine.BSF.3.91.950116184625.3200B-100000@localhost>
In-Reply-To: <199601160738.AA16794@metronet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Hello
	This is for a ppp connection using pap.  This should get you
started, it works for me.

---start /etc/ppp/ppp-on

#!/bin/sh
TELEPHONE='xxx-xxxx'	# The telephone number for the connection
export TELEPHONE 

DIR=/etc/ppp
DIALER_SCRIPT=$DIR/ppp-on-dialer

exec /usr/sbin/pppd -chap +ua $DIR/ppp.secret /dev/cuaa1 38400 \
connect $DIALER_SCRIPT

---end ppp-on

---start /etc/ppp/ppp-on-dialer

#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec /usr/bin/chat -v					\
	TIMEOUT		3				\
	ABORT		'\nBUSY\r'			\
	ABORT		'\nNO ANSWER\r'			\
	ABORT		'\nRINGING\r\n\r\nRINGING\r'	\
	''		'\rAT\r'			\
	'OK-+++\c-OK'	'AT'				\
	TIMEOUT		45				\
	OK		ATDT$TELEPHONE			\
	CONNECT		''				\
---end ppp-on-dialer

---start /etc/ppp/ppp-off
#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
	DEVICE=ppp0
else
	DEVICE=$1
fi

######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1

---end ppp-off

---start /etc/ppp/ppp.secrets
username
password
---end ppp.secrets

---start /etc/ppp/options
crtscts		# enable hardware flow control
modem		# modem control line
noipdefault	# remote PPP server must supply your IP address.
		# if the remote host doesn't send your IP during IPCP
		# negotiation , remove this option
passive		# wait for LCP packets
domain your-domain	# put your domain name here
:xx.xx.xx.xx	# put the IP of remote PPP host here
		# it will be used to route packets via PPP link
		# if you didn't specified the noipdefault option
		# change this line to <local_ip>:<remote_ip>

defaultroute	# put this if you want that PPP server will be your
		# default router
mru 2088        # 40 bytes TCP/IP header + 2048 bytes of date
mtu 2088        # 40 bytes TCP/IP header + 2048 bytes of data
debug
lock
asyncmap 0
escape FF
kdebug 0
netmask 255.255.255.0
---end options

On Tue, 16 Jan 1996, Debuggus Maximus wrote:

> Hiya folks.
> 
> I have RTFM till my eyes have crossed and cannot figure out what I am 
> doing wrong.  My modem is on /dev/ttyd1 and chat refuses to talk to it.
> Ive been at it for hours.  Anyone got suggestions?  I did this with 
> release 2.0 and had no problems, but 2.0.5 seems to choke on it.
> Chances are it is a case of operator headspace and timing.  If someone 
> has a script that works I would be most appreciative.
> 
> 
> David Opalecky
> 
> =====================================================================
> David Opalecky              |         "So braust unser Panzer
> david.opalecky@ast.com      |          wie sturm wind dahin!"
> doplcky@metronet.com        |        -Bundeswehr Panzer Korps
> =====================================================================
> The above opinions may or may not reflect my actual views. =)
> 
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.950116184625.3200B-100000>