*BSD News Article 34241


Return to BSD News archive

Xref: sserve comp.os.linux.help:47596 comp.os.386bsd.misc:3182
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!EU.net!ieunet!iol!barryf
From: barryf@iol.ie (Barry Flanagan)
Newsgroups: comp.os.linux.help,comp.os.386bsd.misc
Subject: Re: DIP-Script for annex available?
Followup-To: comp.os.linux.help,comp.os.386bsd.misc
Date: 13 Aug 1994 15:54:55 GMT
Organization: Ireland On-Line
Lines: 139
Message-ID: <32iqcf$bb6@barnacle.iol.ie>
References: <327jih$12o@virusdd.GUN.de>
NNTP-Posting-Host: hero.iol.ie
X-Newsreader: TIN [version 1.2 PL2]

Ulrich Cyrus (cyrus@virusdd.GUN.de) wrote:
: Since my university has an annex terminalserver I am in need
: of an appropriate DIP-script to login there and start SLIP.
: The problem is, that when calling to the annex it will 
: not give me every time the same IP-Number. Though I need
: a script to read the "myip" from the modem-line.


Here is the one we use at IOL, although the sequence of when you are asked
for the username and when you type "SLIP" might be reversed, depending upon
how your site does the security. The important bit is how it parses the IP
address, which will work fine.

Hope this helps!

-Barry Flanagan

------------8<--------------------
############################################################################
# DIP script for Ireland On-Line dynamic IP SLIP service
# V0.2
# 7 Aug 1994
# Joe Desbonnet
#
# To make this script work, change USERNAME and PASSWORD to be your username
# and password. Also, if you are calling the Dublin number, then comment out 
# the galway entry, and uncomment the Dublin one.
#
# Also, you will need the following in your /etc/hosts file:
# If calling Dublin:
# 193.120.234.194   iol-annex
#
# If calling Galway:
# 193.120.234.39   iol-annex
#
#
# Next, save this file in, say, /etc/iol.dip
# You can now connect to IOL using the command "dip /etc/iol" - you must
# be logged in as root. 
############################################################################

main:
# Set the desired serial port and speed.
port modem
speed 38400

# Prepare for dialing.
send AT&F&C1&D2\r\n
send ATM1\r\n
wait OK 2
if $errlvl != 0 goto error
#
# Uncomment ONE of the following 2 lines, depending upon your location
dial 592711
#dial 285-2700
if $errlvl != 0 goto error

print Dialing IOL SLIP server. Please wait...

wait CONNECT 60
if $errlvl != 0 goto error_no_connect

# We are connected.  Login to the system.
print Carrier lock achieved. Logging in...

login:

sleep 3
send \r\n\r\n

# Wait for Annex service prompt
wait annex: 10
if $errlvl != 0 goto error_login

# Tell Annex we want SLIP service
send slip\n

#
# Now complete authorization procedure
#

wait name: 5
if $errlvl != 0 goto error_login
# SLIP Userid goes here
send USERNAME\n
wait word: 5
if $errlvl != 0 goto error_login
# SLIP password goes here
send PASSWORD\n

loggedin:

# Get local IP for this session.
wait Your\saddress\sis\s 10
if $errlvl != 0 goto error_login
get $local remote 
if $errlvl != 0 goto error_login
get $remote iol-annex

print Local address is $local 
print Remote address is $remote

get $mtu 296

# Set Destination net/address as type 'default' (vice an address).
# This is used by the 'route' command to set the kernel routing table.
# Some machines seem to require this be done for SLIP to work properly.

default

done:
mode SLIP
print CONNECTED.
goto exit

#
# Error handling routines
#

error_no_connect:
print SLIP connect failed. Unable to achieve carrier lock.
goto exit

error_login:
print SLIP connect failed. Error at login stage.
goto exit

error:
print SLIP connect failed. Reason unknown.

exit:

----------------8<---------------------

--
   *********************************************************************** 
              IRELAND ON-LINE, West Wing, Furbo, Galway, Ireland
                Tel: +353 (0)91 592727 : Fax: +353 (0)91 592726
           IOL Internet Services - Dublin: 671-5185 : Galway 592711