*BSD News Article 33914


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!swrinde!news.uh.edu!uuneo.neosoft.com!Starbase.NeoSoft.COM!jkurtz
From: jkurtz@starbase.neosoft.com (John Kurtz)
Newsgroups: comp.os.386bsd.questions
Subject: Re: FreeBSD 1.1.5.1, PPP dialin
Date: 5 Aug 1994 22:27:24 GMT
Organization: NeoSoft Internet Services   +1 713 684 5969
Lines: 114
Message-ID: <31uecd$7pg@uuneo.neosoft.com>
References: <31rptl$eai@uuneo.neosoft.com>
NNTP-Posting-Host: starbase.neosoft.com
X-Newsreader: TIN [version 1.2 PL2]

Originally from peter@starbase.neosoft.com, and cleaned up by myself from
doing the install... :)

For FreeBSD 1.1.5.1

These are things you need to replace with the proper information in the files
or excerpts below:  (Make sure you do the substitutions...)

Phone number:	PHONENUMBER		-- the number you dial
User name:	USERNAME		-- this is the account name
Password:	PASSWORD		-- account password
Modem device:	MODEMDEV		-- which /dev.  like /dev/cua03
Modem baud:	MODEMBAUD		-- like 19200, or 38400 or such
Local:		LOCALHOST		-- fill your machine name in here
Local IP:	LOCAL_IP		-- fill your machine IP in here
Remote:		REMOTEHOST		-- fill connecting machine name here
Remote IP:	REMOTE_IP		-- fill connecting machine IP in here


Add into /etc/netstart
=============================================================================
if [ -e /etc/ppp/ppp-setup ]; then
        /etc/ppp/ppp-setup
fi

# use loopback, not the wire
route add $hostname -interface localhost
=============================================================================

Add into /etc/hosts
=============================================================================
LOCAL_IP    LOCALHOST
REMOTE_IP   REMOTEHOST
=============================================================================

Create /etc/gateways if it doesn't exist
=============================================================================
net 0.0.0.0 gateway REMOTEHOST metric 1 passive
host LOCALHOST gateway LOCALHOST metric 0 passive
=============================================================================

do a 'mkdir /etc/ppp' directory command.

Create /etc/ppp/options
=============================================================================
crtscts
asyncmap a0000
debug
passive
=============================================================================

Create /etc/ppp/ppp-chat
=============================================================================
#!/bin/sh -f

chat "" ATQ0 OK "ATDT PHONENUMBER" CONNECT "" ogin: USERNAME word: PASSWORD
=============================================================================

Create /etc/ppp/ppp-setup
=============================================================================
#!/bin/sh -f

ifconfig ppp0 LOCALHOST REMOTEHOST netmask 0xffffff00 down
=============================================================================

Create /etc/ppp/ppp-start
=============================================================================
#!/bin/sh -f

PPPID='/var/run/ppp0.pid'

if [ ! -f $PPPID ]
then
    set -x
    route delete default
    /usr/libexec/pppd MODEMDEV MODEMBAUD ${1+"$@"} connect /etc/ppp/ppp-chat defaultroute name LOCALHOST
else
    echo "$0: ppp0 is already running"
fi
=============================================================================

Create /etc/ppp/ppp-stop
=============================================================================
#!/bin/sh -f

PPPID='/var/run/ppp0.pid'

if [ -f $PPPID ]
then
   set -x
   kill `cat $PPPID`
   sleep 5
   route flush
   /etc/ppp/ppp-setup
else
    echo "$0: ppp0 is not running"
fi
=============================================================================

Next do a 'chmod 770 /etc/ppp/ppp*' to set permissions.

This *should* be the setup required.  I am running this with no problem.
This also assumes that you rebuilt the kernel while adding at least one ppp
device.

Start the connection with '/etc/ppp/ppp-start' at your shell prompt.
Stop the connection with '/etc/ppp/ppp-stop' at tyour shell prompt.
(NOTE:  I have had problems killing the pppd process using the script, so I
 manually kill the pppd process.  Dunno why it fails, but I don't worry too
 much right now... I got it running, so that is enough :)

J.K.

Special Thanks to Peter da Silva @ neosoft.com