]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/doc/handbook/slipc.sgml
Revert $FreeBSD$ back to $Id$
[FreeBSD/FreeBSD.git] / share / doc / handbook / slipc.sgml
1 <!-- $Id$ -->
2 <!-- The FreeBSD Documentation Project -->
3
4 <sect><heading>Setting up a SLIP client<label id="slipc"></heading>
5
6 <p><em>Contributed by &a.asami;<newline>8 Aug 1995.</em>
7
8 The following is one way to set up a FreeBSD machine for SLIP on a
9 static host network.  For dynamic hostname assignments (i.e., your
10 address changes each time you dial up), you probably need to do
11 something much fancier.
12
13 <!--
14 This is just "what I did, and it worked for me".  I am sharing this
15 just for your reference, I am no expert in SLIP nor networking so your
16 mileage may vary.
17 -->
18
19 First, determine which serial port your modem is connected to.  I have
20 a symbolic link <tt>/dev/modem -&gt; cuaa1</tt>, and only use the modem name in my
21 configuration files.  It can become quite cumbersome when you need to
22 fix a bunch of files in <tt>/etc</tt> and <tt>.kermrc</tt>'s all over the system!  (Note
23 that <tt>/dev/cuaa0</tt> is COM1, <tt>cuaa1</tt> is COM2, etc.)
24
25 Make sure you have
26 <verb>
27 pseudo-device   sl      1
28 </verb>
29 in your kernel's config file.  It is included in the GENERIC kernel,
30 so this will not be a problem unless you deleted it.
31
32 <sect1><heading>Things you have to do only once</heading>
33
34 <p><enum>
35 <item>Add your home machine, the gateway and nameservers to your
36     <tt>/etc/hosts</tt> file.  Mine looks like this:
37 <verb>
38 127.0.0.1               localhost loghost
39 136.152.64.181          silvia.HIP.Berkeley.EDU silvia.HIP silvia
40
41 136.152.64.1            inr-3.Berkeley.EDU inr-3 slip-gateway
42 128.32.136.9            ns1.Berkeley.edu ns1
43 128.32.136.12           ns2.Berkeley.edu ns2
44 </verb>
45     By the way, silvia is the name of the car that I had when I was
46     back in Japan (it is called 2?0SX here in U.S.).
47
48 <item>Make sure you have "hosts" before "bind" in your <tt>/etc/host.conf</tt>.
49     Otherwise, funny things may happen.
50
51 <item>Edit the file <tt>/etc/sysconfig</tt>.
52 <enum>
53 <item>Set your hostname by editing the line that says:
54 <verb>
55 hostname=myname.my.domain
56 </verb>
57     You should give it your full Internet hostname.
58
59 <item>Add sl0 to the list of network interfaces by changing the line
60 that says:
61 <verb>
62 network_interfaces="lo0"
63 </verb>
64 to:
65 <verb>
66 network_interfaces="lo0 sl0"
67 </verb>
68
69 <item>Set the startup flags of sl0 by adding a line:
70 <verb>
71 ifconfig_sl0="inet ${hostname} slip-gateway netmask 0xffffff00 up"            
72 </verb>
73
74 <item>Designate the default router by changing the line:
75 <verb>
76 defaultrouter=NO
77 </verb>
78 to:
79 <verb>
80 defaultrouter=slip-gateway
81 </verb>
82 </enum>
83
84 <item>Make a file <tt>/etc/resolv.conf</tt> which contains:
85 <verb>
86 domain HIP.Berkeley.EDU
87 nameserver 128.32.136.9
88 nameserver 128.32.136.12
89 </verb>
90     As you can see, these set up the nameserver hosts.  Of course, the
91     actual domain names and addresses depend on your environment.
92
93 <item>Set the password for root and toor (and any other accounts that
94     does not have a password).  Use passwd, do not edit the <tt>/etc/passwd</tt>
95     or <tt>/etc/master.passwd</tt> files!
96
97 <item>Reboot your machine and make sure it comes up with the correct
98     hostname.
99 </enum>
100
101 <sect1><heading>Making a SLIP connection</heading>
102
103 <p><enum>
104 <item>Dial up, type "slip" at the prompt, enter your machine name and
105     password.  The things you need to enter depends on your
106     environment.  I use kermit, with a script like this:
107 <verb>
108 # kermit setup
109 set modem hayes
110 set line /dev/modem
111 set speed 115200
112 set parity none
113 set flow rts/cts
114 set terminal bytesize 8
115 set file type binary
116 # The next macro will dial up and login
117 define slip dial 643-9600, input 10 =>, if failure stop, -
118 output slip\x0d, input 10 Username:, if failure stop, -
119 output silvia\x0d, input 10 Password:, if failure stop, -
120 output ***\x0d, echo \x0aCONNECTED\x0a
121 </verb>
122     (of course, you have to change the hostname and password to fit
123     yours).  Then you can just type "slip" from the kermit prompt to
124     get connected.
125
126     <bf>Note</bf>: leaving your password in plain text anywhere in the
127     filesystem is generally a BAD idea.  Do it at your own risk.  I am
128     just too lazy.
129
130 <item>Leave the kermit there (you can suspend it by "z") and as root,
131     type
132 <verb>
133 slattach -h -c -s 115200 /dev/modem
134 </verb>
135     if you are able to "ping" hosts on the other side of the router,
136     you are connected! If it does not work, you might want to try "-a"
137     instead of "-c" as an argument to slattach.
138 </enum>
139
140 <sect1><heading>How to shutdown the connection</heading>
141
142     <p>Type "kill -INT `cat /var/run/slattach.modem.pid`" (as root) to
143     kill slattach.  Then go back to kermit ("fg" if you suspended it)
144     and exit from it ("q").
145
146     The slattach man page says you have to use "ifconfig sl0 down" to
147     mark the interface down, but this does not seem to make any
148     difference for me.  ("ifconfig sl0" reports the same thing.)
149
150     Some times, your modem might refuse to drop the carrier (mine
151     often does).  In that case, simply start kermit and quit it again.
152     It usually goes out on the second try.
153
154 <sect1><heading>Troubleshooting</heading>
155
156 <p>If it does not work, feel free to ask me.  The things that people
157 tripped over so far:
158 <itemize>
159 <item>Not using "-c" or "-a" in slattach (I have no idea why this can be
160   fatal, but adding this flag solved the problem for at least one
161   person)
162
163 <item>Using "s10" instead of "sl0" (might be hard to see the difference on
164   some fonts).
165
166 <item>Try "ifconfig sl0" to see your interface status.  I get:
167 <verb>
168 silvia# ifconfig sl0
169 sl0: flags=10<POINTOPOINT>
170         inet 136.152.64.181 --> 136.152.64.1 netmask ffffff00
171 </verb>
172
173 <item>Also, <tt>netstat -r</tt> will give the routing table, in case you get
174 the "no route to host" messages from ping.  Mine looks like:
175 <verb>
176 silvia# netstat -r
177 Routing tables
178 Destination      Gateway            Flags     Refs     Use  IfaceMTU    Rtt   
179 Netmasks:
180 (root node)
181 (root node)
182
183 Route Tree for Protocol Family inet:
184 (root node) =>
185 default          inr-3.Berkeley.EDU UG          8   224515  sl0 -      -     
186 localhost.Berkel localhost.Berkeley UH          5    42127  lo0 -       0.438
187 inr-3.Berkeley.E silvia.HIP.Berkele UH          1        0  sl0 -      -     
188 silvia.HIP.Berke localhost.Berkeley UGH        34 47641234  lo0 -       0.438
189 (root node)
190 </verb>
191 (this is after transferring a bunch of files, your numbers should be
192 smaller).
193 </itemize>