[1950] in linux-net channel archive

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

Trying to connect to ISP using DIP

daemon@ATHENA.MIT.EDU (Bas Rijniersce)
Tue Feb 20 18:19:43 1996

Date: 	Tue, 20 Feb 1996 17:56:11 +0100
To: linux-net@vger.rutgers.edu
From: Bas Rijniersce <basrijn@hacom.nl>

Hello,

I hope that DIP is not off-topic here..... please don't flame me ;))

I try to use DIP to connect to my ISP. I wrote a script that works fine=
,
until it should get my current IP address (i have a dynamic IP). The se=
rver
responds with a string like:
SL/IP session from (193.67.233.4) to 193.67.233.xxx beginning.....
With: get $locip remote      i get the first IP address :(( that is the
address of the gateway... i want the second address.
Is it possible to get this address???
I'm us=EDng Linux 1.2.1, the dip came with the distribution, i forgot t=
o write
down the version nr. ;-( sorry...

I have included the script:
--------------------------
#######################################################################=
#######
# DIP script to connect to Hacom
# Written by Bas Rijniersce (basrijn@hacom.nl)

  # Fetch the IP address of our target host.
main:

  # Set the desired serial port and speed.
  port /dev/modem
  print Modem selected

  # Reset the modem and terminal line.
  reset
  print Modem reset

  # Prepare for dialing.
  send ATZ\r
  print Modem initialized

  wait OK 10
  if $errlvl !=3D 0 goto init_error
  dial 0334565743
  if $errlvl !=3D 1 goto dial_error

  # We are connected.  Login to the system.
login:
  sleep 3
  wait login: 10
        if $errlvl !=3D 0 goto login_error
  send Cbasrijn\n
  print Username send

  wait Password: 10
  if $errlvl !=3D 0 goto passwd_error
  send mypasswd\n
  print Password send

  # Wait for the the IP addresses
  wait SL/IP 10
  if $errlvl !=3D 0 goto conIP_error
  print SL/IP .... found

  get $locip remote 10
  if $errlvl !=3D 0 goto noIP_error
  get $rmtip 193.67.233.4

done:
  print CONNECTED to $rmtip with address $locip
  default
  mode CSLIP
  goto exit

init_error:
        print Modem Init problem
        goto exit
dial_error:
        print Problem during dialing
        goto exit
login_error:
        print Login string not found
        goto exit
passwd_error:
        print Password string not found
        goto exit
conIP_error:
        print String printed after connection not found
        goto exit
noIP_error:
        print No IP found
        goto exit

error:
  print error.
exit:
--------------------------------

I have added some print's to the script for 'debugging'

I hope that someone knows an answer :))

Thanx in advance
Bas
 __
|__) ye
|___)as        (:)-)    I'm scuba diving

-----------------------------------------------------------------------
*  Bas Rijniersce	*  basrijn@hacom.nl	*
*  Ermelo		*  7193013@stud.rhij.nl	*
*  The Netherlands	*  Fido: 2:2801/506.1	*
-----------------------------------------------------------------------



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