Article View: comp.os.linux.answers
Article #101Linux AX25 HOWTO (part 2/2)
From: Terry Dawson
Date: Wed, 04 Sep 1996 00:00
Date: Wed, 04 Sep 1996 00:00
599 lines
25978 bytes
25978 bytes
Archive-name: linux/howto/ax25/part2
Last-modified: 23 Jun 96
-----BEGIN PGP SIGNED MESSAGE-----
*** The `Linux AX25 HOWTO' is posted automatically by the
*** Linux HOWTO coordinator, Greg Hankins <gregh@sunsite.unc.edu>. Please
*** direct any comments or questions about this HOWTO to the author,
*** Terry Dawson <terry@perf.no.itg.telecom.com.au>.
- --- BEGIN Linux AX25 HOWTO part 2/2 ---
shell
this is the login shell of any new users.
associate
this flag indicates whether outgoing AX.25 connections made by
this user after they login will use their own callsign, or your
stations callsign.
14.5. Configuring the pms
The pms program is an implementation of a simple personal message
system. It was originally written by Alan Cox. Dave Brown, N2RJT,
<dcb@vectorbd.com> 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.
Configuring the pms program is still a little clumsy at the moment
because it is new but bare with it while Dave works on it. The only
difficult part is modifying the source code to support your local mail
delivery agent and whether you use the ttylinkd program or the talk-
ax25 program.
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.
14.5.1. Customising pms.c
If you take a look at the pms.c file in the ax25-utils package you
will see that there a few items that you can configure. Perhaps the
most important to configure is the one that allows you to specify what
local mail delivery agent you use. In most installations the deliver
program may well work, but in the minimal installation on my gateway
machine I needed to modify the line that previously said:
#define MAIL_DELIVERY_AGENT "deliver %s"
to:
#define MAIL_DELIVERY_AGENT "/bin/mail.local %s"
There is no easy way of knowing what local delivery agent your machine
is configured to use, so perhaps you could simply look for either of
these files in the obvious places and choose whichever seems to be
there.
I also have the ttylinkd program installed, so I needed to modify the
section relating to it. I keep my copy of the ttylinkd program in my
/usr/sbin directory, so I modified the line that previously said:
/* #define MY_TALK "/usr/local/sbin/ttylinkd" */
to:
#define MY_TALK "/usr/sbin/ttylinkd"
If you use the talk-ax25 program then you would remove the /* and */
from around that line instead.
There is one last definition that might be useful to you, and that is
if you have a default email gateway. This line is the line containing
the string MY_GATEWAY. If you have an email gateway that you use, then
you should remove the comments from this line and change the address
to that of your gateway.
14.5.2. Create the /usr/local/pms/motd file.
The /usr/local/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.
14.5.3. Create the /usr/local/pms/info file.
The /usr/local/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.
14.5.4. Associate AX.25 callsigns with system users.
When 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.
You make this association with the axparms command. An example looks
like:
# axparms -assoc vk2ktj terry
This command associates that AX.25 callsign vk2ktj with the user terry
on the machine, so any mail for vk2ktj on the pms will be sent to
terry.
Remember to put these associations into your rc file so that they are
available each time your reboot.
14.5.5. Add the PMS to the /usr/local/etc/ax25d.conf file.
Adding 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 NetRom 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:
default 1 10 5 100 5 0 root /usr/local/bin/pms pms -a -o vk2ktj
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.
14.5.6. Test the PMS.
To test the PMS, you can try the following command from the command
line:
# /usr/local/bin/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.
15. HOWTO link NOS and the Linux kernel networking software
Many 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.
15.1. Linking NOS and Linux using a pipe device
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: ptyp[1-f] and the slave end of the pipes are known
as: ttyp[1-f]. Remember they come in pairs, so if you select
/dev/ptypf as your master end then you must use /dev/ttypf 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:
# /sbin/slattach -s 38400 -p slip /dev/ptypf &
# /sbin/ifconfig sl0 broadcast 44.255.255.255 pointopoint 44.70.248.67 /
mtu 1536 44.70.4.88
# /sbin/route add 44.70.248.67 sl0
# /sbin/route add -net 44.0.0.0 gw 44.70.248.67
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:
# you can call the interface anything you want; I use "linux" for convenience.
attach asy ttypf - slip linux 1024 1024 38400
route addprivate 44.70.4.88 linux
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.
16. Some sample configurations.
Following 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.
16.1. Small Ethernet LAN with Linux as a router to Radio LAN
Many 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:
. . . . . .
--- .
| Network /---------\ . Network
| 44.136.8.96/29| | . 44.136.8/24 \ | /
| | Linux | . \|/
| | | . |
| eth0 | Router | . /-----\ /----------\ |
|---------------| |-----| TNC |----| Radio |---/
| 44.136.8.97 | and | . \-----/ \----------/
| | | sl0
| | Server | 44.136.8.5
| | | .
| | | .
| \_________/ .
--- . . . . . .
#!/bin/sh
# /etc/rc.net
# This configuration provides one KISS based AX.25 port and one
# Ethernet device.
echo "/etc/rc.net"
echo " Configuring:"
echo -n " loopback:"
/sbin/ifconfig lo 127.0.0.1
/sbin/route add 127.0.0.1
echo " done."
echo -n " ethernet:"
/sbin/ifconfig eth0 44.136.8.97 netmask 255.255.255.248 \
broadcast 44.136.8.103 up
/sbin/route add 44.136.8.97 eth0
/sbin/route add -net 44.136.8.96 netmask 255.255.255.248 eth0
echo " done."
echo -n " AX.25: "
axattach -i 44.136.8.5 -m 512 /dev/ttyS1 4800
ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.8.255
route add -host 44.136.8.5 sl0
route add -net 44.136.8.0 window 1024 sl0
echo -n " Netrom: "
nrattach -i 44.136.8.5 netrom
echo " Routing:"
/sbin/route add default gw 44.136.8.68 window 1024 sl0
echo " default route."
echo done.
# end
/usr/local/etc/axports
# name callsign speed paclen window description
4800 VK2KTJ-0 4800 256 2 144.800 MHz
/usr/local/etc/nrports
# name callsign alias paclen description
netrom VK2KTJ-1 LINUX 235 Linux Switch Port
/usr/local/etc/nrbroadcast
# ax25_name min_obs def_qual worst_qual verbose
4800 1 120 10 1
� You must have IP_FORWARDING enabled in your kernel.
� The AX.25 configuration files are pretty much those used as
examples in the earlier sections, refer to those where necessary.
� I've chosen to use an IP address for my radio port that is not
within my home network block. I needn't have done so, I could have
easily used 44.136.8.97 for that port too.
� 44.136.8.68 is my local IPIP encapsulated gateway and hence is
where I point my default route.
� Each of the machines on my Ethernet network have a route:
route add -net 44.0.0.0 gw 44.136.8.97 window 512 mss 512 eth0
The use of the mss and window parameters means that I can get optimum
performance from both local Ethernet and radio based connections.
� I also run my sendmail, http, ftp and other daemons on the router
machine so that it needs to be the only machine to provide others
with facilities.
� The router machine is a lowly 386DX20 with a 20Mb harddrive and a
very minimal linux configuration.
16.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.
. . . . . .
--- .
| Network /---------\ . Network
| 154.27.3/24 | | . 44.136.16/24 \ | /
| | Linux | . \|/
| | | . |
| eth0 | IPIP | . /-----\ /----------\ |
---|---------------| |-----| TNC |----| Radio |---/
| 154.27.3.20 | Gateway | . \-----/ \----------/
| | | sl0
| | | 44.136.16.1
| | | .
| | | .
| \_________/ .
--- . . . . . .
The configuration files of interest are:
# /etc/rc.net
# This file is a simple configuration that provides one KISS AX.25
# radio port, one Ethernet device, and utilises the kernel tunnel driver
# to perform the IPIP encapsulation/decapsulation
#
echo "/etc/rc.net"
echo " Configuring:"
#
echo -n " loopback:"
/sbin/ifconfig lo 127.0.0.1
/sbin/route add 127.0.0.1
echo " done."
#
echo -n " ethernet:"
/sbin/ifconfig eth0 154.27.3.20 netmask 255.255.255.0 \
broadcast 154.27.3.255 up
/sbin/route add 154.27.3.20 eth0
/sbin/route add -net 154.27.3.0 netmask 255.255.255.0 eth0
echo " done."
#
echo -n " AX.25: "
axattach -i 44.136.16.1 -m 512 /dev/ttyS1 4800
/sbin/ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.16.255
/sbin/route add -host 44.136.16.1 sl0
/sbin/route add -net 44.136.16.0 netmask 255.255.255.0 window 1024 sl0
#
echo -n " tunnel:"
/sbin/ifconfig tunl0 44.136.16.1 mtu 512 up
#
echo done.
#
echo -n "Routing ... "
source /etc/ipip.routes
echo done.
#
# end.
and:
# /etc/ipip.routes
# This file is generated using the munge script
#
/sbin/route add 44.134.8.0 netmask 255.255.255.0 tunl0 gw 134.43.26.1
/sbin/route add 44.34.9.0 netmask 255.255.255.0 tunl0 gw 174.84.6.17
/sbin/route add 44.13.28.0 netmask 255.255.255.0 tunl0 gw 212.37.126.3
...
...
...
/usr/local/etc/axports
# name callsign speed paclen window description
4800 VK2KTJ-0 4800 256 2 144.800 MHz
Some points to note here are:
� The new tunnel driver uses the gw field in the routing table in
place of the pointopoint parameter to specify the address of the
remote IPIP gateway. This is why it now supports multiple routes
per interface.
� You can configure two network devices with the same address. In
this example both the sl0 and the tunl0 devices have been
configured with the IP address of the radio port. This is done so
that the remote gateway sees the correct address from your gateway
in encapsulated datagrams sent to it.
� The route commands used to specify the encapsulated routes can be
automatically generated by a modified version of the munge script.
This is included below. The route commands would then be written to
a separate file and read in using the bash source /etc/ipip.routes
command (assuming you called the file with the routing commands
/etc/ipip.routes) as illustrated. The source file must be in the
NOS route command format.
� Note the use of the window argument on the route command. Setting
this parameter to an appropriate value improves the performance of
your radio link.
The new tunnel-munge script:
#!/bin/sh
#
# From: Ron Atkinson <n8fow@hamgate.cc.wayne.edu>
#
# This script is basically the 'munge' script written by Bdale N3EUA
# for the IPIP daemon and is modified by Ron Atkinson N8FOW. It's
# purpose is to convert a KA9Q NOS format gateways route file
# (usually called 'encap.txt') into a Linux routing table format
# for the IP tunnel driver.
#
# Usage: Gateway file on stdin, Linux route format file on stdout.
# eg. tunnel-munge < encap.txt > ampr-routes
#
# NOTE: Before you use this script be sure to check or change the
# following items:
#
# 1) Change the 'Local routes' and 'Misc user routes' sections
# to routes that apply to your own area (remove mine please!)
# 2) On the fgrep line be sure to change the IP address to YOUR
# gateway Internet address. Failure to do so will cause serious
# routing loops.
# 3) The default interface name is 'tunl0'. Make sure this is
# correct for your system.
echo "#"
echo "# IP tunnel route table built by $LOGNAME on `date`"
echo "# by tunnel-munge script v960307."
echo "#"
echo "# Local routes"
echo "route add -net 44.xxx.xxx.xxx netmask 255.mmm.mmm.mmm dev sl0"
echo "#"
echo "# Misc user routes"
echo "#"
echo "# remote routes"
fgrep encap | grep "^route" | grep -v " XXX.XXX.XXX.XXX" | \
awk '{
split($3, s, "/")
split(s[1], n,".")
if (n[1] == "") n[1]="0"
if (n[2] == "") n[2]="0"
if (n[3] == "") n[3]="0"
if (n[4] == "") n[4]="0"
if (s[2] == "1") mask="128.0.0.0"
else if (s[2] == "2") mask="192.0.0.0"
else if (s[2] == "3") mask="224.0.0.0"
else if (s[2] == "4") mask="240.0.0.0"
else if (s[2] == "5") mask="248.0.0.0"
else if (s[2] == "6") mask="252.0.0.0"
else if (s[2] == "7") mask="254.0.0.0"
else if (s[2] == "8") mask="255.0.0.0"
else if (s[2] == "9") mask="255.128.0.0"
else if (s[2] == "10") mask="255.192.0.0"
else if (s[2] == "11") mask="255.224.0.0"
else if (s[2] == "12") mask="255.240.0.0"
else if (s[2] == "13") mask="255.248.0.0"
else if (s[2] == "14") mask="255.252.0.0"
else if (s[2] == "15") mask="255.254.0.0"
else if (s[2] == "16") mask="255.255.0.0"
else if (s[2] == "17") mask="255.255.128.0"
else if (s[2] == "18") mask="255.255.192.0"
else if (s[2] == "19") mask="255.255.224.0"
else if (s[2] == "20") mask="255.255.240.0"
else if (s[2] == "21") mask="255.255.248.0"
else if (s[2] == "22") mask="255.255.252.0"
else if (s[2] == "23") mask="255.255.254.0"
else if (s[2] == "24") mask="255.255.255.0"
else if (s[2] == "25") mask="255.255.255.128"
else if (s[2] == "26") mask="255.255.255.192"
else if (s[2] == "27") mask="255.255.255.224"
else if (s[2] == "28") mask="255.255.255.240"
else if (s[2] == "29") mask="255.255.255.248"
else if (s[2] == "30") mask="255.255.255.252"
else if (s[2] == "31") mask="255.255.255.254"
else mask="255.255.255.255"
if (mask == "255.255.255.255")
printf "route add -host %s.%s.%s.%s gw %s dev tunl0\n"\
,n[1],n[2],n[3],n[4],$5
else
printf "route add -net %s.%s.%s.%s gw %s netmask %s dev tunl0\n"\
,n[1],n[2],n[3],n[4],$5,mask
}'
echo "#"
echo "# default the rest of amprnet via mirrorshades.ucsd.edu"
echo "route add -net 44.0.0.0 gw 128.54.16.18 netmask 255.0.0.0 dev tunl0"
echo "#"
echo "# the end"
17. Discussion relating to Amateur Radio and Linux.
There 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 HAMS list on vger.rutgers.edu. 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.rutgers.edu
with the line:
subscribe linux-hams
in the message body. The subject line is ignored.
To join the tcp-group send mail to:
listserver@ucsd.edu
with the line:
subscribe tcp-group
in the body of the text.
Note: Please remember that the tcp-group is primarily for discussion
of the use of advanced protocols, of which tcp/ip is one, in Amateur
Radio. Linux specific questions should not ordinarily go there.
18. Copyright.
The AX25-HOWTO, information on how to install and configure some of
the more important packages providing AX25 support for Linux.
Copyright (c) 1996 Terry Dawson.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the:
Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
USA.
- --- END Linux AX25 HOWTO part 2/2 ---
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: finger gregh@cc.gatech.edu for public key
iQCVAwUBMi4+SntNTo2suu5NAQGwdwP6A9P53kThKMYKAX3bEec9xt4//OrCfWKB
1ugJkAgZ2/ALFrcfiMoFDFy0qDh4xiSsSnQ2PS/bud/oxhP2KmhecW9fz/p+Z6Na
hxM2mv1KZpW7jhNsXsFa3q54dG9w0RKSPpQ+Noemzbwlk3hdDdKcpyZHnpMDMAte
sU0nv5Ybi3o=
=Fnpk
-----END PGP SIGNATURE-----
Technical Details
Message-ID:
<AX25-HOWTO.2-23459.841891416@cc.gatech.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<AX25-HOWTO.1-23459.841891416@cc.gatech.edu>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1038bf,891c642ea2de084c X-Google-Attributes: gid1038bf,public X-Google-Thread: 107ada,891c642ea2de084c X-Google-Attributes: gid107ada,public X-Google-Thread: f68a8,891c642ea2de084c X-Google-Attributes: gidf68a8,public From: Terry Dawson <terry@perf.no.itg.telecom.com.au> Subject: Linux AX25 HOWTO (part 2/2) Date: 1996/09/04 Message-ID: <AX25-HOWTO.2-23459.841891416@cc.gatech.edu> X-Deja-AN: 178585170 sender: gregh@cc.gatech.edu references: <AX25-HOWTO.1-23459.841891416@cc.gatech.edu> followup-to: poster summary: How to configure AX25 networking for Linux organization: Linux HOWTO Project keywords: Linux, Networking, Ham, amateur radio, AX25 newsgroups: comp.os.linux.answers,rec.radio.amateur.misc,aus.radio.amateur.digital nntp-posting-user: gregh