# # xnet.dip Dialup IP connection support program. # This file (should show) shows how to use the DIP # scripting commands to establish a link to a host. # This host runs the 386bsd operating system, and # thus can only be used for the "static" addresses. # # Usage: dip xnet.dip # # Version: @(#)sample.dip 1.40 07/20/93 # # Author: Fred N. van Kempen, # Modified by: David Efflandt, 2/11/96 # # $local/$remote can be used if hosts are set up # or $locip/$rmtip with real IP's works regardless # NOTE: use your real name or ip in place of any shown main: # First of all, set up our name for this connection. # Change to your name and/or IP addr # I am called "USERNAME.xnet.com" (== 199.x.x.117) # get $local USERNAME.xnet.com get $locip 199.x.x.117 # Next, set up the other side's name and address. # My dialin machine is called 'xnet.com' (== 199.x.x.1) # get $remote xnet.com get $rmtip 199.x.x.1 # Set netmask on sl0 to 255.255.255.0 netmask 255.255.255.0 # Set the desired serial port and speed. # NOTE: You would now likely use ttyS1 115200 in this example port cua1 speed 38400 # Reset the modem and terminal line. # This seems to cause trouble for some people! reset # Note! "Standard" pre-defined "errlevel" values: # 0 - OK # 1 - CONNECT # 2 - ERROR # # You can change those grep'ping for "addchat()" in *.c... # Prepare for dialing (string below instead of ATZ if not your defaults). # send ATQ0V1E1X4\r send ATZ\r wait OK 2 if $errlvl != 0 goto modem_trouble dial 555-1212 if $errlvl != 1 goto modem_trouble # We are connected. Login to the system. # Replace with your name and password below: # NOTE: the s_ prefix on slip username may be xnet specific login: sleep 2 wait ogin: 20 if $errlvl != 0 goto login_error send s_USERNAME\n wait ord: 20 if $errlvl != 0 goto password_error send PASSWORD\n loggedin: # We are now logged in. wait abled 15 if $errlvl != 0 goto prompt_error # Set up the SLIP operating parameters (mtu 296 for shell or 1500 for Web). # get $mtu 296 get $mtu 1500 # Ensure "route add -net default xnet.com" will be done default # Say hello and fire up! done: print CONNECTED $locip ---> $rmtip mode CSLIP goto exit prompt_error: print TIME-OUT waiting for SLIPlogin to fire up... goto error login_trouble: print Trouble waiting for the Login: prompt... goto error password:error: print Trouble waiting for the Password: prompt... goto error modem_trouble: print Trouble ocurred with the modem... error: print CONNECT FAILED to $remote quit exit: pwd exit