Subject: Re: PPP
To: None <curfman@cards.com>
From: Mike Long <mike.long@analog.com>
List: netbsd-help
Date: 01/25/1995 11:50:02
curfman@cards.com wrote:
>Ok,
>   So i've gotten a little ways on getting ppp working on my
>NetBSD 1.0 box.  very little. I do have PPP in the kernel.

I've managed to get mine up and running, thanks to everyone who helped.
I'll pass what I've learned on to you:

>Heres what I have/do:
>
>1: /etc/hosts is "127.0.0.1 localhost gateway"
>   should I place my IP addres in here like:
>      127.0.0.1 localhost
>      xxx.x.x.x gateway

I have something similar:

127.0.0.1 localhost
192.0.2.13 azathoth.boston.ma.us azathoth

The 192.* address is bogus, but it doesn't seem to cause any problems.
Does anyone have any better suggestions for doing this?  I've looked
at RFC1597, but RFC1627 seems to deprecate that option.

I haven't yet noticed any need to have information about my provider's
gateway anywhere in my system (/etc/hosts, /etc/mygate).

>2: I have no network interface defined in my kernel - do i need to
>   use ifconfig for any reason?

No.  pppd does that for you.  I found out that you do NOT want to have
an /etc/hostname.ppp0 .

>3: I use "route add -net <remote IP> <my IP>" - which at this point
>   is 127.0.0.1 - back to one - should I place my xxx.x.x.x Ip address
>   here - or do i even need to run route?

The 'defaultroute' option to ppd does this for you.

>4: I then run pppd like this:
>
>      pppd -d /dev/tty00 38400 $LOCALIP:$REMOTEIP 
>      connect 'chat -v '''' atdt'$PHONE_NUMBER' CONNECT '''' ogin: 
>      '$USER_NAME' assword: '$PASSWORD passive defaultroute modem crtscts lock
>
>   (on one line of course).  

I put all of that into /etc/ppp/options (including the TTY and speed)
so that all I need to do is type 'pppd'.

I added the 'local' flag to the line for my modem in /etc/ttys.

My chat script sends a modem init string that tells the modem not to
respond to +++AT sequences; you may end up in trouble if +++ATHO shows
up in a packet, otherwise....

I don't use the following options:
  modem (manpage says it isn't fully implemented)
  passive
  $LOCALIP:$REMOTEIP (pppd establishes both during negotiation)

I don't have a fixed IP address, so I especially appreciate the IP
address negotiation.

I added 'asyncmap 0x0' to my pppd options list; it speeds up the link
because control characters are not quoted.

I also have an /etc/resolv.conf that I got from my service provider.

>   I can see pppd and chat running (via ps) but /var/log/messages gives
>   me :
>      ppp start by curfman 
>      unable to establish connection

I think you have to be running as root in order to get it to work.

Why is it that non-root users can run pppd?  I would think that you
would want to restrict ANY network-related commands to work for root
only.  But since I'm the only user on my box, I don't really care.

>   if I try to ping the remote address it does nothing - same with telnet.
>   if i dont use the route command - it doesnt like the address - so i am guessing
>   that i needed to run route.
>
>   After a ping (or some amount of time) pppd dies.

None of this will work, because you have no connection!

>   The weird part is that when I ping i expect to hear my modem dial - but
>   no - it doesnt.

You should hear the modem dial when you run pppd.
-- 
Mike Long <mike.long@analog.com>       PGP 2.6.2 public key signature:
VLSI Design Engineer                  CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Analog Devices, CPD Division
Norwood, MA 02062 USA                assert(*this!=opinionof(Analog));