ham radio
Configuring Direwolf for HF IP over AX25 using tncattach.

Configuring Direwolf for HF IP over AX25 using tncattach.

First of all, IP over AX25 is not talked about as much as it should be. I know it’s old and slow, but we can send entire Ethernet frames over it, and it still has existing support within modern TNCs. As long as APRS is still kicking, AX25 will be too. There’s a lot of niche sub-hobby’s in amateur radio, and “oldschool” packet radio is one of them. We’re going to take this “oldschool” technology and show how it can be used to create a modern day wold wide client-server network infrastructure independent of the “grid”.

Requirments:

  • Debian based Linux distribution such as Ubuntu(or Debian)
  • An HF Radio
  • An Audio interface with PTT functionality for your HF Radio.
    PTT instead of vox is required due to the fast switching nature of packet radio.
  • Have a non root user with sudo privileges. If you don’t know how to give your user sudo privileges, check out how here first. All commands below are ran as a regular user.
  • You know how to edit text files via the command line.

Installing and Configuring Direwolf

Gotta hand it to TheTechPrepper for his blog post here, because the below snippet is straight up ripped form his site.

The Install is straightforward and the below should work on any Debian Based Linux Distribution:

sudo apt update
sudo apt install git gcc g++ make cmake libasound2-dev libudev-dev -y
cd
git clone https://www.github.com/wb2osz/direwolf && cd direwolf
mkdir build && cd build
cmake ..
make -j4
sudo make install
make install-conf

Your Direwolf configuration file is now located at /home/youruser/direwolf.conf.

Audio Configuration:

The Configuration will vary depending on your radio audio interface, and every configuration can not be explained here (as there are a lot). In simple terms, you need to configure an Audio Interface and a PTT Interface. If you only have one audio interface, the audio partition can be left alone.

To Determine your audio interface issue the command:

arecord -l

You will see a card interface (0-9) and a sub-device Interface (0-9). Note this combination down, and insert it into the Direwolf configuration file at ~/direwolf.conf.

ADEVICE plughw:1,0

PTT Configuration:

Next you will need to determine your PTT interface. There are many options for this, so please refer to the Direwolf official documentation section 9.2.9 here. If you are using the DigiRig, once again TheTechPrepper already has a great post about it here. The article states its for Baofeng, but PTT will be the same for any radio with the DigiRig. Just stop at “YAAC Installation”.

Special Configuration for HF and AX25

Now that Audio and PTT are finished, we are going to add a few more changes to the configuration file to get us legal on HF. Find the “MODEM” line and comment out any existent lines by adding a “#” in front. Then add the below:

#nano ~/direwolf.conf
MODEM 300 1600:1800 7@30 /4
#You may also try the following to see if you get more decoded frames:
#The "D" Is focused toward HF decoding, but have mixed results and more CPU use.
#MODEM 300 1600:1800 7@30 /4 D

Next add the following line to get AX25 to be a little more error resistant:

#nano ~/direwolf.conf
FIX_BITS 1 AX25
#The below may be added if your radio is not keying fast enough and missing the packet header:
TXDELAY 30

Installing and Configuring tncattach:

tncattach is a modern update on kissattach that will allow us to pass Ethernet frames.

sudo apt install net-tools screen ax25-tools -y
cd ~
git clone https://github.com/markqvist/tncattach.git
cd tncattach
make
sudo make install

Putting it all Together

Run direwolf/tncattach via network Kiss Interface:

We will keep it simple and open three terminal interfaces. One for direwolf, another for tncattach, and one to play with.

In the first terminal, run this command to start Direwolf:

/usr/local/bin/direwolf -c ~/direwolf.conf

In another terminal window, run the following command to start tncattach WITH Ethernet frames in a point to multipoint network: (replacing the callsign with yours). You may need to adjust the IP for your needs, but

sudo tncattach --kisstcp --tcphost=127.0.0.1 --tcpport=8001 -s 'Amateur Radio Station KN4MKB' -t 20 -m 300 --noipv6 -i 44.0.0.1/8 -v -e

If you only need a point to point network without Ethernet frames, you can run the following instead to decrease the overhead and increase the speed (The other End would need to use 44.0.0.2/30):

sudo tncattach --kisstcp --tcphost=127.0.0.1 --tcpport=8001 -s 'Amateur Radio Station KN4MKB' -t 300 -m 300 --noipv6 -i 44.0.0.1/30 -v

Alternate Method:
Run direwolf and tncattach via serial interface

This method should have the same outcome as the above, but serves as an alternate if the above does not work for some reason or another.

In the first terminal start direwolf:

/usr/local/bin/direwolf -t 0 -p -c ~/direwolf.conf

Note the serial interface Example “/dev/pts/1”

In the second terminal start tncattach with Ethernet frames for a point to multipoint network using the serial interface above, and your callsign.

sudo tncattach /dev/pts/1 115200 -s 'Amateur Radio Station KN4MKB' -t 300 -m 300 --noipv6 -i 44.0.0.1/8 -e

If you only need a point to point network such as a client-server, you can use the following to run without Ethernet frames to decrease overhead and increase bandwidth:

sudo tncattach /dev/pts/1 115200 -s 'Amateur Radio Station KN4MKB' -t 300 -m 300 --noipv6 -i 44.0.0.1/30 -v

Testing out the network.

On your third and final terminal, we will try and ping the distant end. This assumes you are using IP 44.0.0.1, and the other side is using 44.0.0.2.

#Issue two ping commands with long timeouts to a distant station:
ping -s 1 -i 20 -W 20 -c 2 44.0.0.2

You can even start a webserver with python on one side, and attempt to connect to it in your browser.

sudo apt-get install python
python -m http.server 81

Visit http://44.0.0.2:81 to try and connect to the other side.

Untested Optimizations for Direwolf:

These settings have not been tried by me personally, but have been known to work well elsewhere.

MODEM 300 2130:2230 D
SLOTTIME 12
PERSIST 63
FIX_BITS 1 AX25
#This will disable any type of filtering on bad frames, can maybe be used just for Ethernet traffic
FIX_BITS 1 NONE PASSALL
#This will disable any type of filtering on addresses, which is actually okay for pure AX25 packets
FIX_BITS 1 AX25
#This will Enable FX25, which is a more robust AX25 mode:
FX25TX 1

Consider Subscribing!

Signup for our once a month newsletter!

We don’t spam! Read our privacy policy for more info.

1 thought on “Configuring Direwolf for HF IP over AX25 using tncattach.

Leave a Reply

Your email address will not be published. Required fields are marked *