[4061] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: PPP & Me !!!

daemon@ATHENA.MIT.EDU (James F Martin)
Tue Nov 12 11:40:04 1996

Date: Tue, 12 Nov 1996 11:27:20 -0500
From: James F Martin <martin0036@duq3.cc.duq.edu>
To: redhat-list@redhat.com
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

This note is long, so, hose it if you don't need it.
It is just a matter of sharing my particular set-up.
 
My PPP setup (NOT using RH control-panel):

File checklist:
	All the stuff in the ppp-2.2.0f.rpm
	then, specific files:

/etc/ppp/options
/etc/ppp/chatscript
/etc/host.conf
/etc/resolv.conf
/etc/syslog.conf
/etc/ppp/ip-up

Using these files (as set-up below) my command to start things going is:

pppd

(that's all folks)


Explanation and Contents of the above:
  my sources for learning all this were the Linux Gazzette, in
particular the Pluggin' In page by Baard Johannesen, the PPP How-TO, the
man pages for pppd and chat and much other experimentation and
frustration.


Contents of etc/ppp/options:

connect  /etc/ppp/chatscript
/dev/modem 57600
crtscts
modem
noipdefault
defaultroute

Comments:    This file is automatically read by pppd when you don't
tell it to do otherwise.   The first line tells it to use chatscript
to do the actual connecting (in my case, modem dialing and login to ISP)

Following that, the modem device and speed are given, yours may have to
be 38400 (I have a 33.6/28.8 connection)
crtscts   is for hardware flow control,   
modem     activates/or whatever the other modem control lines
noipdefault    is because my ISP uses dynamic addressing
defaultroute   is essential to add a route so it will all work !!


Contents of /etc/ppp/chatscript:

/usr/sbin/chat -v  \
"" atdt999-9999 \ 
CONNECT "" \
name: YourAccount \  
word: YourPassword \
annex: ppp

Comments:  The  Backslashes \ are not actually in the file - but are 
used here to indicate that it is one long continuous line, so put
whitespace in place of them.  
[I've also removed my real account name, phone number for ISP, and
password - you have to put in your own.]
This is the script which actually does the dialing and login to my ISP
It will be different for yours, probably.  GOOD LUCK on getting it
right.  I tried dip and found it even more frustrating.

/usr/sbin/chat is a very dumb program supplied with the ppp package
the  -v  option tells it to be verbose, but in this case, that means
to send stuff to the system logger, not to the console.
That's why I included     syslog.conf in the file checklist above.
Since pppd is a daemon, the log is not from ppp, but from daemon, and 
this should be set-up in syslog.conf  see the  man page for 
man 5 syslog.conf

The script is actually just a long command-line of expected strings and 
responses.
The first string in each pair is what chat 'expects' to receive from the 
modem.   The second string is what chat should send as a response.
First of all, it should expect nothing  thus we have    ""   
As a response to this nothing, it dials the modem   atdt999-9999 
Then it waits for (expects)  the modem to respond with CONNECT
And then it sends nothing ""    (maybe this sends a linefeed ?)
Then it expects the last part of the Username:  prompt, 
and sends the proper Username/Account ID 
And the same for the Pasword: prompt and the proper Password

Finally, my particular ISP has a command line prompt that uses
the Xylogics annex command interpreter, so the  prompt     annex:  
will be totally different on yours - but it is the last thing 
chat sees before it sends the command to begin a ppp connection.
	ppp
chat is now done with it's job, and nicely relinquishes the modem
connection back to pppd
pppd does the rest of the negotiation with the host computer for
the dynamic ip address and defaultroute, packet sizes, and so on.

My set-up is a stand-alone Linux box, so I am not worried about 
hiding account names and passwords on my system, consequently they
are hardcoded directly into the  chatscript   (and of course, they
are fictionalized here)

Likewise, some ISP's  use a login system whereby passwords and the like
are handled after ppp is invoked rather than before - and this
requires the use of chap or pap-secrets with the pppd.  Mine does not.
See the man pages and HOW-TO's if yours does.


Contents of  /etc/host.conf:

order hosts,bind
multi on

Comments:   I have commonly used hosts in my /etc/hosts file which is
faster than the network DNS.  I want to allow my machine to have
multiple names if necessary.


Contents of  /etc/resolv.conf

nameserver      999.999.8.38
domain		my.isp.domain


Comments:  The numbers after nameserver are specific to your ISP and 
you must obtain them for their DNS nameserver(s)
If there are additional nameservers, you can add them on
separate lines in the same format
The domain   is my isp's domain name.


Contents of /etc/ppp/ip-up

#!/bin/sh
echo -n 'Dynamically assigned Local ip-address is ' $4
cat $4 > /var/run/local-ip
sendmail -q

Comments:   This is a normal shell script file automatically 
invoked by pppd when it is done connecting, and you can put
anything in it you want  (I had   cat spam.au >/dev/audio for 
a while, but it was a bit much hearing Monty Python every time
the ppp link came up)   

The key is that it receives some parameters from pppd 
after the link is up and running.   $4 is one of these = your local 
ip address.  For reasons unknown to me,
mine is always  the same even though my ISP says they are dynamic.

But I like to see it's reassuring face on my console even though
ppp keeps me in the dark  while it does it's work.  I also store
it to a file in case I need to use it again.  Some people write it
into their  /etc/hosts file.

Finally, I invoke sendmail -q to send out my queued mail which has
been nervously awaiting a link to the outside world.

On my system, this is all that is needed.  I hope the explanation is
helpful to any others who have a broken control-panel or problems with
dip /ppp


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post