User Tools

Site Tools


projects:openwrt:soft:ax25

Description

The ax25-essentials and ax25-helpers are a subjective mix of ax25-apps and ax25-tools. The source is the latest from CVS (http://www.linux-ax25.org).

Dependencies

Package depends on
ax25-essentials ax25-libax25 (→ kmod-ax25)
ax25-helpers ax25-essentials (→ ax25-libax25 → kmod-ax25), libncurses (needed for 'listen' and 'call')
ax25-netrom-rose ax25-libax25 (→ kmod-ax25)
ax25-libax25 kmod-ax25

Installation

Both ax25-essentials and ax25-helpers depend on “kmod-ax25-dg8ngn”. Make sure you have it installed.

Diskfree prior to installation:

root@OpenWrt:/ df
Filesystem           1k-blocks      Used Available Use% Mounted on
none                     15256        28     15228   0% /tmp
/dev/mtdblock/4           6016       652      5364  11% /jffs
mini_fo:/jffs             1280      1280         0 100% /
root@OpenWrt:/

Installation:

ipkg update
ipkg install ax25-essentials
ipkg install ax25-helpers
ipkg install ax25-netrom-rose (only needed if you want to use netrom or rose)
reboot

Diskfree after installation:

root@OpenWrt:/# df
Filesystem           1k-blocks      Used Available Use% Mounted on
none                     15256        20     15236   0% /tmp
/dev/mtdblock/4           6016      1252      4764  21% /jffs
mini_fo:/jffs             1280      1280         0 100% /
root@OpenWrt:/#

AX25 Configuration

The following has been put together by Jens, DL3SJB.

Each of the AX.25 applications read a particular configuration file to obtain the parameters of the AX.25 port(s) of your OPENWRT Linux. For AX.25 ports the file is '/etc/ax25/axports'.

root@OpenWrt:/etc/ax25# ls

ax25.profile   ax25mond.conf  axspawn.conf   rip98d.conf    ttylinkd.conf
ax25d.conf     ax25rtd.conf   nrbroadcast    rsports
ax25ipd.conf   axports        nrports        rxecho.conf
root@OpenWrt:/etc/ax25#

The file 'axports' configures the ax25 device:

root@OpenWrt:/etc/ax25# vi axports
# The format of this file is:
#
# name callsign speed paclen window description
#
ax0     d0mmy   115200  255     2    XNET Kernellink

root@OpenWrt:/etc/ax25# 

Note: You need to assign unique callsign (ssid) to each ax25 port in your 'axports' file. In this example the call used is 'd0mmy'.

As netrom is not subject of configuration here, make sure no netrom port is listed in 'nrports':

root@OpenWrt:/etc/ax25# vi nrports

# /etc/ax25/nrports
#
# The format of this file is:
#
# name callsign alias paclen description
#

root@OpenWrt:/etc/ax25# 

Same goes for rose. As rose is not subject of configuration here, make sure no rose port is listed in 'rsports':

root@OpenWrt:/etc/ax25# vi rsports

# /etc/ax25/rsports
#
# The format of this file is:
#
# name address description
#

root@OpenWrt:/etc/ax25# 

The 'axspawn' program is launched by 'ax25d'. It provides for AX.25 logins into the local Linux. To prepare for this add the following lines into your '/etc/ax25/ax25d.conf' file (you may have to delete the existing default lines that are serving as examples):

root@OpenWrt:/etc/ax25# vi ax25d.conf

# /etc/ax25/ax25d.conf
#
# ax25d Configuration File.
#
# AX.25 Ports begin with a '['.
#
[D0MMY VIA AX0]
NOCALL   * * * * * *  L
default  * * * * * *  - root  /usr/sbin/axspawn axspawn %u

root@OpenWrt:/etc/ax25#

Add to File (/etc/group):

guest:x:300:

Add to File (/etc/passwd):

guest:+:300:300:guest:/tmp/guest:/bin/ash

The 'axspawn.conf' file configures the operation of 'axspawn'. Example:

root@OpenWrt:/etc/ax25# vi axspawn.conf

# /etc/ax25/axspawn.conf
#
# allow automatic creation of user accounts
create    yes

# allow empty password field (so user may login via telnet, too) [default no]
create_empty_password       no

# create with system utility useradd(8)? [default no]
create_with_useradd  no

#pwcheck call
#pwcheck group
#pwcheck password

# guest user if above is 'no' or everything else fails. Disable with "no"
guest     no

# group id or name for autoaccount
group     guest

# first user id to use
first_uid 400

# maximum user id
max_uid   2000

# where to add the home directory for the new user
home      /tmp

# secure homedirectories (g-rwx)
#secure_home yes

# user shell
shell     /bin/sh

# bind user id to callsign for outgoing connects.
associate no

root@OpenWrt:/etc/ax25# 

Note (1): The default shell has been altered from the default file (bash ⇒ ash), as Kamikaze normally has no bash support.

Note (2): In this example, the user space is located in the fram disk. If you place the users in /tmp, remember that all content is lost after reset. This maybe, however, an acceptable consequence as it cleans-up the system regularly. If you decide to use flash disk instead, this could be a critical location as flash memories don't have unlimited write cycles. Therefore we suggest to find a different location, such as usb-hdd (if any) or on a samba network share.

If you decide not to use '/tmp' remember to ensure the home root directory does exist, i.e.:

root@OpenWrt:/etc/ax25# mkdir /home
root@OpenWrt:/etc/ax25# mkdir /home/hams
root@OpenWrt:/etc/ax25#

Prior to the XNET configuration, one final step ought to be performed. The standard login script of OPENWRT does not allow 'axspawn' to login a user 'as him-' respectively 'herself'. Therefore, we need to apply a workaround using the scripting language 'ruby' (thanks to DL9SAU).

Diskfree prior to installation:

root@OpenWrt:~/etc/ax25# df
Filesystem           1k-blocks      Used Available Use% Mounted on
none                     15256        40     15216   0% /tmp
/dev/mtdblock/4           6016      2344      3672  39% /jffs
mini_fo:/jffs             1280      1280         0 100% /

Installation of 'ruby':

root@OpenWrt:~/etc/ax25# ipkg install ruby
Installing ruby (1.8.6-p36-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/packages/mipsel/./ruby_1.8.6-p36-1_mipsel.ipk
Installing libruby (1.8.6-p36-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/packages/mipsel/./libruby_1.8.6-p36-1_mipsel.ipk
Configuring libruby
Configuring ruby
Done.
root@OpenWrt:~/etc/ax25#

Diskfree after installation:

root@OpenWrt:~/etc/ax25# df
Filesystem           1k-blocks      Used Available Use% Mounted on
none                     15256        40     15216   0% /tmp
/dev/mtdblock/4           6016      2716      3300  45% /jffs
mini_fo:/jffs             1280      1280         0 100% /
root@OpenWrt:~/etc/ax25#

Note: 372 kb of flash memory are occupied by 'ruby'.

Now modify the standard 'login script' as follows:

root@OpenWrt:~/etc/ax25#vi /bin/login
#!/bin/sh

if [ ! -z "$AXCALL" ]; then
  exec /bin/login.rb $*
fi

grep '^root:[^!]' /etc/passwd >&- 2>&-
[ "$?" = "0" -a -z "$FAILSAFE" ]  &&
{
      echo "Login failed."
          exit 0
}
exec /bin/ash --login

root@OpenWrt:~/etc/ax25#

The main change here is to use the ruby script '/bin/login.rb' which still needs to be created:

root@OpenWrt:~/etc/ax25#vi /bin/login.rb
#!/usr/bin/ruby

Process::Sys.setresgid(300,300,300)
Process::Sys.setreuid(300,300)
exec "/bin/ash --login"

Make '/bin/login.rb' executable:

root@OpenWrt:~/etc/ax25# chmod 755 /bin/login.rb

Now install XNET:

root@OpenWrt:/etc/ax25# ipkg install xnet

Installing xnet (1.39-20071005-0.2) to root...
Downloading http://db0fhn-i.ampr.org/openwrt/kamikaze/packages/mipsel/xnet_1.39-20071005-0.2_mipsel.ipk
Installing screen (4.0.3-1) to root...
Downloading http://downloads.openwrt.org/kamikaze/packages/mipsel/./screen_4.0.3-1_mipsel.ipk
Configuring screen
Configuring xnet
Done.
root@OpenWrt:/etc/ax25# reboot

After reboot check for running XNET:

root@OpenWrt:/# ps
  PID  Uid     VmSize Stat Command

(...)

  481 root        764 S   SCREEN -DmS xnet -c /usr/local/xnet/conf/screen.xnet
  482 root       2716 S   /tmp/xnet/wrtxnet
  483 root        412 R   ps
root@OpenWrt:/#

Now stop running XNET and modify its 'AUTOEXEC.NET' so XNET can talk to the kernel:

root@OpenWrt:/# /etc/init.d/xnet stop
root@OpenWrt:/# vi /usr/local/xnet/conf/AUTOEXEC.NET

att sdev1 kiss 7 1 115200 /dev/pty/m0
my call d1mmy

root@OpenWrt:/#

Note: in this example, the kiss device is attached to XNET port 7 and linked to the master-pry-device '/dev/pty/m0'. XNET's AX25 call is 'd1mmy'. Only the very basic configuation of XNET is shown here, there are many more options that are of no importance here.

Now both restart and check for running XNET:

root@OpenWrt:/# /etc/init.d/xnet start
root@OpenWrt:/# ps | grep "wrtxnet"|head -c45
  482 root       2716 S   /tmp/xnet/wrtxnet
root@OpenWrt:/#

Next prepare the kernel for 'KISS':

root@OpenWrt:/# kissattach
usage: kissattach [-b] [-l] [-m mtu] [-v] tty port [inetaddr]

root@OpenWrt:/# kissattach /dev/pty/s0 ax0 x.x.x.x 
port ax0 bound to device ax0
root@OpenWrt:/#

Note: 'x.x.x.x' needs to match your local IP configuration. If you are unsure, use '192.168.255.200'

Finally, the AX25 configuration needs to be finalized:

 
root@OpenWrt:/#/sbin/ifconfig ax0 mtu 1500
root@OpenWrt:/#/bin/echo 1 >/proc/sys/net/ax25/ax0/ip_default_mode
root@OpenWrt:/#/bin/echo 7 >/proc/sys/net/ax25/ax0/standard_window_size
root@OpenWrt:/#/bin/echo 500 >/proc/sys/net/ax25/ax0/t1_timeout
root@OpenWrt:/#/bin/echo 90 >/proc/sys/net/ax25/ax0/t2_timeout
root@OpenWrt:/#/bin/echo 30000 >/proc/sys/net/ax25/ax0/t3_timeout
root@OpenWrt:/#/bin/echo 30 >/proc/sys/net/ax25/ax0/maximum_retry_count
root@OpenWrt:/#

Now check for running KISS communication from LINUX side:

root@OpenWrt:/# call -r ax0 d1mmy
GW4PTS AX.25 Connect v1.11
*** Connected to d1mmy
Rawmode
(X)NET/LINUX/MIPSel V1.39
=>q

73!
*** Cleared

root@OpenWrt:/#

Is AX25d running?

root@OpenWrt:/# ax25d -l
root@OpenWrt:/# ps |grep "ax25d"|head -c36
  432 root        344 S   ax25d -l
root@OpenWrt:/#

Now check for running KISS communication from XNET side (propper login procedure (axspawn, ruby, login) is being check as well):

root@OpenWrt:~/d0m...# call -r ax0 d1mmy
GW4PTS AX.25 Connect v1.11
*** Connected to d1mmy
Rawmode
(X)NET/LINUX/MIPSel V1.39
=>c d0mmy

link setup (7)...
*** connected to D0MMY
Notice: No .bcpasswd file found in your homedirectory (for more secure
        password authentication than plaintext). Generating example file,
        with unique passwords (which may be changed).
        Please edit ~/.bcpasswd, and enable your prefered authentication type;
        MD5 is recommended.


BusyBox v1.4.2 (2008-02-28 05:09:35 CET) Built-in shell (sh)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (7.09) -----------------------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
d0mmy@OpenWrt:/tmp/d0m.../d0mmy$

Note: the above message “No .bcpasswd file found (…)” appears the first time a user is logging into the system. This is normal. It won't show up the 2nd time. Axspawn creates the user during the initial login in '/etc/passwd' plus makes his/her home-directory in which two files are generated: '.bcpasswd' and '.profile':

d0mmy@OpenWrt:/tmp/d0m.../d0mmy$ ls -al

drwxr-x--x    2 d0mmy    guest          80 Jan  3 08:43 .
drwxr-xr-x    3 root     root           60 Jan  3 08:43 ..
-rw-------    1 d0mmy    guest         421 Jan  3 08:43 .bcpasswd
-rw-------    1 d0mmy    guest          38 Jan  3 08:43 .profile
d0mmy@OpenWrt:/tmp/d0m.../d0mmy$

AX25 Kernel link is up and running.

SLIP Configuration

Configuring SLIP starting with XNET. Add “start routed” (this is the ax25 router) && “start tcpd” (this is the tcp router) to AUTOEXEC.NET. When XNET restarts, it automatically executes IP.NET.

root@OpenWrt:/# /etc/init.d/xnet stop
root@OpenWrt:/# vi /usr/local/xnet/conf/AUTOEXEC.NET

my call d1mmy
att sdev1 kiss 7 1 115200 /dev/pty/m0

start routed
start tcpd

root@OpenWrt:/#

Then we add XNET's IP address (here: 44.0.0.3, please replace with your local IP addresses), attach slip device to pty m2 (this creates s2 to be used on the Linux side later), we tell XNET the Linux Kernel's IP address (here: 44.0.0.2) and then route traffic for 44.0.0.2 over the slip device.

root@OpenWrt:/# vi /usr/local/xnet/conf/IP.NET

myip 44.0.0.3
att sdeva slip 115200 /dev/pty/m2
arp add 44.0.0.2 slip sdeva
ipr add 44.0.0.2 slip

root@OpenWrt:/#

This IP.NET, of course, only shows the principal entries to get TCPIP and SLIP running. There are multiple additional TCP/IP options/functions that can be configured by the sysop. It is recommended to link your packet radio node to IGATE in order to benefit from improved world-wide IP-over-AX25 functionality. For more information click here http://db0fhn-i.ampr.org/doku.php?id=projects:igate:ipoverigate (in German language).

Next add a symlink for IP.NET to /tmp/xnet. Ideally, this is done through the init.d xnet script (/etc/init.d/xnet). Insert the symlink (ln -s …) after the “mkdir /tmp/xnet” command.

root@OpenWrt:/# vi /etc/init.d/xnet

start() {
(...)
mkdir /tmp/xnet
(...)
ln -s /usr/local/xnet/conf/IP.NET /tmp/xnet/IP.NET
(...)
}

Testing for presence of SDEVA SLIP device:

root@OpenWrt:/# /etc/init.d/xnet start
root@OpenWrt:/#
root@OpenWrt:/# call -r ax0 d1mmy
GW4PTS AX.25 Connect v1.11
*** Connected to d1mmy
Rawmode
(X)NET/LINUX/MIPSel V1.39
=>sys

=>att

SDEV1   : KISS Driver: 115200 Baud

SDEVA   : SLIP Driver: 115200 Baud
=>q

73!
*** Cleared
root@OpenWrt:/#

Now the Kernel needs to be setup so it can talk to XNET via /dev/pty/s2. Here's how it is done:

root@OpenWrt:/#
root@OpenWrt:/# slattach -p slip -s 115200 /dev/pty/s2 -d &
slattach: tty_open: trying to open /dev/pty/s2
slattach: tty_open: /dev/pty/s2 (fd=3) slattach: tty_set_speed: 115200
slattach: tty_set_databits: 8
slattach: tty_set_stopbits: 1
slattach: tty_set_parity: N
slip started on /dev/pty/s2 interface sl0

Assignment of IP address 44.0.0.2 to slip device 'sl0' with mtu of 1500 bytes:

root@OpenWrt:/# ifconfig sl0 44.0.0.2 mtu 1500

Route traffic for XNET ('44.0.0.3') via slip device:

root@OpenWrt:/# route add 44.0.0.3 sl0

And finally route all 44-traffic via XNET ('44.0.0.3') with netmask 255.0.0.0:

root@OpenWrt:/# route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.0.0.3

Testing Kernellink. We ping XNET from OPENWRT:

root@OpenWrt:~# ping 44.0.0.3
PING 44.0.0.3 (44.0.0.3): 56 data bytes
64 bytes from 44.0.0.3: icmp_seq=0 ttl=63 time=6.3 ms

--- 44.0.0.3 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 6.3/6.3/6.3 ms
root@OpenWrt:~#

Testing. We ping Openwrt from XNET:

root@OpenWrt:~# call -r ax0 d1mmy
GW4PTS AX.25 Connect v1.11
*** Connected to d1mmy
Rawmode
(X)NET/LINUX/MIPSel V1.39
=>ping 44.0.0.2

ping to 44.0.0.2 ...

=>
*** route: 44.0.0.2 echo reply 12 ms

=>q
*** Cleared
root@OpenWrt:~#

QUOD ERAT DEMONSTRANDUM.

Init-Skript

Last step: create bootable configuration:

root@OpenWrt:~# vi /etc/init.d/ax25slip
#!/bin/sh /etc/rc.common

START=81

start(){
         sleep 1s
         insmod slip.o
         sleep 1s
         slattach -p slip -s 115200 /dev/pty/s2 -d &
         ifconfig sl0 44.0.0.2 mtu 1500
         route add 44.0.0.3 sl0
         route add -net 44.0.0.0 netmask 255.0.0.0 gw 44.0.0.3
         kissattach /dev/pty/s0 ax0 192.168.255.2
         
         ifconfig ax0 mtu 1500
         echo 1 >/proc/sys/net/ax25/ax0/ip_default_mode
         echo 7 >/proc/sys/net/ax25/ax0/standard_window_size
         echo 500 >/proc/sys/net/ax25/ax0/t1_timeout
         echo 90 >/proc/sys/net/ax25/ax0/t2_timeout
         echo 30000 >/proc/sys/net/ax25/ax0/t3_timeout
         echo 30 >/proc/sys/net/ax25/ax0/maximum_retry_count

         ax25d
       }

stop (){
         killall ax25d
         killall kissattach
         killall slattach
        }

root@OpenWrt:~#
root@OpenWrt:~# ln -s /etc/init.d/ax25slip /etc/rc.d/S81ax25slip
root@OpenWrt:~# 
root@OpenWrt:~# reboot

After reboot from Universe:

root@OpenWrt:~# ps
  PID  Uid     VmSize Stat Command
    1 root        400 S   init
    2 root            SW  [keventd]
    3 root            RWN [ksoftirqd_CPU0]
    4 root            SW  [kswapd]
    5 root            SW  [bdflush]
    6 root            SW  [kupdated]
    8 root            SW  [mtdblockd]
   54 root            SWN [jffs2_gcd_mtd4]
   67 root        412 S   logger -s -p 6 -t
   69 root        404 S   init
   86 root        400 S   syslogd -C16
   89 root        376 S   klogd
  207 root        448 S   udhcpc -t 0 -i eth0.1 -b -p /var/run/eth0.1.pid -R
  373 root        376 S   crond -c /etc/crontabs
  377 root        416 S   /usr/sbin/dropbear -p 22
  385 root        392 S   httpd -p 80 -h /www -r OpenWrt
  396 root        764 S   SCREEN -DmS xnet -c /usr/local/xnet/conf/screen.xnet
  400 root       2848 S   /tmp/xnet/wrtxnet
  412 root        244 S   slattach -p slip -s 115200 /dev/pty/s2 -d
  422 root        312 S   kissattach /dev/pty/s0 ax0 192.168.255.2
  424 root        316 S   ax25d
  443 root        608 S   /usr/sbin/dropbear -p 22
  444 root        580 S   -ash
  451 root        412 R   ps

Update

These Files will not be changed on an update:

ax25-essentials:
/etc/ax25/ax25ipd.conf
/etc/ax25/ax25rtd.conf
/etc/ax25/ax25.profile
/etc/ax25/rxecho.conf
/etc/ax25/ax25d.conf
/etc/ax25/axspawn.conf
/etc/ax25/axports
ax25-helpers:
/etc/ax25/ax25mond.conf
/etc/ax25/rip98d.conf
/etc/ax25/ttylinkd.conf
projects/openwrt/soft/ax25.txt · Last modified: 2014/01/12 13:20 by jann