{"id":1498,"date":"2017-01-10T17:53:54","date_gmt":"2017-01-10T15:53:54","guid":{"rendered":"http:\/\/lz4ny.eu\/?p=1498"},"modified":"2017-01-10T17:56:37","modified_gmt":"2017-01-10T15:56:37","slug":"amprnet-44-rip","status":"publish","type":"post","link":"https:\/\/lz4ny.bulinfo.eu\/en\/amprnet-44-rip\/","title":{"rendered":"ampr-ripd and Amprnet Net-44 notes"},"content":{"rendered":"<p><\/p>\n<h1 align=\"center\"><b>ampr-ripd and Amprnet Net-44 notes<\/b><\/h1>\n<h2 style=\"text-align: center;\"><a href=\"http:\/\/adf.ly\/1ho9f9\" target=\"_blank\">Info from page of KB9MWR<\/a><\/h2>\n<p>First some history:<\/p>\n<p>In early 2012, Heikki Hannikainen, <span class=\"c1\">OH7LZB (the ham behind <a href=\"http:\/\/aprs.fi\">aprs.fi<\/a>) modernized the amprnet routing by writing a custom RIPv2 daemon to receive RIP updates from the 44\/8 ampr.org routing service, and insert them in the Linux routing table.\u00a0 This has replaced the encap.txt and munge script method.<\/span><\/p>\n<p>In late 2012 a new unified interface was given to <a href=\"http:\/\/www.ampr.org\" target=\"_blank\">www.ampr.org<\/a>.<\/p>\n<p>Prior; another email robot that Jim Fuller, N7VR maintained emailed a daily encap.txt list of NOS style route commands.\u00a0 From there if you were on the ball you had a cron script <a href=\"http:\/\/adf.ly\/1hoItT\" target=\"_blank\">munge<\/a> these into your gateways routing tables. Most folks who ran gateways were not on the ball and would manually install route updates as time permitted.<\/p>\n<p>To clarify the rip announcer at UCSD is one-way so the gateways robot is still there so that hams can create\/define gateways that RIP packets will be directed to.\u00a0 The rip packets are sent encapsulated from 44.0.0.1.<\/p>\n<p>For inbound IPIP\/IPENCAP encapsulation and the RIP packets to reach your gateway you&#8217;ll need to forward protocol 4 (IPIP) to your gateway server.\u00a0 Most consumer grade router\/gateways and modems will lack a direct way to specify this via the GUI.\u00a0 If nothing else; if you ssh\/telnet into your router can can specify it there.\u00a0 Or it may just be easier to enable the DMZ and point it to your ampr gateway.<\/p>\n<p>Just to make it clear, IPENCAP (4) is a Layer 4 IP protocol, like ICMP (1), TCP (6), UDP (17), GRE(47), OSPF(89), AXIP (93) and a lot of others, with the difference that<br \/>\nit transports another L3 protocol (IP).\u00a0 It works on top of IP, which is the Layer 3 protocol on the internet. And there are other L3 protocols, like ARP, IPv6, AppleTalk DDP, IPX, IPSEC and others. IPENCAP has no port numbers. Those are specific for TCP and UDP, and that&#8217;s it. You can not &#8220;simulate&#8221; it by port numbers.<\/p>\n<p>Heikki wrote the original daemon in the Perl programming language.\u00a0 Later <a href=\"http:\/\/adf.ly\/1hoEWR\" target=\"_blank\">Marius, YO2LOJ, wrote a ampr-ripd dameon in C.<\/a><\/p>\n<p>Here are some notes using <a href=\"http:\/\/releases.ubuntu.com\/lucid\/\">Ubuntu Server 10.04.4 LTS,<\/a>\u00a0 but also confirmed to work on Debian Wheezy. In these notes, using the <a href=\"http:\/\/adf.ly\/1hoFA2\" target=\"_blank\">gateways robot<\/a> we have specified that subnet 44.92.21.0\/24 can be reached by gateway 174.103.224.07.\u00a0 We use Marius YO2LOJ&#8217;s ampr-ripd dameon (v 1.13)\u00a0 (Note: worst case is a two hour wait from the time you first create a gateway in the portal to the time you start receiving route information)<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"notranslate\"><a href=\"http:\/\/adf.ly\/1hoG2o\" target=\"_blank\"><img loading=\"lazy\" class=\"aligncenter wp-image-1501\" src=\"http:\/\/lz4ny.eu\/wp-content\/uploads\/2017\/01\/gateway.jpg\" width=\"574\" height=\"197\" srcset=\"https:\/\/lz4ny.bulinfo.eu\/wp-content\/uploads\/2017\/01\/gateway.jpg 704w, https:\/\/lz4ny.bulinfo.eu\/wp-content\/uploads\/2017\/01\/gateway-300x103.jpg 300w\" sizes=\"(max-width: 574px) 100vw, 574px\" \/><\/a><\/span><\/p>\n<p>eth0 directly connected to the internet (174.103.224.07) WAN<br \/>\neth1 faces the wireless LAN (44.92.21.2) 44.92.21.0\/25<br \/>\ntunl0 is the IPIP wormhole tunnel to the rest of the AMPRNet (44.92.21.1)<br \/>\ntun0 is for the optional OpenVPN\u00a0server. 44.92.21.129\/25<\/p>\n<p><span id=\"result_box\" class=\"\" lang=\"bg\">Wireless hosts use these routes to reach each other and the rest of the amprnet:: mprnet :<\/span><\/p>\n<p><strong>route add 44.92.21.0\/24 netmask 255.255.255.0 dev eth0<\/strong><br \/>\n<strong>route add 44.0.0.0\/8 netmask 255.0.0.0 gw 44.92.21.2 dev eth0<\/strong><\/p>\n<p>You can use these notes as a basis for your setup, but you&#8217;ll need to make changes accordingly.<\/p>\n<p>I have successfully installed this on a low power, cheap <a href=\"http:\/\/www.raspberrypi.org\/\"> Raspberry Pi<\/a> and added a USB network adapter.<\/p>\n<hr \/>\n<p><b>Installing\u00a0<\/b><\/p>\n<p>Debian drives me insane, I suggest making a root account so you don&#8217;t go mad:<\/p>\n<blockquote>\n<pre>sudo passwd root<\/pre>\n<\/blockquote>\n<p>Or at the very least switch to root:<\/p>\n<blockquote>\n<pre>sudo -i<\/pre>\n<\/blockquote>\n<p>Install the tools and dependencies you&#8217;ll need:<\/p>\n<blockquote>\n<pre>apt-get install tcpdump dnsutils iptables-persistant ipset fail2ban lynx<\/pre>\n<\/blockquote>\n<p>Enable IP forwarding and\/or edit in \/etc\/sysctl.conf:<\/p>\n<blockquote>\n<pre>echo 1 &gt; \/proc\/sys\/net\/ipv4\/ip_forward<\/pre>\n<\/blockquote>\n<p>If you run a firewall, ensure IPIP protocol 4 is allowed:<\/p>\n<blockquote>\n<pre>iptables -A INPUT -p 4 -j ACCEPT\r\niptables -A INPUT -p udp --dport 520 -j ACCEPT<\/pre>\n<\/blockquote>\n<pre>Or if you are behind NAT, something like (where 192.168.1.10 is your gateway):<\/pre>\n<blockquote>\n<pre>iptables -t nat -A PREROUTING -p 4 -j DNAT --to 192.168.1.10<\/pre>\n<\/blockquote>\n<p>To reduce traffic, drop neighbor discovery and smb as well as MikroTik Neighbor Discovery Protocol on tunl0 (optional, but a good idea):<\/p>\n<blockquote>\n<pre>iptables -A OUTPUT -o tunl0 -p udp --dport 10001 -j DROP\r\niptables -A OUTPUT -o tunl0 -p udp --dport 137:139 -j DROP\r\niptables -A OUTPUT -o tunl0 -p udp --dport 5678 -j DROP<\/pre>\n<\/blockquote>\n<p>Create a tunnel interface (this should reflect the ampr IP address of your gateway) :<\/p>\n<blockquote>\n<pre>ifconfig tunl0 up 44.92.21.1 netmask 255.255.255.255<\/pre>\n<\/blockquote>\n<p>Download the latest daemon,\u00a0 untar it, compile it, and copy it to a proper location (\/usr\/sbin)<\/p>\n<blockquote>\n<pre>wget <a href=\"http:\/\/www.yo2loj.ro\/hamprojects\/\">http:\/\/www.yo2loj.ro\/hamprojects\/ampr-ripd-xxx.tgz<\/a>\r\n<code>tar -xvzf <\/code> ampr-ripd-xxx.tgz\r\nmake\r\ncp ampr-ripd \/usr\/sbin<\/pre>\n<\/blockquote>\n<p>Run it for the first time:<\/p>\n<p>Run it first with the -d -i tunl0 option to verify that it sees the route announcements from amprgw, and to learn the plaintext password used to authenticate the RIP packets (it&#8217;s not included in the script, and I&#8217;m not posting it here, so that spoofing can only be done by those who are already receiving the announcements). Wait up to 5 minutes until the routes are transmitted, and it&#8217;ll complain about the password it&#8217;s not expecting.\u00a0 (Note if you just submitted\/changed your gateway in the portal, those updates are only loaded every hour):<\/p>\n<blockquote>\n<pre>root@hsmm-gw:~# .\/ampr-ripd -d -i tunl0\r\nfound local address: 174.103.224.07\r\nfound local address: 44.92.21.2\r\nfound local address: 127.0.0.1\r\nfound local address: 44.92.21.1\r\nopening UDP socket...\r\nentering main loop, waiting for RIPv2 datagrams\r\nreceived from 44.0.0.1: 520: 504 bytes\r\nRIPv2 packet contains password PasswordFoundHere but we require none<\/pre>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p>Configure it all to start at boot:<\/p>\n<p>Set up your system so the startup script should be run automatically, e.g. call it in \/etc\/rc.local.<\/p>\n<p>My full startup script: <a href=\"http:\/\/adf.ly\/1hoTKE\" target=\"_blank\">http:\/\/www.qsl.net\/kb9mwr\/wapr\/tcpip\/startampr<\/a><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p style=\"text-align: center;\"><strong><a href=\"http:\/\/adf.ly\/1ho9f9\" target=\"_blank\">Full post in english language is here !<\/a><\/strong><\/p>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>In early 2012, Heikki Hannikainen, OH7LZB (the ham behind aprs.fi) modernized the amprnet routing by writing a custom RIPv2 daemon to receive RIP updates from the 44\/8 ampr.org routing service, and insert them in the Linux routing table.  This has replaced the encap.txt and munge script method. <a href=\"https:\/\/lz4ny.bulinfo.eu\/en\/amprnet-44-rip\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":49,"featured_media":1501,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[14],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/lz4ny.bulinfo.eu\/wp-content\/uploads\/2017\/01\/gateway.jpg","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8ff2h-oa","_links":{"self":[{"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/posts\/1498"}],"collection":[{"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/users\/49"}],"replies":[{"embeddable":true,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":0,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/media\/1501"}],"wp:attachment":[{"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lz4ny.bulinfo.eu\/en\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}