162 lines
6.3 KiB
HTML
162 lines
6.3 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>5.3.4 Using dip</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value="5.3.4 Using dip">
|
|
<meta name="keywords" value="gs">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html4602 HREF="node222.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html4600 HREF="node206.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html4596 HREF="node220.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html4604 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html4605 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4603 HREF="node222.html">5.4 Networking with UUCP</A>
|
|
<B>Up:</B> <A NAME=tex2html4601 HREF="node206.html">5.3 Networking with TCP/IP</A>
|
|
<B> Previous:</B> <A NAME=tex2html4597 HREF="node220.html">5.3.3.3 Dynamic IP address </A>
|
|
<BR> <HR> <P>
|
|
<H2><A NAME=SECTION00734000000000000000>5.3.4 Using dip</A></H2>
|
|
<P>
|
|
<A NAME=secadvusingdip> </A>
|
|
<P>
|
|
<A NAME=6116> </A>
|
|
<A NAME=6117> </A>
|
|
<tt>dip</tt> can simplify the process of connecting to a SLIP server,
|
|
logging in, and configuring the SLIP device. Unless you have a leased
|
|
line running to your SLIP server, <tt>dip</tt> is the way to go.
|
|
<P>
|
|
<A NAME=6118> </A>
|
|
To use <tt>dip</tt>, you'll need to write a ``chat script'' which
|
|
contains a list of commands used to communicate with the SLIP server
|
|
at login time. These commands can automatically send your username/password
|
|
to the server, as well as get information on your IP address from the server.
|
|
<P>
|
|
Here is an example <tt>dip</tt> chat script, for use with a dynamic IP address
|
|
server. For static servers, you will need to set the variables
|
|
<tt>$local</tt> and <tt>$remote</tt> to the values of your local IP address
|
|
and server IP address, respectively, at the top of the script. See the
|
|
<tt>dip</tt> man page for details.
|
|
<P>
|
|
<P><TT> <PRE>main:
|
|
# Set Maximum Transfer Unit. This is the maximum size of packets
|
|
# transmitted on the SLIP device. Many SLIP servers use either 1500 or
|
|
# 1006; check with your network admins when in doubt.
|
|
get $mtu 1500
|
|
|
|
# Make the SLIP route the default route on your system.
|
|
default
|
|
|
|
# Set the desired serial port and speed.
|
|
port cua03
|
|
speed 38400
|
|
|
|
# Reset the modem and terminal line. If this causes trouble for you,
|
|
# comment it out.
|
|
reset
|
|
|
|
# Prepare for dialing. Replace the following with your
|
|
# modem initialization string.
|
|
send ATT&C1&D2\\ N3&Q5%M3%C1N1W1L1S48=7\r
|
|
wait OK 2
|
|
if $errlvl != 0 goto error
|
|
# Dial the SLIP server
|
|
dial 2546000
|
|
if $errlvl != 0 goto error
|
|
wait CONNECT 60
|
|
if $errlvl != 0 goto error
|
|
|
|
# We are connected. Login to the system.
|
|
login:
|
|
sleep 3
|
|
send \r\n\r\n
|
|
# Wait for the login prompt
|
|
wait login: 10
|
|
if $errlvl != 0 goto error
|
|
|
|
# Send your username
|
|
send USERNAME\n
|
|
|
|
# Wait for password prompt
|
|
wait ord: 5
|
|
if $errlvl != 0 goto error
|
|
|
|
# Send password.
|
|
send PASSWORD\n
|
|
|
|
# Wait for SLIP server ready prompt
|
|
wait annex: 30
|
|
if $errlvl != 0 goto error
|
|
|
|
# Send commands to SLIP server to initate connection.
|
|
send slip\n
|
|
wait Annex 30
|
|
|
|
# Get the remote IP address from the SLIP server. The `get...remote'
|
|
# command reads text in the form xxx.xxx.xxx.xxx, and assigns it
|
|
# to the variable given as the second argument (here, $remote).
|
|
get $remote remote
|
|
if $errlvl != 0 goto error
|
|
wait Your 30
|
|
|
|
# Get local IP address from SLIP server, assign to variable $local.
|
|
get $local remote
|
|
if $errlvl != 0 goto error
|
|
|
|
# Fire up the SLIP connection
|
|
done:
|
|
print CONNECTED to $remote at $rmtip
|
|
print GATEWAY address $rmtip
|
|
print LOCAL address $local
|
|
mode SLIP
|
|
goto exit
|
|
error:
|
|
print SLIP to $remote failed.
|
|
|
|
exit:
|
|
</PRE> <P></TT>
|
|
<P>
|
|
<tt>dip</tt> automatically executes <tt>ifconfig</tt> and <tt>route</tt> commands
|
|
based on the values of the variables <tt>$local</tt> and <tt>$remote</tt>.
|
|
Here, those variables are assigned using the <tt>get...remote</tt>
|
|
command, which obtains text from the SLIP server and assigns it to the
|
|
named variable.
|
|
<P>
|
|
If the <tt>ifconfig</tt> and <tt>route</tt> commands that <tt>dip</tt> runs for you
|
|
don't work, you can either run the correct commands in a shell script
|
|
after executing <tt>dip</tt>, or modify the source for <tt>dip</tt> itself.
|
|
Running <tt>dip</tt> with the <tt>-v</tt> option will print debugging information
|
|
while the connection is being set up, which should help you to determine
|
|
where things might be going awry.
|
|
<P>
|
|
Now, in order to run <tt>dip</tt> and open the SLIP connection, you can use
|
|
a command such as:
|
|
<P><TT> <code>/etc/dip/dip -v /etc/dip/mychat 2>&1</code>
|
|
<P></TT>
|
|
Where the various <tt>dip</tt> files, and the chat script (<tt>mychat.dip</tt>),
|
|
are stored in <tt>/etc/dip</tt>.
|
|
<A NAME=6119> </A>
|
|
<A NAME=6120> </A>
|
|
<P>
|
|
The above discussion should be enough to get you well on your way to
|
|
talking to the network, either via Ethernet or SLIP. Again, we strongly
|
|
suggest looking into a book on TCP/IP network configuration, especially
|
|
if your network has any special routing considerations, other than those
|
|
mentioned here.
|
|
<A NAME=6052> </A>
|
|
<A NAME=6053> </A>
|
|
<A NAME=6054> </A>
|
|
<A NAME=6055> </A>
|
|
<A NAME=6056> </A>
|
|
<A NAME=6057> </A>
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html4602 HREF="node222.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html4600 HREF="node206.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html4596 HREF="node220.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html4604 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html4605 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html4603 HREF="node222.html">5.4 Networking with UUCP</A>
|
|
<B>Up:</B> <A NAME=tex2html4601 HREF="node206.html">5.3 Networking with TCP/IP</A>
|
|
<B> Previous:</B> <A NAME=tex2html4597 HREF="node220.html">5.3.3.3 Dynamic IP address </A>
|
|
<BR> <HR> <P>
|
|
<BR> <HR>
|
|
<P><ADDRESS>
|
|
<I>Matt Welsh <BR>
|
|
mdw@sunsite.unc.edu</I>
|
|
</ADDRESS>
|
|
</BODY>
|