Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 5373

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<html><head><title>SLIP/PPP Emulator HOWTO</title></head>
<body><h1>SLIP/PPP Emulator HOWTO</h1>
<h2>version 3.0 (updated 8/7/97) by Irish</h2>

	This document will describe how to get your Linux box to connect
to a generic site via a SLIP/PPP emulator, such as SLiRP or TIA. I take no
responsibility for your use of this information, but corrections are
welcome.<p>
	I will not attempt to describe all that can be done over this 
connection once established, but I will refer you to other documents or 
sites that will contain the relevant information. <p>

	That done, let's do it!<p>
<hr><ul>
<li>	1.0 How does an emulator work?<p>

	It is important to understand how a SLIP/PPP emulator works in
general, to be aware of its limitations. First, you do not need to install
the emulator on your machine. It runs on your remote host only. What you
need on your machine is the TCP/IP and SLIP or PPP protocols installed in 
your kernel (more on that in a bit), and some clients.<p>
	Here's what happens: you send network requests from your machine
to your remote host over the SLIP/PPP link. The emulator grabs them and
sends them out to the Net at large. Then, incoming data is sent back from
the Net to your account on the remote host, where the emulator grabs it
and sends it back over the SLIP/PPP link to your machine. So, to the Net
it appears as if you are working out of your account on the remote host,
but to you it looks like you are really connected right to the Net.<p>
	As you can see, this can confuse stuff that is incoming from the
Net. For example, talk doesn't work via an emulator, because the incoming 
talk request tries to start the remote hosts talk daemon, not yours.<p>
	The other big difference between an emulator and real SLIP/PPP is
you are NOT assigned your own IP address; remember, you are only
converting a dialup account to a SLIP/PPP connection.<p>

<li>	1.1 What is TIA? <p>

	<a href="http://www.marketplace.com/tia/tiahome.html">The Intenet
Adaptor </a> was written by the fine folks at marketplace.com. They have 
quit working on it now, and consider it a 'mature' product. The last 
version is 2.05; if you are going to use TIA, please get this version. 
!NOTE! At last report, only site licenses are available now. <p>

<li>	1.2 What is SLiRP?</p>

	This is a freeware application, covered under the GNU Public 
License. It is out of beta, and is real stable. It sports a few more 
features than TIA, and is (reportedly) easier on host resources. 
Available at fine Linux FTP sites everywhere. <P>

<li>	1.3 What about Term?<p>

	If you don't have root access to your machine for one reason or
another, and you can't persuade someone who does to install SLIP and dip,
then you won't have much choice except to use Term. If you want to know
more about Term, please read the HOWTO on Sunsite. <p>

<li>	1.4 What about real SLIP/PPP?<p>
	
	Hey, a lot of places are offering real SLIP/PPP at reasonable 
prices for non-dedicated dialup nowadays. If you can afford it, or feel 
the need, go for it. The Real Thing is always better than emulation. 
However, one of the things an emulator provides is security; it acts as 
an impregnable firewall, and with it you are pretty much as bulletproof 
as your provider is. You'll pay for it though, emulation is slower, and 
does not fully support every protocol. Still and all, emulation is good 
enough for most people, and is a fine way to connect to the Net. <p>

</ul>
<hr>
	Enough already! How do I set it up?<p>

	Alright hotrod, we're getting there, but first there's some info 
you need to get, and a couple of explanations. <p>
	First, you need to get the IP address of your provider, if you don't 
have it already. You can do this by typing 'who' at a shell prompt there, 
or reading their /etc/hosts, or even just asking them. While your getting 
that, get the IP address of the POP/SMTP host and the NNTP server (if you 
don't know what those are, trust me and ask for them anyway, you'll need 
'em). <p>
	Next, let me explain quickly about hostnames and domain names. 
The hostname is the first part of a machines name, the domain is the rest 
of it. Like this: hostname.domain.name (a four parter would be 
hostname.do.main.name). Together, they make a Fully Qualified Domain 
Name (FQDN). <p> 
	The name of your Linux machine is stored in /etc/HOSTNAME, and 
yes, you can change it. In fact, please do (if you're using Slackware, 
it'll be "darkstar.frop.org" by default). Just edit the /etc/HOSTNAME 
file to be whatever you want - remember, if you are using an emulator, 
you are essentially invisible to the Net at large, so you can be 
creative. However, if you plan to get a real SLIP/PPP connection down the 
road sometime, you'll probably want to conform to being a sub-host of 
your provider. For example, if your provider is "info.superhiway.com", 
the domain is "superhiway.com" and the hostname is "info". So you could 
either be "offramp.info.superhiway.com" or just "offramp.superhiway.com". 
Either would work, and in either case your hostname is "offramp". <p>

<ul>
<li>	2.0 Preparing your Linux machine<p>

	In a nutshell, here's what's required. I'll explain the first three
in detail.<p> 
	<ul>
	<li>	-> Compile your kernel to include SLIP and TCP/IP
	<li>	-> Edit some files in /etc
	<li>	-> Install and configure dip
	<li>	-> Install pppd (optional, for PPP only)
	</ul>
	You will also need to get an emulator binary appropriate for your
remote host and install it.  SLiRP is available at <a
href="ftp://sunsite.unc.edu/pub/Linux/INDEX.html">Sunsite</a> and other
fine Linux FTP sites. All of the relevant info for TIA is available at <a
href="http://marketplace.com/tiahome/tia.html"> TIAs home site</a>. <p>

</ul>
	That's it! Let's get started.<p>
<ul>
<li>	2.1 Compiling your kernel<p>

	If you have never done this, you should. And you should read the 
FAQ first, but don't worry, it's easy. If you want, you can e-mail me and 
I'll help.<p>
	I'll assume that you have here, for the sake of brevity. When you
'make config', look for "Network Devices". Say 'y', of course, then say
'y' to SLIP, CSLIP, (or PPP) and TCP/IP and 'n' to everything else, unless
you have ethercards or need some other protocol for something else. <b>If
you don't do this, it won't work! </b>Finish compiling and installing the
new kernel, then,<p>

<li>	2.2 Edit some files in /etc<p>

	These files will set up your routes to your remote host. /etc is
the directory for system configurations. Replace everything in double
quotes with the appropriate values, naturally (but don't include the
quotes - they are there for reference). There are three files you need to
edit, they are:<p>

	<ul>
	<li>/etc/hosts:
	<pre>
#The next line is required to be EXACTLY as below.
127.0.0.1       localhost

#Note at the end of the next two entries the hostname is repeated. 
#This abbreviation is an alias, and is required for the first entry.
#If you're on a LAN, you'll need to substitute your IP address for 
#the first one below.
192.0.2.1       "yourhostname.domain.name  yourhostname"
"XXX.XXX.XX.XX"	"remotehostname.domain.name  remotehostname"  
	</pre>


	<li>/etc/host.conf:
	<pre>
order hosts, bind
multi on
	</pre>

	<li>/etc/resolv.conf:
	<pre>
domain "yourdomain.name" 	
#The next line usually uses the same remote IP address that's in /etc/hosts
nameserver "XXX.XXX.XX.XX"	
	</pre>

	<li>To use an NNTPserver, put this line in your 
/etc/profile:<p>
export NNTPSERVER="remote.hosts.nntpservername"<p>
	</ul>

<li>	2.3.1 DIP<p>
	
	DIP (Dialup Internet Protocol) is what you will use to dial up the
remote host, start the emulator, and convert the line to SLIP/PPP. It
comes in the "N" set of Slackware, along with a bunch of clients and
utilities, some of which you may want to install also =). It is also
available at <a 
href="ftp://sunsite.unc.edu/pub/Linux/INDEX.html">Sunsite</a> in an
individual tar file<p>
	Once you have it installed, you will need to have a dip script, 
Here's a sample, just plug in the appropriate stuff where the double quotes are
 (but don't include the quotes, they are there for reference).<p>


----------CUT HERE--------------------------------<p>
<pre>
main:
  get $local "yourhostname.domain.name"
  get $remote "remotehostname.domain.name"

#Your port here
  port cua"?" 

#Use 115200 for 28.8 modems 
  speed 57400
  reset

#don't use spaces in your AT command string! 
  init AT "string of commands" 
  wait OK 5

# This will redial. If it doesn't work, play with the wait time (listen 
# to your modem). If it still doesn't work, mail me.
# <b>See also; the note at the bottom of the script re: error codes.</b>

dial:
  dial "phonenumber"
  print Dialing...
  if $errlvl != 0 goto error

#You may need to change this wait time to suit your modem
  wait BUSY 20
  if $errlvl == 0 goto dial	

login:
  print Connected and Logging in...

#This wait and send gets me past my hosts Annex. <b>Change for your site!</b>
  wait ==> 60
  send 4\n
  wait ogin: 60
  if $errlvl != 0 goto login_error1
  send "LOGIN"\n
  wait assword: 60
  if $errlvl != 0 goto login_error2
  send "PASSWORD"\n

loggedin:
  wait "SYSTEM PROMPT" 60
  if $errlvl != 0 goto shell_error
  print Logged in!
  send "emulator startup command"\n
  wait "emulator startup response" 60
  if $errlvl != 0 goto emu_error

#The recommended mtu setting is 1500, but this is faster interactively. 
#Ftp may be slower, so adjust to taste.
  get $mtu 296
  default

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

error:
  print Dialing Error

login_error1:
  print No Login

login_error2:
  print No Password prompt

shell_error:
  print No shell prompt

emu_error:
  There was a problem starting the emulator

exit:

#This will error out when the -v flag is used, but work when run normally 
#(ends dip at a local prompt).
  \r		
</pre>
-------------CUT HERE-----------------------------<p>
<p><li>2.3.2 Dip notes</p>

	Newer versions of dip don't return modem status codes (BUSY, NO 
CONNECT, etc.), they use numbers instead. Here's a table:<p>
<ul>
<li>0 = OK
<li>1 = CONNECT
<li>2 = ERROR
<li>3 = BUSY
<li>4 = NO CARRIER<p>
</ul>
	This would make your dial section look like this:
<pre>
dial:
  dial "phonenumber"
  print Dialing...
  if $errlvl != 0 goto error
  wait 1 20	
  if $errlvl != 1 goto dial
</pre><p>
	Thanks to Lee Olds (lee@eskimo.com) for that bit. <p>

        \n = newline, \r = carriage return. You may require one or 
the other (or both) in the appropriate places. If the ones provided don't 
work, experiment.<p>
	A word about the form of the wait and sends. If it isn't clear by 
the example, here's what's happening:
<pre>
  wait ogin: 60
	(the script will wait for the remote to send 'ogin:' for 60 
	 seconds. When it gets it, the script advances. If it doesn't get 
	 it, it will advance after the timeout of 60 seconds.)
  if $errlvl != 0 goto login_error1 (this whole line is optional)
	(if the script is advancing because it got what it was waiting for, 
	 this gets skipped. if the script is advancing because it timed out, 
o	 it will go to where you tell it to ('login_error1' in this case)
  send "LOGIN"\n
	(DIP will send 'LOGIN' and a newline) 
</pre><p>
	You can put in sleep statements if you need to, like this:
"sleep 10" This will make the script pause for 10 seconds. <p>
	After editing this file, rename it, say, remote.dip and put it in 
/root.  Then, as root, run 'dip remote'. Use the -v flag the first 
time to debug it ('dip -v remote'), this will show you all the steps 
dip takes.<p>
	Dip will only run as root, but there is a way to make it run from 
a user account. For now, if you need this info, ask. I may include it in 
this file later if enough people want it.<p>
	If dip errors out right away, try removing the comments from the 
script.<p>

<li>	2.4 PPP<p>

	The above gets you rolling with CSLIP, which is really fine 
most of the time. It truly is easy to get working, since the protocol is 
supported at the kernel level - just make sure it's in there and it 
works.<p>
	However, some of you will want PPP, for what reasons, only you can
say. I'm not going to tell you how to set it up here, there's a whole
other HOWTO written just for that. What I will do is tell you what the 
gotchas are when using PPP with an emulator. <p>
	First, the latest version of DIP says you can use it to start PPP,
and you can, BUT it only starts the PPP daemon - no flags, nothing. So if
you want to use DIP to start PPP, be sure to put all of your startup info
in the /etc/ppp/options file, or it won't work. <P>
	Speaking of the options file, one of the things that MUST be in 
there no matter how you start pppd is this: '192.0.2.1:XXX.XXX.XX.XX'. 
What this is is 'localIPaddress:remoteIPaddress'. You need it there 
because normally pppd can fill in the blank itself, but fails when 
connecting to an emulator.<P>
	Be sure to get the latest and greatest pppd package. It seems 
there were a few versions recently that had a bit of trouble.<P>
	Lastly, unless you have a good reason to use PPP, or just want to 
learn how it works, you really don't need it. I have tried them both, and 
didn't notice any performance difference with the standard set of 
clients. Of course, Your Mileage May Vary. :) <P>

</ul>
<hr>
<ul>
<li>	3.0 Now what?<p>

	Hey, if all went well, you are now connected to the Net! Try a 
'telnet remotehostname' (remember that abbreviation in your hosts file?). 
You should get the remotes telnet login prompt. Go on, try it! You can now 
telnet/FTP/etc. anywhere on the Net from your local machine. How? Your 
machine is using the remote as a nameserver to resolve addresses 
(resolv.conf). Experiment, find out what works and what doesn't.<p>
	You will not be able to use services that are not provided 
already on your remote host! For example, if your server doesn't allow 
telnets, chances are you can't do it either. Why? Because the emulator is 
only re-directing what is already available.<p>

<li>	3.1 Mail<p>

	The obvious text based solution is Pine, you can get it from <a 
href="ftp://ftp.cac.washington.edu">The University of Washington</a>.<p>

	My pick for 'Best Mail Reader, X Based' has to go to XFmail. This
has now gotten out of beta, and rocks. Easy to install; requires no local
mail system be installed (but will work with local spools) because it has
POP built in - no more popclient/fetchpop! Easy to use; totally customizable 
from the GUI. Also supports MIME. Get it from <a 
href="http://burka.netvision.net.il/xfmail/xfmail.html">The XFmail 
Homesite</a>.<p>

<li>	3.2 News<p>

	The text based News Reader <a
href="ftp://space.mit.edu/pub/davis/slrn">SLRN</a> is fairly simple to
install and use.  It is a true NNTP newsreader, which means <i>no local
news transport is required</i> to make it work (you don't have install
Cnews or INN). It does require that you have access to an NNTPserver,
naturally, but most ISPs have this. It is text based, but has
color and mouse support, and runs fine in an rxvt window. <p>

	The X based News Reader <a 
href="http://www.student.nada.kth.se/~su95-kjo/knews.html">KNews</a> is 
almost perfect. As with SLRN above, no local transport is required, but 
an NNTP server is. It's at least worth a look. <p>

<li>	3.3 Mosaic/Netscape<p>

	Obviously, you will need to have X running for this to work, but 
it's a simple matter of FTPing the binary, unpacking it, 
and installing it. <p>

</ul>
<hr>
<ul>
<li>	4.0 Misc.<p>

	If I've left anything out, or you still have questions, I read my 
mail daily. This information gets updated fairly regularly, so keep checking 
back every so often (I'll change the version numbers). Naturally, the more 
you contribute, the more info will be included here, so don't hesitate to 
tell me about whatever you have to offer.<p>
	If you would like some help, or are having trouble with your
setup, I'll help <i>but you must send me the following info:</i> 1. A copy
of your three /etc files. 2. A copy of your script output, run with the -v
flag (<b>please</b> remove your password from this!)</p>
	Even if you don't have anything to contribute, but used this info
sucsessfully, PLEASE MAIL ME. I want to know how useful this really
is.</p>

<li>	4.1 References<p>

	Sunsite is the FTP site<a
href="ftp://sunsite.unc.edu/pub/Linux/INDEX.html"> sunsite.unc.edu</a>, a
veritable plethora of everything Linux, including almost every FAQ, HOWTO,
and README written.<p>
	<a href="http://marketplace.com/">Marketplace.com </a>is the home
of TIA, the only place it is available.</p> 
	I am Irish, <a href="mailto:irish@eskimo.com">
irish@eskimo.com</a>, available for comment on Linux almost everyday, when
I'm not petting my cat or hugging my kid.<p> <p> 
	This HOWTO is available in the following places:
	<ul>
	<li>http://www.eskimo.com/~irish 
	<li>ftp://ftp.eskimo.com/u/i/irish
	<li>ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/mini/TIA 
	</ul> 
</ul></body></html>