Subject: Re: pppd questions
To: Steve Quint <Squint@flash.net>
From: tcjam <tcjam@voicenet.com>
List: port-mac68k
Date: 07/23/1997 05:28:21
On Tue, 22 Jul 1997, Steve Quint wrote:

> Can anyone explain why the defaultroute option in pppd doesn't work on some
> configurations.  Is it simply a matter of running gated?
> 
> Also, I've written a Perl script (invoked from the 'ppp-up' script) that
> performs a 'netstat -rn' to obtain the IP numbers of the server and my
> assigned IP, so that the script can run the 'route add default xxx' command
> as well as a ipnat script.  My questions is:  Is there a more efficient way
> of getting those IP number?
> 
> Thanks
> Steve
> 
Yeah and I only know about this stuff because I needed it for a dynamic
dns updater.

To get your ip you can use:
ifconfig ppp0 | grep inet | cut -d ' ' -f 2

To get your gateway's ip you can use:
ifconfig ppp0 | grep inet | cut -d ' ' -f 4

And if you use:
ifconfig ppp0 | grep inet | cut -d ' ' -f2,4

it'll list your local ip a space and then your gateway's ip.

Routing tables

Internet:
Destination      Gateway            Flags     Refs     Use    Mtu
Interface
default          doyl-gw.voicenet.n UG          7     2849      -  ppp0
localhost        localhost          UH          1       12      -  lo0
doyl-gw.voicenet doyl153-pri.voicen UH          2       20      -  ppp0

Routing tables

Internet:
Destination      Gateway            Flags     Refs     Use    Mtu
Interface
default          207.103.129.17     UG          7     2874      -  ppp0
127.0.0.1        127.0.0.1          UH          1       12      -  lo0
207.103.129.17   207.103.116.119    UH          2       20      -  ppp0

$ ifconfig ppp0 | grep inet | cut -d ' ' -f2,4
207.103.116.119 207.103.129.17

Later,
tcjam


                                 \||||/
                                  o  o
=============================oOOo==()==oOOo==============================
|| "Please explain the scientific nature         |  tcjam@voicenet.com ||
||   of the whammy." -Scully                     ______________________||
||								       ||
|| "Foolproof systems don't take into account,                         ||
||  the ingenuity of fools" -Unknown 			               ||
||                                                                     ||
||   PGP key can be obtained from:                                     ||
||      http://www.voicenet.com/~tcjam/home/keys.html                  ||
=========================================================================