2d0cd9f29e3833b1c2e98fd1ffd27aecdd91e397
[spider.git] / html / installation-3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5  <TITLE>The DXSpider Installation Manual v1.49: Configuration</TITLE>
6  <LINK HREF="installation-4.html" REL=next>
7  <LINK HREF="installation-2.html" REL=previous>
8  <LINK HREF="installation.html#toc3" REL=contents>
9 <link rel=stylesheet href="style.css" type="text/css" title="default stylesheet">
10 </HEAD>
11 <BODY>
12 <A HREF="installation-4.html">Next</A>
13 <A HREF="installation-2.html">Previous</A>
14 <A HREF="installation.html#toc3">Contents</A>
15 <HR>
16 <H2><A NAME="s3">3. Configuration</A></H2>
17
18 <H2><A NAME="ss3.1">3.1 Allowing ax25 connects from users</A>
19 </H2>
20
21 <P>As stated previously, the aim of this document is not to tell you how to 
22 configure Linux or the ax25 utilities.  However, you do need to add a line 
23 in your ax25d.conf to allow connections to DXSpider for your users.  For
24 each interface that you wish to allow connections on, use the following format ...
25 <P>
26 <BLOCKQUOTE><CODE>
27 <PRE>
28 default  * * * * * *  - sysop /spider/src/client client %u ax25
29 </PRE>
30 </CODE></BLOCKQUOTE>
31 <P>
32 <P>or, if you wish your users to be able to use SSID's on their callsigns ..
33 <P>
34 <BLOCKQUOTE><CODE>
35 <PRE>
36 default  * * * * * *  - sysop /spider/src/client client %s ax25
37 </PRE>
38 </CODE></BLOCKQUOTE>
39 <P>
40 <P>For most purposes this is not desirable. The only time you probably will 
41 need this is when you need to allow other cluster nodes that are using SSID's
42 in. In this case it would probably be better to use the first example and 
43 then add a specific line for that node like this:
44 <P>
45 <BLOCKQUOTE><CODE>
46 <PRE>
47 GB7DJK-2  * * * * * *  - sysop /spider/src/client client gb7djk-2 ax25
48 default  * * * * * *  - sysop /spider/src/client client %u ax25
49 </PRE>
50 </CODE></BLOCKQUOTE>
51 <P>
52 <H2><A NAME="ss3.2">3.2 Allowing telnet connects from users </A>
53 </H2>
54
55 <P> 
56 From version 1.47 there is a new (more efficient) way of doing this
57 (see next section) but, if you prefer, the method of doing it described 
58 here will continue to work just fine.
59 <P>
60 <P>Allowing telnet connections is quite simple.  Firstly you need to add a line 
61 in /etc/services to allow connections to a port number, like this ....
62 <P>
63 <BLOCKQUOTE><CODE>
64 <PRE>
65 spdlogin   8000/tcp     # spider anonymous login port
66 </PRE>
67 </CODE></BLOCKQUOTE>
68 <P>
69 <P>Then add a line in /etc/inetd.conf like this ....
70 <P>
71 <BLOCKQUOTE><CODE>
72 <PRE>
73 spdlogin stream tcp nowait root /usr/sbin/tcpd /spider/src/client login telnet
74 </PRE>
75 </CODE></BLOCKQUOTE>
76 <P>
77 <P>Once this is done, you need to restart inetd like this ....
78 <P>
79 <BLOCKQUOTE><CODE>
80 <PRE>
81 killall -HUP inetd
82 </PRE>
83 </CODE></BLOCKQUOTE>
84 <P>
85 <P>Now login as <EM>sysop</EM> and cd spider/src. You can test that spider 
86 is accepting telnet logins by issuing the following command ....
87 <P>
88 <BLOCKQUOTE><CODE>
89 <PRE>
90 ./client login telnet
91 </PRE>
92 </CODE></BLOCKQUOTE>
93 <P>
94 <P>You should get a login prompt and on issuing a callsign, you will be given 
95 access to the cluster.  Note, you will not get a password login.  There seems 
96 no good reason for a password prompt to be given so it is not asked for.
97 <P>
98 <P>Assuming all is well, then try a telnet from your linux console ....
99 <P>
100 <BLOCKQUOTE><CODE>
101 <PRE>
102 telnet localhost 8000
103 </PRE>
104 </CODE></BLOCKQUOTE>
105 <P>
106 <P>You should now get the login prompt and be able to login as before.
107 <P>
108 <H2><A NAME="ss3.3">3.3 Setting up telnet connects (from 1.47 onwards)</A>
109 </H2>
110
111 <P>From version 1.47 you can choose to allow the perl cluster.pl program to 
112 allow connections directly (i.e. not via the <CODE>/spider/src/client</CODE>
113 interface program). If you are using Windows then this is the only method
114 available of allowing incoming telnet connections.
115 <P>
116 <P>To do this you need first to remove any line that you may previously have set
117 up in /etc/inetd.conf. Remember to:-
118 <P>
119 <BLOCKQUOTE><CODE>
120 <PRE>
121 killall -HUP inetd
122 </PRE>
123 </CODE></BLOCKQUOTE>
124 <P>
125 <P>to make the change happen...
126 <P>
127 <P>Having done that, you need to copy the file 
128 <EM>/spider/perl/Listeners.pm</EM> to <EM>/spider/local</EM> and 
129 then edit it. You will need to uncomment the line containing &quot;0.0.0.0&quot; 
130 and select the correct port to listen on. So that it looks like this:-
131 <P>
132 <BLOCKQUOTE><CODE>
133 <PRE>
134 @listen = (
135     ["0.0.0.0", 8000],
136 );
137 </PRE>
138 </CODE></BLOCKQUOTE>
139 <P>
140 <P>As standard, the listener will listen on all interfaces simultaneously. 
141 If you require more control than this, you can specify each interface 
142 individually:-
143 <P>
144 <BLOCKQUOTE><CODE>
145 <PRE>
146 @listen = (
147     ["gb7baa.dxcluster.net", 8000],
148     ["44.131.16.2", 6300],
149 );
150 </PRE>
151 </CODE></BLOCKQUOTE>
152 <P>
153 <P>This will only be successful if the IP addresses on each interface are static. 
154 If you are using some kind of dynamic IP addressing then the 'default' method 
155 is the only one that will work.
156 <P>
157 <P>Restart the cluster.pl program to enable the listener.
158 <P>
159 <P>One important difference with the internal listener is that no echoing 
160 is done by the cluster program. Users will need to set 'local-echo' on in 
161 their telnet clients if it isn't set automatically (as per the standards). 
162 Needless to say this will probably only apply to Windows users. 
163 <P>
164 <H2><A NAME="ss3.4">3.4 Setting up for AGW Engine (1.47 onwards)</A>
165 </H2>
166
167 <P>AGW Engine is a Windows based ax25 stack. You can connect to an AGW engine 
168 from Linux as well as Windows based machines.
169 <P>
170 <P>In order to enable access to an AGW Engine you need to copy 
171 <EM>/spider/perl/AGWConnect.pm</EM> to <EM>/spider/local</EM> and edit it. 
172 Specifically you must:-
173 <P>
174 <UL>
175 <LI> set <CODE>$enable</CODE> to 1.</LI>
176 <LI> set <CODE>$login</CODE> and <CODE>$passwd</CODE> to the values set up in your AGW installation. 
177 If you haven't set any there, then you should not touch these values.</LI>
178 <LI> You can connect to a remote AGW engine (ie on some other machine) by changing <CODE>$addr</CODE>
179 and <CODE>$port</CODE> appropriately.</LI>
180 <LI> Restart the cluster.pl program</LI>
181 </UL>
182    
183 <P>
184 <P>
185 <H2><A NAME="ss3.5">3.5 Setting up node connects</A>
186 </H2>
187
188 <P>In order to allow cluster node connections, spider needs to know that the 
189 connecting callsign is a cluster node.  This is the case whether the connect 
190 is incoming or outgoing.  In spider this is a simple task and can be done in 
191 runtime.
192 <P>
193 <P>Later versions of Spider can distinguish different software and treat them
194 differently.  For example, the WCY beacon cannot be handles by AK1A type
195 nodes as AK1A does not know what to do with PC73.  There are 4 different
196 types of node at present and although they may not have any major
197 differences at the moment, it allows for compatibility.  The 4 types are ...
198 <P>
199 <BLOCKQUOTE><CODE>
200 <PRE>
201 set/node        (AK1A type)
202 set/spider
203 set/dxnet
204 set/clx
205 </PRE>
206 </CODE></BLOCKQUOTE>
207 <P>
208 <P>For now, we will assume that the cluster we are going to connect to is an
209 AK1A type node.
210 <P>
211 <P>Start up the cluster as you did before and login as the sysop with client.
212 The cluster node I am wanting to make a connection to is GB7BAA but you would
213 obviously use whatever callsign you required.  At the prompt type ...
214 <P>
215 <BLOCKQUOTE><CODE>
216 <PRE>
217 set/node gb7baa
218 </PRE>
219 </CODE></BLOCKQUOTE>
220 <P>
221 <P>The case does not matter as long as you have a version of DXSpider later than 
222 1.33.  Earlier versions required the callsign to be in upper case.
223 <P>
224 <P>That is now set, it is as simple as that.  To prove it, login on yet another 
225 console as sysop, cd to spider/src and issue the command ...
226 <P>
227 <BLOCKQUOTE><CODE>
228 <PRE>
229 ./client gb7baa (using the callsign you set as a node)
230 </PRE>
231 </CODE></BLOCKQUOTE>
232 <P>
233 <P>You should get an initialisation string from DXSpider like this ...
234 <P>
235 <BLOCKQUOTE><CODE>
236 <PRE>
237 ./client gb7baa
238 PC38^GB7MBC^~
239 </PRE>
240 </CODE></BLOCKQUOTE>
241 <P>If the callsign you just set up as a cluster node is for an incoming connect, 
242 this is all that needs to be done.  If the connection is to be outgoing then 
243 a connection script needs to be written.
244 <P>
245 <P>Sometimes you make a mistake... Honest, it does happen.  If you want to make a node
246 back to being a normal user, regardless
247 of what type it is, do:
248 <P>
249 <BLOCKQUOTE><CODE>
250 <PRE>
251 unset/node gb7baa
252 </PRE>
253 </CODE></BLOCKQUOTE>
254 <P>
255 <H2><A NAME="ss3.6">3.6 Connection scripts</A>
256 </H2>
257
258 <P>Because DXSpider operates under Linux, connections can be made using just about 
259 any protocol;  AX25, NETRom, tcp/ip, ROSE etc are all possible examples.  
260 Connect scripts live in the /spider/connect directory and are simple ascii files.  
261 Writing a script for connections is therefore relatively simple.  
262 <P>
263 <P>The connect scripts consist of lines which start with the following keywords 
264 or symbols:-
265 <P>
266 <DL>
267 <P>
268 <DT><B>#</B><DD><P>All lines starting with a <CODE>#</CODE> are ignored, as are completely 
269 blank lines.
270 <P>
271 <DT><B>timeout</B><DD><P><CODE>timeout</CODE> followed by a number is the number of seconds to wait for a 
272 command to complete. If there is no timeout specified in the script 
273 then the default is 60 seconds.
274 <P>
275 <DT><B>abort</B><DD><P><CODE>abort</CODE> is a regular expression containing one or more strings to look 
276 for to abort a connection. This is a perl regular expression and is 
277 executed ignoring case.
278 <P>
279 <DT><B>connect</B><DD><P><CODE>connect</CODE> followed by ax25, agw (for Windows users) or telnet and some type dependent 
280 information. In the case of a telnet connection, there can be up to 
281 two parameters.
282 The first is the ip address or hostname of the computer you wish to 
283 connect to and the second is the port number you want to use (this 
284 can be left out if it is a normal telnet session).
285 In the case of an ax25 session then this would normally be a call to
286 ax25_call or netrom_call as in the example above. It is your
287 responsibility to get your node and other ax25 parameters to work 
288 before going down this route!
289 <P>
290 <DT><B>'</B><DD><P><CODE>'</CODE> is the delimiting character for a word or phrase of an expect/send 
291 line in a chat type script. The words/phrases normally come in pairs,
292 either can be empty. Each line reads input from the connection until 
293 it sees the string (or perl regular expression) contained in the
294 left hand string. If the left hand string is empty then it doesn't 
295 read or wait for anything. The comparison is done ignoring case.
296 When the left hand string has found what it is looking for (if it is)
297 then the right hand string is sent to the connection.
298 This process is repeated for every line of chat script. 
299 <P>
300 <DT><B>client</B><DD><P><CODE>client</CODE> starts the connection, put the arguments you would want here 
301 if you were starting the client program manually. You only need this 
302 if the script has a different name to the callsign you are trying to 
303 connect to (i.e. you have a script called other which actually 
304 connects to GB7DJK-1 [instead of a script called gb7djk-1]).
305 </DL>
306 <P>
307 <P>There are many possible ways to configure the script but here are three examples, 
308 one for a NETRom/AX25 connect, one for AGW engines and one for tcp/ip.  
309 <P>
310 <BLOCKQUOTE><CODE>
311 <PRE>
312 timeout 60
313 abort (Busy|Sorry|Fail)
314 # don't forget to chmod 4775 netrom_call!
315 connect ax25 /usr/sbin/netrom_call bbs gb7djk g1tlh
316 'Connect' '' 
317 'Connect' 'c np7'
318 'Connect' 'c gb7dxm'
319 # you can leave this out if you call the script 'gb7dxm'
320 client gb7dxm ax25
321 </PRE>
322 </CODE></BLOCKQUOTE>
323 <P>
324 <P>
325 <P>
326 <BLOCKQUOTE><CODE>
327 <PRE>
328 timeout 60
329 abort (Busy|Sorry|Fail)
330 # this does exactly the same as the previous example
331 # the '1' is the AGW port number to connect thru for g1tlh
332 connect agw 1 g1tlh
333 'Connect' '' 
334 'Connect' 'c np7'
335 'Connect' 'c gb7dxm'
336 # you can leave this out if you call the script 'gb7dxm'
337 client gb7dxm ax25
338 </PRE>
339 </CODE></BLOCKQUOTE>
340 <P>
341 <P>
342 <P>
343 <BLOCKQUOTE><CODE>
344 <PRE>
345 timeout 15
346 connect telnet dirkl.tobit.co.uk
347 'login' 'gb7djk'
348 'word' 'gb7djk'
349 # tell GB7DJK-1 that it is connected to GB7DJK
350 # you can leave this out if you call this script 'gb7djk'
351 client gb7djk telnet
352 </PRE>
353 </CODE></BLOCKQUOTE>
354 <P>
355 <P>Both these examples assume that everything is set up properly at the other end.  
356 You will find other examples in the /spider/examples directory.
357 <P>
358 <H2><A NAME="ss3.7">3.7 Starting the connection</A>
359 </H2>
360
361 <P>You start the connection, from within a sysop enabled cluster login, by typing 
362 in the word <EM>connect</EM> followed by a script name like this ....
363 <P>
364 <BLOCKQUOTE><CODE>
365 <PRE>
366 G0VGS de GB7MBC 13-Dec-1998 2041Z >connect gb7djk-1
367 connection to GB7DJK-1 started
368 G0VGS de GB7MBC 13-Dec-1998 2043Z >
369 </PRE>
370 </CODE></BLOCKQUOTE>
371 <P>
372 <P>This will start a connection using the script called <EM>gb7djk-1</EM>.  You can
373 follow the connection by watching the term or console from where you started
374 <EM>cluster.pl</EM>.  From version 1.47 onwards, you will need to <CODE>set/debug connect</CODE> first.
375 You should see something like this ...
376 <P>
377 <BLOCKQUOTE><CODE>
378 <PRE>
379 &lt;- D G1TLH connect gb7djk-1
380 -> D G1TLH connection to GB7DJK-1 started
381 -> D G1TLH G1TLH de GB7DJK 13-Dec-1998 2046Z >
382 timeout set to 15
383 CONNECT sort: telnet command: dirkl.tobit.co.uk
384 CHAT "login" -> "gb7djk"
385 received "
386 Red Hat Linux release 5.1 (Manhattan)
387 Kernel 2.0.35 on an i586
388 "
389 received "login: "
390 sent "gb7djk"
391 CHAT "word" -> "gb7djk"
392 received "gb7djk"
393 received "Password: "
394 sent "gb7djk"
395 Connected to GB7DJK-1, starting normal protocol
396 &lt;- O GB7DJK-1 telnet
397 -> B GB7DJK-1 0
398 GB7DJK-1 channel func  state 0 -> init
399 &lt;- D GB7DJK-1 
400 &lt;- D GB7DJK-1 Last login: Sun Dec 13 17:59:56 from dirk1
401 &lt;- D GB7DJK-1 PC38^GB7DJK-1^~
402 &lt;- D GB7DJK-1 PC18^ 1 nodes, 0 local / 1 total users  Max users 0  Uptime 
403 0 00:00^5447^~
404     etc
405 </PRE>
406 </CODE></BLOCKQUOTE>
407 <P>
408 <P>With later versions of Spider there is a set/login command for users.  This 
409 tells them when a user or node logs in or out.  If you do not add a line to 
410 your scripts after the final line (or before the client line which should always 
411 be last if needed) then the login/logout information will be sent to users
412 <I>before</I> the login actually completes.  This means if a node is 
413 unreachable, it will continue sending logins and logouts to users even though it 
414 is not actually connecting.  To avoid this use the following line ...
415 <P>
416 <BLOCKQUOTE><CODE>
417 <PRE>
418 'connect' ''
419 </PRE>
420 </CODE></BLOCKQUOTE>
421 <P>
422 <P>In a script, this might look like ...
423 <P>
424 <BLOCKQUOTE><CODE>
425 <PRE>
426 timeout 35 
427 abort (Busy|Sorry|Fail)
428 connect telnet mary 3000
429 'ogin:' 'gb7mbc'
430 '>' 'telnet 44.131.93.96 7305'
431 'connect' ''
432 </PRE>
433 </CODE></BLOCKQUOTE>
434 <P>
435 <H2><A NAME="ss3.8">3.8 Telnet echo</A>
436 </H2>
437
438 <P>Cluster links in particular suffer greatly from the presence of telnet echo.  
439 This is caused by the telnet negotiation itself and can create at worst severe 
440 loops.  At best it creates unnecessary bandwidth and large logfiles!  There are
441 things that can be done to limit this problem but will not always work dependent 
442 on the route taken to connect.
443 <P>
444 <P>Telnet echo itself should only be a problem if the connection is being made to 
445 the telnet port (23).  This port uses special rules that include echo negotiation.
446 If the connection is to a different port, such as 7300, this negotiation does 
447 not happen and therefore no echo should be present.
448 <P>
449 <P>Sometimes it is not possible to make a direct connection to another node and this 
450 can cause problems.  There is a way of trying to suppress the telnet echo but 
451 this will not always work, unfortunately it is difficult to be more specific.  
452 Here is an example of what I mean ...
453 <P>
454 <BLOCKQUOTE><CODE>
455 <PRE>
456 timeout 35
457 abort (Busy|Sorry|Fail)
458 connect telnet mary.lancs.ac.uk
459 'ogin:' 'gb7mbc'
460 'word:' 'mypasswd'
461 '\$' 'stty -echo raw'
462 '\$' 'telnet 44.131.93.96'
463 'connect' ''
464 </PRE>
465 </CODE></BLOCKQUOTE>
466 <P>
467 <P>So, the first connection is made by Spider.  This is fine as Spider uses the
468 Net_Telnet script from within perl.  This actually uses TCP rather than TELNET 
469 so no negotiation will be done on the first connection.  Once connected to
470 mary.lancs.ac.uk, the command is sent to suppress echo.  Now a telnet is made 
471 to a cluster node that is accepting connections on port 23.  The problem with 
472 this link is that the negotiation is made by the remote machine, therefore you 
473 have no control over it.  The chances are that this link will create echo and 
474 there will be no way you can stop it.
475 <P>
476 <P>
477 <H2><A NAME="ss3.9">3.9 Autostarting the cluster</A>
478 </H2>
479
480 <P>Ok, you should now have DXSpider running nicely and allowing connects by cluster
481 nodes or users.  However, it has to be shutdown and restarted manually.  It
482 would be much easier to have it start automatically. 
483 <P>
484 <P>This is not only a way to start the cluster automatically, it also works as a
485 watchdog, checking the sanity of DXSpider and respawning it should it crash for 
486 any reason.  Before doing the following, shutdown the cluster as you did earlier.
487 <P>
488 <P>Login as root and bring up the /etc/inittab file in your favourite editor.  Add 
489 the following lines to the file near the end ...
490 <P>
491 <BLOCKQUOTE><CODE>
492 <PRE>
493 ##Start DXSpider on bootup and respawn it should it crash
494 DX:3:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
495 </PRE>
496 </CODE></BLOCKQUOTE>
497 <P>
498 <P>This line works fine for RedHat distributions. It is also fine for SuSE up to
499 7.0.  From Suse 7.1 you need to add runlevels 2 and 5 like this ...
500 <P>
501 <BLOCKQUOTE><CODE>
502 <PRE>
503 DX:235:respawn:/bin/su -c "/usr/bin/perl -w /spider/perl/cluster.pl" sysop >/dev/tty7
504 </PRE>
505 </CODE></BLOCKQUOTE>
506 <P>
507 <P>The line required for Slackware distributions is slightly different.  My thanks to 
508 Aurelio, PA3EZL for this information.
509 <P>
510 <BLOCKQUOTE><CODE>
511 <PRE>
512 DX:23:respawn:/bin/su - sysop -c "/usr/bin/perl -w /spider/perl/cluster.pl" >/dev/tty7
513 </PRE>
514 </CODE></BLOCKQUOTE>
515 <P>
516 <P>This will automatically start DXSpider on tty7 (ALT-F7) on bootup and restart 
517 it should it crash for any reason.
518 <P>
519 <P>As root type the command <EM>telinit q</EM>.  DXSpider should start up 
520 immediately.  You will see the output on tty7 and if you login as <EM>sysop</EM> 
521 you should find everything running nicely.
522 <P>
523 <HR>
524 <A HREF="installation-4.html">Next</A>
525 <A HREF="installation-2.html">Previous</A>
526 <A HREF="installation.html#toc3">Contents</A>
527 </BODY>
528 </HTML>