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