RIP44.lua: Difference between revisions

From 44Net Wiki
Jump to navigation Jump to search
(Create initial page)
 
m (fix download instructions)
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
The script should only require Lua and the LuaSocket module to work. As well as the IPIP kernel module, of course. If you do not have the "ip" command installed then you will also need this.
The script should only require Lua and the LuaSocket module to work. As well as the IPIP kernel module, of course. If you do not have the "ip" command installed then you will also need this.


== Install ==
== OpenWRT Install ==
Installation is currently manual, a service script and installation script will be added here later.
I have provided an OpenWRT package which should install the required dependencies.


Download the script from [https://toolkit.m6xcv.uk/rip44.lua https://toolkit.m6xcv.uk/rip44.lua] and place it in a sensible location. Then open it in a text editor, you should only need to change LOCAL_SUBNET and GATEWAY. If GATEWAY is false then it will use your normal default route for Internet-based destinations, set it to the main gateways IP address to use that instead. You might also want to change SAVE_FILE to a different (persistent) location.
SSH in to your device and run the following commands:


Make sure the script is executable (<code>chmod +x rip44.lua</code>) and launch it manually. When the next RIP broadcast arrives (should be every 5 minutes) and confirm you get some updates.
*opkg update
*opkg install wget libustream-openssl ca-bundle ca-certificates (to support HTTPS for the download)
*wget https://raw.githubusercontent.com/NotMikeDEV/RIP44/master/rip44_2019.04.07-1_all.ipk
*opkg install rip44_2019.04.07-1_all.ipk


Once you have received a broadcast, check your routing table. By default it will use routing table 44, therefore you need to use the command <code>ip route list table 44</code> to check.
You then need to edit '''/etc/rip44.conf''' to specify your AMPRNet allocation. Once this is done, reboot to load the required modules and start the daemon.


If everything looks OK, set the script to auto-run on startup then reboot and check the routing table again. You should not need to wait for a RIP broadcast before the routes appear after the initial run.
If the configuration setting GATEWAY is false then it will use your normal default route for Internet-based destinations, set it to the main gateways IP address to use that instead. You might also want to change SAVE_FILE to a different location.
 
Once you have received a broadcast, check your routing table. By default it will use routing table 44, therefore you need to use the command <code>ip route list table 44</code> to check. Broadcasts are sent every 5 minutes, so you will have to wait for the next broadcast to confirm everything is working.
 
You should not need to wait for a RIP broadcast before the routes appear after the initial run.
 
If you have just added your gateway to the portal then you may need to wait an hour or so before you start receiving broadcasts.
 
== Other Linux systems ==
 
Get the script by cloning https://github.com/NotMikeDEV/RIP44 you will need to place rip44.conf in /etc/rip44.conf and rip44.lua in an appropriate directory. You will also need to set rip44.lua to run on startup. Further instructions are distro-specific, but anyone familiar with Linux should be able to figure it out. Startup scripts are not currently provided for distributions other than OpenWRT as it is felt that another routing daemon is probably more appropriate on platforms with full toolchains. This script is primarily designed for OpenWRT devices where binary releases are awkward to build.


== Testing ==
== Testing ==
Perform a TraceRoute from one of your AMPRNet IP addresses to 44.0.0.1 and ensure it does *not* go through your ISP.
Perform a TraceRoute from one of your AMPRNet IP addresses to 44.88.0.1 and ensure it does *not* go through your ISP. By default the script adds the specified address to your tunnel interface, so if your network allocation is 44.1.2.0/29 you could test from the router with the command <code>traceroute 44.88.0.1 -s 44.1.2.0</code>. Note that this does not stop you from assigning your allocation to an Ethernet interface.
 
If traffic appears to be blocked, you may need to add the interface (tunl0) in the OpenWRT web interface and add it to a firewall zone. It depends on your firewall configuration for if this will be needed or not, you may also need to set your WAN interface to ALLOW inbound traffic to receive the IPIP encapsulated packets. The requirements for OpenWRT network configuration should be the same as with other daemons, so if you have previously set up another routing daemon it should work the same with this one.
 
Check out the [[Services]] page for other hosts you can run tests to.


Check out the [[Services]] page for hosts you can run tests to.
This script will set up your routing with a separate routing table for your 44Net prefix. This means other traffic will continue to use your normal Internet connection. Only traffic from your 44/8 prefix will be routed through the tunnels. If you wish for all traffic to come from a 44Net IP you will need to adjust the routing and NAT accordingly.


== Updates ==
== Updates ==
This script is experimental, even if it works you want to check back here in a couple of weeks for updates. Startup and install scripts will also appear shortly.
This script is experimental, please let m6xcv@m6xcv.uk know if you are using this script and if it worked or not. If you have any problems then contact me and I will look in to it.

Latest revision as of 10:51, 8 April 2019

Status: Experimental.

M6XCV has written a RIP44 daemon in Lua. The expected primary use case is OpenWRT/LEDE based devices, however the script was developed on Debian and should work on any Linux platform with the appropriate libraries. The script is currently considered experimental, having received only limited testing on a couple of devices.

Requirements

The script should only require Lua and the LuaSocket module to work. As well as the IPIP kernel module, of course. If you do not have the "ip" command installed then you will also need this.

OpenWRT Install

I have provided an OpenWRT package which should install the required dependencies.

SSH in to your device and run the following commands:

You then need to edit /etc/rip44.conf to specify your AMPRNet allocation. Once this is done, reboot to load the required modules and start the daemon.

If the configuration setting GATEWAY is false then it will use your normal default route for Internet-based destinations, set it to the main gateways IP address to use that instead. You might also want to change SAVE_FILE to a different location.

Once you have received a broadcast, check your routing table. By default it will use routing table 44, therefore you need to use the command ip route list table 44 to check. Broadcasts are sent every 5 minutes, so you will have to wait for the next broadcast to confirm everything is working.

You should not need to wait for a RIP broadcast before the routes appear after the initial run.

If you have just added your gateway to the portal then you may need to wait an hour or so before you start receiving broadcasts.

Other Linux systems

Get the script by cloning https://github.com/NotMikeDEV/RIP44 you will need to place rip44.conf in /etc/rip44.conf and rip44.lua in an appropriate directory. You will also need to set rip44.lua to run on startup. Further instructions are distro-specific, but anyone familiar with Linux should be able to figure it out. Startup scripts are not currently provided for distributions other than OpenWRT as it is felt that another routing daemon is probably more appropriate on platforms with full toolchains. This script is primarily designed for OpenWRT devices where binary releases are awkward to build.

Testing

Perform a TraceRoute from one of your AMPRNet IP addresses to 44.88.0.1 and ensure it does *not* go through your ISP. By default the script adds the specified address to your tunnel interface, so if your network allocation is 44.1.2.0/29 you could test from the router with the command traceroute 44.88.0.1 -s 44.1.2.0. Note that this does not stop you from assigning your allocation to an Ethernet interface.

If traffic appears to be blocked, you may need to add the interface (tunl0) in the OpenWRT web interface and add it to a firewall zone. It depends on your firewall configuration for if this will be needed or not, you may also need to set your WAN interface to ALLOW inbound traffic to receive the IPIP encapsulated packets. The requirements for OpenWRT network configuration should be the same as with other daemons, so if you have previously set up another routing daemon it should work the same with this one.

Check out the Services page for other hosts you can run tests to.

This script will set up your routing with a separate routing table for your 44Net prefix. This means other traffic will continue to use your normal Internet connection. Only traffic from your 44/8 prefix will be routed through the tunnels. If you wish for all traffic to come from a 44Net IP you will need to adjust the routing and NAT accordingly.

Updates

This script is experimental, please let m6xcv@m6xcv.uk know if you are using this script and if it worked or not. If you have any problems then contact me and I will look in to it.