*BSD News Article 61831


Return to BSD News archive

Newsgroups: comp.unix.bsd.bsdi.misc,info.bsdi.users
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!metro!metro!inferno.mpx.com.au!news.mel.aone.net.au!mackay01.cqit.qld.edu.au!nanguo.chalmers.com.au!robert
From: robert@nanguo.chalmers.com.au (Robert Chalmers)
Subject: mini-faq for PPP. beginning 
Reply-To: robert@chalmers.com.au
Organization: China House.
Date: Mon, 12 Feb 1996 09:36:13 GMT
Approved: none
Message-ID: <DMnpCD.J42.G.nanguo@nanguo.chalmers.com.au>
Lines: 287
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:2416 info.bsdi.users:7529

Archive-name: mini-faq. bsdi
Last-modified: Mon Feb 12 19:30:51 EST 1996

Some general notes:
This FAQs may be available via the Web.

When used alone, the word "bsdi" is used to mean any of the
versions that may have been released.

Many people have contributed to this list, directly or indirectly.  In
some cases, an answer has been adapted from one or more postings on the
My thanks to all of those who post answers.
The name (or names) at the end of an entry indicate that the information
was taken from postings by those individuals; the text may have been
edited for this FAQ.  These citations are only given to acknowledge the
contribution.



      T I P S,  T R I C K S  a n d  T R A P S.


A N  I N T R O D U C T I O N  T O   B S D I    S E T U P S  &  F I X E S

A compendium of tips, of tricks, and of traps for the innocent & the unwary



  	  ------------ Introduction --------------
Having spent considerable time on this little baby, I have at last
found  the solution to my PPP connection problems. Yet to be resolved
aew the dead mouse port, and the non-functional incoming ftp over the
ppp link.  I tracked down the lack of connectivity to a few peoblems,
the final one being switches defaulting to 'on', when all hardware
that I have installed at remote ends is default 'off'. Tricky.
So here is what I have done to get a PPP link, dial out from the
BSDI server, to a remote site. The BSDI site is numbered
203.22.80.2, the remote site 203.1.96.4, 2 C-class networks.



Table of Contents.
Dialout.  PPP

In this instance, I have taken out the Dialin bits.


The ppp.sys file looks like this;

#	BSDI SYS,v 2.5 1995/05/09 15:55:05 prb Exp
# Standard dialin and dialout entries.
# These two should normally be left untouched.
#	
Dialout:\
	:do:\
	:li=/etc/netscripts/Dialout.login:\
	:lu=/etc/netscripts/Dialout.up:\
	:ld=/etc/netscripts/Dialout.down:

#
# entry also assumes you have a hayes compatible modem.
# Generally a 14.4 modem should run at 57600 and a 28.8 at 115200
# In either case, you want at least a buffered (16550) UART.

modem1:du:at=hayes:dv=/dev/tty01:br#38400

#
#---------------------------- L_IP           R_IP
Peros:tc=Dialout:\
	:in#0:im:id#0:if=inet 203.22.80.5 203.1.96.4 netmask 0xffffff00:\
	:pf=-pfc,-acfc,-tcpc,-ftel,trace:\
	:pn=578425:\
	:s0=^M^M:\
	:e0=username:f0=^M:\
	:s1=robert^M:\
	:e1=password:f1=^M:\
	:s2=moonbeam^M:\
	:e2=ECS:\
	:s3=ppp^M:\
	:e3=PPP.:\
	:tc=modem1:



In the above script, I had to set the following in the :pf: line,

	:pf=-pfc,-acfc,-tcpc,-ftel,trace:\


This showed up in the output from a connection. The last one I set was
-tcpc. I had left it as tcpc. My remote hardware didn't want to know.
This became  evident in the trace, It's not that long, and is worth
printing out so you can see how it fails. Because the remote doesn't know
about the tcpc, it actually connects, then times out. Note also that
the  :pf: option 'trace' is on.

resulting from 'ppp -x Peros'		[Peros is the name of the remote]

Feb 12 14:16:38 mackay01 kernel: ppp0: init PPP link
Feb 12 14:16:38 mackay01 kernel: ppp0: got CD -- send Conf-Req
Feb 12 14:16:38 mackay01 kernel: ppp_cp_up: LCP
Feb 12 14:16:38 mackay01 kernel: state <- CP_REQSENT
Feb 12 14:16:38 mackay01 kernel: LCP_CREQ -- {MRU: 1500} {ACCM: 0} {MAGIC: 0x6460d253} id=13
Feb 12 14:16:38 mackay01 kernel: PPPIOCIPWBOS f062210c: waiting
Feb 12 14:16:39 mackay01 kernel: ppp0: RCV LCP1 Configure-Request id=1 len=8  {PFC: len=2} REJECT {ACFC: len=2} REJECT -> send Conf-Rej

........... note the REJECT warnings turning up here, along with the
	    PFC and ACFC settings. The system is REJECT'ing the Conf.

Feb 12 14:16:39 mackay01 kernel: state <- CP_REQSENT
Feb 12 14:16:39 mackay01 kernel: ppp0: RCV LCP1 Configure-Request id=2 len=4  -> send Conf-Ack (len=8)
Feb 12 14:16:39 mackay01 kernel: state <- CP_ACKSENT
Feb 12 14:16:41 mackay01 kernel: ppp0: LCP[rc=10] TO+ - send Conf-Req
Feb 12 14:16:41 mackay01 kernel: LCP_CREQ -- {MRU: 1500} {ACCM: 0} {MAGIC: 0x6460d253} id=14
Feb 12 14:16:41 mackay01 kernel: ppp0: RCV LCP4 Configure-Reject id=14 len=10  {5: len=6} -- send Conf-Req
Feb 12 14:16:41 mackay01 kernel: LCP_CREQ -- {MRU: 1500} {ACCM: 0} id=15
Feb 12 14:16:41 mackay01 kernel: ppp0: RCV LCP2 Configure-Ack id=15 len=14 state <- CP_OPENED
Feb 12 14:16:41 mackay01 kernel: ppp_cp_up: IPCP
Feb 12 14:16:41 mackay01 kernel: state <- CP_REQSENT
Feb 12 14:16:41 mackay01 kernel: ppp0: IPCP_CREQ -- {CPROT: 2d} {ADDR: 203.22.80.5}
Feb 12 14:16:41 mackay01 kernel: ppp0: RCV IPCP2 Configure-Ack id=5 len=16  -- init restart cntr
Feb 12 14:16:41 mackay01 kernel: state <- CP_ACKRCVD
Feb 12 14:16:44 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=3 len=16  {CPROT: len=6 prot=0x2d ms=15 c=1} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:44 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=4 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:44 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=5 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:44 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=6 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=7 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=8 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=9 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=10 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=11 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=12 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV IPCP1 Configure-Request id=13 len=16  {CPROT: len=6 prot=0x0 ms=15 c=0} NAK {ADDR: len=6 addr=203.1.96.4} -> send Conf-Nak (len=14)
Feb 12 14:16:45 mackay01 kernel: ppp0: RCV LCP5 Terminate-Request id=14 len=4 ppp_cp_down: IPCP
Feb 12 14:16:45 mackay01 kernel: state <- CP_STARTING
Feb 12 14:16:45 mackay01 kernel: state <- CP_STOPPING
Feb 12 14:16:45 mackay01 kernel:  -- send Term-Ack
Feb 12 14:16:48 mackay01 kernel: ppp0: LCP[rc=1] TO- Drop Connection
Feb 12 14:16:48 mackay01 kernel: state <- CP_STOPPED
Feb 12 14:17:38 mackay01 kernel: PPPIOCIPWBOS f062210c: failed
Feb 12 14:17:38 mackay01 kernel: ppp0: CD lost
Feb 12 14:17:38 mackay01 kernel: ppp_cp_down: LCP
Feb 12 14:17:38 mackay01 kernel: state <- CP_STARTING
Feb 12 14:17:38 mackay01 kernel: ppp0: shutdown PPP link
Feb 12 14:17:38 mackay01 kernel: ppp_cp_close: LCP
Feb 12 14:17:38 mackay01 kernel: state <- CP_INITIAL

--------------------------------------------------------
After counting down, it times out. This is before I fixed the tcpc by
turning it off with -tcpc.

Now, ppp.sys calls Dialout.login, Dialout.up and Dialout.down. These
are as follows.

Dialout.login. _unchanged_ from delivered.
============================================
#!/bin/sh
#	BSDI Dialout.login,v 2.2 1995/05/09 15:54:09 prb Exp
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SYSTEM=$1
INTERFACE=$2
#
# Login script for SLIP dialout.
# If a PPP session comes in, just exit with a 0
# If we cannot find an IP address for this account then we must give up.
#
case $INTERFACE in
ppp*) exit 0 ;;
esac

LOCAL=$(hostname)
REMOTE=

if [ -r /etc/netscripts/addr-map ] ; then
	REMOTE=$(awk -v S=$SYSTEM '$1 == S { $1 = "" ; print ; exit 0; }' \
		< /etc/netscripts/addr-map)
	if [ X"$REMOTE" = X ] ; then
		exit 1
	fi
	eval set - $REMOTE
	REMOTE=$1
	shift
	if [ $REMOTE = DNS ] ; then
	    REMOTE=$(/usr/libexec/ppputil $(echo $SYSTEM | sed -e 's/.//'))
	    if [ -z $REMOTE ] ; then
		echo "Failed to find IP address for $SYSTEM" >&2
		exit 1
	    fi
	fi
	ifconfig $INTERFACE inet $LOCAL $REMOTE $* && exit 0
fi
exit 1
================================================================

Dialout.up
------------
#!/bin/sh
#	BSDI Dialout.up,v 2.2 1995/05/09 15:54:39 prb Exp
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SYSTEM=$1	# System
INTERFACE=$2	# Interface
LOCAL=$3	# Local address
REMOTE=$4	# Remote address

#
# If there is no default route then add one through this interface
# Comment out these lines if you do not want a default route defined
#
#if [ "$REMOTE" ] ; then
#    if ! route get default 2> /dev/null | grep default > /dev/null 2>&1 ; then
#	route add default $REMOTE
#    fi
#fi
route add 203.1.96.0 203.1.96.4 -hopcount 1
exit 0
======================  added the route on the remote to point to its net.

Dialout.down.  _unchanged_
----------------------------
#!/bin/sh
#	BSDI Dialout.down,v 2.3 1995/05/19 18:36:35 prb Exp
PATH=/sbin:/usr/sbin:/bin:/usr/bin
SYSTEM=$1	# System
INTERFACE=$2	# Interface
LOCAL=$3	# Local address
REMOTE=$4	# Remote address

#
# If the default route points to this interface, delete it.
# If you do not want to delete the default route, comment out the next 3 lines
#
if route get default | grep -q "interface: $INTERFACE\$" ; then
	route delete default
fi
if [ "$LOCAL" ] ; then
	ifconfig $INTERFACE -alias $LOCAL down -link0 -link1 -link2
fi
exit 0
==================================================================


addr-map. fairly standard.
==========================
ppp0	203.22.80.5
ppp1	203.22.80.6
ppp2	203.22.80.7
ppp3	203.22.80.8

==================================================================

#	BSDI $Id: ttys,v 2.1 1995/02/03 05:54:46 polk Exp $
#	@(#)ttys        5.2 (Berkeley) 6/10/93

# PC COM ports (tty00 is DOS COM1)
tty00	"/usr/libexec/getty std.1200"	unknown	off
tty01	"/usr/libexec/getty std.38400"	ibmpc3	off
tty02	"/usr/libexec/getty std.9600"	unknown	off
tty03	"/usr/libexec/getty std.9600"	unknown	off


and the appropriate part from gettytab;


#	BSDI gettytab,v 2.2 1995/07/11 18:06:08 donn Exp
#	@(#)gettytab	5.14 (Berkeley) 3/27/91


h|std.38400|38400-baud:\
	:hf:\
	:sp#38400:

========================================================


routed is running. All appropriate routes are put in place, and the
system starts up and connects now no worries.

The last, and really tricky part was the :pf: switches. They had
me looking under the bonnet, when actually the wheels had fallen off the pram!


Hope that is of some help;  I will add the Dialin bits to this 
mini-faq later.

-- 
The China House					Sheng Huo Jiu Shi Dou Zheng
robert@chalmers.com.au				上  或  就  是 斗  争