PirateBox upgrade to Forban

I’m looking to upgrade my two pirate box to test the mesh network forban between the two. Apparently, this will slow down the device as the TP Link small devices are not so powerful, but i like the idea to be able to create mesh network between piratebox. In my point of view it is the right way to make this project real.

I actually have my two piratebox configured in version 0.5, i’ll firstly update them to the latest version, then add the Forban tool following Matthias’s materials.

I’ll upgrade my TP Link Mr3020 and TP Link MR3040.

Configure network to connect to PirateBox and work as a gateway

First step is to be able to connect the piratebox, for this, I created an alias to my network card and activate masquerading and routing to be able to use my desktop as a link between the PirateBox and Internet

ifconfig eth1:1 192.168.1.10 up
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
sysctl -w net.ipv4.ip_forward=1

Then I’m able to connect to the pirate box over ssh and configure it to connect to Internet using my Desktop connection.

Prepare MR3020 pirate box for 0.6.1 and forban upgrade

Stop Piratebox services

/etc/init.d/piratebox stop

Clean overlay directory to make it as a clean openwrt. The usb drive can also be clean no remove the previous installation. You can save you Shared directory

mv /mnt/usb/PirateBox/Shared /mnt/usb
opkg remove piratebox
rm -rf /mnt/usb/PirateBox rm -rf /overlay/*

Reboot the device, then telnet 192.168.1.1 and type passwd to set a password and activate ssh. Deconnect from telnet and reconnect to ssh.

Update /etc/network to be able to reach internet by adding two lines

        option gateway '192.168.1.10'
        list dns '10.0.0.254'

Reconfigure the USB modules

insmod uhci
insmod usb-ohci

Prepare MR3040 with OpenWRT before install 0.6.1

The trunk OpenWRT firmware does not contains all the needed kernel module and if you have it installed on your PirateBox you should have the following error message when execute the mesh installation :

satisfy_dependencies_for: Cannot satisfy the following dependencies for piratebox-mesh:
 *      kmod-batman-adv *

For this reason, I had to install Matthias OpenWrt version as described below.

  • The first step is to get the latest firmware
ssh -l root 192.168.1.1
# cd /tmp# wget http://piratebox.aod-rpg.de/mesh_test/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin
# sysupgrade -n *.bin

Reboot the device, then telnet 192.168.1.1 and type passwd to set a password and activate ssh. Deconnect from telnet and reconnect to ssh.

Update /etc/config/network to be able to reach internet by adding two lines

        option gateway '192.168.1.10'
        list dns '10.0.0.254'

Test the Internet connection with a ping to google.com for example.

Then Install the PirateBox Software

 

Upgrade MR3020 and MR3040 for 0.6.1 for forban

  • Prepare your USB

The USB drive can’t be mounted at this step, so it is better to put the stick on your desktop and download some materials to put on root of the USB stick:

wget http://piratebox.aod-rpg.de/mesh_test/piratebox_ws_0.6_img.tar.gz

Connect the USB on the piratebox.

  • Install the 0.6.1 piratebox
cd /tmp
wget http://piratebox.aod-rpg.de/mesh_test/piratebox_0.6.1_all.ipk
opkg update && opkg install piratebox_0.6.1_all.ipk
  • Next step : download forban
cd /mnt/usb
wget http://piratebox.aod-rpg.de/mesh_test/piratebox-forban_0.34.1_all.ipk
wget http://piratebox.aod-rpg.de/mesh_test/piratebox-mesh_0.2.8_all.ipk
wget http://piratebox.aod-rpg.de/mesh_test/forban_img.tar.gz
  • Install Mesh & forban
/opt/piratebox/bin/timesave.sh /opt/piratebox/conf/piratebox.conf install
opkg install piratebox-mesh_0.2.8_all.ipk
/etc/init.d/mesh init
/etc/init.d/mesh enable
opkg install piratebox-forban_0.34.1_all.ipk 
reboot
  •  At this time the MR3020 becomes really slow and once booted you need to wait a couple of time before forban is available.

Then, you can connect to forban using the http://192.168.1.1:12555 as url.

Forban on PirateBox running on mr3020

Forban on PirateBox running on mr3020

And this is what you get when a second one apears :

Pirate box with forban discovering another piratebox

Pirate box with forban discovering another piratebox

References

This article mostly based on Mathias one : can be found here

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.