41e6eb8704b11878fab527c3bd44c3a4fdf482c7
[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>
32 <H2><A NAME="ss3.2">3.2 Allowing telnet connects from users</A>
33 </H2>
34
35 <P>Allowing telnet connections is quite simple.  Firstly you need to add a line 
36 in /etc/services to allow connections to a port number, like this ....
37 <P>
38 <BLOCKQUOTE><CODE>
39 <PRE>
40 spdlogin   8000/tcp     # spider anonymous login port
41 </PRE>
42 </CODE></BLOCKQUOTE>
43 <P>Then add a line in /etc/inetd.conf like this ....
44 <P>
45 <BLOCKQUOTE><CODE>
46 <PRE>
47 spdlogin stream tcp nowait root /usr/sbin/tcpd /spider/src/client login telnet
48 </PRE>
49 </CODE></BLOCKQUOTE>
50 <P>
51 <P>This needs to be added above the standard services such as ftp, telnet etc.  
52 Once this is done, you need to restart inetd like this ....
53 <P>
54 <BLOCKQUOTE><CODE>
55 <PRE>
56 killall -HUP inetd
57 </PRE>
58 </CODE></BLOCKQUOTE>
59 <P>
60 <P>
61 <P>Now login as <EM>sysop</EM> and cd spider/perl. You can test that spider 
62 is accepting telnet logins by issuing the following command ....
63 <P>
64 <BLOCKQUOTE><CODE>
65 <PRE>
66 client.pl login telnet
67 </PRE>
68 </CODE></BLOCKQUOTE>
69 <P>You should get a login prompt and on issuing a callsign, you will be given 
70 access to the cluster.  Note, you will not get a password login.  There seems 
71 no good reason for a password prompt to be given so it is not asked for.
72 <P>
73 <P>Assuming all is well, then try a telnet from your linux console ....
74 <P>
75 <BLOCKQUOTE><CODE>
76 <PRE>
77 telnet localhost 8000
78 </PRE>
79 </CODE></BLOCKQUOTE>
80 <P>
81 <P>You should now get the login prompt and be able to login as before.
82 <P>
83 <H2><A NAME="ss3.3">3.3 Setting up node connects</A>
84 </H2>
85
86 <P>In order to allow cluster node connections, spider needs to know that the 
87 connecting callsign is a cluster node.  This is the case whether the connect 
88 is incoming or outgoing.  In spider this is a simple task and can be done in 
89 runtime.
90 <P>
91 <P>Later versions of Spider can distinguish different software and treat them
92 differently.  For example, the WCY beacon cannot be handles by AK1A type
93 nodes as AK1A does not know what to do with PC73.  There are 4 different
94 types of node at present and although they may not have any major
95 differences at the moment, it allows for compatibility.  The 4 types are ...
96 <P>
97 <BLOCKQUOTE><CODE>
98 <PRE>
99 set/node        (AK1A type)
100 set/spider
101 set/dxnet
102 set/clx
103 </PRE>
104 </CODE></BLOCKQUOTE>
105 <P>
106 <P>For now, we will assume that the cluster we are going to connect to is an
107 AK1A type node.
108 <P>
109 <P>Start up the cluster as you did before and login as the sysop with client.pl.
110 The cluster node I am wanting to make a connection to is GB7BAA but you would
111 obviously use whatever callsign you required.  At the prompt type ...
112 <P>
113 <BLOCKQUOTE><CODE>
114 <PRE>
115 set/node gb7baa
116 </PRE>
117 </CODE></BLOCKQUOTE>
118 <P>
119 <P>The case does not matter as long as you have a version of DXSpider later than 
120 1.33.  Earlier versions required the callsign to be in upper case.
121 <P>
122 <P>That is now set, it is as simple as that.  To prove it, login on yet another 
123 console as sysop and issue the command ...
124 <P>
125 <BLOCKQUOTE><CODE>
126 <PRE>
127 client.pl gb7baa (using the callsign you set as a node)
128 </PRE>
129 </CODE></BLOCKQUOTE>
130 <P>
131 <P>You should get an initialisation string from DXSpider like this ...
132 <P>
133 <BLOCKQUOTE><CODE>
134 <PRE>
135 client.pl gb7baa
136 PC38^GB7MBC^~
137 </PRE>
138 </CODE></BLOCKQUOTE>
139 <P>If the callsign you just set up as a cluster node is for an incoming connect, 
140 this is all that needs to be done.  If the connection is to be outgoing then 
141 a connection script needs to be written.
142 <P>
143 <H2><A NAME="ss3.4">3.4 Connection scripts</A>
144 </H2>
145
146 <P>Because DXSpider operates under Linux, connections can be made using just about 
147 any protocol;  AX25, NETRom, tcp/ip, ROSE etc are all possible examples.  
148 Connect scripts live in the /spider/connect directory and are simple ascii files.  
149 Writing a script for connections is therefore relatively simple.  
150 <P>
151 <P>The connect scripts consist of lines which start with the following keywords 
152 or symbols:-
153 <P>
154 <PRE>
155         
156 #               All lines starting with a # are ignored, as are completely 
157                 blank lines.
158
159 timeout         timeout followed by a number is the number of seconds to wait for a 
160                 command to complete. If there is no timeout specified in the script 
161                 then the default is 60 seconds.
162
163 abort           abort is a regular expression containing one or more strings to look 
164                 for to abort a connection. This is a perl regular expression and is 
165                 executed ignoring case.
166
167 connect         connect followed by ax25 or telnet and some type dependent 
168                 information. In the case of a telnet connection, there can be up to 
169                 two parameters.
170                 The first is the ip address or hostname of the computer you wish to 
171                 connect to and the second is the port number you want to use (this 
172                 can be left out if it is a normal telnet session).
173                 In the case of an ax25 session then this would normally be a call to
174                 ax25_call or netrom_call as in the example above. It is your
175                 responsibility to get your node and other ax25 parameters to work 
176                 before going down this route!
177
178 '               ' is the delimiting character for a word or phrase of an expect/send 
179                 line in a chat type script. The words/phrases normally come in pairs,
180                 either can be empty. Each line reads input from the connection until 
181                 it sees the string (or perl regular expression) contained in the
182                 left hand string. If the left hand string is empty then it doesn't 
183                 read or wait for anything. The comparison is done ignoring case.
184                 When the left hand string has found what it is looking for (if it is)
185                 then the right hand string is sent to the connection.
186                 This process is repeated for every line of chat script. 
187
188 client          client starts the connection, put the arguments you would want here 
189                 if you were starting the client program manually. You only need this 
190                 if the script has a different name to the callsign you are trying to 
191                 connect to (i.e. you have a script called other which actually 
192                 connects to GB7DJK-1 [instead of a script called gb7djk-1]).
193 </PRE>
194 <P>
195 <P>There are many possible ways to configure the script but here are two examples, 
196 one for a NETRom/AX25 connect and one for tcp/ip.  
197 <P>
198 <BLOCKQUOTE><CODE>
199 <PRE>
200 timeout 60
201 abort (Busy|Sorry|Fail)
202 # don't forget to chmod 4775 netrom_call!
203 connect ax25 /usr/sbin/netrom_call bbs gb7djk g1tlh
204 'Connect' '' 
205 'Connect' 'c np7'
206 'Connect' 'c gb7dxm'
207 # you can leave this out if you call the script 'gb7dxm'
208 client gb7dxm ax25
209 </PRE>
210 </CODE></BLOCKQUOTE>
211 <P>
212 <P>
213 <P>
214 <BLOCKQUOTE><CODE>
215 <PRE>
216 timeout 15
217 connect telnet dirkl.tobit.co.uk
218 'login' 'gb7djk'
219 'word' 'gb7djk'
220 # tell GB7DJK-1 that it is connected to GB7DJK
221 # you can leave this out if you call this script 'gb7djk'
222 client gb7djk telnet
223 </PRE>
224 </CODE></BLOCKQUOTE>
225 <P>
226 <P>Both these examples assume that everything is set up properly at the other end.  
227 You will find other examples in the /spider/examples directory.
228 <P>
229 <H2><A NAME="ss3.5">3.5 Starting the connection</A>
230 </H2>
231
232 <P>You start the connection, from within a sysop enabled cluster login, by typing 
233 in the word <EM>connect</EM> followed by a script name like this ....
234 <P>
235 <BLOCKQUOTE><CODE>
236 <PRE>
237 G0VGS de GB7MBC 13-Dec-1998 2041Z >connect gb7djk-1
238 connection to GB7DJK-1 started
239 G0VGS de GB7MBC 13-Dec-1998 2043Z >
240 </PRE>
241 </CODE></BLOCKQUOTE>
242 <P>This will start a connection using the script called <EM>gb7djk-1</EM>.  You can
243 follow the connection by watching the term or console from where you started
244 <EM>cluster.pl</EM>.  You should see something like this ...
245 <P>
246 <BLOCKQUOTE><CODE>
247 <PRE>
248 &lt;- D G1TLH connect gb7djk-1
249 -> D G1TLH connection to GB7DJK-1 started
250 -> D G1TLH G1TLH de GB7DJK 13-Dec-1998 2046Z >
251 timeout set to 15
252 CONNECT sort: telnet command: dirkl.tobit.co.uk
253 CHAT "login" -> "gb7djk"
254 received "
255 Red Hat Linux release 5.1 (Manhattan)
256 Kernel 2.0.35 on an i586
257 "
258 received "login: "
259 sent "gb7djk"
260 CHAT "word" -> "gb7djk"
261 received "gb7djk"
262 received "Password: "
263 sent "gb7djk"
264 Connected to GB7DJK-1, starting normal protocol
265 &lt;- O GB7DJK-1 telnet
266 -> B GB7DJK-1 0
267 GB7DJK-1 channel func  state 0 -> init
268 &lt;- D GB7DJK-1 
269 &lt;- D GB7DJK-1 Last login: Sun Dec 13 17:59:56 from dirk1
270 &lt;- D GB7DJK-1 PC38^GB7DJK-1^~
271 &lt;- D GB7DJK-1 PC18^ 1 nodes, 0 local / 1 total users  Max users 0  Uptime 
272 0 00:00^5447^~
273     etc
274 </PRE>
275 </CODE></BLOCKQUOTE>
276 <P>
277 <P>With later versions of Spider there is a set/login command for users.  This 
278 tells them when a user or node logs in or out.  If you do not add a line to 
279 your scripts after the final line (or before the client line which should always 
280 be last if needed) then the login/logout information will be sent to users
281 <I>before</I> the login actually completes.  This means if a node is 
282 unreachable, it will continue sending logins and logouts to users even though it 
283 is not actually connecting.  To avoid this use the following line ...
284 <P>
285 <BLOCKQUOTE><CODE>
286 <PRE>
287 'connect' ''
288 </PRE>
289 </CODE></BLOCKQUOTE>
290 <P>
291 <P>In a script, this might look like ...
292 <P>
293 <BLOCKQUOTE><CODE>
294 <PRE>
295 timeout 35 
296 abort (Busy|Sorry|Fail)
297 connect telnet mary 3000
298 'ogin:' 'gb7mbc'
299 '>' 'telnet 44.131.93.96 7305'
300 'connect' ''
301 </PRE>
302 </CODE></BLOCKQUOTE>
303 <P>
304 <H2><A NAME="ss3.6">3.6 Telnet echo</A>
305 </H2>
306
307 <P>Cluster links in particular suffer greatly from the presence of telnet echo.  
308 This is caused by the telnet negotiation itself and can create at worst severe 
309 loops.  At best it creates unnecessary bandwidth and large logfiles!  There are
310 things that can be done to limit this problem but will not always work dependent 
311 on the route taken to connect.
312 <P>
313 <P>Telnet echo itself should only be a problem if the connection is being made to 
314 the telnet port (23).  This port uses special rules that include echo negotiation.
315 If the connection is to a different port, such as 8000, this negotiation does 
316 not happen and therefore no echo should be present.
317 <P>
318 <P>Sometimes it is not possible to make a direct connection to another node and this 
319 can cause problems.  There is a way of trying to suppress the telnet echo but 
320 this will not always work, unfortunately it is difficult to be more specific.  
321 Here is an example of what I mean ...
322 <P>
323 <BLOCKQUOTE><CODE>
324 <PRE>
325 timeout 35
326 abort (Busy|Sorry|Fail)
327 connect telnet mary.lancs.ac.uk
328 'ogin:' 'gb7mbc'
329 'word:' 'mypasswd'
330 '\$' 'stty -echo raw'
331 '\$' 'telnet 44.131.93.96'
332 'connect' ''
333 </PRE>
334 </CODE></BLOCKQUOTE>
335 <P>So, the first connection is made by Spider.  This is fine as Spider uses the
336 Net_Telnet script from within perl.  This actually uses TCP rather than TELNET 
337 so no negotiation will be done on the first connection.  Once connected to
338 mary.lancs.ac.uk, the command is sent to suppress echo.  Now a telnet is made 
339 to a cluster node that is accepting connections on port 23.  The problem with 
340 this link is that the negotiation is made by the remote machine, therefore you 
341 have no control over it.  The chances are that this link will create echo and 
342 there will be no way you can stop it.
343 <P>
344 <P>
345 <HR>
346 <A HREF="adminmanual-4.html">Next</A>
347 <A HREF="adminmanual-2.html">Previous</A>
348 <A HREF="adminmanual.html#toc3">Contents</A>
349 </BODY>
350 </HTML>