Linux FPAC mini-HOWTO

Bernard Pidoux, F6BVP, f6bvp at amsat dot org

V1.5.2, 2010-01-31


Packet radio is a way of connecting computers via Amateur Radio. This mini-HOWTO covers the installation and configuration of an Amateur Radio packet switch. (FPAC version 3.27) under Linux operating system with kernel 2.6. The reader will be guided step by step through the process of configuring a FPAC node capable of automatically reach a destination via a network of interconnected node stations (either via radio or Internet ). The user will be responsible for the radio interface configuration not described here. If your Linux box is setup with a radio device, FPAC can provide inter connections between local packet-radio networks and remote nodes using AX.25 Packet Layer Protocol (AX.25 PLP) RATS Open Systems Environment, ROSE. A network of FPAC nodes can transparently interconnect many applications such as BBS stations for bulletin or message forwarding, DX spots, and Terminal Chat user connections, etc.. For a complete description of FPAC software, please read this FPAC HOWTO (or from this mirror).


1. Introduction

2. How to configure a Linux 2.6 kernel with AX25 modules

3. How to install AX25 libraries

4. How to install AX25 tools

5. How to install AX25 apps

6. A script for various directories and file rights setup

7. How to configure ax25ipd

8. How to install and configure FPAC 3.27

9. AX25 startup scripts

10.1 Router Configuration

10.2 Interfacing FPAC with application programs

10.3 Other Network Utility programs

11. HOWTO

12. Getting Help


1. Introduction

FPAC for Linux was written by Jean-Paul, F6FBB. An earlier FPAC version , written for DOS, was coded in assembly language by Antoine, F6DWJ, in collaboration with Rémy, F6ABJ. FPAC is based on Thomas A. Moulton W2VY implementation of the Radio Amateur  Telecommunications Society (RATS) Open Systems Environment (ROSE), based on X.25 CCITT standard,  in assembly language and "C" for packet radio Terminal Node controler TNC2. Jean-Paul also wrote the FPAC HOWTO ( or from this mirror) which covers the operation and setup of the FPAC node. An FPAC sysop's manual has also been written by Charles Schumann, K4GBB.

The purpose of this document is to assist the reader in the setup of an Amateur Radio Packet node from scratch. The process is based on my own experience using a Mandriva Linux distro. Before starting here are a few recommandations. Avoid using a brand new hardware with the most recent high performance graphic adapter or sophisticated Ethernet interfaces included on the mother board. Linux drivers like nVidia are proprietary and may not be included in Linux kernel.  You must know that Linux is very  performant  and does not need  high frequency microprocessors as opposed to a well known commercial operating system. Take the opportunity to recycle your old computer rejected by your children for low performance reasons. You will be surprised how fast Linux boots on this "old" machine.

With Linux 2.2 kernels, the last available being 2.2.26, AX25 applications were quite stable. It managed a packet radio system for weeks without needing intervention. However, you may want to use more recent Linux kernels which contain support for USB interfaces, serial ATA disks, Blue Tooth, and wireless LAN. Due to extensive changes in the kernel code, AX25 was not as well supported on 2.4 and early 2.6 kernels. Although you can run AX25 with kernel 2.4, Linux system often becomes unstable and will lock-up. Ralf DL5RB worked intensively on AX25 code adaptation to 2.6 kernel. Versions later than 2.6.29 are fine to run HamRadio AX25 applications. Latest 2.6.29 kernel is however recommanded. For example browse link LATEST-IS-2.6..... here : ftp://ftp.kernel.org/pub/linux/kernel/v2.6/LATEST-IS-2.6.29.2

This step by step procedure to set up an FPAC node, based on Mandriva Linux distro with 2.6 Linux kernel, will cover :

1. Installation of Linux 2.6 kernel with AX25 modules

2. Installation of AX25 libraries

3. Installation of AX25 tools

4. Installation of AX25 applications

5. Configuration of the ax25ipd daemon

6. Installation of the FPAC software

7. Installation of AX25 start-up scripts

8. Setting up the FPAC switch.


2. How to configure a Linux 2.6 kernel with AX25 modules

stable: 2.6.32.7 2010-01-28 [Full Source] [Patch] [View Patch] [View Inc.] [Gitweb] [Changelog

Create the two following symbolic links to linux that you can use later when you download and apply a kernel patch.

ln -s linux  a

ln -s linux  b
make

Move the archive file into this directory then unpack it :

tar xvf libax25-0.0.11.4src_f6bvp.tgz  then change the directory

cd  libax25-0.0.11 and type the following set of commands :

./configure
make

make install

make installconf  
(only if no previous configuration file exist, as they would be overwritten)   

This will copy the following configuration sample files into /usr/local/etc/ax25 directory : axports, rsports and nrports, include files into  /usr/local/include, documentation manual pages accessible with man program into /usr/local/man and install AX25 libraries into the /usr/local/lib/ directory.


If you prefere to download already compiled library files download http://f6bvp.free.fr/logiciels/ax25/libax25-0.0.11_i386.tgz

Move the file into a directory, for example, /usr/local/src/ax25 and change to that directory.

cd   /usr/local/src/ax25

Unpack the package :

tar xfP libax25-0.0.11_i386.tgz

Note : P flag in xfP is upper case.

This should unpack ax25 libraries into /usr/local/lib/ directory and copy include, sample and documentation manual files as stated above.

-rw-r--r--  1 root root 101464 déc  4 19:59 libax25.a
-rw-r--r-- 1 root root 20816 déc 4 19:59 libax25io.a
-rwxr-xr-x 1 root root 720 déc 4 19:59 libax25io.la*
lrwxrwxrwx 1 root root 18 déc 4 19:59 libax25io.so -> libax25io.so.0.0.0*
lrwxrwxrwx 1 root root 18 déc 4 19:59 libax25io.so.0 -> libax25io.so.0.0.0*
-rwxr-xr-x 1 root root 23090 déc 4 19:59 libax25io.so.0.0.0*
-rwxr-xr-x 1 root root 706 déc 4 19:59 libax25.la*
lrwxrwxrwx 1 root root 16 déc 4 19:59 libax25.so -> libax25.so.0.0.0*
lrwxrwxrwx 1 root root 16 déc 4 19:59 libax25.so.0 -> libax25.so.0.0.0*
-rwxr-xr-x 1 root root 76967 déc 4 19:59 libax25.so.0.0.0*

4. How to install AX25 tools

I only modified some #include headers and variable type declaration in order to help the compilation of ax25tools-0.0.8 package with 2.6 kernel. You may choose to get the compiled tool binary files or the source files and compile them. It is always preferable to compile software for your system.

To get the source files archive, right click on the following link and download the package into the directory of your choice

http://f6bvp.free.fr/logiciels/ax25/ax25-tools-0.0.8.2src_f6bvp.tgz

Unpack the package:

tar xfP ax25-tools-0.0.8_i386.tgz

This will put configuration files into /usr/local/etc/ax25, manual files into /usr/local/man, binary files into /usr/local/sbin and others in /usr/local/bin .


5. How to install AX25 applications

Unlike the previous two packages, AX25 applications have evolved recently. Steve VK5ASF has provided an ax25ipd version with dynamic IP capability. Although there is no official release at the present time, I have provided the binary and source files of modified ax25-0.0.6 packages. You may choose to use the compiled applications (not recommanded) or get the source files and compile them. It is always preferable to compile software on your own system.

To get the source files archive, right click on the following link to download the newest version package into the directory of your choice : http://f6bvp.free.fr/logiciels/ax25/ax25-apps-0.0.6.2src_f6bvp.tgz

Move the file into a directory, for example, /usr/local/src/ax25 then change to that directory.

tar xf ax25-apps-0.0.6.2src_f6bvp.tgz – Change directory

cd ax25-apps-0.0.6 and type the following set of commands :

http://f6bvp.free.fr/logiciels/ax25/ax25-apps-0.0.6_i386.tgz

tar xfP ax25-apps-0.0.6_i386.tgz

Note : flag P is upper case.

This will put configuration files into /usr/local/etc/ax25, manual files into /usr/local/man, binary files into /usr/local/sbin and others in /usr/local/bin .is will put some binary files into /usr/local/sbin and others in /usr/local/bin .


6. A script for various directories and file setup

To run an FPAC node on a 2.6 Linux kernel we need to setup some directories and file rights. I wrote the following script to facilitate the job.

#!/bin/sh
# rc.init.script
# Part of http://rose.fpac.free.fr/MINI-HOWTO/
# by f6bvp at amsat dot org
#
# This script should be run only once after installation of
#
# - libax25
# - ax25-apps
# - ax25-tools
#
# and before installing FPAC fpac327 package
#
# AX25 libraries declaration (into ld.so.conf)
#
echo "/usr/local/lib" >> /etc/ld.so.conf
/sbin/ldconfig
#
# Reserving UDP port 10093 for FPAC service
#
echo "fpad 10093/tcp # FPAC" >> /etc/services
echo "fpad 10093/udp # FPAC" >> /etc/services
#
# Making necessary AX25 directories
#
mkdir /usr/local/var
mkdir /usr/local/var/ax25
cd /var
ln -s /usr/local/var/ax25 ax25
mkdir /usr/local/etc
mkdir /usr/local/etc/ax25
cd /etc
ln -s /usr/local/etc/ax25 ax25
#
# Add some FPAC directories and files
#
mkdir /usr/local/var/ax25/fpac
/bin/chmod a+x /usr/local/var
/bin/chmod a+x /usr/local/var/ax25
/bin/chmod a+x /usr/local/var/ax25/fpac
/bin/touch /usr/local/var/ax25/fpac/loggedin
/bin/chmod a+w /usr/local/var/ax25/fpac/loggedin
#
mkdir /usr/local/var/ax25/mheard
/bin/chmod a+x /usr/local/var/ax25/mheard
/bin/touch /usr/local/var/ax25/mheard/mheard.dat
#
/bin/touch /usr/local/etc/ax25/axports
/bin/touch /usr/local/etc/ax25/nrports
/bin/touch /usr/local/etc/ax25/flexd.conf
/bin/touch /usr/local/etc/ax25/node.routes
#
echo "Do not forget to edit 'SYSOP=' and 'CONNECT='"
echo "in file /usr/local/sbin/fpac.sh"
echo "according to your own BBS callsign and sysop name"
#

# /usr/local/etc/ax25/axports
#
# The format of this file is:
#
# name callsign speed paclen maxframes description
#
0   F6ZZZ-8  38400   256  4  Linux  (AXIP)
#1   F6ZZZ-4   38400   256  2  Linux  (VHF-1)
#2   F6ZZZ-5   38400   256  2  Linux  (UHF-1)
#3   F6ZZZ-6   38400   256  2  Linux  (VHF-2)
#4   F6ZZZ-7   38400   256  2  Linux  (UHF-2)
#


7. How to configure ax25ipd

# /usr/local/etc/ax25/ax25ipd.conf
# ax25ipd configuration file for station f6zzz
#
# Select axip transport. 'ip' is what you want for compatibility
# with most other gates ...
#
#socket ip
socket udp 10093
#
# Set ax25ipd mode of operation. (digi or tnc)
#
mode tnc
#
# If you selected digi, you must define a callsign. If you selected
# tnc mode, the call sign is currently optional, but this may change
# in the future! (2 calls if using dual port kiss)
#
#mycall2 vk5xxx-5
#
# In digi mode, you may use an alias. (2 for dual port)
#
#myalias2 svwdn2
#
# Send an ident every 540 seconds ...
#
#beacon after 540
#btext ax25ip -- tncmode rob/vk5xxx -- Experimental AXIP gateway
#
# Serial port, or pipe connected to a kissattach in my case
# master /dev/ptyq1 is attached to port ax0 ( 0 in /usr/local/etc/ax25/axports)
#
device /dev/ttyq1

#
# Set the device speed
#
speed 38400
#
# loglevel 0 - no output
# loglevel 1 - config info only
# loglevel 2 - major events and errors
# loglevel 3 - major events, errors, and AX25 frame trace
# loglevel 4 - all events
# log 0 for the moment, syslog not working yet ...
#
loglevel 2
#
# If we are in digi mode, we might have a real tnc here, so use param to
# set the tnc parameters ...
#
#param 1 20
#
# Broadcast Address definition. Any of the addresses listed will be forwarded
# to any of the routes flagged as broadcast capable routes.
#
broadcast QST-0 NODES-0
#
# ax.25 route definition, define as many as you need.
# format is route (call/wildcard) (ip host at destination)
# ssid of 0 routes all ssid's
#
# route <destcall> <destaddr> [flags]
#
# Valid flags are:
# b - allow broadcasts to be transmitted via this route
# d - this route is the default route
#
#route vk2sut-0 44.136.8.68 b
route f5mtz-0 f5mtz.no-ip.org udp 10093 b
route kp4djt-0 24.129.134.206 udp 10093 b
route f1hci-0 f1hci.org udp 10093 b
route f5kbw-0 147.210.91.241 udp 10093 b
route f6bvp-0 f6bvp.org udp 10093 b
#
#delay f5mzn-0 35
#


8. How to install and configure FPAC 3.27

Jean-Paul F6FBB, the author of Linux FPAC, stopped its development with version 3.25 for Linux kernel 2.2, but released a compiled working version (3.26) on a floppy image that can be downloaded from F6FBB FTP site or from a mirror site. This Windows program , Rawrite, will help you to make a bootable floppy that will run Fpac. FPAC 3.26 was associated with Linux system glibc6 library compatible with 2.4 kernels. For our purpose we need to compile FPAC sources.

make
make install
make installconf
(only if no previous FPAC configuration file exist, as they would be overwritten)

#
# Configuration file for FPAC node
# This file is /usr/local/etc/ax25/fpac.conf
#
# Node Informations
#
L2call = F6BVP-10
L3call = F6BVP-11
Trcall = F6BVP-15
DNIC = 2080
Address = 175502
Coverage =
InetPort = 10093
InetAddr = 44.151.75.15
Password = abcdefghi
City = PARIS-17
locator = JN18DV
UserPort = *
DefPort = 0
#
# Additional commands
#

Command
HRD = /usr/local/sbin/mheard -d m
BBs = connect f6bvp-1 2080175520
CLuster = /usr/bin/telnet f6bvp 9000
CLSpider = /usr/bin/telnet bernard 7300
CONVers = /usr/bin/telnet f4bwt.no-ip.org 3600
STHeure = /bin/cat /usr/local/var/ax25/fpac/fpacstat.dat
STJour = /bin/cat /usr/local/var/ax25/fpac/fpacstat.day
# Telnet =
IPLinks = /bin/netstat --ip
IPRoutes = /bin/netstat -nr
ROse = /bin/cat /proc/net/rose
RS_NEigh = /bin/cat /proc/net/rose_neigh
RS_NOdes = /bin/cat /proc/net/rose_nodes
RS_Routes = /bin/cat /proc/net/rose_routes
NR_netrom = /bin/cat /proc/net/nr
NR_NEigh = /bin/cat /proc/net/nr_neigh
NR_NOdes = /bin/cat /proc/net/nr_nodes
MANuals = /usr/bin/man %1
TRace = connect f6bvp-15 2080175502
KCK = connect f5kck-10
KBW = connect f5kbw-8 2080833501
USA = connect kd4yal-8 3100727489
End

# Bbs command will connect the user to the BBS on the same machine
# via rose level
# idem for command CLu that will connect the user to local DxNet server
# STat command will display connexion statistics
# Empty command telnet will do nothing

# Sysop reserved commands
#
Sysop
DIsk = /bin/df -k
SYSop = /usr/local/sbin/fpacshell
YGET = /usr/local/sbin/yapp -u /usr/local/etc/ax25/%1
YPUT = /usr/local/sbin/yapp -d /usr/local/etc/ax25/%1
RM = /bin/rm /usr/local/etc/ax25/%1
LS = /bin/ls -l /usr/local/etc/ax25/%1
CP = /bin/cp /usr/local/etc/ax25/%1 /usr/local/etc/ax25/%2
CAT = /bin/cat /usr/local/etc/ax25/%1
MV = /bin/mv /usr/local/etc/ax25/%1 /usr/local/etc/ax25/%2
REBoot = /sbin/reboot
WEdit = /usr/local/sbin/wpedit %*
End
#
#
# Port specific to an address
#
# on donne au port d'acces utilisateur VHF l'adresse 175502
# will add a rose device like rose1
# AddPort = VHF
# Address = 175602
# Port = 4
# End
# Port specific to an address
# AddPort = UHF
# Address = 175502
# Port = 1
# End
# Port UHF 9600 via carte SCC4 et T7F (experimental)
# AddPort = UHF-9600
# Address = 175402
# Port = 4
# End
#
# This was when Kissnetd was used to create an internal network
# in order to link applications together. But now, ax25d, xfbb,
# or dxnet are able to listen to rose connexions, so may be directly
# connected via rose0 port issuing a Level 3# on donne au port d'acces utilisateur UHF l'adresse 175502
command.

# User = BBS
# Path = F6KDS-1
# port =
# End

#
# List of alias for easy connexions to some address
#

Alias = F6BVP-3
Path = F6BVP-3,175520
End

# Alias = F6BVP-4
# Path = F6KDS-1,194501
# End

#
# List of adjacent nodes
# NoWP = 1 means no White Page
# for FPAC DOS does not know how to handle white pages

# Node = F6ABJ
# Path = F6ABJ-11
# DNIC = 2080
# Address = 175501
# Port = 0
# NoWP = 1
#End

Node = LAN522
Path = F6BVP-5
DNIC = 2080
Address = 175522
Port = 0
NoWP = 0
End

Node = VK2TV
Path = VK2TV-2
DNIC = 5050
Address = 656200
Port = 0
NoWP = 0
End

Node = KP4DJT
Path = KP4DJT-9
DNIC = 3100
Address = 813626
Port = 0
NoWp = 0
End

Node = K4GBB
Path = K4GBB-9
DNIC = 3100
Address = 352726
Port = 0
NoWp = 0
End

Node = MVP
Path = F1MVP-5
DNIC = 2080
Address = 886801
Port = 0
NoWp = 0
End

Node = YAL
Path = KD4YAL-9
DNIC = 3100
Address = 727489
Port = 0
NoWp = 0
End

Node = F5KBW
Path = F5KBW-9
DNIC = 2080
Address = 833501
Port = 0
NoWp = 0
End

Node = F4BWT
Path = F4BWT-11
DNIC = 2080
Address = 428501
Port = 0
NoWp = 0
End

Node = LAN520
Path = F6BVP-9
DNIC = 2080
Address = 175520
Port = 0
NoWp = 0
End

Node = LAN521
Path = F6BVP-7
DNIC = 2080
Address = 175521
Port = 0
NoWp = 0
End

Node = GGY
Path = F6GGY-9
DNIC = 2080
Address = 847501
Port = 0
NoWP = 0
End

Node = F3KT
Path = F3KT-11
DNIC = 2080
Address = 444501
Port = 0
NoWp = 0
End

#
# Routes to adjacent nodes
# and routes to address via adjacent nodes
# DNIC has 4 digits
# Address has 1 to 6 digits, using hierarchy
#

Routes
DNIC = 0
2080 = F4BWT
2080 = F3KT
2080 = F5KBW
3100 = KP4DJT
3100 = K4GBB
3100 = YAL
5050 = YAL
5050 = KP4DJT
5050 = VK2TV
7120 = YAL
7120 = K4GBB
7120 = KP4DJT
#
DNIC = 2080
# 175505 = KVP
175520 = LAN521
175520 = LAN522
175520 = LAN520
175521 = LAN521
175522 = LAN522
178 = LAN520
195 = LAN520
444 = MVP
444 = GGY
444 = F3KT
444501 = F3KT
7 = F5KBW
8 = F5KBW
8335 = F5KBW
833501 = F5KBW
847 = F4BWT
847 = GGY
847501 = GGY
428 = F4BWT
428501 = F4BWT
886801 = MVP
9 = F5KBW
DNIC = 3100
772 = VK2TV
772 = K4GBB
772 = YAL
352726 = K4GBB
727489 = YAL
End
Routes:
DNIC Address Primary Route ! 1st Alt Route ! 2nd Alt Route !
7120,...... KP4DJT-9 Closed ! K4GBB-9 Opened ! KD4YAL-9 Opened !
5050,...... VK2TV-2 Opened ! KP4DJT-9 Closed ! KD4YAL-9 Opened !
3100,...... KD4YAL-9 Opened ! K4GBB-9 Opened ! KP4DJT-9 Closed !
2080,...... F5KBW-9 Closed ! F3KT-11 Opened ! F4BWT-11 Opened !
2080,9..... F5KBW-9 Closed !
2080,8..... F5KBW-9 Closed !
2080,7..... F5KBW-9 Closed !
3100,772... KD4YAL-9 Opened ! K4GBB-9 Opened ! VK2TV-2 Opened !
2080,428... F4BWT-11 Opened !
2080,847... F6GGY-9 Closed ! F4BWT-11 Opened !
2080,444... F3KT-11 Opened ! F6GGY-9 Closed ! F1MVP-5 Closed !
2080,195... F6BVP-9 Opened !
2080,178... F6BVP-9 Opened !
2080,8335.. F5KBW-9 Closed !
3100,727489 KD4YAL-9 Opened !
3100,352726 K4GBB-9 Opened !
2080,886801 F1MVP-5 Closed !
2080,428501 F4BWT-11 Opened !
2080,847501 F6GGY-9 Closed !
2080,833501 F5KBW-9 Closed !
2080,444501 F3KT-11 Opened !
2080,175522 F6BVP-5 Closed !
2080,175521 F6BVP-7 Closed !
2080,175520 F6BVP-9 Opened ! F6BVP-5 Closed ! F6BVP-7 Closed !


9. AX25 startup scripts

#!/bin/sh
# /etc/rc.d/rc.ax25
#
# This script will start AX25 FPAC switch application on a Linux 2.6 system
# at boot time with a sample callsign F6ZZZ.
# rc.eth0 : setup Ethernet eth0 device LAN address and initialize a route to Internet
# through a gateway ;
# rc.tnc : attach ax0 device to pseudo device ptyq1 ;
# rc.axip : install a tunnel between ptyq1 and ttyq1 pseudo tty devices ;
# run ax25ipd daemon that performs AX25 frame encapsulation in IP frames ;
# routes encapsulated packets from ax0 to Internet rose FPAC address;
# rc.fpac : start FPAC suite of programs and mheardd daemon;
# rc.beacon : start listen application on console 2 listening to port 0
# and install a beacon broadcast on ax0 port ;
#
echo 15 > /proc/sys/kernel/panic
echo 1 > /proc/sys/net/ipv4/ip_forward
#
# The following is an example for eth0 fixed IP address
# not necessary if protocol DHCP is used
#
#/sbin/ifconfig eth0 192.168.0.200
#/sbin/route add -net 192.168.0.0 netmask 255.255.255.0 eth0
#/sbin/ifconfig lo 127.0.0.1
#/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo
#/sbin/route add default gw 192.168.0.1
#
# /etc/rc.d/rc.tnc
#
/usr/local/sbin/kissattach /dev/ptyq1 0 44.151.75.153
/bin/sleep 2
#
#/etc/rc.d/rc.axip
#
/bin/date > /var/log/ax25ipd.log
/usr/local/sbin/ax25ipd -l4 >> /var/log/ax25ipd.log 2>&1
#
#/etc/rc.d/rc.fpac
#
/bin/date > /var/log/fpac
/usr/local/sbin/fpac.sh
/usr/local/sbin/mheardd
#
#/etc/rc.d/rc.beacon
#
#/usr/local/bin/listen -char >> /dev/tty2 &
/usr/local/sbin/beacon -c F6ZZZ -d QST -t 10 0 'Nodal Rose FPAC F6ZZZ'
#

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
#
echo 60 > /proc/sys/kernel/panic
echo 60 > /proc/sys/kernel/panic_on_oops
echo 1  > /proc/sys/kernel/sysrq

#
/etc/rc.d/rc.ax25
#
touch /var/lock/subsys/local
#

cd  /usr/local/bin

ln -s /etc/rc.d/rc.ax25  ax25


10.1. Router configuration

If your Linux computer is directly connected to your DSL box without a router, the following applies to your DSL router settings.

A router not only performs the basic routing functions but it usally includes a firewall function to protect your computer and LAN from Internet intruders. By default the traffic passing through the router may be filtered in both directions. IP packets going from LAN to Internet are routed only if you give the permission. You may already be setup to pass normal traffic. However AX25 applications are using ports that must be opened in both directions. Ports up to 1024 are reserved for Standard applications and must not be used. See /etc/services file. Our FPAC needs port 10093 to be opened in both directions for UDP and TCP protocols. Check your router or DSL modem documentation to find out how to enable these ports and redirect these ports to your computer local IP address. Same for other AX25 applications such as  port 6300 (TCP/UDP) for BBS F6BVP, port 9000 UDP for DxNet.


10.2. Interfacing FPAC with application programs

Some application programs that will run on the same Linux machine can listen to a local port and may be easily interconnected with fpac node.

FBB and DxNet can communicate with FPAC without additive programs. NetRomd needs ax25d to perform the interface with FPAC.

Run the following sample script during AX25 setup. It will create NetRom devices that will be used by the following applications and start NetRomd daemon.

#!/bin/sh
# /etc/rc.d/rc.netrom
#
#echo "NETROM"
  /sbin/modprobe netrom
#
killall -KILL netromd
ifconfig nr1 down
ifconfig nr0 down
ifconfig nr2 down
ifconfig nr3 down
# creating NET/ROM devices (please edit your own ampr.org network address)
/usr/local/sbin/nrattach -i 44.151.75.15 -m 256 netnod
/usr/local/sbin/nrattach -i 44.151.75.15 -m 256 netbbs
/usr/local/sbin/nrattach -i 44.151.75.15 -m 256 netclu
# adjacent NET/ROM nodes creation via port 4=ax4 (ax25 over ip)
/usr/local/sbin/nrparms -nodes k4gbb-14  + CIT03 120 6 4 k4gbb-14
/usr/local/sbin/nrparms -nodes kp4djt-14 + DJT14 120 6 4 kp4djt-14
/usr/local/sbin/nrparms -nodes vk2tv-14  + KEMPC 120 6 4 vk2tv-14
/usr/local/sbin/nrparms -nodes vk2vy-2   + VYNODE 120 6 4 vk2vy-2
# start ax25d daemon to link NetRom and FPAC node
/usr/local/sbin/ax25d
# Broadcast NET/ROM
/usr/local/sbin/netromd -lid -t 10
# Setup Netrom subnetmask
/sbin/ifconfig nr0 netmask 255.255.255.255
/sbin/ifconfig nr1 netmask 255.255.255.255
/sbin/ifconfig nr2 netmask 255.255.255.255
/sbin/ifconfig nr3 netmask 255.255.255.255
#

For deeper understanding see nrattach and nrparms manuals.



10.2.1. Interfacing FPAC with a BBS application

If your Linux box is running a BBS it can be internally connected to ROSE FPAC and interfaced with NetRom. This will give your BBS a worldwide access to AX25 stations
Important notice : Modern distro use
Simultaneous Parallel Multiprocessing (SMP) precompiled kernels. However LinFBB BBS sometimes does not work well under SMP kernel. In that case the trick is to disable smp using a special instruction "nosmp" in GRUB /boot/grub/menu.lst file.

Edit this file and add nosmp like in the following example :

title 2.6.19.1
kernel (hd0,0)/boot/vmlinuz-2.6.19.1 BOOT_IMAGE=2.6.19.1 root=/dev/hda1 splash=silent vga=788 nosmp initrd (hd0,0)/boot/initrd-2.6.19.1.img

Second important notice :
Lin FBB is using CRC table designed for 32 bits CPU architecture. Nowadays 64 bits CPUs are more common. Thus computed CRC will be different.
If your Linux system has a 64 bits CPU,  you need to disable FBB compressed forwarding using parameter N1 in forward file like illustrated in the following example :

A F6BVP
P A
N 1
C C F6BVP-1 2080175520
...

Recommanded FBB version is 7.04r6.1 (earlier versions have serious bugs)

Lets now have a look at different FBB configuration files under Linux. This is a partial listing from FBB BBS showing the port description file : /usr/local/etc/ax25/fbb/port.sys

#Com Interface Adress (Hex)   Baud
    1   9        *****        115200
    2   9        189C         0
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
   0   0    0   0       0     0     0     0      00/01   ---- File-fwd.
   1  20    1   rose0   250   2     6     10     15/10   XULWY Rose0
   2   4    1   3       250   2     2     10     08/10   XULWY UHF
   3  10    2   0       250   7     8     10     15/15   TUWY  Telnet
   4   4    1   netbbs  250   7     2     10     15/15   XULWY NetRom
#

MultCh represents pseudo TTY devices created by kissattach. Devices names are declared in /usr/local/etc/ax25/axports.
Unlike in the above example Multch names can be different from 1, 2, 3,... More clearly identified names like vhf-1, vhf-2, uhf, axudp, aprs, are encouraged. Remember, Multch device names must be identical to the names declared in axports file, or be a zero for Telnet device.

There is a TNC linked to AX25 port 3 defined in /etc/ax25/axports file.

Telnet port 189C is decimal 6300. Command is : telnet <hostname> 6300 to enter the BBS.

Pseudo netbbs will interface the BBS with NetRom.

Pseudo rose0 is the interface toward  and from ROSE network handled by FPAC packet switch application.

Remember to declare BBS telnet port 6300 in /etc/services as explained earlier.

By the way, dealing with 2.6 kernels, F6FBB's xfbbd source file needed to be updated in order to be compiled with recent compilers.

You can download the latest BBS source file archive xd704 via FTP.
You may also download the archive xd704 via HTTP, for example xd704r6.1-src.tar.bz2
There is a version of FBB 7.04j  prepared by DM3TT and including a patch for PACTOR of PTC-II driver on channel 31.
This patch will be included into next FBB release.

cd /usr/local/src/ax25

tar  xf   xd704r6.1-src.tar.bz2
cd fbbsrc.704r6.1
cd src
make
make install

urpmi lesstif
urpmi lesstif-devel
urpmi libopenmotif

Then enter fbb X11 subdirectory fbbsrc.704p/src/X11

cd X11
make
cp xfbbX        /usr/local/sbin
cp xfbbX_cl    /usr/local/bin
cp xfbb            /usr/local/sbin
xfbb -a &
xfbbX &

 
A second choice (obsolete and not recommanded) would be to download already compiled FBB suite via http from xd704o-i386.tgz
or via FTP from xd704o_i386.tgz

Note: flag P is uppercase

To start BBS application, enter command fbb that will execute /usr/local/sbin/script. The first time it will proceed to initialization of the necessary configuration files asking a few questions and create /usr/local/etc/ax25/fbb.conf and /usr/local/etc/ax25/port.sys if they did not exist yet. Next times it will start xfbbd the BBS daemon application.

To help you configuring FBB there is a BBS keywords documentation provided by charlie K4GBB.

For local connexions, edit sysop CALLSIGN and  PASSWORD in file /etc/ax25/fbb/passwrd.sys

# Passwords
123456789
PASSWORD OF ALL NON DEFINED CALLSIGNS.
CALLSIGN 63 1023 PASSWORD
44.151.75.15 *
#

You can start a console FBB client manually with the command :
xfbbC -c -i CALLSIGN -w PASSWORD

However is is more convenient to write a script to start a console FBB client :

#!/bin/sh
#
/usr/local/sbin/xfbbC -c -i CALLSIGN -w PASSWORD
#

Replace CALLSIGN and PASSWORD by the corresponding names in /etc/ax25/fbb/passwrds
Lets call the following script
file bbs and put it in /usr/local/bin and make it executable :

chmod +x bbs

Simple bbs command will now allow you the SYSOP to enter your local BBS by running the FBB client xfbbC.




10.2.2. Interfacing FPAC with DxCluster or DxSpider applications

DxCluster

Dxnet system/dxnet.cfg file will look like :

set/node +f8kgk-3 +f5mtz-3 +f5kbw-3 +f6cdd-3 +tu5ex-3 +kp4ig-5
set/call f6bvp-2
set/sys +F6BVP
set/ssid +2
set/port 0 1 3 4 rose0 inet:9000 netclu
set/tz +2


The Dx cluster can be accessed via either ax25 radio ports 0, 1, 3 and 4, via FPAC node port rose0, telnet port 9000 and NetRom port netclu.

DxSpider

If you want to provide FPAC users access to DxSpider (callsign F6BVP-2)  you can use ax25d daemon.

Install DxSpider following its documentation. Follow the examples for configuring telnet or radio ports user access. Don't forget to change the file name of startup.issue and rename it startup after editing it according to your needs, as it took me a long time since I found out why DxSPider did not work properly for it did not find startup file but did not complain about it !

For access through FPAC here is is the content of necessary /usr/local/etc/ax25/ax25d.conf file

# a ROSE port is declared between { }
{F6BVP-2 via rose0}
NOCALL * * * * * * L
default  * * * * * *  -   sysop  /spider/src/client client %u ax25
#

Replace %u with %f if you want to handle users or other nodes SSID.
After editing this file you need to restart /usr/local/sbin/ax25d daemon.
If Spider main directory is not /spider, then change it accordingly in the above example configuration file.
Note : when starting ax25d from a script it must be started after fpac in order to have rose0 device already set up.
When a user issues a connect request to F6BVP-2 via FPAC network, it will be connected to the DX cluster.



10.2.3. Interfacing FPAC with NetRom

The following will give the necessary instructions to interface FPAC with a NetRom net.

Example of /usr/local/etc/ax25/nrports file

# /usr/local/etc/ax25/nrports
#
# The format of this file is:
# name callsign alias paclen description
#
netnod  F6BVP-10  BVPNOD    235    F6BVP FPAC node
netbbs  F6BVP-1   BVPBBS    235    F6BVP BBS
netclu  F6BVP-2   BVPDX     235    F6BVP Dx Cluster
#

This is the content of your /usr/local/etc/ax25/ax25d.conf file

#
<netrom>
parameters 1   10 * * * * *
NOCALL * * * * * * L
default  * * * * * * *    root /usr/sbin/fpacnode fpacnode -q %S
#

Add the letter b after UDP port number of the route description in /usr/local/etc/ax25ipd.conf to allow broadcast of NetRom routes.



10.2.4. Allowing remote users access to FPAC node via Internet

This is how to configure Internet acces to your FPAC node using either a TELNET or SSH connection.
Note : this will not give users access to your Linux machine but only give them access to FPAC node.

If you did not already create a user named  fpacuser, create it with the following command :

# adduser -m fpacuser

Create user  fpacuser password fpac :

# passwd fpacuser
enter NEW UNIX password : fpac
ignore the remark and retype
NEW UNIX password : fpac

Edit file  /etc/group for adding users to fpacuser group

Use your usual editor, the following syntax is for vi

# vi /etc/group
Use arrow keys to get down to the last line comprising

fpacuser:x:150:

Note : the number may be different.

Type on key i to get into insert mode and add fpacuser and root

fpacuser:x:150:fpacuser,root

Type on key Esc then on key semicolon : then enter wq and press Enter key to leave the editor.
We now need to edit the users password file to change the shell program name invoked when a fpacuser user is connecting
 

vi /etc/passwd

Type on key i to get into insert mode use arrow keys to get down to the last line comprising user fpacuser
and replace existing  /bin/sh or /bin/bash by /usr/local/sbin/fpacnode

Type on key Esc then on key semicolon : then enter wq and press Enter key to leave the editor.
It is now necessary to give users the rights for using fpacnode  :

# chmod  4775 /usr/local/sbin
# chmod  4775 /usr/local/sbin/fpacnode

It is also necessary to change loggedin file permission :

# chmod a+w /usr/local/var/ax25/fpac/loggedin

You can now check that your configuration is working by making a local connection via telnet or ssh to your FPAC Linux :

# telnet localhost -l fpacuser
or
# ssh  -l  fpacuser localhost

and enter password fpac to get access to fpac node.



10.3. Other Network Utility Programs

Net-tools includes some usefull programs. Among them, netstat is interesting for it can display a list of Linux sockets opened, kernel route table and network statistics.

In present net-tools (1.60) with debian patches (-23), netstat handles NetRom and AX.25 sockets, but does not provide any information about ROSE sockets used by FPAC.

From here ( http://f6bvp.free.fr/logiciels/netstat/  ) can be downloaded a patch to make netstat know about ROSE sockets.

Also download those three patches : hostname, inet, x25.

cd    /usr/local/src/

            tar  xf   net-tools_1.60.orig.tar.gz
            gunzip   net-tools_1.60-23.diff.gz
            patch -p0 < net-tools_1.60-23.diff
            mv    net-tools-1.60     net-tools-1.60-23
            patch -p0 < net-tools-1.60-23.hostname.patch
            patch -p0 < net-tools-1.60-23.inet_src.patch
            patch -p0 < net-tools-1.60-23.netstat.x25_sr.patch
            patch -p0 < net-tools-1.60-23.netstat.rose.patch
            make (you need to answer y (yes) or n (no) to a number of questions to customize net-tools compilation
                        default response is ok)
           
            make install


          You can now use netstat to display ROSE sockets information :

[root@f6bvp-9 net-tools-1.60-23]# netstat --ax25 --netrom --rose
Active AX.25 sockets
Dest       Source     Device  State        Vr/Vs    Send-Q  Recv-Q
F6BVP-12   F6BVP-14   ax2     ESTABLISHED  006/003  0       0
F6BVP-11   F6BVP-9    ax2     ESTABLISHED  003/000  0       0
*          F6BVP-1    ax2     LISTENING    000/000  0       0
*          F6BVP-1    ax1     LISTENING    000/000  0       0
*          F6BVP-1    ax0     LISTENING    000/000  0       0
*          F6BVP-15*  ???     LISTENING    000/000  0       0
*          F6BVP-15   ???     LISTENING    000/000  0       0
*          F6BVP-8    ???     LISTENING    000/000  0       0
*          F6BVP-8*   ???     LISTENING    000/000  0       0
*          F6BVP-9*   ???     LISTENING    000/000  0       0
Active NET/ROM sockets
User       Dest       Source     Device  State        Vr/Vs    Send-Q  Recv-Q
*          *          F6BVP-0    nr1     LISTENING    000/000  0       0
Active ROSE sockets
dest_addr   dest_call  src_addr    src_call  dev   lci neigh  state
2080175521  ROUTE-0    2080175520  F6BVP-9   rose0   0     0   LISTENING
2080175520  F6BVP-0    2080175520  F6BVP-15  rose0   0     1   LISTENING
*           *          2080175520  F6BVP-1   rose0   0     0   LISTENING
2080428501  F4BWT-10   2080175520  F6BVP-0   rose0   0     0   LISTENING
*           *          2080175520  ROUTE-0   rose0   0     0   LISTENING
*           *          2080175520  F6BVP-15  rose0   0     0   LISTENING
2080175520  FPAD-0     2080175520  WP-0      rose0   0     0   LISTENING
*           *          2080175520  WP-0      rose0   0     0   LISTENING
2080175520  WP-0       2080175520  FPAD-0    rose0   1     1   ESTABLISHED
*           *          2080175520  ??????-?  rose0   0     0   LISTENING

You may want to display kernel ROSE routing table :
 
[root@f6bvp-11 bernard]# netstat --rose -r
Table de routage ROSE du noyau
Destination  neigh1 callsign  device  neigh2 callsign  device  neigh3 callsign  device
2080175502   00001  RSLOOP-0     ???  
2080175522   00016  F6BVP-5      ax0  
2080175521   00015  F6BVP-7      ax0  
2080175520   00014  F6BVP-9      ax0  
2080854509   00012  F8COJ-11     ax0  
2080444501   00013  F3KT-11      ax0  
2080833501   00008  F5KBW-9      ax0  
2080847501   00011  F6GGY-9      ax0  
2080428501   00010  F4BWT-11     ax0  
2080886801   00009  F1MVP-5      ax0  
3100352726   00007  K4GBB-9      ax0  
3100727489   00006  KD4YAL-9     ax0  
3100813626   00005  KP4DJT-9     ax0  
5050699300   00004  VK2XB-2      ax0  
5050656200   00003  VK2TV-2      ax0  
7120282700   00002  TI2HAS-9     ax0  
2080833500   00008  F5KBW-9      ax0  
2080444000   00013  F3KT-11      ax0  00011  F6GGY-9      ax0  00009  F1MVP-5      ax0  
2080847000   00011  F6GGY-9      ax0  00010  F4BWT-11     ax0  
2080428000   00010  F4BWT-11     ax0  
3100772000   00006  KD4YAL-9     ax0  00007  K4GBB-9      ax0  00003  VK2TV-2      ax0  
2080100000   00014  F6BVP-9      ax0  00015  F6BVP-7      ax0  
2080700000   00008  F5KBW-9      ax0  
2080800000   00012  F8COJ-11     ax0  00008  F5KBW-9      ax0  
2080900000   00008  F5KBW-9      ax0  
2080000000   00008  F5KBW-9      ax0  00013  F3KT-11      ax0  00010  F4BWT-11     ax0  
3100000000   00006  KD4YAL-9     ax0  00007  K4GBB-9      ax0  00005  KP4DJT-9     ax0  
5050000000   00003  VK2TV-2      ax0  00004  VK2XB-2      ax0  00006  KD4YAL-9     ax0  
7120000000   00002  TI2HAS-9     ax0  00007  K4GBB-9      ax0  00006  KD4YAL-9     ax0  
7100000000   00002  TI2HAS-9     ax0  00007  K4GBB-9      ax0  00006  KD4YAL-9     ax0 





11. HOWTO

There are many other documents that relate to Linux networking in a general way. I strongly recommend you also read them. They will assist your efforts and provide a stronger insight into other possible configurations.

They are:

The Linux Kernel HOWTO

The AX25-HOWTO,

Tithe HAM-HOWTO,

The NET-3-HOWTO,

The Ethernet-HOWTO,

and:

The Firewall-HOWTO


12. Getting Help

Remember that FPAC is a network switch. You must be able to connected to at least one other FPAC node. The more adjacent nodes you are linked to the better your network will perform.

Stations already running an FPAC node is a good place to get help.

Reading messages from FPAC News list is a must.. To see the collection of prior postings to the list, visit the fpac Archives.

Subscribe to the FPAC list by going to this page.

Global help about Linux and Ham radio can be requested via the Linux Ham list. First check the Linux-hams archive. or the actual Linux-ham list.
Linux-Hams is a mailing list for the discussion of the Linux operating system, and it's use in Amateur Radio. Anyone with an interest in both subjects is encouraged to subscribe. The discussion is mostly concentrated on the use and development of the AX.25 code in the Linux kernel. If you would like to subscribe to the Linux-hams mailing list and receive these messages in your own mailbox, send a message to majordomo@vger.kernel.org, placing the line

subscribe linux-hams

in the body of the message.