![]() | ![]() |
|
1. IntroductionAmateur radio is a non-profit, non-commercial activity enjoyed by hobbyists world-wide. Radio amateurs are licensed by government authorities to use portions of the radio spectrum allocated to them for non-commercial, non-profit activities including personal communication, public service, and technical experimentation. Packet Radio is a particular digital mode of communication that makes use of networking protocols to provide computer to computer communication. This document was originally an appendix to the HAM-HOWTO, but grew too large to be reasonably managed in that fashion. This document describes how to install and configure the native AX.25, NET/ROM and ROSE support for Linux. A few typical configurations are described that could be used as models to work from. The Linux implementation of the amateur radio protocols is very flexible. To people relatively unfamiliar with the Linux operating system the configuration process may look daunting and complicated. It will take you a little time to come to understand how the whole thing fits together. You will find configuration very difficult if you have not properly prepared yourself by learning about Linux in general. You cannot expect to switch from some other environment to Linux without learning about Linux itself. 1.1. Changes from the previous version
1.2. Where to obtain new versions of this documentThe best place to obtain the latest version of this document is from a Linux Documentation Project archive. The Linux Documentation Project runs a web server and this document appears there as the AX25-HOWTO. This document is also available in various formats from the Linux Documentation Project. You can always contact me, but I pass new versions of the document directly to the LDP HOWTO coordinator, so if it isn't there then chances are I haven't finished it. 1.3. Other related documentationThere is a lot of related documentation. There are many documents that relate to Linux networking in more general ways and I strongly recommend you also read these as they will assist you in your efforts and provide you with deeper insight into other possible configurations. They are: You may come across references to a Linux HAM HOWTO. This document is obsolete and has been replaced by the Hamsoft Linux Ham Radio Applications and Utilities Database web site. More general Linux information may be found by referencing other Linux HOWTO documents. 2. The Packet Radio Protocols and LinuxThe AX.25 protocol offers both connected and connectionless modes of operation, and is used either by itself for point-point links, or to carry other protocols such as TCP/IP and NET/ROM. It is similar to X.25 level 2 in structure, with some extensions to make it more useful in the amateur radio environment. The NET/ROM protocol is an attempt at a full network protocol and uses AX.25 at its lowest layer as a datalink protocol. It provides a network layer that is an adapted form of AX.25. The NET/ROM protocol features dynamic routing and node aliases. The ROSE protocol was conceived and first implemented by Tom Moulton W2VY and is an implementation of the X.25 packet layer protocol and is designed to operate with AX.25 as its datalink layer protocol. It too provides a network layer. ROSE addresses take the form of 10 digit numbers. The first four digits are called the Data Network Identification Code (DNIC) and are taken from Appendix B of the CCITT X.121 recommendation. More information on the ROSE protocol may be obtained from the RATS Web server. Alan Cox developed some early kernel based AX.25 software support for Linux. Jonathon Naylor has taken up ongoing development of the code, has added NET/ROM and ROSE support and is now the developer of the AX.25 related kernel code. DAMA support was developed by Joerg, DL1BKE. Baycom and Soundmodem support were added by Thomas Sailer. The AX.25 software is now maintained by a small team of developers on SourceForge. The Linux code supports KISS and 6PACK based TNC's (Terminal Node Controllers), the Ottawa PI card, the Gracilis PacketTwin card and other Z8530 SCC based cards with the generic SCC driver, several parallel and serial port Baycom modems, and serial port YAM modems. Thomas Sailer's kernel soundmodem driver supports SoundBlaster and sound cards based on the Crystal chip set, and his newer user-mode soundmodem uses the standard kernel sound drivers, so it should work with any sound card supported under Linux. The user programs contain a simple PMS (Personal Message System), a beacon facility, a line mode connect program, listen (an example of how to capture all AX.25 frames at raw interface level), and programs to configure the NET/ROM protocol. Also included are an AX.25 server style program to handle and dispatch incoming AX.25 connections and a NET/ROM daemon which does most of the hard work for NET/ROM support. There are utility programs to support APRS, including digipeating and gatewaying to the Internet. 2.1. How it all fits togetherThe Linux AX.25 implementation is a brand new implementation. While in many ways it may looks similar to NOS, or BPQ or other AX.25 implementations, it is none of these and is not identical to any of them. The Linux AX.25 implementation is capable of being configured to behave almost identically to other implementations, but the configuration process is very different. To assist you in understanding how you need to think when configuring this section describes some of the structural features of the AX.25 implementation and how it fits into the context of the overall Linux structure. Simplified Protocol Layering Diagram
This diagram simply illustrates that NET/ROM, ROSE and TCP/IP all run directly on top of AX.25, but that each of these protocols is treated as a separate protocol at the programming interface. The `_' names are simply the names given to the `Address Family' of each of these protocols when writing programs to use them. The important thing to note here is the implicit dependence on the configuration of your AX.25 devices before you can configure your NET/ROM, ROSE or TCP/IP devices. Software Module Diagram of Linux Network Implementation
This diagram is a little more general than the first. This diagram attempts to show the relationship between user applications, the kernel and the hardware. It also shows the relationship between the Socket application programming interface, the actual protocol modules, the kernel networking devices and the device drivers. Anything in this diagram is dependent on anything underneath it, and in general you must configure from the bottom of the diagram upwards. So for example, if you want to run the call program you must also configure the hardware, then ensure that the kernel has the appropriate device driver, that you create the appropriate network device, that the kernel includes the desired protocol that presents a programming interface that the call program can use. I have attempted to lay out this document in roughly that order. 3. The AX.25/NET/ROM/ROSE software componentsThe AX.25 software is comprised of three components: the kernel source, the network configuration tools and the utility programs. AX.25 support in the Linux kernel has been fairly stable since the 2.2 series of kernel versions. This document assumes you are using the most recent kernel, which as the time of writing was 2.4.9.
3.1. Finding the kernel, tools and utility packages3.1.1. The kernel sourceThe kernel source can be found at www.kernel.org and ftp.kernel.org. For the 2.4.9 kernel it would be downloaded from ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.9.tar.gz. 3.1.2. The network toolsThe latest release of the standard Linux network tools support AX.25 and NET/ROM and can be found at http://www.tazenda.demon.co.uk/phil/net-tools. The latest ipchains package can be found at http://netfilter.filewatcher.org/ipchains.
3.1.3. The AX.25 utilitiesThe old ax25-utils used with the 2.0 and 2.1 kernels is now obsolete and has been replaced with new packages hosted on SourceForge at http://sourceforge.net/projects/hams. The software is distributed as three packages: the AX.25 library, tools, and applications. At the time of writing the most recent versions were the following: 4. Installing the AX.25/NET/ROM/ROSE softwareTo successfully install AX.25 support on your Linux system you must configure and install an appropriate kernel and then install the AX.25 utilities.
4.1. Compiling the kernelIf you are already familiar with the process of compiling the Linux kernel then you can skip this section, just be sure to select the appropriate options when compiling the kernel. If you are not, then read on. You may also want to read the Linux Kernel HOWTO. The normal place for the kernel source to be unpacked to is the /usr/src directory into a subdirectory called linux. To do this you should be logged in as root and execute a series of commands similar to the following:
After you have unpacked the kernel source, you need to run the configuration script and choose the options that suit your hardware configuration and the options that you wish built into your kernel. You do this by using the command:
If you are running X you can get a graphical interface using:
You might also try:
I'm going to describe the full screen method (menuconfig) because it is easier to move around, but use whichever you are most comfortable with. In either case you will be offered a range of options at which you must answer `Y' or `N'. (Note you may also answer `M' if you are using modules. For the sake of simplicity I will assume you are not, please make appropriate modifications if you are). The options most relevant to an AX.25 configuration are:
The options I have flagged with a `*' are those that you must must answer `Y' to. The rest are dependent on what hardware you have and what other options you want to include. Some of these options are described in more detail later on, so if you don't know what you want yet, then read ahead and come back to this step later. After you have completed the kernel configuration you should be able to cleanly compile your new kernel:
Make sure you move your arch/i386/boot/zImage file wherever you want it and then edit your /etc/lilo.conf file and rerun lilo to ensure that you actually boot from it. 4.1.1. A word about kernel modulesCompiling drivers as modules is useful if you only use AX.25 occasionally and want to be able to load and unload them on demand to save system resources. However, some people have problems getting the modularized drivers working because they are more complicated to configure. If you've chosen to compile any drivers as modules, then you'll also need to run the commands:
to install your modules in the appropriate location. You will also need to add some entries into your /etc/modules.conf file to ensure that the kerneld program knows how to locate the kernel modules. You should add/modify the following:
4.2. The AX.25 library, tools, and application programsAfter you have successfully compiled and booted your new kernel you need to compile and install the ax25 library, tools, and application programs. To compile and install libax25 you should use a series of commands similar to the following:
If this is a first time installation, that is you've never installed any ax25 code on your machine before, you should also use the:
command to install some sample configuration files into the /etc/ax25/ directory from which to work. You can now build install the AX.25 tools in a similar fashion:
And finally you can install the AX.25 applications:
If you get messages something like:
then you should double check that you have the ncurses package properly installed on your system. The configuration script attempts to locate your package in the common locations, but some installations have it badly installed and it is unable to locate them. 5. A note on callsigns, addresses and things before we startEach AX.25 and NET/ROM port on your system must have a callsign/ssid allocated to it. These are configured in the configuration files that will be described in detail later on. Some AX.25 implementations such as NOS and BPQ will allow you to configure the same callsign/ssid on each AX.25 and NET/ROM port. For somewhat complicated technical reasons Linux does not allow this. This isn't as big a problem in practice as it might seem. This means that there are things you should be aware of and take into consideration when doing your configurations.
5.1. What are all those T1, T2, N2 and things ?Not every AX.25 implementation is a TNC2. Linux uses nomenclature that differs in some respects from that you will be used to if your sole experience with packet is a TNC. The following table should help you interpret what each of the configurable items are, so that when you come across them later in this text you'll understand what they mean.
5.2. Run time configurable parametersThe kernel allows you to change many parameters at run time. If you take a careful look at the /proc/sys/net/ directory structure you will see many files with useful names that describe various parameters for the network configuration. The files in the /proc/sys/net/ax25/ directory each represent one configured AX.25 port. The name of the file relates to the name of the port. The structure of the files in /proc/sys/net/ax25/portname/ is as follows:
In the table T1, T2 and T3 are given in seconds, and the Idle Timeout is given in minutes. But please note that the values used in the sysctl interface are given in internal units where the time in seconds is multiplied by 10, this allows resolution down to 1/10 of a second. With timers that are allowed to be zero, e.g. T3 and Idle, a zero value indicates that the timer is disabled. The structure of the files in /proc/sys/net/netrom/ is as follows:
The structure of the files in /proc/sys/net/rose/ is as follows:
To set a parameter all you need to do is write the desired value to the file itself, for example to check and set the ROSE window size you'd use something like:
6. Configuring an AX.25 portEach of the AX.25 applications read a particular configuration file to obtain the parameters for the various AX.25 ports configured on your Linux machine. For AX.25 ports the file that is read is the /etc/ax25/axports file. You must have an entry in this file for each AX.25 port you want on your system. 6.1. Creating the AX.25 network deviceThe network device is what is listed when you use the `ifconfig' command. This is the object that the Linux kernel sends and receives network data from. Nearly always the network device has a physical port associated with it, but there are occasions where this isn't necessary. The network device does relate directly to a device driver. In the Linux AX.25 code there are a number of device drivers. The most common is probably the KISS driver, but others are the SCC driver(s), the Baycom driver and the Soundmodem driver. Each of these device drivers will create a network device when it is started. 6.1.1. Creating a KISS deviceKernel Compile Options:
Probably the most common configuration will be for a KISS TNC on a serial port. You will need to have the TNC preconfigured and connected to your serial port. You can use a communications program like minicom or seyon to configure the TNC into kiss mode. To create a KISS device you use the kissattach program. In it simplest form you can use the kissattach program as follows:
The kissattach command will create a KISS network device. These devices are called `ax[0-9]'. The first time you use the kissattach command it creates `ax0', the second time it creates `ax1' etc. Each KISS device has an associated serial port. The kissparms command allows you to set various KISS parameters on a KISS device. Specifically the example presented would create a KISS network device using the serial device `/dev/ttyS0' and the entry from the /etc/ax25/axports with a port name of `radio'. It then configures it with a txdelay and slottime of 100 milliseconds and a ppersist value of 25. Please refer to the man pages for more information. 6.1.1.1. Configuring for Dual Port TNC'sThe mkiss utility included in the ax25-utils distribution allows you to make use of both modems on a dual port TNC. Configuration is fairly simple. It works by taking a single serial device connected to a single multiport TNC and making it look like a number of devices each connected to a single port TNC. You do this before you do any of the AX.25 configuration. The devices that you then do the AX.25 configuration on are pseudo-TTY interfaces, (/dev/ttyq*), and not the actual serial device. Pseudo-TTY devices create a kind of pipe through which programs designed to talk to tty devices can talk to other programs designed to talk to tty devices. Each pipe has a master and a slave end. The master end is generally called `/dev/ptyq*' and the slave ends are called `/dev/ttyq*'. There is a one to one relationship between masters and slaves, so /dev/ptyq0 is the master end of a pipe with /dev/ttyq0 as its slave. You must open the master end of a pipe before opening the slave end. mkiss exploits this mechanism to split a single serial device into separate devices. Example: if you have a dual port TNC and it is connected to your /dev/ttyS0 serial device at 9600 bps, the command:
would create two pseudo-tty devices that each look like a normal single port TNC. You would then treat /dev/ttyq0 and /dev/ttyq1 just as you would a conventional serial device with TNC connected. This means you'd then use the kissattach command as described above, on each of those, in the example for AX.25 ports called port1 and port2. You shouldn't use kissattach on the actual serial device as the mkiss program uses it. The mkiss command has a number of optional arguments that you may wish to use. They are summarized as follows:
6.1.2. Creating a 6PACK deviceKernel Compile Options:
6PACK is a protocol that is supported by some TNCs as an alternative to KISS. It is used in a similar fashion to the KISS driver, using the slattach command instead of kissattach. A mini HOWTO on the 6PACK driver is included in the kernel source code as the file /usr/src/linux/Documentation/networking/6pack.txt. 6.1.3. Creating a Baycom deviceKernel Compile Options:
Thomas Sailer, despite the popularly held belief that it would not work very well, has developed Linux support for Baycom modems. His driver supports the Ser12 serial port, Par96 and the enhanced PicPar parallel port modems. Further information about the modems themselves may be obtained from the Baycom Web site. Your first step should be to determine the i/o and addresses of the serial or parallel port(s) you have Baycom modem(s) connected to. When you have these you must configure the Baycom driver with them. The Baycom driver creates network devices called: bc0, bc1, bc2 etc. when it is configured. The sethdlc utility allows you to configure the driver with these parameters, or, if you have only one Baycom modem installed you may specify the parameters on the insmod command line when you load the Baycom module. For example, a simple configuration. Disable the serial driver for COM1: then configure the Baycom driver for a Ser12 serial port modem on COM1: with the software DCD option enabled:
Par96 parallel port type modem on LPT1: using hardware DCD detection:
This is not really the preferred way to do it. The sethdlc utility works just as easily with one device as with many. The sethdlc man page has the full details, but a couple of examples will illustrate the most important aspects of this configuration. The following examples assume you have already loaded the Baycom module using:
or that you compiled the kernel with the driver inbuilt. Configure the bc0 device driver as a Parallel port Baycom modem on LPT1: with software DCD:
Configure the bc1 device driver as a Serial port Baycom modem on COM1:
6.1.4. Configuring the AX.25 channel access parametersThe AX.25 channel access parameters are the equivalent of the KISS ppersist, txdelay and slottime type parameters. Again you use the sethdlc utility for this. Again the sethdlc man page is the source of the most complete information but another example of two won't hurt: Configure the bc0 device with TxDelay of 200 mS, SlotTime of 100 mS, PPersist of 40 and half duplex:
Note that the timing values are in milliseconds. 6.1.4.1. Configuring the Kernel AX.25 to use the Baycom deviceThe Baycom driver creates standard network devices that the AX.25 Kernel code can use. Configuration is much the same as that for a PI or PacketTwin card. The first step is to configure the device with an AX.25 callsign. The ifconfig utility may be used to perform this.
will assign the Baycom device bc0 the AX.25 callsign VK2KTJ-15. Alternatively you can use the axparms command, you'll still need to use the ifconfig command to bring the device up though:
The next step is to create an entry in the /etc/ax25/axports file as you would for any other device. The entry in the axports file is associated with the network device you've configured by the callsign you configure. The entry in the axports file that has the callsign that you configured the Baycom device with is the one that will be used to refer to it. You may then treat the new AX.25 device as you would any other. You can configure it for TCP/IP, add it to ax25d and run NET/ROM or ROSE over it as you please. 6.1.5. Creating a kernel Soundmodem deviceKernel Compile Options:
Thomas Sailer has built a driver for the kernel that allows you to use your soundcard as a modem. Connect your radio directly to your soundcard to play packet! Thomas recommends at least a 486DX2/66 if you want to use this software as all of the digital signal processing is done by the main CPU. The driver currently emulates 1200 bps AFSK, 4800 HAPN and 9600 FSK (G3RUH compatible) modem types. The only sound cards currently supported are SoundBlaster and Windows Sound System Compatible models. If you have a sound card of another type, you can try the user-mode soundmodem described later in this document. The sound cards require some circuitry to help them drive the Push-To-Talk circuitry, and information on this is available from Thomas's Soundmodem PTT circuit web page. There are quite a few possible options, they are: detect the sound output from the soundcard, or use output from a parallel port, serial port or MIDI port. Circuit examples for each of these are on Thomas's site. The Soundmodem driver creates network devices called: sm0, sm1, sm2 etc when it is configured.
6.1.5.1. Configuring the sound cardThe Soundmodem driver does not initialize the sound card. The ax25-utils package includes a utility to do this called `setcrystal' that may be used for sound cards based on the Crystal chip set. If you have some other card then you will have to use some other software to initialize it. Its syntax is fairly straightforward:
So, for example, if you wished to configure a SoundBlaster card at i/o base address 0x388, irq 10 and DMA 1 you would use:
To configure a Window Sound System card at i/o base address 0x534, irq 5, DMA 3 you would use:
The [-f synthio] parameter is the set the synthesizer address, and the [-c dma2] parameter is to set the second DMA channel to allow full duplex operation. 6.1.5.2. Configuring the Soundmodem driverWhen you have configured the soundcard you need to configure the driver telling it where the sound card is located and what sort of modem you wish it to emulate. The sethdlc utility allows you to configure the driver with these parameters, or, if you have only one soundcard installed you may specify the parameters on the insmod command line when you load the Soundmodem module. For example, a simple configuration, with one SoundBlaster soundcard configured as described above emulating a 1200 bps modem:
This is not really the preferred way to do it. The sethdlc utility works just as easily with one device as with many. The sethdlc man page has the full details, but a couple of examples will illustrate the most important aspects of this configuration. The following examples assume you have already loaded the Soundmodem modules using:
or that you compiled the kernel with the driver inbuilt. Configure the driver to support the Windows Sound System card we configured above to emulate a G3RUH 9600 compatible modem as device sm0 using a parallel port at 0x378 to key the Push-To-Talk:
Configure the driver to support the SoundBlaster card we configured above to emulate a 4800 bps HAPN modem as device sm1 using the serial port located at 0x2f8 to key the Push-To-Talk:
Configure the driver to support the SoundBlaster card we configured above to emulate a 1200 bps AFSK modem as device sm1 using the serial port located at 0x2f8 to key the Push-To-Talk:
6.1.5.3. Configuring the AX.25 channel access parametersThe AX.25 channel access parameters are the equivalent of the KISS ppersist, txdelay and slottime type parameters. You use the sethdlc utility for this as well. Again the sethdlc man page is the source of the most complete information but another example of two won't hurt: Configure the sm0 device with TxDelay of 100 mS, SlotTime of 50mS, PPersist of 128 and full duplex:
Note that the timing values are in milliseconds. 6.1.5.4. Setting the audio levels and tuning the driverIt is very important that the audio levels be set correctly for any radio based modem to work. This is equally true of the Soundmodem. Thomas has developed some utility programs that make this task easier. They are called smdiag and smmixer.
To start the smmixer utility for the Soundmodem device sm0 you would use:
6.1.5.5. Configuring the Kernel AX.25 to use the SoundmodemThe Soundmodem driver creates standard network devices that the AX.25 Kernel code can use. Configuration is much the same as that for a PI or PacketTwin card. The first step is to configure the device with an AX.25 callsign. The ifconfig utility may be used to perform this.
will assign the Soundmodem device sm0 the AX.25 callsign VK2KTJ-15. Alternatively you can use the axparms command, but you still need the ifconfig utility to bring the device up:
The next step is to create an entry in the /etc/ax25/axports file as you would for any other device. The entry in the axports file is associated with the network device you've configured by the callsign you configure. The entry in the axports file that has the callsign that you configured the Soundmodem device with is the one that will be used to refer to it. You may then treat the new AX.25 device as you would any other. You can configure it for TCP/IP, add it to ax25d and run NET/ROM or ROSE over it as you please. 6.1.6. Creating a user-mode Soundmodem deviceKernel Compile Options: not applicable Thomas Sailer has written a sound modem driver that runs in user-mode using the kernel sound drivers, so it should work with any sound card supported under Linux. The driver is implemented as the user-mode program soundmodem. The graphical soundmodemconfig program allows configuring and testing the soundmodem driver. As well as kernel sound support you need the kernel AX.25 mkiss driver. The software and documentation can be downloaded from http://www.baycom.org/~tom/ham/soundmodem. 6.1.7. Creating a YAM deviceKernel Compile Options:
YAM is Yet Another Modem, a 9600 baud modem designed by Nico Palermo. Information on the Linux driver can be found at http://www.teaser.fr/~frible/yam.html while general information on the modem can be found at http://www.microlet.com/yam/ 6.1.8. Creating a PI card deviceKernel Compile Options:
The PI card device driver creates devices named `pi[0-9][ab]'. The first PI card detected will be allocated `pi0', the second `pi1' etc. The `a' and `b' refer to the first and second physical interface on the PI card. If you have built your kernel to include the PI card driver, and the card has been properly detected then you can use the following command to configure the network device:
This command would configure the first port on the first PI card detected with the callsign VK2KTJ-15 and make it active. To use the device all you now need to do is to configure an entry into your /etc/ax25/axports file with a matching callsign/ssid and you will be ready to continue on. The PI card driver was written by David Perry. 6.1.9. Creating a PacketTwin deviceKernel Compile Options:
The PacketTwin card device driver creates devices named `pt[0-9][ab]'. The first PacketTwin card detected will be allocated `pt0', the second `pt1' etc. The `a' and `b' refer to the first and second physical interface on the PacketTwin card. If you have built your kernel to include the PacketTwin card driver, and the card has been properly detected then you can use the following command to configure the network device:
This command would configure the first port on the first PacketTwin card detected with the callsign VK2KTJ-15 and make it active. To use the device all you now need to do is to configure an entry into your /etc/ax25/axports file with a matching callsign/ssid and you will be ready to continue on. The PacketTwin card driver was written by Craig Small, VK2XLZ. 6.1.10. Creating a generic SCC deviceKernel Compile Options:
Joerg Reuter, DL1BKE, has developed generic support for Z8530 SCC based cards. His driver is configurable to support a range of different types of cards and present an interface that looks like a KISS TNC so you can treat it as though it were a KISS TNC. 6.1.10.1. Obtaining and building the configuration tool packageWhile the kernel driver is included in the standard kernel distribution, Joerg distributes more recent versions of his driver with the suite of configuration tools that you will need to obtain as well. You can obtain the configuration tools package from: Joerg's web page, ftp://db0bm.automation.fh-aachen.de/incoming/dl1bke, ftp://insl1.etec.uni-karlsruhe.de/pub/hamradio/linux/z8530, ftp://ftp.ucsd.edu/hamradio/packet/tcpip/linux, or ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming. You will find multiple versions, choose the one that best suits the kernel you intend to use: z8530drv-2.4a.dl1bke.tar.gz for 2.0.* kernels and z8530drv-utils-3.0.tar.gz for 2.1.6 or later kernels. The following commands were what I used to compile and install the package for kernel version 2.0.30:
After the above is complete you should have three new programs installed in your /sbin directory: gencfg, sccinit and sccstat. It is these programs that you will use to configure the driver for your card. You will also have a group of new special device files created in your /dev called scc0-scc7. These will be used later and will be the `KISS' devices you will end up using. If you chose to 'make for_kernel' then you will need to recompile your kernel. To ensure that you include support for the z8530 driver you must be sure to answer `Y' to: `Z8530 SCC kiss emulation driver for AX.25' when asked during a kernel `make config'. If you chose to 'make module' then the new scc.o will have been installed in the appropriate /lib/modules directory and you do not need to recompile your kernel. Remember to use the insmod command to load the module before your try and configure it. 6.1.10.2. Configuring the driver for your cardThe z8530 SCC driver has been designed to be as flexible as possible so as to support as many different types of cards as possible. With this flexibility has come some cost in configuration. There is more comprehensive documentation in the package and you should read this if you have any problems. You should particularly look at doc/scc_eng.doc or doc/scc_ger.doc for more detailed information. I've paraphrased the important details, but as a result there is a lot of lower level detail that I have not included. The main configuration file is read by the sccinit program and is called /etc/z8530drv.conf. This file is broken into two main stages: Configuration of the hardware parameters and channel configuration. After you have configured this file you need only add:
into the rc file that configures your network and the driver will be initialized according to the contents of the configuration file. You must do this before you attempt to use the driver. 6.1.10.2.1. Configuration of the hardware parametersThe first section is broken into stanzas, each stanza representing an 8530 chip. Each stanza is a list of keywords with arguments. You may specify up to four SCC chips in this file by default. The #define MAXSCC 4 in scc.c can be increased if you require support for more. The allowable keywords and arguments are:
Some example configurations for the more popular cards are as follows:
If you already have a working configuration for your card under NOS, then you can use the gencfg command to convert the PE1CHL NOS driver commands into a form suitable for use in the z8530 driver configuration file. To use gencfg you simply invoke it with the same parameters as you used for the PE1CHL driver in NET/NOS. For example:
will generate a skeleton configuration for the OptoSCC card. 6.1.10.3. Channel ConfigurationThe Channel Configuration section is where you specify all of the other parameters associated with the port you are configuring. Again this section is broken into stanzas. One stanza represents one logical port, and therefore there would be two of these for each one of the hardware parameters stanzas as each 8530 SCC supports two ports. These keywords and arguments are also written to the /etc/z8530drv.conf file and must appear after the hardware parameters section. Sequence is very important in this section, but if you stick with the suggested sequence it should work okay. The keywords and arguments are:
6.1.10.4. Using the driverTo use the driver you simply treat the /dev/scc* devices just as you would a serial tty device with a KISS TNC connected to it. For example, to configure Linux Kernel networking to use your SCC card you could use something like:
You can also use NOS to attach to it in precisely the same way. From JNOS for example you would use something like:
6.1.10.5. The sccstat and sccparam toolsTo assist in the diagnosis of problems you can use the sccstat program to display the current configuration of an SCC device. To use it try:
you will displayed a very large amount of information relating to the configuration and health of the /dev/scc0 SCC port. The sccparam command allows you to change or modify a configuration after you have booted. Its syntax is very similar to the NOS param command, so to set the txtail setting of a device to 100mS you would use:
6.1.11. Creating a BPQ ethernet deviceKernel Compile Options:
Linux supports BPQ Ethernet compatibility. This enables you to run the AX.25 protocol over your Ethernet LAN and to interwork your linux machine with other BPQ machines on the LAN. The BPQ network devices are named `bpq[0-9]'. The `bpq0' device is associated with the `eth0' device, the `bpq1' device with the `eth1' device etc. Configuration is quite straightforward. You firstly must have configured a standard Ethernet device. This means you will have compiled your kernel to support your Ethernet card and tested that this works. Refer to the Ethernet-HOWTO for more information on how to do this. To configure the BPQ support you need to configure the Ethernet device with an AX.25 callsign. The following command will do this for you:
Again, remember that the callsign you specify should match the entry in the /etc/ax25/axports file that you wish to use for this port. 6.1.12. Configuring the BPQ Node to talk to the Linux AX.25 supportBPQ Ethernet normally uses a multicast address. The Linux implementation does not, and instead it uses the normal Ethernet broadcast address. The NET.CFG file for the BPQ ODI driver should therefore be modified to look similar to this:
6.2. Creating the /etc/ax25/axports fileThe /etc/ax25/axports is a simple text file that you create with a text editor. The format of the /etc/ax25/axports file is as follows:
where:
In my case, mine looks like:
Remember, you must assign unique callsign/ssid to each AX.25 port you create. Create one entry for each AX.25 device you want to use, this includes KISS, Baycom, SCC, PI, PT and Soundmodem ports. Each entry here will describe exactly one AX.25 network device. The entries in this file are associated with the network devices by the callsign/ssid. This is at least one good reason for requiring unique callsign/ssid. 6.3. Configuring AX.25 routingYou may wish to configure default digipeaters paths for specific hosts. This is useful for both normal AX.25 connections and also IP based connections. The axparms command enables you to do this. Again, the man page offers a complete description, but a simple example might be:
This command would set a digipeater entry for VK2XLZ via VK2SUT on the AX.25 port named radio. 7. Configuring an AX.25 interface for TCP/IPIt is very simple to configure an AX.25 port to carry TCP/IP. If you have KISS interfaces then there are two methods for configuring an IP address. The kissattach command has an option that allows you to specify an IP address. The more conventional method using the ifconfig command will work on all interface types. So, modifying the previous KISS example:
to create the AX.25 interface with an IP address of 44.136.8.5 and an MTU of 512 bytes. You should still use the ifconfig to configure the other parameters if necessary. If you have any other interface type then you use the ifconfig program to configure the ip address and netmask details for the port and add a route via the port, just as you would for any other TCP/IP interface. The following example is for a PI card device, but would work equally well for any other AX.25 network device:
The commands listed above are typical of the sort of configuration many of you would be familiar with if you have used NOS or any of its derivatives or any other TCP/IP software. Note that the default route might not be required in your configuration if you have some other network device configured. To test it out, try a ping or a telnet to a local host.
Note the use of the `-i 5' arguments to ping to tell it to send pings every 5 seconds instead of its default of 1 second. 8. Configuring a NET/ROM portThe NET/ROM protocol relies on, and uses the AX.25 ports you have created. The NET/ROM protocol rides on top of the AX.25 protocol. To configure NET/ROM on an AX.25 interface you must configure two files. One file describes the NET/ROM interfaces, and the other file describes which of the AX.25 ports will carry NET/ROM. You can configure multiple NET/ROM ports, each with its own callsign and alias, the same procedure applies for each. 8.1. Configuring /etc/ax25/nrportsThe first is the /etc/ax25/nrports file. This file describes the NET/ROM ports in much the same way as the /etc/ax25/axports file describes the AX.25 ports. Each NET/ROM device you wish to create must have an entry in the /etc/ax25/nrports file. Normally a Linux machine would have only one NET/ROM device configured that would use a number of the AX.25 ports defined. In some situations you might wish a special service such as a BBS to have a separate NET/ROM alias and so you would create more than one. This file is formatted as follows:
Where:
An example would look something like the following:
This example creates a NET/ROM port known to the rest of the NET/ROM network as `LINUX:VK2KTJ-9'. This file is used by programs such as the call program. 8.2. Configuring /etc/ax25/nrbroadcastThe second file is the /etc/ax25/nrbroadcast file. This file may contain a number of entries. There would normally be one entry for each AX.25 port that you wish to allow NET/ROM traffic on. This file is formatted as follows:
Where:
An example would look something like the following:
8.3. Creating the NET/ROM Network deviceWhen you have the two configuration files completed you must create the NET/ROM device in much the same way as you did for the AX.25 devices. This time you use the nrattach command. The nrattach works in just the same way as the axattach command except that it creates NET/ROM network devices called `nr[0-9]'. Again, the first time you use the nrattach command it creates the `nr0' device, the second time it creates the `nr1' network devices etc. To create the network device for the NET/ROM port we've defined we would use:
This command would start the NET/ROM device (nr0) named netrom configured with the details specified in the /etc/ax25/nrports file. 8.4. Starting the NET/ROM daemonThe Linux kernel does all of the NET/ROM protocol and switching, but does not manage some functions. The NET/ROM daemon manages the NET/ROM routing tables and generates the NET/ROM routing broadcasts. You start NET/ROM daemon with the command:
You should soon see the /proc/net/nr_neigh file filling up with information about your NET/ROM neighbours. Remember to put the /usr/sbin/netromd command in your rc files so that it is started automatically each time you reboot. 8.5. Configuring NET/ROM routing.You may wish to configure static NET/ROM routes for specific hosts. The nrparms command enables you to do this. Again, the man page offers a complete description, but a simple example might be:
This command would set a NET/ROM route to #MINTO:VK2XLZ-10 via a neighbour VK2SUT-9 on my AX.25 port called `radio'. You can manually create entries for new neighbours using the nrparms command as well. For example:
This command would create VK2SUT-9 as a NET/ROM neighbour with a quality of 120 and this will be locked and will not be deleted automatically. 9. Configuring a NET/ROM interface for TCP/IPConfiguring a NET/ROM interface for TCP/IP is almost identical to configuring an AX.25 interface for TCP/IP. Again you can either specify the ip address and mtu on the nrattach command line, or use the ifconfig and route commands, but you need to manually add arp entries for hosts you wish to route to because there is no mechanism available for your machine to learn what NET/ROM address it should use to reach a particular IP host. So, to create an nr0 device with an IP address of 44.136.8.5, an mtu of 512 and configured with the details from the /etc/ax25/nrports file for a NET/ROM port named netrom you would use:
or you could use something like the following commands manually:
Then for each IP host you wish to reach via NET/ROM you need to set route and arp entries. To reach a destination host with an IP address of 44.136.80.4 at NET/ROM address BBS:VK3BBS via a NET/ROM neighbour with callsign VK2SUT-0 you would use commands as follows:
The `120' and `6' arguments to the nrparms command are the NET/ROM quality and obsolescence count values for the route. 10. Configuring a ROSE portThe ROSE packet layer protocol is similar to layer three of the X.25 specification. The kernel based ROSE support is a modified version of the FPAC Rose implementation. The ROSE packet layer protocol protocol relies on, and uses the AX.25 ports you have created. The ROSE protocol rides on top of the AX.25 protocol. To configure ROSE you must create a configuration file that describes the ROSE ports you want. You can create multiple ROSE ports if you wish, the same procedure applies for each. 10.1. Configuring /etc/ax25/rsportsThe file where you configure your ROSE interfaces is the /etc/ax25/rsports file. This file describes the ROSE port in much the same way as the /etc/ax25/axports file describes the AX.25 ports. This file is formatted as follows:
Where:
An example would look something like the following:
Note that ROSE will use the default callsign/ssid configured on each AX.25 port unless you specify otherwise. To configure a separate callsign/ssid for ROSE to use on each port you use the rsparms command as follows:
This example would make Linux listen for and use the callsign/ssid VK2KTJ-10 on all of the configured AX.25 ports for ROSE calls. 10.2. Creating the ROSE Network deviceWhen you have created the /etc/ax25/rsports file you may create the ROSE device in much the same way as you did for the AX.25 devices. This time you use the rsattach command. The rsattach command creates network devices named `rose[0-5]'. The first time you use the rsattach command it create the `rose0' device, the second time it creates the `rose1' device etc. For example:
This command would start the ROSE device (rose0) configured with the details specified in the /etc/ax25/rsports file for the entry named `rose'. 10.3. Configuring ROSE RoutingThe ROSE protocol currently supports only static routing. The rsparms utility allows you to configure your ROSE routing table under Linux. For example:
would add a route to ROSE node 5050295502 via an AX.25 port named `radio' in your /etc/ax25/axports file to a neighbour with the callsign VK2XLZ. You may specify a route with a mask to capture a number of ROSE destinations into a single routing entry. The syntax looks like:
which would be identical to the previous example except that it would match any destination address that matched the first four digits supplied, in this case any address commencing with the digits 5050. An alternate form for this command is:
which is probably the less ambiguous form. 11. Making AX.25/NET/ROM/ROSE callsNow that you have all of your AX.25, NET/ROM and ROSE interfaces configured and active, you should be able to make test calls. The AX.25 Utilities package includes a program called `call' which is a split screen terminal program for AX.25, NET/ROM and ROSE. A simple AX.25 call would look like:
A simple NET/ROM call to a node with an alias of SUNBBS would look like:
A simple ROSE call to HEARD at node 5050882960 would look like:
Note: you must tell call which port you wish to make the call on, as the same destination node might be reachable on any of the ports you have configured. The call program is a line mode terminal program for making AX.25 calls. It recognizes lines that start with `˜' as command lines. The `˜.' command will close the connection. Please refer to the man page in /usr/man for more information. 12. Configuring Linux to accept Packet connectionsLinux is a powerful operating system and offers a great deal of flexibility in how it is configured. With this flexibility comes a cost in configuring it to do what you want. When configuring your Linux machine to accept incoming AX.25, NET/ROM or ROSE connections there are a number of questions you need to ask yourself. The most important of which is: "What do I want users to see when they connect?". People are developing neat little applications that may be used to provide services to callers, a simple example is the pms program included in the AX.25 utilities, a more complex example is the node program also included in the AX.25 utilities. Alternatively you might want to give users a login prompt so that they can make use of a shell account, or you might even have written your own program, such as a customized database or a game, that you want people to connect to. Whatever you choose, you must tell the AX.25 software about this so that it knows what software to run when it accepts an incoming AX.25 connection. The ax25d program is similar to the inetd program commonly used to accept incoming TCP/IP connections on UNIX machines. It sits and listens for incoming connections, when it detects one it goes away and checks a configuration file to determine what program to run and connect to that connection. Since this the standard tool for accepting incoming AX.25, NET/ROM and ROSE connections I'll describe how to configure it. 12.1. Creating the /etc/ax25/ax25d.conf fileThis file is the configuration file for the ax25d AX.25 daemon which handles incoming AX.25, NET/ROM and ROSE connections. The file is a little cryptic looking at first, but you'll soon discover it is very simple in practice, with a small trap for you to be wary of. The general format of the ax25d.conf file is as follows:
Where:
You need one section in the above format for each AX.25, NET/ROM or ROSE interface you want to accept incoming AX.25, NET/ROM or ROSE connections on. There are two special lines in the paragraph, one starts with the string `parameters' and the other starts with the string `default' (yes there is a difference). These lines serve special functions. The `default' lines purpose should be obvious, this line acts as a catch-all, so that any incoming connection on the <interface_call> interface that doesn't have a specific rule will match the `default' rule. If you don't have a `default' rule, then any connections not matching any specific rule will be disconnected immediately without notice. The `parameters' line is a little more subtle, and here is the trap I mentioned earlier. In any of the fields for any definition for a peer you can use the `*' character to say `use the default value'. The `parameters' line is what sets those default values. The kernel software itself has some defaults which will be used if you don't specify any using the `parameters' entry. The trap is that the these defaults apply only to those rules below the `parameters' line, not to those above. You may have more than one `parameters' rule per interface definition, and in this way you may create groups of default configurations. It is important to note that the `parameters' rule does not allow you to set the `uid' or `command' fields. 12.2. A simple example ax25d.conf fileOkay, an illustrative example:
This example says that anybody attempting to connect to the callsign `VK2KTJ-0' heard on the AX.25 port called `radio' will have the following rules applied: Anyone whose callsign is set to `NOCALL' should be locked out, note the use of mode `L'. The parameters line changes two parameters from the kernel defaults (Window and T1) and will run the /usr/sbin/axspawn program for them. Any copies of /usr/sbin/axspawn run this way will appear as axspawn in a ps listing for convenience. The next two lines provide definitions for two stations who will receive those permissions. The last line in the paragraph is the `catch all' definition that everybody else will get (including VK2XLZ and VK2DAY using any other SSID other than -1). This definition sets all of the parameters implicitly and will cause the pms program to be run with a command line argument indicating that it is being run for an AX.25 connection, and that the owner callsign is VK2KTJ. (See the `Configuring the PMS' section below for more details). The next configuration accepts calls to VK2KTJ-1 via the radio port. It runs the node program for everybody that connects to it. The next configuration is a NET/ROM configuration, note the use of the greater-then and less-than braces instead of the square brackets. These denote a NET/ROM configuration. This configuration is simpler, it simply says that anyone connecting to our NET/ROM port called `netrom' will have the node program run for them, unless they have a callsign of `NOCALL' in which case they will be locked out. The last two configurations are for incoming ROSE connections. The first for people who have placed calls to `vk2ktj-0' and the second for `VK2KTJ-1 at the our ROSE node address. These work precisely the same way. Not the use of the curly braces to distinguish the port as a ROSE port. This example is a contrived one but I think it illustrates clearly the important features of the syntax of the configuration file. The configuration file is explained fully in the ax25d.conf man page. A more detailed example is included in the ax25-utils package that might be useful to you too. 12.3. Starting ax25dWhen you have the two configuration files completed you start ax25d with the command:
When this is run people should be able to make AX.25 connections to your Linux machine. Remember to put the ax25d command in your rc files so that it is started automatically when you reboot each time. 13. Configuring the node softwareThe node software was developed by Tomi Manninen and was based on the original PMS program. It provides a fairly complete and flexible node capability that is easily configured. It allows users once they are connected to make Telnet, NET/ROM, ROSE, and AX.25 connections out and to obtain various sorts of information such as Finger, Nodes and Heard lists etc. You can configure the node to execute any Linux command you wish fairly simply. The node would normally be invoked from the ax25d program although it is also capable of being invoked from the TCP/IP inetd program to allow users to telnet to your machine and obtain access to it, or by running it from the command line. 13.1. Creating the /etc/ax25/node.conf fileThe node.conf file is where the main configuration of the node takes place. It is a simple text file and its format is as follows:
13.2. Creating the /etc/ax25/node.perms fileThe node allows you to assign permissions to users. These permissions allow you to determine which users should be allowed to make use of options such as the (T)elnet, and (C)onnect commands, for example, and which shouldn't. The node.perms file is where this information is stored and contains five key fields. For all fields an asterisk `*' character matches anything. This is useful for building default rules.
A sample nodes.perms might look like:
13.3. Configuring node to run from ax25dThe node program would normally be run by the ax25d program. To do this you need to add appropriate rules to the /etc/ax25/ax25d.conf file. In my configuration I wanted users to have a choice of either connecting to the node or connecting to other services. ax25d allows you to do this by cleverly creating creating port aliases. For example, given the ax25d configuration presented above, I want to configure node so that all users who connect to VK2KTJ-1 are given the node. To do this I add the following to my /etc/ax25/ax25d.conf file:
This says that the Linux kernel code will answer any connection requests for the callsign `VK2KTJ-1' heard on the AX.25 port named `radio', and will cause the node program to be run. 13.4. Configuring node to run from inetdIf you want users to be able to telnet a port on your machine and obtain access to the node you can go this fairly easily. The first thing to decide is what port users should connect to. In this example I've arbitrarily chosen port 4000, though Tomi gives details on how you could replace the normal telnet daemon with the node in his documentation. You need to modify two files. To /etc/services you should add:
and to /etc/inetd.conf you should add:
When this is done, and you have restarted the inetd program any user who telnet connects to port 3694 of your machine will be prompted to login and if configured, their password and then they will be connected to the node. 14. Configuring axspawnThe axspawn program is a simple program that allows AX.25 stations who connect to be logged in to your machine. It may be invoked from the ax25d program as described above in a manner similar to the node program. To allow a user to log in to your machine you should add a line similar to the following into your /etc/ax25/ax25d.conf file:
If the line ends in the + character then the connecting user must hit return before they will be allowed to login. The default is to not wait. Any individual host configurations that follow this line will have the axspawn program run when they connect. When axspawn is run it first checks that the command line argument it is supplied is a legal callsign, strips the SSID, then it checks that /etc/passwd file to see if that user has an account configured. If there is an account, and the password is either "" (null) or + then the user is logged in, if there is anything in the password field the user is prompted to enter a password. If there is not an existing account in the /etc/passwd file then axspawn may be configured to automatically create one. 14.1. Creating the /etc/ax25/axspawn.conf fileYou can alter the behaviour of axspawn in various ways by use of the /etc/ax25/axspawn.conf file. This file is formatted as follows:
The eight configurable characteristics of axspawn are as follows:
15. Configuring the pmsThe pms program is an implementation of a simple personal message system. It was originally written by Alan Cox. Dave Brown, N2RJT, has taken on further development of it. At present it is still very simple, supporting only the ability to send mail to the owner of the system and to obtain some limited system information but Dave is working to expand its capability to make it more useful. After that is done there are a couple of simple files that you should create that give users some information about the system and then you need to add appropriate entries into the ax25d.conf file so that connected users are presented with the PMS. 15.1. Create the /etc/ax25/pms.motd fileThe /etc/ax25/pms.motd file contains the `message of the day' that users will be presented with after they connect and receive the usual BBS id header. The file is a simple text file, any text you include in this file will be sent to users. 15.2. Create the /etc/ax25/pms.info fileThe /etc/ax25/pms.info file is also a simple text file in which you would put more detailed information about your station or configuration. This file is presented to users in response to their issuing of the Info command from the PMS> prompt. 15.3. Associate AX.25 callsigns with system usersWhen a connected user sends mail to an AX.25 callsign, the pms expects that callsign to be mapped, or associated with a real system user on your machine. This is described in a section of its own. 15.4. Add the PMS to the /etc/ax25/ax25d.conf fileAdding the pms to your ax25d.conf file is very simple. There is one small thing you need to think about though. Dave has added command line arguments to the PMS to allow it to handle a number of different text end-of-line conventions. AX.25 and NET/ROM by convention expect the end-of-line to be carriage return, linefeed while the standard UNIX end-of-line is just newline. So, for example, if you wanted to add an entry that meant that the default action for a connection received on an AX.25 port is to start the PMS then you would add a line that looked something like:
This simply runs the pms program, telling it that it is an AX.25 connection it is connected to and that the PMS owner is vk2ktj. Check the man page for what you should specify for other connection methods. 15.5. Test the PMSTo test the PMS, you can try the following command from the command line: # /usr/sbin/pms -u vk2ktj -o vk2ktj Substitute your own callsign for mine and this will run the pms, telling it that it is to use the UNIX end-of-line convention, and that user logging in is vk2ktj. You can do all the things connected users can. Additionally you might try getting some other node to connect to you to confirm that your ax25d.conf configuration works. 16. Configuring the user_call programsThe `user_call' programs are really called: ax25_call and netrom_call. They are very simple programs designed to be called from ax25d to automate network connections to remote hosts. They may of course be called from a number of other places such as shell scripts or other daemons such as the node program. They are like a very simple call program. They don't do any meddling with the data at all, so the end of line handling you'll have to worry about yourself. Let's start with an example of how you might use them. Imagine you have a small network at home and that you have one linux machine acting as your Linux radio gateway and another machine, lets say a BPQ node connected to it via an ethernet connection. Normally if you wanted radio users to be able to connect to the BPQ node they would either have to digipeat through your linux node, or connect to the node program on your linux node and then connect from it. The ax25_call program can simplify this if it is called from the ax25d program. Imagine the BPQ node has the callsign VK2KTJ-9 and that the linux machine has the AX.25/ethernet port named `bpq'. Let us also imagine the Linux gateway machine has a radio port called `radio'. An entry in the /etc/ax25/ax25d.conf that looked like:
would enable users to connect direct to `VK2KTJ-1' which would actually be the Linux ax25d daemon and then be automatically switched to an AX.25 connection to `VK2KTJ-9' via the `bpq' interface. There are all sorts of other possible configurations that you might try. The `netrom_call' and `rose_call' utilities work in similar ways. One amateur has used this utility to make connections to a remote BBS easier. Normally the users would have to manually enter a long connection string to make the call so he created an entry that made the BBS appear as though it were on the local network by having his ax25d proxy the connection to the remote machine. 17. Configuring the ROSE Uplink and Downlink commandsIf you are familiar with the ROM based ROSE implementation you will be familiar with the method by which AX.25 users make calls across a ROSE network. If a users local ROSE node has the callsign VK2KTJ-5 and the AX.25 user wants to connect to VK5XXX at remote ROSE node 5050882960 then they would issue the command:
At the remote node, VK5XXX would see an incoming connection with the local AX.25 users callsign and being digipeated via the remote ROSE nodes callsign. The Linux ROSE implementation does not support this capability in the kernel, but there are two application programs called rsuplnk and rsdwnlnk which perform this function. 17.1. Configuring a ROSE downlinkTo configure your Linux machine to accept a ROSE connection and establish an AX.25 connection to any destination callsign that is not being listened for on your machine you need to add an entry to your /etc/ax25/ax25d.conf file. Normally you would configure this entry to be the default behaviour for incoming ROSE connections. For example you might have ROSE listeners operating for destinations like NODE-0 or HEARD-0 that you wish to handle locally, but for all other destination calls you may want to pass them to the rsdwnlink command and assume they are AX.25 users. A typical configuration would look like:
With this configuration any user who established a ROSE connection to your Linux nodes address with a destination call of something that you were not specifically listening for would be converted into an AX.25 connection on the AX.25 port named 4800 with a digipeater path of VK2KTJ-5. 17.2. Configuring a ROSE uplinkTo configure your Linux machine to accept AX.25 connections in the same way that a ROM ROSE node would you must add an entry into your /etc/ax25/ax25d.conf file that looks similar to the following:
Note the special syntax for the local callsign. The `*' character indicates that the application should be invoked if the callsign is heard in the digipeater path of a connection. This configuration would allow an AX.25 user to establish ROSE calls using the example connect sequence presented in the introduction. Anybody attempting to digipeat via VK2KTJ-5 on the AX.25 port named 4800 would be handled by the rsuplnk command. 18. Associating AX.25 callsigns with Linux usersThere are a number of situations where it is highly desirable to associate a callsign with a linux user account. One example might be where a number of amateur radio operators share the same linux machine and wish to use their own callsign when making calls. Another is the case of PMS users wanting to talk to a particular user on your machine. The AX.25 software provides a means of managing this association of linux user account names with callsigns. We've mentioned it once already in the PMS section, but I'm spelling it out here to be sure you don't miss it. You make the association with the axparms command. An example looks like:
This command associates that AX.25 callsign vk2ktj with the user terry on the machine. So, for example, any mail for vk2ktj on the pms will be sent to Linux account terry. Remember to put these associations into your rc file so that they are available each time your reboot. Note you should never associate a callsign with the root account as this can cause configuration problems in other programs. 19. Configuring APRS
20. The /proc/ file system entriesThe /proc filesystem contains a number of files specifically related to the AX.25 and NET/ROM kernel software. These files are normally used by the AX52 utilities, but they are plainly formatted so you may be interested in reading them. The format is fairly easily understood so I don't think much explanation will be necessary.
21. AX.25, NET/ROM, ROSE network programmingProbably the biggest advantage of using the kernel based implementations of the amateur packet radio protocols is the ease with which you can develop applications and programs to use them. While the subject of Unix Network Programming is outside the scope of this document I will describe the elementary details of how you can make use of the AX.25, NET/ROM and ROSE protocols within your software. 21.1. The address familiesNetwork programming for AX.25, NET/ROM and ROSE is quite similar to programming for TCP/IP under Linux. The major differences being the address families used, and the address structures that need to be mangled into place. The address family names for AX.25, NET/ROM and ROSE are AF_AX25, AF_NETROM and AF_ROSE respectively. 21.2. The header filesYou must always include the `netax25/ax25.h' header file, and also the `netrom/netrom.h' or `netrose/rose.h' header files if you are dealing with those protocols. Simple top level skeletons would look something like the following: For AX.25:
For NET/ROM:
For ROSE:
21.3. Callsign mangling and examplesThere are routines within the lib/ax25.a library built in the AX.25 utilities package that manage the callsign conversions for you. You can write your own of course if you wish. The user_call utilities are excellent examples from which to work. The source code for them is included in the AX.25 utilities package. If you spend a little time working with those you will soon see that ninety percent of the work is involved in just getting ready to open the socket. Actually making the connection is easy, the preparation takes time. The examples are simple enough to not be very confusing. If you have any questions, you should feel to direct them to the linux-hams mailing list and someone there will be sure to help you. 22. Some sample configurationsFollowing are examples of the most common types of configurations. These are guides only as there are as many ways of configuring your network as there are networks to configure, but they may give you a start. 22.1. Small Ethernet LAN with Linux as a router to Radio LANMany of you may have small local area networks at home and want to connect the machines on that network to your local radio LAN. This is the type of configuration I use at home. I arranged to have a suitable block of addresses allocated to me that I could capture in a single route for convenience and I use these on my Ethernet LAN. Your local IP coordinator will assist you in doing this if you want to try it as well. The addresses for the Ethernet LAN form a subset of the radio LAN addresses. The following configuration is the actual one for my linux router on my network at home:
/etc/ax25/axports
/etc/ax25/nrports
/etc/ax25/nrbroadcast
22.2. IPIP encapsulated gateway configuration
Linux is now very commonly used for TCP/IP encapsulated gateways around the world. The new tunnel driver supports multiple encapsulated routes and makes the older ipip daemon obsolete. A typical configuration would look similar to the following.
The configuration files of interest are:
and:
/etc/ax25/axports
Some points to note here are:
The new tunnel-munge script:
22.3. AXIP encapsulated gateway configurationMany Amateur Radio Internet gateways encapsulate AX.25, NET/ROM and ROSE in addition to tcp/ip. Encapsulation of AX.25 frames within IP datagrams is described in RFC-1226 by Brian Kantor. Mike Westerhof wrote an implementation of an AX.25 encapsulation daemon for UNIX in 1991. The ax25-utils package includes a marginally enhanced version of it for Linux. An AXIP encapsulation program accepts AX.25 frames at one end, looks at the destination AX.25 address to determine what IP address to send them to, encapsulates them in a tcp/ip datagram and then transmits them to the appropriate remote destination. It also accepts tcp/ip datagrams that contain AX.25 frames, unwraps them and processes them as if it had received them directly from an AX.25 port. To distinguish IP datagrams containing AX.25 frames from other IP datagrams which don't, AXIP datagrams are coded with a protocol id of 4 (or 94 which is now deprecated). This process is described in RFC-1226. The ax25ipd program included in the ax25-utils package presents itself as a program supporting a KISS interface across which you pass AX.25 frames, and an interface into the tcp/ip protocols. It is configured with a single configuration file called /etc/ax25/ax25ipd.conf. 22.3.1. AXIP configuration optionsThe ax25ipd program has two major modes of operation. "digipeater" mode and "tnc" mode. In "tnc" mode the daemon is treated as though it were a kiss TNC, you pass KISS encapsulated frames to it and it will transmit them, this is the usual configuration. In "digipeater" mode, you treat the daemon as though it were an AX.25 digipeater. There are subtle differences between these modes. In the configuration file you configure "routes" or mappings between destination AX.25 callsigns and the IP addresses of the hosts that you want to send the AX.25 packets too. Each route has options which will be explained later. Other options that are configured here are:
22.3.2. A typical /etc/ax25/ax25ipd.conf file
22.3.3. Running ax25ipd
22.3.4. Some notes about the routes and route flagsThe "route" command is where you specify where you want your AX.25 packets encapsulated and sent to. When the ax25ipd daemon receives a packet from its interface, it compares the destination callsign with each of the callsigns in its routing table. If if finds a match then the ax.25 packet is encapsulated in an IP datagram and then transmitted to the host at the specified IP address. There are two flags you can add to any of the route commands in the ax25ipd.conf file. The two flags are:
The broadcast flag is very useful, as it enables informations that is normally destined for all stations to a number of AXIP destinations. Normally axip routes are point-to-point and unable to handle 'broadcast' packets. 22.4. Linking NOS and Linux using a pipe deviceMany people like to run some version of NOS under Linux because it has all of the features and facilities they are used to. Most of those people would also like to have the NOS running on their machine capable of talking to the Linux kernel so that they can offer some of the linux capabilities to radio users via NOS. Brandon S. Allbery, KF8NH, contributed the following information to explain how to interconnect the NOS running on a Linux machine with the kernel code using the Linux pipe device. Since both Linux and NOS support the slip protocol it is possible to link the two together by creating a slip link. You could do this by using two serial ports with a loopback cable between them, but this would be slow and costly. Linux provides a feature that many other Unix-like operating systems provide called `pipes'. These are special pseudo devices that look like a standard tty device to software but in fact loopback to another pipe device. To use these pipes the first program must open the master end of the pipe, and the open then the second program can open the slave end of the pipe. When both ends are open the programs can communicate with each other simply by writing characters to the pipes in the way they would if they were terminal devices. To use this feature to connect the Linux Kernel and a copy of NOS, or some other program you first must choose a pipe device to use. You can find one by looking in your /dev directory. The master end of the pipes are named: ptyq[1-f] and the slave end of the pipes are known as: ttyq[1-f]. Remember they come in pairs, so if you select /dev/ptyqf as your master end then you must use /dev/ttyqf as the slave end. Once you have chosen a pipe device pair to use you should allocate the master end to you linux kernel and the slave end to the NOS program, as the Linux kernel starts first and the master end of the pipe must be opened first. You must also remember that your Linux kernel must have a different IP address to your NOS, so you will need to allocate a unique address for it if you haven't already. You configure the pipe just as if it were a serial device, so to create the slip link from your linux kernel you can use commands similar to the following:
In this example the Linux kernel has been given IP address 44.70.4.88 and the NOS program is using IP address 44.70.248.67. The route command in the last line simply tells your linux kernel to route all datagrams for the amprnet via the slip link created by the slattach command. Normally you would put these commands into your /etc/rc.d/rc.inet2 file after all your other network configuration is complete so that the slip link is created automatically when you reboot. Note: there is no advantage in using cslip instead of slip as it actually reduces performance because the link is only a virtual one and occurs fast enough that having to compress the headers first takes longer than transmitting the uncompressed datagram. To configure the NOS end of the link you could try the following:
These commands will create a slip port named `linux' via the slave end of the pipe device pair to your linux kernel, and a route to it to make it work. When you have started NOS you should be able to ping and telnet to your NOS from your Linux machine and vice versa. If not, double check that you have made no mistakes especially that you have the addresses configured properly and have the pipe devices around the right way. 23. Summary of AX.25-related Linux commandsThis section summarizes all of the commands that are specific to AX.25.
24. Where do I find more information about .... ?Since this document assumes you already have some experience with packet radio, and that this might not be the case, I've collected a set of references to other information that you might find useful. 24.2. Protocol Documentation
24.3. Hardware Documentation
24.4. Linux Ham Radio SoftwareJohn Ackermann has a web site with information related to configuring AX.25 on Linux at http://www.febo.com/linux-ax25/index.html. The Hamsoft Linux Ham Radio Applications and Utilities Database attempts to maintain a complete list of Amateur Radio related applications for Linux. It can be found at http://radio.linux.org.au. 25. Discussion relating to Amateur Radio and LinuxThere are various places that discussion relating to Amateur Radio and Linux take place. They take place in the comp.os.linux.* newsgroups, they also take place on the linux-hams list on vger.kernel.org. Other places where they are held include the tcp-group mailing list at ucsd.edu (the home of amateur radio TCP/IP discussions), and you might also try the #linpeople channel on the linuxnet irc network. To join the Linux linux-hams channel on the mail list server, send mail to majordomo@vger.kernel.org with the line subscribe linux-hams in the message body. The subject line is ignored. The linux-hams mailing list is archived at: http://hes.iki.fi/archive/linux-hams/ and http://web.gnu.walfield.org/mail-archive/linux-hams. Please use the archives when you are first starting, because many common questions are answered there. To join the tcp-group send mail to listserver@ucsd.edu with the line subscribe tcp-group in the body of the text.
26. AcknowledgementsTerry Dawson was the original author and maintainer of this HOWTO. Jeff Tranter took over as maintainer in 2001 to allow Terry more time to concentrate on AX.25 software development. The following people have contributed to this document in one way or another, knowingly or unknowingly. In no particular order (as I find them): Jonathon Naylor, Thomas Sailer, Joerg Reuter, Ron Atkinson, Alan Cox, Craig Small, John Tanner, Brandon Allbery, Hans Alblas, Klaus Kudielka, Carl Makin, John Ackermann, Riley Williams. 27. FeedbackI rely on you, the reader, to make this HOWTO useful. If you have any suggestions, corrections, or comments, please send them to me, tranter@pobox.com, and I will try to incorporate them in the next revision. If you publish this document on a CD-ROM or in hardcopy form, a complimentary copy would be appreciated; mail me for my postal address. Also consider making a donation to the Linux Documentation Project to help support free documentation for Linux. Contact the LDP at feedback@linuxdoc.org for more information. 28. Distribution PolicyCopyright (c) 1996-1997 by Terry Dawson, Copyright (c) 2001 by Jeff Tranter. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html |