Copyright (C) 2000-2012 |
Whole document tree 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. |