Startampr

From 44Net Wiki
Revision as of 09:18, 3 August 2015 by Kb3vwg (talk | contribs)
Jump to navigation Jump to search

startampr is a custom Bourne Again Shell script developed by KB3VWG and others in the 44Net mailing list Community, that turns a Debian/Ubuntu-based Linux machine into an AMPR Gateway on boot; and starts an IPENCAP (or IP Protocol number four) tunnel. Other tools included with the official release include: init scripts to execute the file, save the routing table (if using a method that does not automatically save it); and an executable script generator (made using the sed command that can restore the AMPR routing table (i.e. in the case the administrator flushes the table). The script uses the ipip Linux Kernel module and implements Linux ip routing table's policy-based routing to properly move traffic across the routing plane. It suggested that iptables be used to firewall traffic after verification of a proper installation. The current version is: 2.0 Release Candidate 4, released to the 44Net mailing list Community on August 2, 2015 at 7:00 PM UTC.

The official release uses rip44d as its routing protocol daemon; but ampr-ripd or Encap.txt with a munge script may be used (instructions by KB9MWR use ampr-ripd). To operate a Gateway on AMPRNet, you must have a method of obtaining up-to-date route information. A variant of RIP version 2 named RIP44 is used internally. rip44d is written in the Perl programming language. ampr-ripd is written in C. The routing table is relatively small, so the performance or memory consumption of this daemon isn't very critical. The developer choose rip44d simply because it was the only daemon available when version 1.0 was developed. The use of any method to add route information to table 44 will work.

NOTE: if you do not wish to compile software, you must use rip44d or Encap.txt with a munge script.


Requirements

  1. You'll need a Linux computer, which has been added in the Gateways file using the Portal, so that it is known as an AMPRnet Gateway and will receive RIP44 updates from the main Gateway. It will take some time before Amprgw will learn about new gateways.
  2. The instructions below are currently only for Debian/Ubuntu, but there's nothing Debian-specific - it should work fine on other distributions (if the correct packages used (e.g. wget/curl, The Bourne Again Shell/BASH, sed, ip, chmod, PERL, etc.) Interface names, file and folder locations, file permissions, etc. are edited.

You must first properly install:

  • the operating system and network interfaces
  • then properly install startampr to enable the tunnel. The tunnel interface must be operational and in 'UP' status before proceeding.
  • the RIP44 daemon which receives periodic routing table updates from the AMPRNet routing service, and inserts them in the Linux routing table of your choice (most users use table 44; and the scripts use this value as well). You must verify that you are receiving route information before proceeding.
  • boot script to /etc/init/
  • (Optional) a script to restore the routing table to /etc/if-ip.d/

Installation of startampr

Install the the script to /usr/local/sbin and sudo chmod ug+x /usr/local/sbin/startampr

After obtaining the correct password from the route announcement and entering it into the properly configured script, install the boot and interface-up scripts (sample init scripts provided).

That should be all. Really. The downside of this configuration is that it will take up to 5 minutes for the gateway to receive a routing update and become operational after a reboot. The additional scripts provided store the current routing table in a local file hourly and load it from there when starting up. Thereafter, after every hour of uptime your routing table is backed up at :17 on the hour. This backup can be used if you ever need to execute the ip command to flush table 44.


Installation of dependencies on Debian/Ubuntu

If you use rip44d, install perl, and IO::Socket::Multicast, a Perl module used for receiving the RIP multicast packets

sudo apt-get install perl libio-socket-multicast-perl libio-interface-perl

recommended:

sudo apt-get install traceroute


Installation of dependencies on other distributions

Other distributions should have an easy way to install the required packages too (using yum or a similar program). Please fill in details here, if you know them.


Notes

  • startampr allows you to execute your RIP44 routing daemon automatically
  • rip44d automatically adds an AMPR route to the Main AMPRNet Gateway on table 44
  • rip44d expects that your tunnels are configured on tunl0. Use the -i <if> option to change to another. The tunnel interface must be up and configured before rip44d starts up.

Support, bug reports and improvements

If you have questions to ask about the usage of this script, please contact the 44Net mailing list.

If you have improvements to the script and wish to submit a patch, please contact KB3VWG on the 44Net mailing list, or via contact details in the Portal. Thank you!

The daemon was written by Lynwood, KB3VWG, and with major contributions from PE1CHL (for implementation of policy-based IP routing) and Marc, LX1DUC (to automate enabling of IP forwarding).

See also

Links