home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / DOC / HOWTO / AX25_HOW.GZ / AX25_HOW
Encoding:
Text File  |  1996-06-23  |  76.6 KB  |  2,075 lines

  1.   Linux AX25-HOWTO, Amateur Radio.
  2.   Terry Dawson, VK2KTJ, terry@perf.no.itg.telecom.com.au
  3.   v1.1, 14 June 1996
  4.  
  5.   The Linux Operating System is perhaps the only operating system in the
  6.   world that can boast native and standard support for the AX.25 packet
  7.   radio protocol utilised by Amateur Radio Operators worldwide. This
  8.   document aims to describe how to install and configure this support.
  9.  
  10.   1.  Introduction.
  11.  
  12.   This document was originally an appendix to the HAM-HOWTO, but grew
  13.   too large to be reasonably managed in that fashion. This document
  14.   describes how to install and configure the native AX.25 and NetRom
  15.   support for Linux. A few typical configurations are described that
  16.   could be used as models to work from.
  17.  
  18.   1.1.  Changes from the previous version
  19.  
  20.   Additions:
  21.           Baycom support - ye gads!
  22.  
  23.   Corrections/Updates:
  24.           Included SLIP support in kernel config - oops.
  25.           2.0.0 kernel and ax25-tools update.
  26.           Updated net-tools to 1.32-alpha version.
  27.           Removed Jonathons `special' net-tools.
  28.           A bit of shuffling about to make more sense.
  29.           Updated the example configurations.
  30.           A minor copyright ooops.
  31.  
  32.   1.2.  Other related documentation.
  33.  
  34.   There is a lot of related documentation. There are many documents that
  35.   relate to Linux networking in more general ways and I strongly
  36.   recommend you also read these as they will assist you in your efforts
  37.   and provide you with stronger insight into other possible
  38.   configurations.
  39.  
  40.   They are:
  41.  
  42.   The HAM-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/HAM-HOWTO.html>
  43.  
  44.   the Net-2-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/NET-2-HOWTO.html>
  45.  
  46.   the Ethernet-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Ethernet-
  47.   HOWTO.html>
  48.  
  49.   the IPX-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/IPX-HOWTO.html>
  50.  
  51.   and
  52.  
  53.   the Firewall-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Firewall-
  54.   HOWTO.html>
  55.  
  56.   2.  Where to obtain new versions of this document.
  57.  
  58.   The best place to obtain the latest version of this document is from a
  59.   Linux Documentation Project archive. The Linux Documentation Project
  60.   runs a Web Server and this document appears there as The AX25-HOWTO
  61.   <http://sunsite.unc.edu/mdw/HOWTO/AX25-HOWTO.html>. You can always
  62.   contact me, but I pass new versions of the document directly to the
  63.   LDP HOWTO coordinator, so if it isn't there then chances are I haven't
  64.   finished it.
  65.  
  66.   3.  Linux and the AX.25 and NetRom Packet Radio Protocols.
  67.  
  68.   The AX.25 protocol offers both connected and connectionless modes of
  69.   operation, and is used either by itself for point-point links, or to
  70.   carry other protocols such as TCP/IP and NetRom.
  71.  
  72.   It is similar to X.25 level 2 in structure, with some extensions to
  73.   make it more useful in the amateur radio environment.
  74.  
  75.   The NetRom protocol is an attempt at a full network protocol and uses
  76.   AX.25 at its lowest layer as a datalink protocol. It provides a
  77.   network layer that is an adapted form of AX.25.
  78.  
  79.   Alan Cox developed some early kernel based AX.25 software support for
  80.   Linux.  Jonathon Naylor <g4klx@g4klx.demon.co.uk> has taken up ongoing
  81.   development of the code, has added NetRom support and is now the
  82.   developer of the AX.25 related kernel code and utilities. DAMA support
  83.   was developed by Joerg, DL1BKE. Finally Baycom support was added by
  84.   Thomas Sailer, <sailer@ife.ee.ethz.ch>.
  85.  
  86.   The Linux code supports KISS based TNC's (Terminal Node Controllers),
  87.   the Ottawa PI card, the Gracilis PacketTwin card and other Z8530 SCC
  88.   based cards with the generic SCC driver and both the Parallel and
  89.   Serial port Baycom modems.
  90.  
  91.   The User programs contain a simple PMS (Personal Message System), a
  92.   beacon facility, a line mode connect program, `listen' an example of
  93.   how to capture all AX.25 frames at raw interface level and programs to
  94.   configure the NetRom protocol. Included also are an AX.25 server style
  95.   program to handle and despatch incoming AX.25 connections and a NetRom
  96.   daemon which does most of the hard work for NetRom support.
  97.  
  98.   4.  The AX.25/NetRom software components.
  99.  
  100.   The AX.25 software is comprised of three components, the kernel
  101.   source, the network configuration tools and the utility programs.
  102.  
  103.   The version 1.3.xx Linux kernels include the AX.25, NetRom, Z8530 SCC,
  104.   PI card and PacketTwin drivers by default. I recommend you obtain and
  105.   use the version 1.3.xx kernel source.
  106.  
  107.   These are three reasons I'm recommending you use the alpha version
  108.   software even though most everyone else will recommend you don't use
  109.   it:
  110.  
  111.   ╖  it makes the process of building and configuring the software a
  112.      whole lot simpler. There are no patches to apply it is a simple
  113.      matter of configuring and compiling a kernel with the appropriate
  114.      options enabled.
  115.  
  116.   ╖  it is the most recent software and is most likely to provide the
  117.      most satisfactory results.
  118.  
  119.   ╖  like all new software, it needs testing and bug reports. The more
  120.      people that take the software and attempt to use it in their own
  121.      configurations the more likely it will be that bugs are uncovered
  122.      and the easier it will be to get the software debugged. Join the
  123.      team, contribute bug reports and help everybody.
  124.   Be warned though, this software is alpha and may have problem that you
  125.   wouldn't otherwise encounter. Please take all the usual precautions
  126.   and be sure to keep a working kernel as backup when testing new
  127.   kernels. It is wise to test a new kernel by booting from it from
  128.   floppy before actually installing it with lilo, though I haven't
  129.   bothered for about 90 kernels revisions so I'm fairly confident you
  130.   can pretty safely run with alpha kernels.
  131.  
  132.   4.1.  Finding the kernel, tools and utility packages.
  133.  
  134.   4.1.1.  The kernel source:
  135.  
  136.   The kernel source can be found in its usual place at:
  137.  
  138.   ftp.funet.fi
  139.  
  140.        /pub/Linux/PEOPLE/Linus/v2.0/
  141.  
  142.   4.1.2.  The network tools:
  143.  
  144.   The latest alpha release of the standard Linux network tools support
  145.   AX.25 and NetRom and can be found at:
  146.  
  147.   ftp.inka.de
  148.  
  149.        /pub/comp/Linux/networking/net-tools/net-tools-1.32-alpha.tar.gz
  150.  
  151.   or:
  152.  
  153.   ftp.linux.org.uk
  154.  
  155.        /pub/linux/Networking/PROGRAMS/NetTools/net-tools-1.32-alpha.tar.gz
  156.  
  157.   The latest ipfwadm package can be found at:
  158.  
  159.   ftp.xos.nl
  160.  
  161.        /pub/linux/ipfwadm/
  162.  
  163.   4.1.3.  The AX25 utilities:
  164.  
  165.   The AX.25 utility programs can be found at:
  166.  
  167.   sunsite.unc.edu
  168.  
  169.   /pub/Linux/apps/ham/ax25-utils-2.0.0.tar.gz
  170.  
  171.   or:
  172.  
  173.   ftp.ucsd.edu
  174.  
  175.        /hamradio/packet/tcpip/incoming/ax25-utils-2.0.0.tar.gz
  176.  
  177.   5.  Installing the AX.25/NetRom software.
  178.  
  179.   To successfully install AX.25 support on your linux system you must
  180.   configure and install an appropriate kernel and then install the AX.25
  181.   utilities.
  182.  
  183.   5.1.  Compiling the kernel.
  184.  
  185.   If you are already familiar with the process of compiling the Linux
  186.   Kernel then you can skip this section, just be sure to select the
  187.   appropriate options when compiling the kernel. If you are not, then
  188.   read on.
  189.  
  190.   The normal place for the kernel source to be unpacked to is the
  191.   /usr/src directory into a subdirectory called linux.  To do this you
  192.   should be logged in as root and execute a series of commands similar
  193.   to the following:
  194.  
  195.        # mv linux linux.old
  196.        # cd /usr/src
  197.        # gzip -dc linux-2.0.0.tar.gz | tar xvofp -
  198.        # cd linux
  199.  
  200.   After you have unpacked the kernel source into place you need to run
  201.   the configuration script and choose the options that suit your
  202.   hardware configuration and the options that you wish built into your
  203.   kernel.  You do this by using the command:
  204.  
  205.        # make config
  206.  
  207.   You might also try:
  208.  
  209.        # make menuconfig
  210.  
  211.   if you prefer a full screen menu based method. I'm going to describe
  212.   the original method, but you use whichever you are most comfortable
  213.   with.
  214.  
  215.   In either case you will be offered a range of options at which you
  216.   must answer `Y' or `N'. (Note you may also answer `M' if you are using
  217.   modules.  For the sake of simplicity I will assume you are not, please
  218.   make appropriate modifications if you are).
  219.  
  220.   The options most relevant to an AX.25 configuration are:
  221.  
  222.   Networking support (CONFIG_NET) [Y/n/?]                             Y
  223.   Loopback device support (CONFIG_BLK_DEV_LOOP) [N/y/m/?]             Y
  224.   Network firewalls (CONFIG_FIREWALL) [N/y/?]
  225.   TCP/IP networking (CONFIG_INET) [Y/n/?]                             Y
  226.   IP: forwarding/gatewaying (CONFIG_IP_FORWARD) [N/y/?]
  227.   IP: firewalling (CONFIG_IP_FIREWALL) [N/y/?] (NEW)
  228.   IP: tunneling (CONFIG_NET_IPIP) [N/y/m/?] (NEW)
  229.   Amateur Radio AX.25 Level 2 (CONFIG_AX25) [N/y/?]                   Y
  230.   AX.25 over Ethernet (CONFIG_BPQETHER) [N/y/?] (NEW)
  231.   Amateur Radio NET/ROM (CONFIG_NETROM) [N/y/?] (NEW)
  232.   Kernel/User network link driver(ALPHA) (CONFIG_NETLINK) [N/y/?]
  233.   Network device support (CONFIG_NETDEVICES) [Y/n/?]                  Y
  234.   SLIP (serial line) support (CONFIG_SLIP) [N/y/m/?]                  Y
  235.   Radio network interfaces (CONFIG_NET_RADIO) [N/y/?]
  236.   BAYCOM ser12 and par96 kiss emulation driver for AX.25 (CONFIG_BAYCOM) [N/y/m/?]
  237.   Z8530 SCC kiss emulation driver for AX.25 (CONFIG_SCC) [N/y/m/?]
  238.   Other ISA cards (CONFIG_NET_ISA) [N/y/?]
  239.   Ottawa PI and PI/2 support (CONFIG_PI) [N/y/?] (NEW)
  240.   Gracilis PackeTwin support (CONFIG_PT) [N/y/?] (NEW)
  241.   Standard/generic serial support (CONFIG_SERIAL) [Y/n/?]
  242.  
  243.   The options I have flagged with a `Y' are those that you must must
  244.   answer `Y' to. The rest are dependent on what hardware you have and
  245.   what options you want to include. Some of these options are described
  246.   in more detail later on, so if you don't know what you want yet, then
  247.   read ahead and come back to this step later.
  248.  
  249.   After you have completed the kernel configuration you should be able
  250.   to cleanly compile your new kernel:
  251.  
  252.        # make dep
  253.        # make clean
  254.        # make zImage
  255.  
  256.   Make sure you move your arch/i386/boot/zImage file wherever you want
  257.   it and then run lilo to ensure that you actually boot from it.
  258.  
  259.   5.2.  The network configuration tools.
  260.  
  261.   After you have compiled the kernel you should compile the new network
  262.   configuration tools. These tools allow you to modify the configuration
  263.   of network devices and to add routes to the routing table.
  264.  
  265.   The new alpha release of the standard net-tools package includes
  266.   support for AX.25 and NetRom support. I've tested this and it seems to
  267.   work well for me.
  268.   5.2.1.  Building the standard net-tools release.
  269.  
  270.   Don't forget to read the Release file and follow any instructions
  271.   there. The steps I used to compile the tools were:
  272.  
  273.        # cd /usr/src
  274.        # tar xvfz net-tools-1.32-alpha.tar.gz
  275.        # cd net-tools-1.32-alpha
  276.        # make config
  277.  
  278.   At this stage you will be presented with a series of configuration
  279.   questions, similar to the kernel configuration questions. Be sure to
  280.   include support for all of the protocols and network devices types
  281.   that you intend to use. If you do not know how to answer a particular
  282.   question then answer `Y'.
  283.  
  284.   The tools compiled cleanly against a 2.0.0 kernel without error.
  285.  
  286.   When the compilation is complete, you should need only use the:
  287.  
  288.        # make install
  289.  
  290.   command to install the programs in their proper place.
  291.  
  292.   If you wish to use the IP firewall facilities then you will need the
  293.   latest firewall administration tool ipfwadm. This tool replaces the
  294.   older ipfw tool which will not work with new kernels.
  295.  
  296.   I compiled the ipfwadm utility with the following commands:
  297.  
  298.        # cd /usr/src
  299.        # tar xvfz ipfwadm-2.0beta2.tar.gz
  300.        # cd ipfwadm-2.0beta2
  301.        # make install
  302.        # cp ipfwadm.8 /usr/man/man8
  303.        # cp ipfw.4 /usr/man/man4
  304.  
  305.   5.3.  The AX.25 user programs.
  306.  
  307.   After you have successfully compiled and booted your new kernel, you
  308.   need to compile the user programs. To compile and install the user
  309.   programs you should use a series of commands similar to the following:
  310.  
  311.   # cd /usr/local
  312.   # gzip -dc ax25-utils-2.0.0.tar.gz | tar xvvof -
  313.   # cd ax25-utils-2.0
  314.   # make install
  315.  
  316.   The files will be installed under the /usr/local directory by default
  317.   in subdirectories: bin, sbin, etc and man.
  318.  
  319.   If you get messages something like:
  320.  
  321.   gcc -Wall -Wstrict-prototypes -O2 -I../lib -c call.c
  322.   call.c: In function `statline':
  323.   call.c:268: warning: implicit declaration of function `attron'
  324.   call.c:268: `A_REVERSE' undeclared (first use this function)
  325.   call.c:268: (Each undeclared identifier is reported only once
  326.   call.c:268: for each function it appears in.)
  327.  
  328.   then you should read the README.ncurses file in the top level
  329.   directory. You can do as Jonathon suggests, or you can try replacing:
  330.  
  331.   #include <curses.h>
  332.  
  333.   with:
  334.  
  335.   #include <ncurses/curses.h>
  336.  
  337.   in the:
  338.  
  339.   call/call.c
  340.   call/menu.c
  341.  
  342.   files.
  343.  
  344.   6.  Configuring a RAW AX.25 connected mode interface.
  345.  
  346.   The first stage to configuration of an AX.25 interface is to configure
  347.   it to work as a `vanilla' AX.25 interface with no TCP/IP. The
  348.   following configuration will get you to the point of being able to
  349.   make AX.25 calls from your Linux machine to other AX.25 nodes.
  350.  
  351.   The AX.25 software has been designed to work with a TNC in kiss mode
  352.   or with other cards such as the Ottawa PI2 card, PacketTwin and other
  353.   SCC cards via special drivers that emulate a kiss tnc.
  354.  
  355.   For real KISS TNC's there are two steps to complete in order to create
  356.   an AX.25 port ready to use to make outgoing calls. For other types of
  357.   hardware you need only complete the first step.
  358.  
  359.   6.1.  Creating the /usr/local/etc/axports file.
  360.  
  361.   The AX.25 ports have a configuration file that is read by many
  362.   programs that want to find information about an AX.25 port. This file
  363.   is called the:
  364.  
  365.   /usr/local/etc/axports
  366.  
  367.   file. The format of the file is as follows:
  368.  
  369.        portname  callsign  baudrate  paclen  window  description
  370.  
  371.   where:
  372.  
  373.      portname
  374.         is a text name that you will refer to the port by.
  375.  
  376.      callsign
  377.         is the AX.25 callsign you want to assign to the port.
  378.  
  379.      baudrate
  380.         is the speed at which you wish the port to communicate with your
  381.         TNC.
  382.  
  383.      paclen
  384.         is the maximum packet length you want to configure the port to
  385.         use for AX.25 connected mode connections.
  386.  
  387.      window
  388.         is the AX.25 window (K) parameter. This is the same as the
  389.         MAXFRAME setting of many tnc's.
  390.  
  391.      description
  392.         is a textual description of the port.
  393.  
  394.   In my case, mine looks like:
  395.  
  396.        radio    VK2KTJ-0        4800    256     2       144.800 MHz
  397.  
  398.   6.2.  Creating the AX.25 device
  399.  
  400.   If you are using an SCC card like the PI2 or PacketTwin then you do
  401.   not need to create the network device, as the kernel driver will
  402.   automatically do this for you. If you are using a KISS TNC then you
  403.   will need to create the AX.25 interface as it will not already exist.
  404.   Creating an AX.25 port is very similar to creating a slip device.
  405.  
  406.   You will need to have the TNC preconfigured and connected to your
  407.   serial port.  You can use a communications program like minicom or
  408.   seyon to configure the TNC into kiss mode if you wish.
  409.  
  410.   You use the axattach program in much the same way as you would use the
  411.   slattach program (refer to the NET-2-HOWTO for more information on
  412.   slattach and the other network software for Linux). For example:
  413.  
  414.   # /usr/local/sbin/axattach /dev/ttyS0 radio
  415.  
  416.   would configure your /dev/ttyS1 serial device to be a kiss interface
  417.   configured as per the details for the line beginning with the portname
  418.   "radio" in the /usr/local/etc/axports file.
  419.  
  420.   All this step has done is to actually activate the device in the
  421.   kernel, you need to run other programs before you an actually make use
  422.   of the port.
  423.  
  424.   6.2.1.  Setting the callsign for SCC cards.
  425.  
  426.   If you are using a PI or PacketTwin card then you should use the
  427.   axparms -setcall command to change the callsign of the appropriate
  428.   port to that which you intend to use. Refer to the PI/PacketTwin
  429.   section for the names of the network devices to use.
  430.  
  431.   6.2.2.  Testing the interface.
  432.  
  433.   You now should be able to make outgoing AX.25 connections. To test
  434.   AX.25 connected mode you could use the call program as demonstrated:
  435.  
  436.        /usr/local/bin/call radio VK2DAY via VK2SUT
  437.  
  438.   Note: you must tell call which AX.25 port you wish to make the call
  439.   on, as the same AX.25 node might be reachable on any of the ports you
  440.   have configured.
  441.  
  442.   The call program is a linemode terminal program for making AX.25
  443.   calls. It recognises lines that start with `~' as command lines.  The
  444.   `~.' command will close the connection.
  445.  
  446.   Please refer to the man pages in /usr/local/man and the README file in
  447.   ax25-utils-2.0.0 distribution for more information.
  448.  
  449.   7.  Configuring an AX.25 interface for tcp/ip.
  450.  
  451.   It is very simple to configure an AX.25 port to carry tcp/ip. Jonathon
  452.   has modified the axattach command so that you can include the IP
  453.   address that you want the interface to be configured with on the
  454.   command line. For example, to modify the example presented earlier, I
  455.   could use the command:
  456.  
  457.        # /usr/local/sbin/axattach -i 44.136.8.5 -m 512 /dev/ttyS0 radio
  458.        # /sbin/route add -net 44.136.8.0 sl0
  459.        # /sbin/route add default sl0
  460.  
  461.   to create the AX.25 interface with an IP address of 44.136.8.6 and an
  462.   MTU of 512 bytes. You should still use the ifconfig to configure the
  463.   other parameters if necessary.
  464.  
  465.   You do not need to do it this way, you can of course just use the
  466.   ifconfig program to configure the ip address and netmask details for
  467.   the port and add a route via the port, just as you would for any other
  468.   tcp/ip interface.
  469.  
  470.        # /sbin/ifconfig sl0 44.136.8.5
  471.        # /sbin/ifconfig sl0 netmask 255.255.255.0
  472.        # /sbin/ifconfig sl0 broadcast 44.136.8.255
  473.        # /sbin/ifconfig sl0 arp mtu 256 up
  474.        # /sbin/route add -net 44.136.8.0 sl0
  475.        # /sbin/route add default sl0
  476.  
  477.   The commands listed above are typical of the sort of configuration
  478.   many of you would be familiar with if you have used NOS or any of its
  479.   derivatives or any other tcp/ip software. Note that the default route
  480.   might not be required in your configuration if you have some other
  481.   network device configured.
  482.  
  483.   To test it out, try a ping or a telnet to a local host.
  484.  
  485.        # ping -i 5 44.136.8.58
  486.  
  487.   Note the use of the `-i 5' arguments to ping to tell it to send pings
  488.   every 5 seconds instead of its default of 1 second.
  489.  
  490.   8.  Configuring an AX.25 interface for NetRom.
  491.  
  492.   To configure NetRom on an AX.25 interface you must configure two
  493.   files.
  494.  
  495.   8.1.  Configuring /usr/local/etc/nrports
  496.  
  497.   The first is the /usr/local/etc/nrports file. This file describes the
  498.   NetRom port in much the same way as the /usr/local/etc/axports file
  499.   describes the AX.25 ports.
  500.  
  501.   This file is formatted as follows:
  502.  
  503.        name callsign  alias  paclen   description
  504.  
  505.   Where:
  506.  
  507.      name
  508.         is the text name that you wish to refer to the port by.
  509.  
  510.      callsign
  511.         is the callsign that the NetRom traffic from this port will use.
  512.      alias
  513.         is the NetRom alias this port will have assigned to it.
  514.  
  515.      paclen
  516.         is the maximum size of NetRom frames transmitted by this port.
  517.  
  518.      description
  519.         is a free text description of the port.
  520.  
  521.   An example would look something like the following:
  522.  
  523.        netrom  VK2KTJ-1        LINUX   235     Linux Switch Port
  524.  
  525.   Note that the ports are referred to by name by programs such as call.
  526.  
  527.   8.2.  Configuring /usr/local/etc/nrbroadcast
  528.  
  529.   The second file is the /usr/local/etc/nrbroadcast file.
  530.  
  531.   This file is formatted as follows:
  532.  
  533.        axport min_obs def_qual worst_qual verbose
  534.  
  535.   Where:
  536.  
  537.      axport
  538.         is the port name obtained from the /usr/local/etc/axports file.
  539.         If you do not have an entry in /usr/local/etc/nrbroadcasts for a
  540.         port then this means that no NetRom routing will occur and any
  541.         received NetRom broadcasts will be ignored for that port.
  542.  
  543.      min_obs
  544.         is the minimum obselesence value for the port.
  545.  
  546.      def_qual
  547.         is the default quality for the port.
  548.  
  549.      worst_qual
  550.         is the worst quality value for the port, any routes under this
  551.         quality will be ignored.
  552.  
  553.      verbose
  554.         is a flag determining whether full NetRom routing broadcasts
  555.         will occur from this port or only a routing broadcast
  556.         advertising the node itself.
  557.  
  558.   An example would look something like the following:
  559.  
  560.        radio    1       200      10         1
  561.  
  562.   8.3.  Creating the NetRom device
  563.  
  564.   When you have the two configuration files completed you must create
  565.   the NetRom device in much the same way as you did for the AX.25
  566.   devices.  This time you use the nrattach command:
  567.  
  568.        # nrattach netrom
  569.  
  570.   This command would start the NetRom device (nr0) named netrom
  571.   configured with the details specified in the /usr/local/etc/nrports
  572.   file.
  573.  
  574.   8.4.  Starting the NetRom daemon
  575.  
  576.   The NetRom daemon manages the NetRom routing tables and generates the
  577.   NetRom routing broadcasts. You start NetRom with the command:
  578.  
  579.        # /usr/local/sbin/netromd
  580.  
  581.   You should soon see the /proc/net/nr_neigh file filling up with
  582.   information about your NetRom neighbours.
  583.  
  584.   Remember to put the /usr/local/sbin/netromd command in your rc files
  585.   so that it is started automatically each time you reboot.
  586.  
  587.   9.  Configuring IP on a NetRom interface.
  588.  
  589.   Configuring a NetRom interface for tcp/ip is almost identical to
  590.   configuring an AX.25 interface for tcp/ip.
  591.  
  592.   Again you can either specify the ip address and mtu on the nrattach
  593.   command line, or use the ifconfig and route commands, but you need to
  594.   manually add arp entries for hosts you wish to route to because there
  595.   is no mechanism available for your machine to learn what NetRom
  596.   address it should use to reach a particular IP host.
  597.  
  598.   So, to create an nr0 device with an IP address of 44.136.8.5 and an
  599.   mtu of 512 and configured with the details from the
  600.   /usr/local/etc/nrports file for a NetRom port named netrom you would
  601.   use:
  602.  
  603.        # /usr/local/sbin/nrattach -i 44.136.8.5 -m 512 netrom
  604.        # route add 44.136.8.5 nr0
  605.  
  606.   or you could use something like the following commands manually:
  607.  
  608.   # ifconfig nr0 44.136.8.5 hw netrom VK2KTJ-1
  609.   # route add 44.136.8.5 nr0
  610.  
  611.   Then for each IP host you wish to reach via NetRom you need to set
  612.   route and arp entries. To reach a destination host with an IP address
  613.   of 44.136.80.4 at NetRom address BBS:VK3BBS via a NetRom neighbour
  614.   with callsign VK2SUT-0 you would use commands as follows:
  615.  
  616.        # route add 44.136.80.4 nr0
  617.        # arp -t netrom -s 44.136.80.4 vk2sut-0
  618.        # nrparms -nodes vk3bbs + BBS 120 6 sl0 vk2sut-0
  619.  
  620.   The `120' and `6' arguments to the nrparms command are the NetRom
  621.   quality and obsolescence count values for the route.
  622.  
  623.   10.  Configuring an Ethernet device for AX.25 ala BPQ
  624.  
  625.   Linux support BPQ Ethernet compatibility. This enables you to run the
  626.   AX.25 protocol over your Ethernet LAN and to interwork your linux
  627.   machine with other BPQ machines on the LAN.
  628.  
  629.   Configuration is quite straightforward. You firstly must have
  630.   configured a standard Ethernet device. This means you will have
  631.   compiled your kernel to support your Ethernet card, and executed
  632.   configuration commands similar to the following:
  633.  
  634.        # ifconfig eth0 44.136.8.5 netmask 255.255.255.248 up
  635.        # ifconfig eth0 broadcast 44.136.8.103
  636.        # route add -net 44.136.8.96 netmask 255.255.255.248 eth0
  637.  
  638.   To configure the BPQ support you need to associate an AX.25 callsign
  639.   with your Ethernet hardware address. You should use the following:
  640.  
  641.        # axparms -dev eth0 vk2ktj-9
  642.  
  643.   This says that AX.25 callsign vk2ktj-9 is associated with the eth0
  644.   device.
  645.  
  646.   BPQ Ethernet normally uses a multicast address. The Linux
  647.   implementation does not, and instead it uses the normal Ethernet
  648.   broadcast address. The NET.CFG file for the BPQ ODI driver should
  649.   therefore look similar to this:
  650.  
  651.   LINK SUPPORT
  652.  
  653.           MAX STACKS 1
  654.           MAX BOARDS 1
  655.  
  656.   LINK DRIVER E2000                    ; or other MLID to suit your card
  657.  
  658.           INT 10                       ;
  659.           PORT 300                     ; to suit your card
  660.  
  661.           FRAME ETHERNET_II
  662.  
  663.           PROTOCOL BPQ 8FF ETHERNET_II ; required for BPQ - can change PID
  664.  
  665.   BPQPARMS                             ; optional - only needed if you want
  666.                                        ; to override the default target addr
  667.  
  668.           ETH_ADDR  FF:FF:FF:FF:FF:FF  ; Target address
  669.  
  670.   11.  Ottawa PI/PI2 card driver and Gracilis PacketTwin driver.
  671.  
  672.   The Ottawa PI and the Gracilis PacketTwin are Z8530 SCC based card for
  673.   IBM PC type machines that are in common usage by Amateur Radio
  674.   operators worldwide.  The PI card supports a high speed half duplex
  675.   (single DMA channel) port, and a low speed (<9k6bps interrupt driven)
  676.   half duplex port. The PI2 is a new version of the card that supports
  677.   an on board radio modem and improved hardware design. The PacketTwin
  678.   card supports two high speed port and is capable of accepting on board
  679.   modems.
  680.  
  681.   The PI card driver was written by David Perry, <dp@hydra.carleton.edu>
  682.   The PacketTwin card driver was written by Craig Small VK2XLZ,
  683.   <csmall@triode.apana.org.au>.  Both drivers are a standard feature of
  684.   the 1.3.xx kernel.
  685.  
  686.   Please refer to the AX.25 section above for details on how to
  687.   configure the kernel to include the PI card or the PacketTwin card
  688.   drivers.
  689.  
  690.   Once you have the appropriate driver configured into your kernel then
  691.   you should reboot and when you do, you should see mention of the PI or
  692.   PacketTwin card driver in the messages that appear on the screen while
  693.   the kernel is booting. The drivers test each of the I/O port addresses
  694.   that the card might be configured for and reports any that it finds.
  695.   You should then look at the /proc/net/dev file and you should see
  696.   reference to devices called pi0a and pi0b or pt0a and pt0b for the PI
  697.   and PacketTwin cards respectively.
  698.  
  699.   If the devices don't appear then recheck that you have configured and
  700.   compiled your kernel correctly and that you are in fact actually
  701.   running your new kernel. If you still don't then this suggests that
  702.   your PI or PacketTwin card was not detected by the kernel while it
  703.   booted and may indicate that you have some sort of hardware
  704.   conflicting with your PI/PT card that prevented it being detected.
  705.  
  706.   If all of the above went as planned then you will need to configure
  707.   your PI/PT card with an AX.25 address and for IP. The configuration of
  708.   the PI/PT cards is virtually identical to that of any other IP
  709.   interface. Something like the following should work ok for you:
  710.  
  711.        # /usr/local/sbin/axparms -setcall pi0a VK2KTJ-2
  712.        # /sbin/ifconfig pi0a 44.136.8.5
  713.        # /sbin/ifconfig pi0a netmask 255.255.255.0
  714.        # /sbin/ifconfig pi0a broadcast 44.136.8.255
  715.        # /sbin/ifconfig pi0a arp mtu 256 up
  716.        # /sbin/route add -net 44.136.8.0 pi0a
  717.        # /sbin/route add default pi0a
  718.  
  719.   Note that pi0a refers to the `a' port on the first PI card found, and
  720.   that pi0b would therefore refer to the `b' port on the first PI card
  721.   found. pt0a would therefore be the first port on the first PacketTwin
  722.   card detected.
  723.  
  724.   Note also the use of the axparms -setcall command to set the AX.25
  725.   callsign of the port.
  726.  
  727.   As usual, when this has been done you can test the interface with the
  728.   ping or telnet command to ensure it is working.
  729.  
  730.   12.  Z8530 SCC Kiss Emulation
  731.  
  732.   Joerg Reuter, DL1BKE has developed generic support for Z8530 SCC based
  733.   cards.  His driver is configurable to support a range of different
  734.   types of cards and present an interface that looks like a KISS TNC so
  735.   you can treat it as though it were a KISS TNC.
  736.  
  737.   12.1.  Obtaining and building the configuration tool package.
  738.  
  739.   The kernel driver is included in the standard kernel distribution, but
  740.   there are a suite of configuration tools that you will need to obtain
  741.   as well.
  742.  
  743.   To compile the kernel support you must be sure to answer `Y' to:
  744.   `Z8530 SCC kiss emulation driver for AX.25' when asked during a kernel
  745.   `make config'.
  746.  
  747.   You can obtain the configuration tools package from:
  748.  
  749.   ftp.ucsd.edu
  750.  
  751.        /hamradio/packet/tcpip/incoming/z8530drv-2.0.dl1bke.real.tar.gz
  752.  
  753.   The following command were what I used to compile and install the
  754.   package for kernel version 1.3.93:
  755.  
  756.        # cd /usr/src
  757.        # gzip -dc z8530drv-2.0.dl1bke.real.tar.gz | tar xvpofz -
  758.        # cd z8530drv
  759.        # rm gencfg sccinit sccstat
  760.        # make dep
  761.        # make utils
  762.        # make install
  763.  
  764.   Note: I've not followed the instructions included because the version
  765.   of driver in the 2.0.0 kernel is actually newer than that included in
  766.   the package and the normal installation process would have overwritten
  767.   the new kernel source with the older version.
  768.  
  769.   After the above is complete you should have three new programs
  770.   installed in your /sbin directory: gencfg, sccinit and sccstat. It is
  771.   these programs that you will use to configure the driver for your
  772.   card.
  773.  
  774.   You will also have a group of new special device files created in your
  775.   /dev called scc0 .. scc7. These will be used later and will be the
  776.   `KISS' devices you will end up using.
  777.  
  778.   12.2.  Configuring the driver for your card.
  779.  
  780.   The z8530 SCC driver has been designed to be as flexible as possible
  781.   so as to support as many different types of cards as possible. With
  782.   this flexibility has come some cost in configuration.
  783.  
  784.   There is more comprehensive documentation in the package and you
  785.   should read this if you have any problems. You should particularly
  786.   look at doc/scc_eng.doc or doc/scc_ger.doc for more detailed
  787.   information. I've paraphrased the important details, but as a result
  788.   there is a lot of lower level detail that I have not included.
  789.  
  790.   The main configuration file is read by the sccinit program and is
  791.   called /etc/z8530drv.rc. This file is broken into two main stages:
  792.   Configuration of the hardware parameters and channel configuration.
  793.   After you have configured this file you need only add:
  794.  
  795.        # sccinit
  796.  
  797.   into the rc file that configures your network and the driver will be
  798.   initialised according to the contents of the configuration file. You
  799.   must do this before you attempt to use the driver.
  800.  
  801.   12.2.1.  Configuration of the hardware parameters.
  802.  
  803.   The first section is broken into stanzas, each stanza representing an
  804.   8530 chip. Each stanza is a list of keywords with arguments. You may
  805.   specify up to four SCC chips in this file by default. The #define
  806.   MAXSCC 4 in scc.c can be increased if you require support for more.
  807.  
  808.   The allowable keywords and arguments are:
  809.  
  810.      chip
  811.         the chip keyword is used to separate stanzas. It will take
  812.         anything as an argument. The arguments are not used.
  813.  
  814.      data_a
  815.         this keyword is used to specify the address of the data port for
  816.         the z8530 channel `A'. The argument is a hexadecimal number e.g.
  817.         0x300
  818.  
  819.      ctrl_a
  820.         this keyword is used to specify the address of the control port
  821.         for the z8530 channel `A'. The arguments is a hexadecimal number
  822.         e.g. 0x304
  823.  
  824.      data_b
  825.         this keyword is used to specify the address of the data port for
  826.         the z8530 channel `B'. The argument is a hexadecimal number e.g.
  827.         0x301
  828.  
  829.      ctrl_b
  830.         this keyword is used to specify the address of the control port
  831.         for the z8530 channel `B'. The arguments is a hexadecimal number
  832.         e.g. 0x305
  833.  
  834.      irq
  835.         this keyword is used to specify the IRQ used by the 8530 SCC
  836.         described in this stanza. The argument is an integer e.g. 5
  837.  
  838.      pclock
  839.         this keyword is used to specify the frequency of the clock at
  840.         the PCLK pin of the 8530. The argument is an integer frequency
  841.         in Hz which defaults to 4915200 if the keyword is not supplied.
  842.  
  843.      board
  844.         the type of board supporting this 8530 SCC. The argument is a
  845.         character string. The allowed values are:
  846.  
  847.         PA0HZP
  848.            the PA0HZP SCC Card
  849.  
  850.         EAGLE
  851.            the Eagle card
  852.  
  853.         PC100
  854.            the DRSI PC100 SCC card
  855.  
  856.         PRIMUS
  857.            the PRIMUS-PC (DG9BL) card
  858.  
  859.         BAYCOM
  860.            BayCom (U)SCC card
  861.  
  862.      escc
  863.         this keyword is optional and is used to enable support for the
  864.         Extended SCC chips (ESCC) such as the 8580, 85180, or the 85280.
  865.         The argument is a character string with allowed values of `yes'
  866.         or `no'. The default is `no'.
  867.  
  868.      vector
  869.         this keyword is optional and specifies the address of the vector
  870.         latch (also known as "intack port") for PA0HZP cards. There can
  871.         be only one vector latch for all chips. The default is 0.
  872.  
  873.      special
  874.         this keyword is optional and specifies the address of the
  875.         special function register on several cards. The default is 0.
  876.  
  877.      option
  878.         this keyword is optional and defaults to 0.
  879.  
  880.   Some example configurations for the more popular cards are as follows:
  881.  
  882.      BayCom USCC
  883.  
  884.      chip    1
  885.      data_a  0x300
  886.      ctrl_a  0x304
  887.      data_b  0x301
  888.      ctrl_b  0x305
  889.      irq     5
  890.      board   BAYCOM
  891.      #
  892.      # SCC chip 2
  893.      #
  894.      chip    2
  895.      data_a  0x302
  896.      ctrl_a  0x306
  897.      data_b  0x303
  898.      ctrl_b  0x307
  899.      board   BAYCOM
  900.  
  901.      PA0HZP SCC card
  902.  
  903.           chip 1
  904.           data_a 0x153
  905.           data_b 0x151
  906.           ctrl_a 0x152
  907.           ctrl_b 0x150
  908.           irq 9
  909.           pclock 4915200
  910.           board PA0HZP
  911.           vector 0x168
  912.           escc no
  913.           #
  914.           #
  915.           #
  916.           chip 2
  917.           data_a 0x157
  918.           data_b 0x155
  919.           ctrl_a 0x156
  920.           ctrl_b 0x154
  921.           irq 9
  922.           pclock 4915200
  923.           board PA0HZP
  924.           vector 0x168
  925.           escc no
  926.  
  927.      DRSI SCC card
  928.  
  929.           chip 1
  930.           data_a 0x303
  931.           data_b 0x301
  932.           ctrl_a 0x302
  933.           ctrl_b 0x300
  934.           irq 7
  935.           pclock 4915200
  936.           board DRSI
  937.           escc no
  938.  
  939.   If you already have a working configuration for your card under NOS,
  940.   then you can use the gencfg command to convert the PE1CHL NOS driver
  941.   commands into a form suitable for use in the z8530 driver
  942.   configuration file.
  943.  
  944.   To use gencfg you simply invoke it with the same parameters as you
  945.   used for the PE1CHL driver in NET/NOS. For example:
  946.  
  947.        # gencfg 2 0x150 4 2 0 1 0x168 9 4915200
  948.  
  949.   will generate a skeleton configuration for the OptoSCC card.
  950.  
  951.   12.2.2.  Channel Configuration
  952.  
  953.   The Channel Configuration section is where you specify all of the
  954.   other parameters associated with the port you are configuring. Again
  955.   this section is broken into stanzas. One stanza represents one logical
  956.   port, and therefore there would be two of these for each one of the
  957.   hardware parameters stanzas as each 8530 SCC supports two ports.
  958.  
  959.   These keywords and arguments are also written to the /etc/z8530drv.rc
  960.   file and must appear after the hardware parameters section.
  961.  
  962.   Sequence is very important in this section, but if you stick with the
  963.   suggested sequence it should work ok. The keywords and arguments are:
  964.  
  965.      device
  966.         this keyword must be the first line of a port definition and
  967.         specifies the name of the special device file that the rest of
  968.         the configuration applies to. e.g. /dev/scc0
  969.  
  970.      speed
  971.         this keyword specifies the speed in bits per second of the
  972.         interface. The argument is an integer: e.g. 1200
  973.  
  974.      clock
  975.         this keyword specifies where the clock for the data will be
  976.         sourced. Allowable values are:
  977.  
  978.         dpll
  979.            normal halfduplex operation
  980.  
  981.         external
  982.            MODEM supplies its own Rx/Tx clock
  983.  
  984.         divider
  985.            use fullduplex divider if installed.
  986.  
  987.      mode
  988.         this keyword specifies the data coding to be used. Allowable
  989.         arguments are: nrzi or nrz
  990.  
  991.      rxbuffers
  992.         this keyword specifies the number of receive buffers to allocate
  993.         memory for. The argument is an integer, e.g. 8.
  994.  
  995.      txbuffers
  996.         this keyword specifies the number of transmit buffers to
  997.         allocate memory for. The argument is an integer, e.g. 8.
  998.  
  999.      bufsize
  1000.         this keyword specifies the size of the receive and transmit
  1001.         buffers. The arguments is in bytes and represents the total
  1002.         length of the frame, so it must also take into account the AX.25
  1003.         headers and not just the length of the data field. This keyword
  1004.         is optional and default to 384
  1005.  
  1006.      txdelay
  1007.         the KISS transmit delay value, the argument is an integer in mS.
  1008.  
  1009.      persist
  1010.         the KISS persist value, the argument is an integer.
  1011.  
  1012.      slot
  1013.         the KISS slot time value, the argument is an integer in mS.
  1014.  
  1015.      tail
  1016.         the KISS transmit tail value, the argument is an integer in mS.
  1017.  
  1018.      fulldup
  1019.         the KISS full duplex flag, the argument is an integer.  1==Full
  1020.         Duplex, 0==Half Duplex.
  1021.  
  1022.      wait
  1023.         the KISS wait value, the argument is an integer in mS.
  1024.  
  1025.      min
  1026.         the KISS min value, the argument is an integer in S.
  1027.  
  1028.      maxkey
  1029.         the KISS maximum keyup time, the argument is an integer in S.
  1030.  
  1031.      idle
  1032.         the KISS idle timer value, the argument is an integer in S.
  1033.  
  1034.      maxdef
  1035.         the KISS maxdef value, the argument is an integer.
  1036.  
  1037.      group
  1038.         the KISS group value, the argument is an integer.
  1039.  
  1040.      txoff
  1041.         the KISS txoff value, the argument is an integer in mS.
  1042.  
  1043.      softdcd
  1044.         the KISS softdcd value, the argument is an integer.
  1045.  
  1046.      slip
  1047.         the KISS slip flag, the argument is an integer.
  1048.  
  1049.   12.3.  Using the driver.
  1050.  
  1051.   To use the driver you simply treat the /dev/scc* devices just as you
  1052.   would a serial tty device with a KISS TNC connected to it. For
  1053.   example, to configure Linux Kernel networking to use your SCC card you
  1054.   could use something like:
  1055.  
  1056.        # axattach -s 4800 /dev/scc0 VK2KTJ
  1057.  
  1058.   You can also use NOS to attach to it in precisely the same way. From
  1059.   JNOS for example you would use something like:
  1060.        attach asy scc0 0 ax25 scc0 256 256 4800
  1061.  
  1062.   12.4.  The sccstat and sccparam tools.
  1063.  
  1064.   To assist in the diagnosis of problems you can use the sccstat program
  1065.   to display the current configuration of an SCC device. To use it try:
  1066.  
  1067.        # sccstat /dev/scc0
  1068.  
  1069.   you will displayed a very large amount of information relating to the
  1070.   configuration and health of the /dev/scc0 SCC port.
  1071.  
  1072.   The sccparam command allows you to change or modify a configuration
  1073.   after you have booted. Its syntax is very similar to the NOS param
  1074.   command, so to set the txtail setting of a device to 100mS you would
  1075.   use:
  1076.  
  1077.        # sccparam /dev/scc0 txtail 0x8
  1078.  
  1079.   13.  Configuring an interface for a Baycom modem.
  1080.  
  1081.   Thomas Sailer, <sailer@ife.ee.ethz.ch>, despite the popularly held
  1082.   belief that it would not work very well, has developed Linux support
  1083.   for Baycom modems. His driver supports the Ser12 serial port, Par96
  1084.   and the enhanced Par97 parallel port modems.
  1085.  
  1086.   When the driver is running it follows the standard of looking like a
  1087.   KISS interface, so you treat it in much the same way as you would the
  1088.   PI card, PacketTwin or SCC driver ports.
  1089.  
  1090.   13.1.  Compiling the kernel
  1091.  
  1092.   The driver is only available as a module, so you must have compiled
  1093.   module support into your kernel, and also selected the appopriate
  1094.   options to support the Baycom driver during the make config stage when
  1095.   compiling your kernel.
  1096.  
  1097.   The relevant options that you must answer `Y' for are:
  1098.  
  1099.        Radio network interfaces (CONFIG_NET_RADIO) [N/y/?]
  1100.        BAYCOM ser12 and par96 kiss emulation driver for AX.25 (CONFIG_BAYCOM) [N/y/m/?]
  1101.  
  1102.   13.2.  Creating the /dev device files.
  1103.  
  1104.   The Baycom driver uses special device files in the /dev directory.
  1105.   You need to create these manually. The following commands should work
  1106.   ok for you:
  1107.  
  1108.        # mknod /dev/bc0 c 60 0
  1109.        # mknod /dev/bc1 c 60 1
  1110.        # mknod /dev/bc2 c 60 2
  1111.        # mknod /dev/bc3 c 60 3
  1112.  
  1113.   You will use these later.
  1114.  
  1115.   13.3.  Loading the module.
  1116.  
  1117.   When the kernel compilation is complete and you have installed the
  1118.   module baycom.o wherever you normally keep your modules
  1119.   (conventionally they are stored in /lib/modules/2.0.0/), you must
  1120.   start the module.  The module takes configuration paramters from the
  1121.   insmod command line, so you must start it manually from an rc file or
  1122.   if you use the kerneld program you must configure it with the relevant
  1123.   paramters so that it supplies them when it loads the module.
  1124.  
  1125.   If you use kerneld you will need to add the following line to your
  1126.   /etc/conf.modules file:
  1127.  
  1128.        alias char-major-60 baycom
  1129.  
  1130.   There are four main items to specify when loading the module, they
  1131.   are:
  1132.  
  1133.      modem
  1134.         the baycom modem type you are configuring it for.
  1135.  
  1136.         1. Ser12 type modem.
  1137.  
  1138.         2. Par96 or Par97 type modem.
  1139.  
  1140.      iobase
  1141.         the i/o address of the serial or parallel port you will use.
  1142.  
  1143.         0x3f8
  1144.            COM1:
  1145.  
  1146.         0x2f8
  1147.            COM2:
  1148.  
  1149.         0x378
  1150.            LPT1:
  1151.  
  1152.         0x278
  1153.            LPT2:
  1154.  
  1155.      irq
  1156.         the Interrupt Request (IRQ) line your port will use.
  1157.  
  1158.         4  COM1:
  1159.  
  1160.         3  COM2:
  1161.  
  1162.         7  LPT1:
  1163.  
  1164.         5  LPT2:
  1165.  
  1166.      options
  1167.         some baycom specific options.
  1168.  
  1169.         0  use hardware generated DCD signal.
  1170.  
  1171.         1  use software DCD signal.
  1172.  
  1173.   13.4.  A small trap to be aware of.
  1174.  
  1175.   Because the Baycom driver uses the serial and parallel ports of your
  1176.   machines, and because it is a low level driver for these, it competes
  1177.   with the existing serial and parallel drivers in the kernel. There are
  1178.   some ways of working around this problem. The first way is to make
  1179.   sure that you load the Baycom module first so that it takes the
  1180.   hardware it needs before the serial or parallel device driver modules
  1181.   load and search for their own. With the serial driver you have the
  1182.   luxury of being able to disable it for a single port using the
  1183.   setserial command, this will be demonstrated in the examples. If you
  1184.   are using the parallel port modems then beware of the lp.o Line
  1185.   Printer and plip.o Parallel Line IP modules.
  1186.  
  1187.   13.5.  Some example configurations.
  1188.  
  1189.   These examples are for the two most common configurations.
  1190.  
  1191.   Disable the serial driver for COM1: then configure the Baycom driver
  1192.   for a Ser12 serial port modem on COM1: with the software DCD option
  1193.   enabled:
  1194.  
  1195.        # setserial /dev/ttyS0 uart none
  1196.        # insmod baycom modem=1 iobase=0x3f8 irq=4 options=1
  1197.  
  1198.   Par96 parallel port type modem on LPT1: using hardware DCD detection:
  1199.  
  1200.        # insmod baycom modem=2 iobase=0x378 irq=7 options=0
  1201.  
  1202.   The first device created is /dev/bc0, the second is /dev/bc1 etc.
  1203.  
  1204.   13.6.  Configuring multiple devices.
  1205.  
  1206.   Using the insmod program and its command line arguments you can only
  1207.   configure one Baycom modem. There is a setbaycom utility which I have
  1208.   not yet located that will allow you to configure others. If you happen
  1209.   to find it please let me know where it is kept so that I can include
  1210.   details for it here.
  1211.  
  1212.   13.7.  Actually using the devices.
  1213.  
  1214.   This device driver when loaded looks like a serial tty driver with a
  1215.   KISS TNC attached. This means that configuration of the AX.25 software
  1216.   for this driver is identical to the configuration for a KISS TNC
  1217.   presented earlier.  You need to use the axattach program and add the
  1218.   port to your /usr/local/etc/axports file. The only difference is that
  1219.   you would use the device /dev/bc0 instead of /dev/ttyS0.
  1220.  
  1221.   14.  Configuring ax25d to accept incoming AX.25/Netrom connections.
  1222.  
  1223.   Linux is a powerful operating system and offers a great deal of
  1224.   flexibility in how it is configured. With this flexibility comes a
  1225.   cost in configuring it to do what you want. When configuring your
  1226.   Linux machine to accept incoming AX.25 or NetRom connections there are
  1227.   a number of questions you need to ask yourself. The most important of
  1228.   which is: "What do I want users to see when they connect?". As
  1229.   detailed in the HAM-HOWTO there are BBS systems that are being
  1230.   developed that you might want users to see when they connect,
  1231.   alternatively you might want to give users a login prompt so that they
  1232.   can make use of a shell account, or you might even have written your
  1233.   own program, such as a customised database or a game, that you want
  1234.   people to connect to.  Whatever you choose, you must tell the AX.25
  1235.   software about this so that it knows what software to run when it
  1236.   accepts an incoming AX.25 connection.
  1237.  
  1238.   14.1.  Creating the /usr/local/etc/ax25d.conf file.
  1239.  
  1240.   This file is the configuration file for the ax25d AX.25 daemon which
  1241.   handles incoming AX.25 and NetRom connections.
  1242.  
  1243.   The file is a little cryptic looking at first, but you'll soon
  1244.   discover it is very simple in practice, with a small trap for you to
  1245.   be wary of.
  1246.  
  1247.   The format of the ax25d.conf file is as follows:
  1248.  
  1249.        # This is a comment and is ignored by the ax25d program.
  1250.        [<interface_call>]
  1251.        <peer1>  window T1 T2 T3 N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  1252.        <peer2>  window T1 T2 T3 N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  1253.        defaults window T1 T2 T3 N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  1254.        <peer3>  window T1 T2 T3 N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  1255.        default  window T1 T2 T3 N2 <mode> <uid> <cmd> <cmd-name> <arguments>
  1256.  
  1257.   Where:
  1258.  
  1259.      #  at the start of a line marks a comment and is completely ignored
  1260.         by the ax25d program.
  1261.  
  1262.      <interface_call>
  1263.         is the AX.25 callsign of the AX.25 or NetRom interface that this
  1264.         particular paragraph is for.
  1265.  
  1266.      <peer>
  1267.         is the callsign of the peer node that this particular
  1268.         configuration applies to. If you don't specify an SSID here then
  1269.         any SSID will match.
  1270.  
  1271.      window
  1272.         is the AX.25 Window parameter (K) or MAXFRAME parameter for this
  1273.         configuration.
  1274.  
  1275.      T1 is the Frame retransmission (T1) timer in half second units.
  1276.  
  1277.      T2 is the amount of time the AX.25 software will wait for another
  1278.         incoming frame before preparing a response in 1 second units.
  1279.  
  1280.      T3 is the amount of time of inactivity before the AX.25 software
  1281.         will disconnect the session in 1 second units.
  1282.  
  1283.      N2 is the number of consecutive retransmissions that will occur
  1284.         before the connection is closed.
  1285.  
  1286.      <mode>
  1287.         provides a mechanism for determining certain types of general
  1288.         permissions. The modes are enabled or disabled by setting or
  1289.         resetting bits in an 8 bit map. You set that map by setting
  1290.         <mode> to the sum of the following values:
  1291.  
  1292.         1  Setup utmp, and run on a ptty (planned).
  1293.  
  1294.         2  UNUSED.
  1295.  
  1296.         4  UNUSED.
  1297.  
  1298.         8  UNUSED.
  1299.  
  1300.         16 UNUSED.
  1301.  
  1302.         32 UNUSED.
  1303.  
  1304.         64 Disallow digipeated uplinks, only allow direct connections.
  1305.  
  1306.         128
  1307.            Lockout, Barred, immediate disconnect.
  1308.  
  1309.      <uid>
  1310.         is the userid that the program to be run to support the
  1311.         connection should be run as.
  1312.  
  1313.      <cmd>
  1314.         is the full pathname of the command to be run, with no arguments
  1315.         specified.
  1316.  
  1317.      <cmd-name>
  1318.         is the text that should appear in a ps as the command name
  1319.         running (normally the same as <cmd> except without the directory
  1320.         path information.
  1321.  
  1322.      <arguments>
  1323.         are the command line argument to be passed to the <:cmd> when it
  1324.         is run. You pass useful information into these arguments by use
  1325.         of the following tokens:
  1326.  
  1327.         %U AX.25 callsign of the connected party without the SSID, in
  1328.            uppercase.
  1329.  
  1330.         %u AX.25 callsign of the connected party without the SSID, in
  1331.            lowercase.
  1332.  
  1333.         %S AX.25 callsign of the connected party with the SSID, in
  1334.            uppercase.
  1335.  
  1336.         %s AX.25 callsign of the connected party with the SSID, in
  1337.            lowercase.
  1338.  
  1339.   You need one section in the above format for each AX.25 or NetRom
  1340.   interface you want to accept incoming AX.25 or NetRom connections on.
  1341.  
  1342.   There are two special lines in the paragraph, one starts with the
  1343.   string `defaults' and other starts with the string `default' (yes
  1344.   there is a difference). These lines serve special functions.
  1345.  
  1346.   The `default' lines purpose should be obvious, this line acts as a
  1347.   catch-all, so that any incoming connection on the <interface_call>
  1348.   interface that doesn't have a specific rule will match the `default'
  1349.   rule. If you don't have a `default' rule, then any connections not
  1350.   matching any specific rule will be disconnected immediately without
  1351.   notice.
  1352.  
  1353.   The `defaults' line is a little more subtle, and here is the trap I
  1354.   mentioned earlier. In any of the fields for any definition for a peer
  1355.   you can use the `*' character to say `use the default value'. The
  1356.   `default' line is what sets those default values. The kernel software
  1357.   itself has some defaults which will be used if you don't specify any.
  1358.   The trap is that the these defaults apply only to those rules below
  1359.   the `default' line not to those above. You may have more than one
  1360.   `default' rule per interface definition, and in this way you may
  1361.   create groups of default configurations.
  1362.  
  1363.   14.2.  A simple example ax25d.conf file.
  1364.  
  1365.   Ok, an illustrative example:
  1366.  
  1367.        # ax25d.conf for VK2KTJ - 21/11/95
  1368.        # This configuration uses the AX.25 port defined earlier.
  1369.        [VK2KTJ-1]
  1370.        NOCALL     *     *  *  *  *   0    guest /usr/games/fortune
  1371.        defaults   1    10  *  *  *   0    root  /usr/local/sbin/axspawn axspawn %u +
  1372.        VK2XLZ-1   *     *  *  *  *   *      *     *         *
  1373.        VK2DAY-1   *     *  *  *  *   *      *     *         *
  1374.        default    1    10  5 100 5   0    root  /usr/local/bin/pms pms -a -o vk2ktj
  1375.        #
  1376.  
  1377.   This example says that anybody connecting to the interface on my
  1378.   machine with the callsign VK2KTJ-1 will have the following rules
  1379.   applied:
  1380.  
  1381.   Anyone whose callsign is set to `NOCALL' should use the kernel default
  1382.   parameters and have the fortune program run as guest for them.
  1383.  
  1384.   The defaults line changes two parameters from the kernel defaults
  1385.   (Window and T1) and will run the /usr/local/sbin/axspawn program for
  1386.   them. Any copies of /usr/local/sbin/axspawn run this way will appear
  1387.   as axspawn in a ps listing for convenience. The next two lines
  1388.   definitions for two stations who will receive those permissions.
  1389.  
  1390.   The last line in the paragraph is the `catch all' definition that
  1391.   everybody else will get (including VK2XLZ and VK2DAY using any other
  1392.   SSID other than -1).  This definition sets all of the parameters
  1393.   implicitly and will cause the pms program to be run with a command
  1394.   line argument indicating that it is being run for an AX.25 connection
  1395.   (assuming VK2KTJ-1 to be an AX.25 interface) and that the owner
  1396.   callsign is VK2KTJ. (See the `Configuring the PMS' section below for
  1397.   more details).
  1398.  
  1399.   If you wanted to define rules for another interface, a NetRom
  1400.   interface for example, then you would add another paragraph coded in
  1401.   the same way with rules and callsign appropriate to it.
  1402.  
  1403.   This example is a contrived one but I think it illustrates clearly the
  1404.   important features of the syntax of the configuration file. Jonathon
  1405.   includes a much longer and more detailed example in the ax25-utils
  1406.   package that you should look at if you need more information.
  1407.  
  1408.   14.3.  Starting ax25d
  1409.  
  1410.   When you have the two configuration files completed you start ax25d
  1411.   with the command:
  1412.  
  1413.        # /usr/local/sbin/ax25d
  1414.  
  1415.   When this is run people should be able to make AX.25 connections to
  1416.   your Linux machine. Remember to put the ax25d command in your rc files
  1417.   so that it is started automatically when you reboot each time.
  1418.  
  1419.   14.4.  Configuring axspawn.
  1420.  
  1421.   The axspawn program is a simple program that allows AX.25 stations who
  1422.   connect to be log in to your machine. It is invoked from the ax25d
  1423.   program as described above. To allow a user to log in to your machine
  1424.   you should add a line similar to the following into your
  1425.   /usr/local/etc/ax25d.conf file:
  1426.  
  1427.        default * * * * * 1 root /usr/local/sbin/axspawn axspawn %u
  1428.  
  1429.   If the line ends in the + character then the connecting user must hit
  1430.   return before they will be allowed to login. The default is to not
  1431.   wait.  Any individual host configurations that follow this line will
  1432.   have the axspawn program run when they connect. When axspawn is run it
  1433.   first checks that the command line argument it is supplied is a legal
  1434.   callsign, strips the SSID, then it checks that /etc/passwd file to see
  1435.   if that user has an account configured. If there is an account, and
  1436.   the password is either "" (null) or + then the user is logged in, if
  1437.   there is anything in the password field the user is prompted to enter
  1438.   a password. If there is not an existing account in the /etc/passwd
  1439.   file then axspawn may be configured to automatically create one.
  1440.  
  1441.   14.4.1.  Creating the /usr/local/etc/axspawn.conf file.
  1442.  
  1443.   You can alter the behaviour of axspawn in various ways by use of the
  1444.   /usr/local/etc/axspawn.conf file. This file is formatted as follows:
  1445.  
  1446.   # /usr/local/etc/axspawn.conf
  1447.   #
  1448.   # allow automatic creation of user accounts
  1449.   create    yes
  1450.   #
  1451.   # guest user if above is 'no' or everything else fails. Disable with "no"
  1452.   guest     no
  1453.   #
  1454.   # group id or name for autoaccount
  1455.   group     ax25
  1456.   #
  1457.   # first user id to use
  1458.   first_uid 2001
  1459.   #
  1460.   # maximum user id
  1461.   max_uid   3000
  1462.   #
  1463.   # where to add the home directory for the new users
  1464.   home      /home/ax25
  1465.   #
  1466.   # user shell
  1467.   shell     /bin/bash
  1468.   #
  1469.   # bind user id to callsign for outgoing connects.
  1470.   associate yes
  1471.  
  1472.   The eight configurable characteristics of axspawn are as follows:
  1473.  
  1474.      #  indicates a comment.
  1475.  
  1476.      create
  1477.         if this field is set to yes then axspawn will attempt to
  1478.         automatically create a user account for any user who connects
  1479.         and does not already have an entry in the /etc/passwd file.
  1480.  
  1481.      guest
  1482.         this field names the login name of the account that will be used
  1483.         for people who connect who do not already have accounts if
  1484.         create is set to no. This is usually ax25 or guest.
  1485.  
  1486.      group
  1487.         this field names the group name that will be used for any users
  1488.         who connect and do not already have an entry in the /etc/passwd
  1489.         file.
  1490.  
  1491.      first_uid
  1492.         this is the number of the first userid that will be
  1493.         automatically created for new users.
  1494.  
  1495.      max_uid
  1496.         this is the maximum number that will be used for the userid of
  1497.         new users.
  1498.  
  1499.      home
  1500.         this is the home (login) directory of new users.
  1501.  
  1502.      shell
  1503.         this is the login shell of any new users.
  1504.  
  1505.      associate
  1506.         this flag indicates whether outgoing AX.25 connections made by
  1507.         this user after they login will use their own callsign, or your
  1508.         stations callsign.
  1509.  
  1510.   14.5.  Configuring the pms
  1511.  
  1512.   The pms program is an implementation of a simple personal message
  1513.   system. It was originally written by Alan Cox. Dave Brown, N2RJT,
  1514.   <dcb@vectorbd.com> has taken on further development of it.  At present
  1515.   it is still very simple, supporting only the ability to send mail to
  1516.   the owner of the system and to obtain some limited system information
  1517.   but Dave is working to expand its capability to make it more useful.
  1518.  
  1519.   Configuring the pms program is still a little clumsy at the moment
  1520.   because it is new but bare with it while Dave works on it. The only
  1521.   difficult part is modifying the source code to support your local mail
  1522.   delivery agent and whether you use the ttylinkd program or the talk-
  1523.   ax25 program.
  1524.  
  1525.   After that is done there are a couple of simple files that you should
  1526.   create that give users some information about the system and then you
  1527.   need to add appropriate entries into the ax25d.conf file so that
  1528.   connected users are presented with the PMS.
  1529.  
  1530.   14.5.1.  Customising pms.c
  1531.  
  1532.   If you take a look at the pms.c file in the ax25-utils package you
  1533.   will see that there a few items that you can configure.  Perhaps the
  1534.   most important to configure is the one that allows you to specify what
  1535.   local mail delivery agent you use. In most installations the deliver
  1536.   program may well work, but in the minimal installation on my gateway
  1537.   machine I needed to modify the line that previously said:
  1538.  
  1539.   #define MAIL_DELIVERY_AGENT     "deliver %s"
  1540.  
  1541.   to:
  1542.  
  1543.   #define MAIL_DELIVERY_AGENT     "/bin/mail.local %s"
  1544.  
  1545.   There is no easy way of knowing what local delivery agent your machine
  1546.   is configured to use, so perhaps you could simply look for either of
  1547.   these files in the obvious places and choose whichever seems to be
  1548.   there.
  1549.  
  1550.   I also have the ttylinkd program installed, so I needed to modify the
  1551.   section relating to it. I keep my copy of the ttylinkd program in my
  1552.   /usr/sbin directory, so I modified the line that previously said:
  1553.  
  1554.   /* #define MY_TALK              "/usr/local/sbin/ttylinkd" */
  1555.  
  1556.   to:
  1557.  
  1558.   #define MY_TALK              "/usr/sbin/ttylinkd"
  1559.  
  1560.   If you use the talk-ax25 program then you would remove the /* and */
  1561.   from around that line instead.
  1562.  
  1563.   There is one last definition that might be useful to you, and that is
  1564.   if you have a default email gateway. This line is the line containing
  1565.   the string MY_GATEWAY. If you have an email gateway that you use, then
  1566.   you should remove the comments from this line and change the address
  1567.   to that of your gateway.
  1568.  
  1569.   14.5.2.  Create the /usr/local/pms/motd file.
  1570.  
  1571.   The /usr/local/pms/motd file contains the `message of the day' that
  1572.   users will be presented with after they connect and receive the usual
  1573.   BBS id header. The file is a simple text file, any text you include in
  1574.   this file will be sent to users.
  1575.  
  1576.   14.5.3.  Create the /usr/local/pms/info file.
  1577.  
  1578.   The /usr/local/pms/info file is also a simple text file in which you
  1579.   would put more detailed information about your station or
  1580.   configuration.  This file is presented to users in response to their
  1581.   issuing of the Info command from the PMS> prompt.
  1582.  
  1583.   14.5.4.  Associate AX.25 callsigns with system users.
  1584.  
  1585.   When a connected user sends mail to an AX.25 callsign, the pms expects
  1586.   that callsign to be mapped, or associated with a real system user on
  1587.   your machine.
  1588.  
  1589.   You make this association with the axparms command. An example looks
  1590.   like:
  1591.  
  1592.        # axparms -assoc vk2ktj terry
  1593.  
  1594.   This command associates that AX.25 callsign vk2ktj with the user terry
  1595.   on the machine, so any mail for vk2ktj on the pms will be sent to
  1596.   terry.
  1597.  
  1598.   Remember to put these associations into your rc file so that they are
  1599.   available each time your reboot.
  1600.  
  1601.   14.5.5.  Add the PMS to the /usr/local/etc/ax25d.conf file.
  1602.  
  1603.   Adding the pms to your ax25d.conf file is very simple.  There is one
  1604.   small thing you need to think about though. Dave has added command
  1605.   line arguments to the PMS to allow it to handle a number of different
  1606.   text end-of-line conventions. AX.25 and NetRom by convention expect
  1607.   the end-of-line to be carriage return, linefeed while the standard
  1608.   unix end-of-line is just newline. So, for example, if you wanted to
  1609.   add an entry that meant that the default action for a connection
  1610.   received on an AX.25 port is to start the PMS then you would add a
  1611.   line that looked something like:
  1612.  
  1613.        default  1  10 5 100 5   0    root  /usr/local/bin/pms pms -a -o vk2ktj
  1614.  
  1615.   This simply runs the pms program, telling it that it is an AX.25
  1616.   connection it is connected to and that the PMS owner is vk2ktj.  Check
  1617.   the man page for what you should specify for other connection methods.
  1618.   14.5.6.  Test the PMS.
  1619.  
  1620.   To test the PMS, you can try the following command from the command
  1621.   line:
  1622.  
  1623.   # /usr/local/bin/pms -u vk2ktj -o vk2ktj
  1624.  
  1625.   Substitute your own callsign for mine and this will run the pms,
  1626.   telling it that it is to use the unix end-of-line convention, and that
  1627.   user logging in is vk2ktj. You can do all the things connected users
  1628.   can.
  1629.  
  1630.   Additionally you might try getting some other node to connect to you
  1631.   to confirm that your ax25d.conf configuration works.
  1632.  
  1633.   15.  HOWTO link NOS and the Linux kernel networking software
  1634.  
  1635.   Many people like to run some version of NOS under Linux because it has
  1636.   all of the features and facilities they are used to. Most of those
  1637.   people would also like to have the NOS running on their machine
  1638.   capable of talking to the Linux kernel so that they can offer some of
  1639.   the linux capabilities to radio users.
  1640.  
  1641.   15.1.  Linking NOS and Linux using a pipe device
  1642.  
  1643.   Brandon S. Allbery, KF8NH, contributed the following information to
  1644.   explain how to interconnect the NOS running on a Linux machine with
  1645.   the kernel code using the Linux pipe device.
  1646.  
  1647.   Since both Linux and NOS support the slip protocol it is possible to
  1648.   link the two together by creating a slip link. You could do this by
  1649.   using two serial ports with a loopback cable between them, but this
  1650.   would be slow and costly. Linux provides a feature that many other
  1651.   Unix-like operating systems provide called `pipes'. These are special
  1652.   pseudo devices that look like a standard tty device to software but in
  1653.   fact loopback to another pipe device. To use these pipes the first
  1654.   program must open the master end of the pipe, and the open then the
  1655.   second program can open the slave end of the pipe. When both ends are
  1656.   open the programs can communicate with each other simply by writing
  1657.   characters to the pipes in the way they would if they were terminal
  1658.   devices.
  1659.  
  1660.   To use this feature to connect the Linux Kernel and a copy of NOS, or
  1661.   some other program you first must choose a pipe device to use. You can
  1662.   find one by looking in your /dev directory. The master end of the
  1663.   pipes are named: ptyp[1-f] and the slave end of the pipes are known
  1664.   as: ttyp[1-f]. Remember they come in pairs, so if you select
  1665.   /dev/ptypf as your master end then you must use /dev/ttypf as the
  1666.   slave end.
  1667.  
  1668.   Once you have chosen a pipe device pair to use you should allocate the
  1669.   master end to you linux kernel and the slave end to the NOS program,
  1670.   as the Linux kernel starts first and the master end of the pipe must
  1671.   be opened first.  You must also remember that your Linux kernel must
  1672.   have a different IP address to your NOS, so you will need to allocate
  1673.   a unique address for it if you haven't already.
  1674.  
  1675.   You configure the pipe just as if it were a serial device, so to
  1676.   create the slip link from your linux kernel you can use commands
  1677.   similar to the following:
  1678.  
  1679.   # /sbin/slattach -s 38400 -p slip /dev/ptypf &
  1680.   # /sbin/ifconfig sl0 broadcast 44.255.255.255 pointopoint 44.70.248.67 /
  1681.           mtu 1536 44.70.4.88
  1682.   # /sbin/route add 44.70.248.67 sl0
  1683.   # /sbin/route add -net 44.0.0.0 gw 44.70.248.67
  1684.  
  1685.   In this example the Linux kernel has been given IP address 44.70.4.88
  1686.   and the NOS program is using IP address 44.70.248.67. The route
  1687.   command in the last line simply tells your linux kernel to route all
  1688.   datagrams for the amprnet via the slip link created by the slattach
  1689.   command. Normally you would put these commands into your
  1690.   /etc/rc.d/rc.inet2 file after all your other network configuration is
  1691.   complete so that the slip link is created automatically when you
  1692.   reboot.  Note: there is no advantage in using cslip instead of slip as
  1693.   it actually reduces performance because the link is only a virtual one
  1694.   and occurs fast enough that having to compress the headers first takes
  1695.   longer than transmitting the uncompressed datagram.
  1696.  
  1697.   To configure the NOS end of the link you could try the following:
  1698.  
  1699.        # you can call the interface anything you want; I use "linux" for convenience.
  1700.        attach asy ttypf - slip linux 1024 1024 38400
  1701.        route addprivate 44.70.4.88 linux
  1702.  
  1703.   These commands will create a slip port named `linux' via the slave end
  1704.   of the pipe device pair to your linux kernel, and a route to it to
  1705.   make it work. When you have started NOS you should be able to ping and
  1706.   telnet to your NOS from your Linux machine and vice versa. If not,
  1707.   double check that you have made no mistakes especially that you have
  1708.   the addresses configured properly and have the pipe devices around the
  1709.   right way.
  1710.  
  1711.   16.  Some sample configurations.
  1712.  
  1713.   Following are examples of the most common types of configurations.
  1714.   These are guides only as there are as many ways of configuring your
  1715.   network as there are networks to configure, but they may give you a
  1716.   start.
  1717.  
  1718.   16.1.  Small Ethernet LAN with Linux as a router to Radio LAN
  1719.  
  1720.   Many of you may have small local area networks at home and want to
  1721.   connect the machines on that network to your local radio LAN. This is
  1722.   the type of configuration I use at home. I arranged to have a suitable
  1723.   block of addresses allocated to me that I could capture in a single
  1724.   route for convenience and I use these on my Ethernet LAN. Your local
  1725.   IP coordinator will assist you in doing this if you want to try it as
  1726.   well. The addresses for the Ethernet LAN form a subset of the radio
  1727.   LAN addresses. The following configuration is the actual one for my
  1728.   linux router on my network at home:
  1729.  
  1730.                                             .      .   .    .    . .
  1731.     ---                                .
  1732.      | Network       /---------\     .    Network
  1733.      | 44.136.8.96/29|         |    .     44.136.8/24        \ | /
  1734.      |               | Linux   |   .                          \|/
  1735.      |               |         |  .                            |
  1736.      |          eth0 | Router  |  .  /-----\    /----------\   |
  1737.      |---------------|         |-----| TNC |----| Radio    |---/
  1738.      |   44.136.8.97 |  and    |  .  \-----/    \----------/
  1739.      |               |         | sl0
  1740.      |               | Server  | 44.136.8.5
  1741.      |               |         |    .
  1742.      |               |         |     .
  1743.      |               \_________/       .
  1744.     ---                                     .      .   .    .    . .
  1745.  
  1746.        #!/bin/sh
  1747.        # /etc/rc.net
  1748.        # This configuration provides one KISS based AX.25 port and one
  1749.        # Ethernet device.
  1750.  
  1751.        echo "/etc/rc.net"
  1752.        echo "  Configuring:"
  1753.  
  1754.        echo -n "    loopback:"
  1755.        /sbin/ifconfig lo 127.0.0.1
  1756.        /sbin/route add 127.0.0.1
  1757.        echo " done."
  1758.  
  1759.        echo -n "    ethernet:"
  1760.        /sbin/ifconfig eth0 44.136.8.97 netmask 255.255.255.248 \
  1761.                        broadcast 44.136.8.103 up
  1762.        /sbin/route add 44.136.8.97 eth0
  1763.        /sbin/route add -net 44.136.8.96 netmask 255.255.255.248 eth0
  1764.        echo " done."
  1765.  
  1766.        echo -n "    AX.25: "
  1767.        axattach -i 44.136.8.5 -m 512 /dev/ttyS1 4800
  1768.        ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.8.255
  1769.        route add -host 44.136.8.5 sl0
  1770.        route add -net 44.136.8.0 window 1024 sl0
  1771.  
  1772.        echo -n "    Netrom: "
  1773.        nrattach -i 44.136.8.5 netrom
  1774.  
  1775.        echo "  Routing:"
  1776.        /sbin/route add default gw 44.136.8.68 window 1024 sl0
  1777.        echo "    default route."
  1778.        echo done.
  1779.  
  1780.        # end
  1781.  
  1782.   /usr/local/etc/axports
  1783.  
  1784.        # name  callsign        speed   paclen  window  description
  1785.        4800    VK2KTJ-0        4800    256     2       144.800 MHz
  1786.  
  1787.   /usr/local/etc/nrports
  1788.  
  1789.        # name  callsign        alias   paclen  description
  1790.        netrom  VK2KTJ-1        LINUX   235     Linux Switch Port
  1791.  
  1792.   /usr/local/etc/nrbroadcast
  1793.  
  1794.        # ax25_name     min_obs def_qual        worst_qual      verbose
  1795.        4800            1       120             10              1
  1796.  
  1797.   ╖  You must have IP_FORWARDING enabled in your kernel.
  1798.  
  1799.   ╖  The AX.25 configuration files are pretty much those used as
  1800.      examples in the earlier sections, refer to those where necessary.
  1801.  
  1802.   ╖  I've chosen to use an IP address for my radio port that is not
  1803.      within my home network block. I needn't have done so, I could have
  1804.      easily used 44.136.8.97 for that port too.
  1805.  
  1806.   ╖  44.136.8.68 is my local IPIP encapsulated gateway and hence is
  1807.      where I point my default route.
  1808.  
  1809.   ╖  Each of the machines on my Ethernet network have a route:
  1810.  
  1811.        route add -net 44.0.0.0 gw 44.136.8.97 window 512 mss 512 eth0
  1812.  
  1813.   The use of the mss and window parameters means that I can get optimum
  1814.   performance from both local Ethernet and radio based connections.
  1815.  
  1816.   ╖  I also run my sendmail, http, ftp and other daemons on the router
  1817.      machine so that it needs to be the only machine to provide others
  1818.      with facilities.
  1819.  
  1820.   ╖  The router machine is a lowly 386DX20 with a 20Mb harddrive and a
  1821.      very minimal linux configuration.
  1822.  
  1823.   16.2.  IPIP encapsulated gateway configuration.
  1824.  
  1825.   Linux is now very commonly used for tcp/ip encapsulated gateways
  1826.   around the world. The new tunnel driver supports multiple encapsulated
  1827.   routes and makes the older ipip daemon obsolete.
  1828.  
  1829.   A typical configuration would look similar to the following.
  1830.  
  1831.                                             .      .   .    .    . .
  1832.     ---                                .
  1833.      | Network       /---------\     .    Network
  1834.      | 154.27.3/24   |         |    .     44.136.16/24       \ | /
  1835.      |               | Linux   |   .                          \|/
  1836.      |               |         |  .                            |
  1837.      |          eth0 | IPIP    |  .  /-----\    /----------\   |
  1838.   ---|---------------|         |-----| TNC |----| Radio    |---/
  1839.      |   154.27.3.20 | Gateway |  .  \-----/    \----------/
  1840.      |               |         | sl0
  1841.      |               |         | 44.136.16.1
  1842.      |               |         |    .
  1843.      |               |         |     .
  1844.      |               \_________/       .
  1845.     ---                                     .      .   .    .    . .
  1846.  
  1847.   The configuration files of interest are:
  1848.  
  1849.        # /etc/rc.net
  1850.        # This file is a simple configuration that provides one KISS AX.25
  1851.        # radio port, one Ethernet device, and utilises the kernel tunnel driver
  1852.        # to perform the IPIP encapsulation/decapsulation
  1853.        #
  1854.        echo "/etc/rc.net"
  1855.        echo "  Configuring:"
  1856.        #
  1857.        echo -n "    loopback:"
  1858.        /sbin/ifconfig lo 127.0.0.1
  1859.        /sbin/route add 127.0.0.1
  1860.        echo " done."
  1861.        #
  1862.        echo -n "    ethernet:"
  1863.        /sbin/ifconfig eth0 154.27.3.20 netmask 255.255.255.0 \
  1864.                        broadcast 154.27.3.255 up
  1865.        /sbin/route add 154.27.3.20 eth0
  1866.        /sbin/route add -net 154.27.3.0 netmask 255.255.255.0 eth0
  1867.        echo " done."
  1868.        #
  1869.        echo -n "    AX.25: "
  1870.        axattach -i 44.136.16.1 -m 512 /dev/ttyS1 4800
  1871.        /sbin/ifconfig sl0 netmask 255.255.255.0 broadcast 44.136.16.255
  1872.        /sbin/route add -host 44.136.16.1 sl0
  1873.        /sbin/route add -net 44.136.16.0 netmask 255.255.255.0 window 1024 sl0
  1874.        #
  1875.        echo -n "    tunnel:"
  1876.        /sbin/ifconfig tunl0 44.136.16.1 mtu 512 up
  1877.        #
  1878.        echo done.
  1879.        #
  1880.        echo -n "Routing ... "
  1881.        source /etc/ipip.routes
  1882.        echo done.
  1883.        #
  1884.        # end.
  1885.  
  1886.   and:
  1887.  
  1888.        # /etc/ipip.routes
  1889.        # This file is generated using the munge script
  1890.        #
  1891.        /sbin/route add 44.134.8.0 netmask 255.255.255.0 tunl0 gw 134.43.26.1
  1892.        /sbin/route add 44.34.9.0 netmask 255.255.255.0 tunl0 gw 174.84.6.17
  1893.        /sbin/route add 44.13.28.0 netmask 255.255.255.0 tunl0 gw 212.37.126.3
  1894.           ...
  1895.           ...
  1896.           ...
  1897.  
  1898.   /usr/local/etc/axports
  1899.  
  1900.        # name  callsign        speed   paclen  window  description
  1901.        4800    VK2KTJ-0        4800    256     2       144.800 MHz
  1902.  
  1903.   Some points to note here are:
  1904.  
  1905.   ╖  The new tunnel driver uses the gw field in the routing table in
  1906.      place of the pointopoint parameter to specify the address of the
  1907.      remote IPIP gateway. This is why it now supports multiple routes
  1908.      per interface.
  1909.  
  1910.   ╖  You can configure two network devices with the same address.  In
  1911.      this example both the sl0 and the tunl0 devices have been
  1912.      configured with the IP address of the radio port. This is done so
  1913.      that the remote gateway sees the correct address from your gateway
  1914.      in encapsulated datagrams sent to it.
  1915.  
  1916.   ╖  The route commands used to specify the encapsulated routes can be
  1917.      automatically generated by a modified version of the munge script.
  1918.      This is included below. The route commands would then be written to
  1919.      a separate file and read in using the bash source /etc/ipip.routes
  1920.      command (assuming you called the file with the routing commands
  1921.      /etc/ipip.routes) as illustrated. The source file must be in the
  1922.      NOS route command format.
  1923.  
  1924.   ╖  Note the use of the window argument on the route command. Setting
  1925.      this parameter to an appropriate value improves the performance of
  1926.      your radio link.
  1927.  
  1928.   The new tunnel-munge script:
  1929.  
  1930.   #!/bin/sh
  1931.   #
  1932.   # From: Ron Atkinson <n8fow@hamgate.cc.wayne.edu>
  1933.   #
  1934.   #  This script is basically the 'munge' script written by Bdale N3EUA
  1935.   #  for the IPIP daemon and is modified by Ron Atkinson N8FOW. It's
  1936.   #  purpose is to convert a KA9Q NOS format gateways route file
  1937.   #  (usually called 'encap.txt') into a Linux routing table format
  1938.   #  for the IP tunnel driver.
  1939.   #
  1940.   #        Usage: Gateway file on stdin, Linux route format file on stdout.
  1941.   #               eg.  tunnel-munge < encap.txt > ampr-routes
  1942.   #
  1943.   # NOTE: Before you use this script be sure to check or change the
  1944.   #       following items:
  1945.   #
  1946.   #     1) Change the 'Local routes' and 'Misc user routes' sections
  1947.   #        to routes that apply to your own area (remove mine please!)
  1948.   #     2) On the fgrep line be sure to change the IP address to YOUR
  1949.   #        gateway Internet address. Failure to do so will cause serious
  1950.   #        routing loops.
  1951.   #     3) The default interface name is 'tunl0'. Make sure this is
  1952.   #        correct for your system.
  1953.  
  1954.   echo "#"
  1955.   echo "# IP tunnel route table built by $LOGNAME on `date`"
  1956.   echo "# by tunnel-munge script v960307."
  1957.   echo "#"
  1958.   echo "# Local routes"
  1959.   echo "route add -net 44.xxx.xxx.xxx netmask 255.mmm.mmm.mmm dev sl0"
  1960.   echo "#"
  1961.   echo "# Misc user routes"
  1962.   echo "#"
  1963.   echo "# remote routes"
  1964.  
  1965.   fgrep encap | grep "^route" | grep -v " XXX.XXX.XXX.XXX" | \
  1966.   awk '{
  1967.           split($3, s, "/")
  1968.           split(s[1], n,".")
  1969.           if      (n[1] == "")    n[1]="0"
  1970.           if      (n[2] == "")    n[2]="0"
  1971.           if      (n[3] == "")    n[3]="0"
  1972.           if      (n[4] == "")    n[4]="0"
  1973.           if      (s[2] == "1")   mask="128.0.0.0"
  1974.           else if (s[2] == "2")   mask="192.0.0.0"
  1975.           else if (s[2] == "3")   mask="224.0.0.0"
  1976.           else if (s[2] == "4")   mask="240.0.0.0"
  1977.           else if (s[2] == "5")   mask="248.0.0.0"
  1978.           else if (s[2] == "6")   mask="252.0.0.0"
  1979.           else if (s[2] == "7")   mask="254.0.0.0"
  1980.           else if (s[2] == "8")   mask="255.0.0.0"
  1981.           else if (s[2] == "9")   mask="255.128.0.0"
  1982.           else if (s[2] == "10")  mask="255.192.0.0"
  1983.           else if (s[2] == "11")  mask="255.224.0.0"
  1984.           else if (s[2] == "12")  mask="255.240.0.0"
  1985.           else if (s[2] == "13")  mask="255.248.0.0"
  1986.           else if (s[2] == "14")  mask="255.252.0.0"
  1987.           else if (s[2] == "15")  mask="255.254.0.0"
  1988.           else if (s[2] == "16")  mask="255.255.0.0"
  1989.           else if (s[2] == "17")  mask="255.255.128.0"
  1990.           else if (s[2] == "18")  mask="255.255.192.0"
  1991.           else if (s[2] == "19")  mask="255.255.224.0"
  1992.           else if (s[2] == "20")  mask="255.255.240.0"
  1993.           else if (s[2] == "21")  mask="255.255.248.0"
  1994.           else if (s[2] == "22")  mask="255.255.252.0"
  1995.           else if (s[2] == "23")  mask="255.255.254.0"
  1996.           else if (s[2] == "24")  mask="255.255.255.0"
  1997.           else if (s[2] == "25")  mask="255.255.255.128"
  1998.           else if (s[2] == "26")  mask="255.255.255.192"
  1999.           else if (s[2] == "27")  mask="255.255.255.224"
  2000.           else if (s[2] == "28")  mask="255.255.255.240"
  2001.           else if (s[2] == "29")  mask="255.255.255.248"
  2002.           else if (s[2] == "30")  mask="255.255.255.252"
  2003.           else if (s[2] == "31")  mask="255.255.255.254"
  2004.           else                    mask="255.255.255.255"
  2005.  
  2006.   if (mask == "255.255.255.255")
  2007.           printf "route add -host %s.%s.%s.%s gw %s dev tunl0\n"\
  2008.                   ,n[1],n[2],n[3],n[4],$5
  2009.   else
  2010.           printf "route add -net %s.%s.%s.%s gw %s netmask %s dev tunl0\n"\
  2011.                   ,n[1],n[2],n[3],n[4],$5,mask
  2012.    }'
  2013.  
  2014.   echo "#"
  2015.   echo "# default the rest of amprnet via mirrorshades.ucsd.edu"
  2016.   echo "route add -net 44.0.0.0 gw 128.54.16.18 netmask 255.0.0.0 dev tunl0"
  2017.   echo "#"
  2018.   echo "# the end"
  2019.  
  2020.   17.  Discussion relating to Amateur Radio and Linux.
  2021.  
  2022.   There are various places that discussion relating to Amateur Radio and
  2023.   Linux take place. They take place in the comp.os.linux.* newsgroups,
  2024.   they also take place on the HAMS list on vger.rutgers.edu. Other
  2025.   places where they are held include the tcp-group mailing list at
  2026.   ucsd.edu (the home of amateur radio tcp/ip discussions), and you might
  2027.   also try the #linpeople channel on the linuxnet irc network.
  2028.  
  2029.   To join the Linux linux-hams channel on the mail list server, send
  2030.   mail to:
  2031.  
  2032.        Majordomo@vger.rutgers.edu
  2033.  
  2034.   with the line:
  2035.  
  2036.        subscribe linux-hams
  2037.  
  2038.   in the message body. The subject line is ignored.
  2039.  
  2040.   To join the tcp-group send mail to:
  2041.  
  2042.        listserver@ucsd.edu
  2043.  
  2044.   with the line:
  2045.        subscribe tcp-group
  2046.  
  2047.   in the body of the text.
  2048.  
  2049.   Note: Please remember that the tcp-group is primarily for discussion
  2050.   of the use of advanced protocols, of which tcp/ip is one, in Amateur
  2051.   Radio. Linux specific questions should not ordinarily go there.
  2052.  
  2053.   18.  Copyright.
  2054.  
  2055.   The AX25-HOWTO, information on how to install and configure some of
  2056.   the more important packages providing AX25 support for Linux.
  2057.   Copyright (c) 1996 Terry Dawson.
  2058.  
  2059.   This program is free software; you can redistribute it and/or modify
  2060.   it under the terms of the GNU General Public License as published by
  2061.   the Free Software Foundation; either version 2 of the License, or (at
  2062.   your option) any later version.
  2063.  
  2064.   This program is distributed in the hope that it will be useful, but
  2065.   WITHOUT ANY WARRANTY; without even the implied warranty of
  2066.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  2067.   General Public License for more details.
  2068.  
  2069.   You should have received a copy of the GNU General Public License
  2070.   along with this program; if not, write to the:
  2071.  
  2072.   Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  2073.   USA.
  2074.  
  2075.