aboutsummaryrefslogtreecommitdiff
path: root/handbook/slipc.sgml
blob: 97873313884f15a3b1167925cdd46f37e9df6dc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!-- $Id: slipc.sgml,v 1.1.1.1 1995-04-28 16:19:59 jfieber Exp $ -->
<!-- The FreeBSD Documentation Project -->

<sect><heading>Setting up a SLIP client</heading>

<p><em>Contributed by &a.asami;.</em>

The following is one way to set up a FreeBSD machine for SLIP on a
static host network.  For dynamic hostname assignments (i.e., your
address changes each time you dial up), you probably need to do
something much fancier.

<!--
This is just "what I did, and it worked for me".  I'm sharing this
just for your reference, I'm no expert in SLIP nor networking so your
mileage may vary.
-->

Note: for 1.1 systems (not 1.1.5), you need to use /dev/tty01 instead
of /dev/cua01. substitute all the occurences of "cua" in this document
with "tty".

Note: the default 1.1.5(.1) system only comes with cua/ttyd pairs for
the last two ports (2 and 3), so if your modem is at sio0/sio1
(COM1/COM2), you need to make the devices.  Try "cd /dev; sh MAKEDEV
cua01" to make the new special files for sio1 (ditto for sio0).  This
will delete tty01, but you shouldn't need it anymore...or you can make
a symbolic link /dev/tty01 -> ttyd1 if you don't want to hunt down all
occurences of tty01 in your setup files.

I actually have a symbolic link /dev/modem -> cua01 (and /dev/mouse ->
ttyd0). I use only the modem/mouse names in my configuration files.
This helped a lot when I switched from 1.1 to 1.1.5.1 (tty01 => cua01)
and when I had to move my modem temporarily to sio2 to enable the
RS-232C port on the serial card.  It can become quite cumbersome when
you need to fix a bunch of files in /etc and .kermrc's all over the
system!

First, make sure you have
<verb>
pseudo-device   sl      2
</verb>
in your kernel's config file.  It is included in the GENERIC, GENERICAH
and GENERICBT kernels, so this won't be a problem unless you deleted it.

<sect1><heading>Things you have to do only once</heading>

<p><enum>
<item> Add your home machine, the gateway and nameservers to your
    /etc/hosts file.  Mine looks like this:
<verb>
127.0.0.1               localhost loghost
136.152.64.181          silvia.HIP.Berkeley.EDU silvia.HIP silvia

136.152.64.1            inr-3.Berkeley.EDU inr-3 slip-gateway
128.32.136.9            ns1.Berkeley.edu ns1
128.32.136.12           ns2.Berkeley.edu ns2
</verb>
    By the way, silvia is the name of the car that I had when I was
    back in Japan (it's called 2?0SX here in U.S.).

<item> Make sure you have "hosts" before "bind" in your /etc/host.conf.
    Otherwise, funny things may happen.

<item> Edit the /etc/netstart and add this to the end of the file:
<verb>
# set up slip
gateway=slip-gateway
ifconfig sl0 inet $hostname $gateway netmask 0xffffff00
route add default $gateway
</verb>
    Note that because of the "slip-gateway" entry in /etc/hosts, there
    is no local dependency in the netstart file.  Also, you might want
    to un-comment the "<verb>route add $hostname localhost</verb>" line.

<item> Make a file /etc/resolv.conf which contains:
<verb>
domain HIP.Berkeley.EDU
nameserver 128.32.136.9
nameserver 128.32.136.12
</verb>
    As you can see, these set up the nameserver hosts.  Of course, the
    actual addresses depend on your environment.

<item> Set the password for root and toor (and any other accounts that
    doesn't have a password).  Use passwd, don't edit the passwd or
    passwd.master files!

<item> Edit /etc/myname and reboot the machine.
</enum>


<sect1><heading>Making a SLIP connection</heading>

<p><enum>
<item> Dial up, type "slip" at the prompt, enter your machine name and
    password.  The things you need to enter depends on your
    environment.  I use kermit, with a script like this:
<verb>
# kermit setup
set modem hayes
set line /dev/cua01
set speed 57600
set parity none
set flow rts/cts
set terminal bytesize 8
set file type binary
# The next macro will dial up and login
define slip dial 643-9600, input 10 =>, if failure stop, -
output slip\x0d, input 10 Username:, if failure stop, -
output silvia\x0d, input 10 Password:, if failure stop, -
output ***\x0d, echo \x0aCONNECTED\x0a
</verb>
    (of course, you have to change the hostname and password to fit
    yours).  Then you can just type "slip" from the kermit prompt to
    get connected.

    Note: leaving your password in plain text anywhere in the
    filesystem is generally a BAD idea.  Do it at your own risk.  I'm
    just too lazy.

    Note: If you have an 1.1 machine, and kermit doesn't give you a
    prompt, try "stty -f /dev/tty01 clocal".  I put this in
    /etc/rc.local so that it works the first time I boot the machine.
    This doesn't apply to 1.1.5(.1) systems, as cua0? are already
    configured for dialouts.

<item> Leave the kermit there (you can suspend it by "z") and as root,
    type
<verb>
slattach -h -c -s 57600 /dev/cua01
</verb>
    if you are able to "ping" hosts on campus, you are connected!
    If it doesn't work, you might want to try "-a" instead of "-c".
</enum>

<sect1><heading>How to shutdown the connection</heading>

    <p>Type "ps gx" (as root) to find out the PID of slattach, and use
    "kill -INT" to kill it.
    Then go back to kermit ("fg" if you suspended it) and exit from it
    ("q").

    The slattach man page says you have to use "ifconfig sl0 down" to
    mark the interface down, but this doesn't seem to make any
    difference for me.  ("ifconfig sl0" reports the same thing.)

    Some times, your modem might refuse to drop the carrier (mine
    often does).  In that case, simply start kermit and quit it again.
    It usually goes out on the second try.

    When you want to connect again, go back to (XXX).  You may have to
    watch out for clocal mode.  If "stty -f /dev/tty01" doesn't tell
    you it's clocal, you need to re-set it before kermitting.  Again,
    this is only for 1.1 machines.

<sect1><heading>Troubleshooting</heading>

<p>If it doesn't work, feel free to ask me.  The things that people
tripped over so far:
<itemize>
<item> Not using "-c" or "-a" in slattach (I have no idea why this can be
  fatal, but adding this flag solved the problem for at least one
  person)

<item> Using "s10" instead of "sl0" (might be hard to see the difference on
  some fonts.

<item> Try "ifconfig sl0" to see your interface status.  I get:
<verb>
silvia# ifconfig sl0
sl0: flags=10<POINTOPOINT>
        inet 136.152.64.181 --> 136.152.64.1 netmask ffffff00
</verb>

<item>Also, "netstat -r" will give the routing table, in case you get the
"no route to host" messages from ping.  Mine looks like:
<verb>
silvia# netstat -r
Routing tables
Destination      Gateway            Flags     Refs     Use  IfaceMTU    Rtt   
Netmasks:
(root node)
(root node)

Route Tree for Protocol Family inet:
(root node) =>
default          inr-3.Berkeley.EDU UG          8   224515  sl0 -      -     
localhost.Berkel localhost.Berkeley UH          5    42127  lo0 -       0.438
inr-3.Berkeley.E silvia.HIP.Berkele UH          1        0  sl0 -      -     
silvia.HIP.Berke localhost.Berkeley UGH        34 47641234  lo0 -       0.438
(root node)
</verb>
(this is after transferring a bunch of files, your numbers should be
smaller).
</itemize>