Subject: ip connection using pppd and pap
To: None <port-mac68k@NetBSD.ORG>
From: Brian Wildasinn <bwildasi@csulb.edu>
List: port-mac68k
Date: 10/31/1997 02:16:22
--------------81F537A8CD26CBAE3BBA066E
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Hi!
I'm just a casual user of this stuff, but would appreciate any
suggestions for getting my modem to dial and pppd to connect netbsd to
my school's computer using pap.
I'm sorry, but the man pages for pppd are simply not sufficient for me
to figure this out for myself w/o examples, and the extensive ppp faq
for the bsd family seems to be mainly for freebsd which uses different
ppp files, although i've tried the suggestion of using ppp.setup.gz.

Anyway, I'm sure my difficulty is just some stupid user error. So,
without further ado...thanks for all the suggestions everybody has sent
for pppd and pap questions, but  i've never gotten a valid ppp
connection with netbsd and my school (a NeXT machine)--at least the
modem use to continuously redail. I've tried the old and new ppp.setup
files, but nothing's working. Does /etc/ttys need to be altered to fire
up the modem?

Here's what i've been getting,
ppp-up
connecting...done  <by the way, there is NO dial tone or anything from
the modem here>
#Oct 28 17:20:07 mynamepppd[215]:pppd2.3.1 Started by root uid0
#Oct 28 17:20:07 mynamepppd[215]:Connect: pppp0 <--> /dev/tty00
#Oct 28 17:20:07 mynamepppd[215]:Serial line is looped back
#Oct 28 17:20:07 mynamepppd[215]:Connection terminated.
#Oct 28 17:20:07 mynamepppd[215]:Disconnect script failed.

Now, if I add a "nomagic" to ppp-up to turn off a buggy peer, this is
what I get:
ppp-up
connecting...done  <by the way, there is STILL NO dial tone or anything
from the modem here>
#Oct 28 17:24:03 mynamepppd[305]:pppd2.3.1 Started by root uid0
#Oct 28 17:24:03 mynamepppd[305]:Connect: pppp0 <--> /dev/tty00
#Oct 28 17:24:03 mynamepppd[305]:Deflate (15) Compression enabled
#Oct 28 17:24:03 mynamepppd[305]:Could not determine remote ip address
#Oct 28 17:24:03 mynamepppd[305]:Could not determine remote ip address
#Oct 28 17:24:03 mynamepppd[305]:Connection terminated.
#Oct 28 17:24:03 mynamepppd[305]:Disconnect script failed.

ifconfig -a
sn0: flags=8822<BROADCAST, NOTRAILERS,SIMPLEX,MULTICAST> mtu 1500
address: 08:00:07:54:0f:66
ppp0:flags=8010<POINTOPOINT,MULTICAST> mtu 1500
ppp1:flags=8010<POINTOPOINT,MULTICAST> mtu 1500
lo0:flags=8009<UP,LOOPBACK,MULTICAST> mtu 2976
inet 127.0.0.1 netmask 0xff000000
sl0:flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 296

Jeffery's note a while back seems to make alot of sense, but since
there's so many ppp files i'm not sure how to plug in his suggestions:

>  Brian wrote this once upon a time:
>
>>  Using ZTerm here's what my school's computer says:
>>
>>         ---------------example #1:
>>          AT&FE1V1Q0&A3&B1&H1&R2&D0&C1x450.
>>
>>
>>         CONNECT 33600/ARQ/V34/LAPM/V42BIS CSULB
>>
>>         AutoProtocolDetect - Begin protocol or enter 4 returns for
>>        interactive
>>          mode.
>>
> This is the important part. The terminal server is waiting for one of
> two things: for your machine begin PPP (that's the AutoDetect part --
> unless it seriously is saying "AutoDefect". Then maybe it's ...
> defective), or for four returns. You don't want to give it four
> returns, you want NetBSD to recognize this text stream as its cue to
> begin PPP. Here is my ppp-up file, verbatim. I know it works because I
> am connected from my Mac using NetBSD:

> /usr/sbin/pppd /dev/tty00 19200 connect '/usr/sbin/chat -v "" ATZ OK
> ATDT372-8452 "CONNECT 19200 bgnet 14400\r \r\r\r\r AutoProtocolDetect
> - Begin protocol or enter 4 returns for interactive mode.\r"' crtscts
> defaultroute noipdefault modem remotename *.bgsu.edu user jaohlma

> You should recognize some elements in this file as similar to what you
> are seeing when you use ZTerm. (If there are elements you  don't
> recognize at all, then I'm afraid you really do need to read

> some more man pages, or at least some kind of reference. It will
> help you out in the long run.) What you need to do is substitute
> your particulars for mine (i.e., modem init and dial string, your
> domain and user name).
>
> You also need the pap-secrets file, which has the format
>
> user server secret address (optional)
>


Here's the ppp.setup.tgz files configured the best I could thus far:
#-----------> options.debug
passive
crtscts
defaultroute
lock
lcp-echo-interval 30
lcp-echo-failure 10
netmask 255.255.0.0
domain csulb.edu
mtu 1500
name bwildasi
disconnect /etc/ppp/ppp-down
debug kdebug 1
#-----------------> ppp-chat
ABORT BUSY
ABORT "NO CARRIER"
ABORT "NO DIAL"
TIMEOUT 10
"" ATZ OK AT&FE1V1Q0&A3&B1&H1&R2&D0&C1X4S0=0S7=90
OK ATDT$NUMBER
TIMEOUT 60
CONNECT ""
#---------------> ppp-connect
#!/bin/sh
#
# usage: ppp-connect <number-list> <login> <template chat script>
if [ $# -ne 3 ]
then
  echo 'usage: ppp-connect <number-list> <login> <template chat script>'
1>&2
  exit 1
fi
#
stty clocal
umask 077
#
NUMBERLIST=`cat $1`
#
NUMBER=${NUMBERLIST%%:*}
NUMBERLIST=${NUMBERLIST#*:}:$NUMBER
#
#until (sed -e "s/\$NUMBER/$NUMBER/g" -f $2 $3 >/tmp/chat-script; chat
-v -f /tmp/chat-script)
until (sed -e "s/\$NUMBER/$NUMBER/g" -f $2 $3 >/tmp/chat-script; chat -r
/tmp/ppp-report -f /tmp/chat-script)
do
  NUMBER=${NUMBERLIST%%:*}
  NUMBERLIST=${NUMBERLIST#*:}:$NUMBER
done
rm -f /tmp/chat-script
#-----------------------> ppp-down
#!/bin/sh
if [ -f /var/spool/lock/LCK..tty00 ]; then
  p=`cat /var/spool/lock/LCK..tty00`
else
  p=""
fi
#
if [ -n "$p" ]; then
  echo -n killing pppd...
  kill $p
  echo done
else
  echo ppp already is down 1>&2
fi
#---------------> ppp-login
s/\$LOGIN/bwildasi/g
s/\$PASSWD/q8abcp36/g
#----------------> ppp-numbers
985-8660; 985-7777
#----------------> ppp-up
#!/bin/sh
# ppp-up - start pppd
#
PPPDIR=/etc/ppp
NUMBERLIST=$PPPDIR/ppp-numbers
LOGIN=$PPPDIR/ppp-login
CHATSCRIPT=$PPPDIR/ppp-chat
CONNECT=$PPPDIR/ppp-connect
#
# To change this file to work w/ tty01, just change all the tty00's
# to tty01's in this file (two immediately below, one on the pppd line)
# and in the ppp-down script.
#
if [ -f /var/spool/lock/LCK..tty00 ]; then
  p=`cat /var/spool/lock/LCK..tty00`
else
  p=""
fi
#
if [ -n "$p" ]; then
  echo -n pppd is already running...
else
  echo -n connecting...
  pppd /dev/tty00 19200 connect "$CONNECT $NUMBERLIST $LOGIN
$CHATSCRIPT"
fi
echo done
#-----------------> resolv.conf.down
#
# Resolv.conf
#
#
domain  garuda.edu
nameserver 134.139.1.2
lookup  file bind
#-----------------> pap-secrets (i've entered asterisks as is, but the
password is fictitious)
* * q8uiew31

Any help is appreciated!

Sincerely,
Brian Wildasinn
bwildasi@csulb.edu
notes: Q700; current snapshot 100497; GENERIC 44; booter 1.11; bayer
asprin

--------------81F537A8CD26CBAE3BBA066E
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Hi!
<BR>I'm just a casual user of this stuff, but would appreciate any suggestions
for getting my modem to dial and pppd to connect netbsd to my school's
computer using pap.
<BR>I'm sorry, but the man pages for pppd are simply not sufficient for
me to figure this out for myself w/o examples, and the extensive ppp faq
for the bsd family seems to be mainly for freebsd which uses different
ppp files, although i've tried the suggestion of using ppp.setup.gz.

<P>Anyway, I'm sure my difficulty is just some stupid user error. So, without
further ado...thanks for all the suggestions everybody has sent for pppd
and pap questions, but&nbsp; i've never gotten a valid ppp connection with
netbsd and my school (a NeXT machine)--at least the modem use to continuously
redail. I've tried the old and new ppp.setup files, but nothing's working.
Does /etc/ttys need to be altered to fire up the modem?

<P>Here's what i've been getting,
<BR>ppp-up
<BR>connecting...done&nbsp; &lt;by the way, there is NO dial tone or anything
from the modem here>
<BR>#Oct 28 17:20:07 mynamepppd[215]:pppd2.3.1 Started by root uid0
<BR>#Oct 28 17:20:07 mynamepppd[215]:Connect: pppp0 &lt;--> /dev/tty00
<BR>#Oct 28 17:20:07 mynamepppd[215]:Serial line is looped back
<BR>#Oct 28 17:20:07 mynamepppd[215]:Connection terminated.
<BR>#Oct 28 17:20:07 mynamepppd[215]:Disconnect script failed.

<P>Now, if I add a "nomagic" to ppp-up to turn off a buggy peer, this is
what I get:
<BR>ppp-up
<BR>connecting...done&nbsp; &lt;by the way, there is STILL NO dial tone
or anything from the modem here>
<BR>#Oct 28 17:24:03 mynamepppd[305]:pppd2.3.1 Started by root uid0
<BR>#Oct 28 17:24:03 mynamepppd[305]:Connect: pppp0 &lt;--> /dev/tty00
<BR>#Oct 28 17:24:03 mynamepppd[305]:Deflate (15) Compression enabled
<BR>#Oct 28 17:24:03 mynamepppd[305]:Could not determine remote ip address
<BR>#Oct 28 17:24:03 mynamepppd[305]:Could not determine remote ip address
<BR>#Oct 28 17:24:03 mynamepppd[305]:Connection terminated.
<BR>#Oct 28 17:24:03 mynamepppd[305]:Disconnect script failed.

<P>ifconfig -a
<BR>sn0: flags=8822&lt;BROADCAST, NOTRAILERS,SIMPLEX,MULTICAST> mtu 1500
<BR>address: 08:00:07:54:0f:66
<BR>ppp0:flags=8010&lt;POINTOPOINT,MULTICAST> mtu 1500
<BR>ppp1:flags=8010&lt;POINTOPOINT,MULTICAST> mtu 1500
<BR>lo0:flags=8009&lt;UP,LOOPBACK,MULTICAST> mtu 2976
<BR>inet 127.0.0.1 netmask 0xff000000
<BR>sl0:flags=c010&lt;POINTOPOINT,LINK2,MULTICAST> mtu 296

<P>Jeffery's note a while back seems to make alot of sense, but since there's
so many ppp files i'm not sure how to plug in his suggestions:
<BLOCKQUOTE TYPE=CITE>
<PRE>&nbsp;Brian wrote this once upon a time:</PRE>

<BLOCKQUOTE TYPE=CITE>
<PRE>&nbsp;Using ZTerm here's what my school's computer says:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ---------------example #1:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AT&amp;FE1V1Q0&amp;A3&amp;B1&amp;H1&amp;R2&amp;D0&amp;C1x450.


&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECT 33600/ARQ/V34/LAPM/V42BIS CSULB

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AutoProtocolDetect - Begin protocol or enter 4 returns for
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interactive
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mode.</PRE>
</BLOCKQUOTE>
This is the important part. The terminal server is waiting for one of two
things: for your machine begin PPP (that's the AutoDetect part -- unless
it seriously is saying "AutoDefect". Then maybe it's ... defective), or
for four returns. You don't want to give it four returns, you want NetBSD
to recognize this text stream as its cue to begin PPP. Here is my ppp-up
file, verbatim. I know it works because I am connected from my Mac using
NetBSD:</BLOCKQUOTE>

<BLOCKQUOTE TYPE=CITE>/usr/sbin/pppd /dev/tty00 19200 connect '/usr/sbin/chat
-v "" ATZ OK ATDT372-8452 "CONNECT 19200 bgnet 14400\r \r\r\r\r AutoProtocolDetect
- Begin protocol or enter 4 returns for interactive mode.\r"' crtscts defaultroute
noipdefault modem remotename *.bgsu.edu user jaohlma</BLOCKQUOTE>

<BLOCKQUOTE TYPE=CITE>You should recognize some elements in this file as
similar to what you are seeing when you use ZTerm. (If there are elements
you&nbsp; don't recognize at all, then I'm afraid you really do need to
read</BLOCKQUOTE>

<BLOCKQUOTE TYPE=CITE>
<PRE>some more man pages, or at least some kind of reference. It will
help you out in the long run.) What you need to do is substitute
your particulars for mine (i.e., modem init and dial string, your
domain and user name).

You also need the pap-secrets file, which has the format

user server secret address (optional)</PRE>
</BLOCKQUOTE>
&nbsp;

<P>Here's the ppp.setup.tgz files configured the best I could thus far:
<BR>#-----------> options.debug
<BR>passive
<BR>crtscts
<BR>defaultroute
<BR>lock
<BR>lcp-echo-interval 30
<BR>lcp-echo-failure 10
<BR>netmask 255.255.0.0
<BR>domain csulb.edu
<BR>mtu 1500
<BR>name bwildasi
<BR>disconnect /etc/ppp/ppp-down
<BR>debug kdebug 1
<BR>#-----------------> ppp-chat
<BR>ABORT BUSY
<BR>ABORT "NO CARRIER"
<BR>ABORT "NO DIAL"
<BR>TIMEOUT 10
<BR>"" ATZ OK AT&amp;FE1V1Q0&amp;A3&amp;B1&amp;H1&amp;R2&amp;D0&amp;C1X4S0=0S7=90
<BR>OK ATDT$NUMBER
<BR>TIMEOUT 60
<BR>CONNECT ""
<BR>#---------------> ppp-connect
<BR>#!/bin/sh
<BR>#
<BR># usage: ppp-connect &lt;number-list> &lt;login> &lt;template chat
script>
<BR>if [ $# -ne 3 ]
<BR>then
<BR>&nbsp; echo 'usage: ppp-connect &lt;number-list> &lt;login> &lt;template
chat script>' 1>&amp;2
<BR>&nbsp; exit 1
<BR>fi
<BR>#
<BR>stty clocal
<BR>umask 077
<BR>#
<BR>NUMBERLIST=`cat $1`
<BR>#
<BR>NUMBER=${NUMBERLIST%%:*}
<BR>NUMBERLIST=${NUMBERLIST#*:}:$NUMBER
<BR>#
<BR>#until (sed -e "s/\$NUMBER/$NUMBER/g" -f $2 $3 >/tmp/chat-script; chat
-v -f /tmp/chat-script)
<BR>until (sed -e "s/\$NUMBER/$NUMBER/g" -f $2 $3 >/tmp/chat-script; chat
-r /tmp/ppp-report -f /tmp/chat-script)
<BR>do
<BR>&nbsp; NUMBER=${NUMBERLIST%%:*}
<BR>&nbsp; NUMBERLIST=${NUMBERLIST#*:}:$NUMBER
<BR>done
<BR>rm -f /tmp/chat-script
<BR>#-----------------------> ppp-down
<BR>#!/bin/sh
<BR>if [ -f /var/spool/lock/LCK..tty00 ]; then
<BR>&nbsp; p=`cat /var/spool/lock/LCK..tty00`
<BR>else
<BR>&nbsp; p=""
<BR>fi
<BR>#
<BR>if [ -n "$p" ]; then
<BR>&nbsp; echo -n killing pppd...
<BR>&nbsp; kill $p
<BR>&nbsp; echo done
<BR>else
<BR>&nbsp; echo ppp already is down 1>&amp;2
<BR>fi
<BR>#---------------> ppp-login
<BR>s/\$LOGIN/bwildasi/g
<BR>s/\$PASSWD/q8abcp36/g
<BR>#----------------> ppp-numbers
<BR>985-8660; 985-7777
<BR>#----------------> ppp-up
<BR>#!/bin/sh
<BR># ppp-up - start pppd
<BR>#
<BR>PPPDIR=/etc/ppp
<BR>NUMBERLIST=$PPPDIR/ppp-numbers
<BR>LOGIN=$PPPDIR/ppp-login
<BR>CHATSCRIPT=$PPPDIR/ppp-chat
<BR>CONNECT=$PPPDIR/ppp-connect
<BR>#
<BR># To change this file to work w/ tty01, just change all the tty00's
<BR># to tty01's in this file (two immediately below, one on the pppd line)
<BR># and in the ppp-down script.
<BR>#
<BR>if [ -f /var/spool/lock/LCK..tty00 ]; then
<BR>&nbsp; p=`cat /var/spool/lock/LCK..tty00`
<BR>else
<BR>&nbsp; p=""
<BR>fi
<BR>#
<BR>if [ -n "$p" ]; then
<BR>&nbsp; echo -n pppd is already running...
<BR>else
<BR>&nbsp; echo -n connecting...
<BR>&nbsp; pppd /dev/tty00 19200 connect "$CONNECT $NUMBERLIST $LOGIN $CHATSCRIPT"
<BR>fi
<BR>echo done
<BR>#-----------------> resolv.conf.down
<BR>#
<BR># Resolv.conf
<BR>#
<BR>#
<BR>domain&nbsp; garuda.edu
<BR>nameserver 134.139.1.2
<BR>lookup&nbsp; file bind
<BR>#-----------------> pap-secrets (i've entered asterisks as is, but
the password is fictitious)
<BR>* * q8uiew31
<BR>&nbsp;
<BR>Any help is appreciated!

<P>Sincerely,
<BR>Brian Wildasinn
<BR>bwildasi@csulb.edu
<BR>notes: Q700; current snapshot 100497; GENERIC 44; booter 1.11; bayer
asprin</HTML>

--------------81F537A8CD26CBAE3BBA066E--