NOSintro – TCP/IP over Packet Radio

An Introduction to the KA9Q Network Operating System

by Ian Wade, G3NRW

Chapter 15: HANDS ON — autoexec.nos

 

We now take a closer look at some of the NOS startup commands to be found in autoexec.nos. As usual, this chapter assumes you are using the default autoexec.nos listed in Appendix 3 (pages 312–317). This means that you are NS9BOB, so when you give a command like finger sysop@ns9bob, you are really talking to yourself. Try the commands as we go along.

 

Command Ground Rules

As explained earlier, all NOS commands are lower case, and you can abbreviate them as long as they are still unique. However, you must be careful when adding parameters to the commands: you shouldn’t abbreviate parameters, as NOS is not always thorough about checking them for validity.

If you are not sure about what parameters are needed for a particular command, just type the command followed by a question mark. NOS will reply with a list of required parameters. For example:

net> mbox ?
valid subcommands: attend expert fwdinfo haddress jumpstart kick maxmsg motd nrid password qth secure smtptoo status
timer tiptimeout trace utc zipcode

Alternatively, you can consult the NOS Command Set Reference in Appendix 2, or use VIEW to look at the same file on-line (when in VIEW, use F3 to display file V:\!CMDSET).

Note that many of the commands are of a "display or set" nature. That is, if you give the command by itself, you can display the current values of its parameters, but if you follow the command name with parameters you can change the parameter values to something else.

Let’s take a look at the beginning of autoexec.nos.

 

Miscellaneous Setup

# Miscellaneous setup ****************************************
attended on
escape ESC # <ESC> character
isat yes # 286/386 clock
multitask on
log /dump/session.log
watchdog off

motd "If I'm not here, please leave a message in mailbox."

attended:   The attended flag indicates whether the station is attended and you are ready to accept incoming chat requests. If attended is set to off, NOS sends a message back to the caller saying that the station is unattended.

isat:   The isat flag states whether the PC is an AT (i.e. 286/386/486) or not. When set to on, NOS measures time intervals in milliseconds, but if set to off it can only measure time in 55 millisecond clock ticks.

multitask:   When multitask is set to on, NOS continues to run when you escape to a DOS shell. If set to off, NOS activity ceases until you exit from DOS and return to NOS.

log:   The session log file contains a log of every time you start and stop NOS, and a summary of every session you run. This can be useful in tracing system problems. Not surprisingly, the file can grow to be very large, so you should delete it from time to time to save disk space.

watchdog:   When set to on, NOS runs a watchdog process that monitors internal activity. If the watchdog times out (after 5 minutes), NOS will automatically exit. This is useful for unattended site operation, where STARTNOS.BAT can be part of an endless loop, as in the file REMOTE.BAT:

:loop
N:\STARTNOS
GOTO loop

motd:   Specifies the "message of the day", used to welcome callers.

 

Domain Commands

There are many domain commands, most of which you’ll rarely use. They specify how NOS is to resolve and display IP addresses:

# Set up domain defaults *************************************
domain cache size 30
domain suffix ampr.org.
domain translate on # display host names
domain verbose off # do not display suffix
domain addserver ns9dns

domain suffix:   NOS automatically adds the suffix to any hostname you type which does not end in a dot, to generate the full domain name. For example, when you give the command ftp ns9ken, NOS will look in domain.txt for the name ns9ken.ampr.org.

domain translate:   When set to on, NOS converts numeric IP addresses to host names, making it much easier to understand status reports. For example, the route command gives an output like this when domain translate is set to on:

Dest Len Interface Gateway Metric P Timer Use
ns9tom 32 netrom 1 man 0
region45 24 tnc0 ns9ken 1 man 0

This is much more meaningful than:

Dest Len Interface Gateway Metric P Timer Use
44.199.47.75 32 netrom 1 man 0
44.199.45.0 24 tnc0 44.199.41.2 1 man 0

when domain translate is set to off. (Unfortunately some versions of NOS are broken; even when domain translate is set to on, the conversion does not take place).

domain verbose:   When set to on, NOS displays the full domain names of hosts, including the suffix; e.g. ns9ken.ampr.org. This can be useful if domain.txt contains hosts from several different domains, but in an AMPRnet-only environment you don’t need to see the suffix, so you can set domain verbose to off.

 

Station Identification

Here is where you tell NOS who you are:

# Station Identification *************************************
ip address ns9bob
hostname ns9bob
ax25 mycall NS9BOB-5 # This MUST precede 'attach'

ip address:   This is the IP address of your station. This corresponds to the word host in descriptions of command syntax. For example, the syntax for the ftp command is "ftp host", which means that the ftp command needs an IP address (or a name in domain.txt which corresponds to that address).

(N.B.  A lot of existing reference documentation uses the word hostid to mean IP address. This is quite wrong. A hostid is an IP address expressed in hexadecimal; e.g. the IP address 44.199.47.75 is equivalent to a hostid of 2cc72f4b. You can say ftp tom or ftp 44.199.47.75, but ftp 2cc72f4b won’t get you very far. Except for mentioning it here, the word hostid is not used anywhere else in this book).

hostname:   The hostname is the name by which you greet users of your FTP server and your NOS BBS. In principle you can use any name here, but this can cause complications when people try to reply to mail, so it’s best to use the name corresponding to your IP address in domain.txt.

ax25 mycall:   This tells NOS your AX.25 callsign. Note that it does not set up your tnc with the callsign as well; you must do this separately (e.g. in the script kisson.dia) before starting NOS.

 

Setting up the TNC

We’ve already seen how to attach the serial interface to the tnc, with the attach asy command. You can also set up various parameters in the tnc with the param command:

 

# Set up the TNC *********************************************
attach asy 0x3f8 4 ax25 tnc0 2048 256 4800 # COM1
# attach asy 0x2f8 3 ax25 tnc0 2048 256 4800 # COM2
# attach asy 0x3e8 4 ax25 tnc0 2048 256 4800 # COM3
# attach asy 0x2e8 3 ax25 tnc0 2048 256 4800 # COM4

# trace tnc0 211

# Initialise the tnc to KISS mode ****************************
dialer tnc0 /scripts/kisson.dia

param tnc0 1 20 # TX delay (x 10mS)
param tnc0 2 63 # Persistence (0-255)
param tnc0 3 10 # Slot Time (x 10mS)
param tnc0 4 10 # TX tail (x 10mS)
param tnc0 5 0 # 0=HDX
param tnc0 dtr 1
param tnc0 rts 1

 

Here is a list of param commands which may be applicable to your tnc (all values of n are decimal in the range 0-255):

param tnc0 1 n TX Delay (x 10mS)
param tnc0 2
n
Persistence
param tnc0 3
n
Slottime delay (x 10mS)
param tnc0 4
n
TX Tail (x 10mS)
param tnc0 5
n
0=half duplex, 1=full duplex
param tnc0 6
Hardware dependent
param tnc0 7
TX mute
param tnc0 8
n
0=DTR low, 1=DTR high
param tnc0 9
n
0=RTS low, 1=RTS high
param tnc0 10
Baudrate
param tnc0 11
n
End delay
param tnc0 12
n
Group
param tnc0 13
n
Idle
param tnc0 14
n
Min
param tnc0 15
n
Max key
param tnc0 16
n
Wait
param tnc0 17
n
Parity: 0=none, 1=even, 2=odd
param tnc0 129
n
Down
param tnc0 130
n
Up
param tnc0 254
Prepare to switch tnc to native mode
param tnc0 255
Switch tnc from KISS to native mode

Note that many of these parameters are tnc- and NOS-version dependent; only parameters 1-3, 5 and 255 are common to all implementations.

 

Interface Configuration

The interface configuration command (ifconfig) sets up various network parameters for each of the NOS interfaces. The parameter you may need to change is description:

ifconfig tnc0 description "144.625 MHz port"

This description provides useful information to people who want to use this interface as a gateway to other networks.

To obtain the current status of all NOS interfaces, use the ifconfig command by itself:

net> ifconfig
tnc0 IP addr ns9bob MTU 256 Link encap AX25
Link addr NS9BOB-5
flags 0 trace 0x0 netmask 0xff000000 broadcast
44.255.255.255
sent: ip 0 tot 6 idle 0:00:00:07
recv: ip 0 tot 0 idle 0:00:00:07
descr: 144.625 MHz port
loopback IP addr loopback MTU 65535 Link encap None
flags 0 trace 0x0 netmask 0xffffffff broadcast
255.255.255.255
sent: ip 0 tot 0 idle 0:00:00:07
recv: ip 0 tot 0 idle 0:00:00:07
encap IP addr 0.0.0.0 MTU 65535 Link encap None
flags 0 trace 0x0 netmask 0xffffffff broadcast
255.255.255.255
sent: ip 0 tot 0 idle 0:00:00:07
recv: ip 0 tot 0 idle 0:00:00:07

This tells us several things about each interface:

The IP address

The MTU (maximum transmission unit); i.e. largest packet size.

The encapsulation: i.e. whether the packets are AX.25 or NET/ROM packets etc.

The link address: either an AX.25 callsign or Ethernet adapter address

Various flags and masks

Numbers of packets sent and received through the interface.

In addition to the tnc0 interface defined in autoexec.nos, there are two other interfaces which appear automatically: loopback and encap. The loopback interface is a software loopback within NOS; that is, it is not attached to a physical interface port. This can be useful for testing. The encap interface is used for encapsulating AMPRnet traffic inside packets which the Internet understands.

 

The finger Command

To show how you can use NOS to communicate with other stations, let’s look at the finger command. This allows you to "put a finger on" (i.e. find out about) users on another system. The syntax of the command is:

finger @host
finger
user@host

To find out who is known on particular system, use the first form of this command. Try:

net> finger @ns9bob

Alternatively, you can try finger @loopback, which amounts to the same thing. N.B. There is no space after the @ symbol.

NOS replies with the message:

@ns9bob — Resolving ns9bob... trying ns9bob:finger
Known users on this system:
sysop

The first line confirms that NOS is resolving (looking for) ns9bob in domain.txt, and is then trying to connect to the finger server at ns9bob. The finger server then responds with a list of known users on the system; in this case, just one (sysop).

Where did the name sysop come from? Take a look in directory /finger (with the dir /finger command). Here you’ll find a text file named sysop, containing everything you ever wanted to know about sysop.

Now that you know the file sysop exists in the finger directory, you can ask NOS to send you a copy of the file:

net> finger sysop@ns9bob

(N.B. No spaces either side of the @ symbol).

This time, NOS responds with the contents of /finger/sysop:

sysop@ns9bob — Resolving ns9bob... trying ns9bob:finger

Hello and welcome to ns9bob

User: bob (NS9BOB)
Real Name: Robert R Roberts
Class: Extra
Address: 12345 Anystreet
Anytown, Anystate, AnyZIP
Telephone: (111) BOB-3456
System Config: PK-88
Yaesu FT-27RB
144.625 MHz

Occupation: Professor of Anglo-Saxon
Hobbies: Sheepshearing

So all you have to do now is prepare a separate text file for each user on your system that you want to tell the world about. Please remember KISS — keep it short, stupid! One screenful is quite enough. Give each file a name up to 8 letters long (no extension), and place it in directory /finger.

Incidentally, if you give the ifconfig command again, you will now see that the send and receive counts on the loopback interface have increased. In other words, ifconfig is useful for checking that traffic is actually passing through an interface.

Back to Contents Page

Back to NOSintro Main Page.


[Copyright 1992-2009 Dowermain Ltd. All Rights Reserved. This page last modified: 21 May 2009]