This is an old revision of the document!
Mesh RPi
This article describes the needed modifications for PirateBox RPi image 1.1.3 to get a similar setup like on OpenWrt. Similar setup means a bridged network between AP and Mesh.
Note: Due to kernel incompatibilities of BATMAN-advanced betweeen OpenWrt and RPi, both Systems can not talk to each other.
Requirements:
- 2nd wifi card for mesh only
- some time ;)
All the scripts will be executed on the Pi. The configuration consists of the following steps:
- Setup a software bridge
- Reconfigure PirateBox to make use use of the bridge interface
- Enable IPv6 configuration for PirateBox
- Create Mesh setup script & make it bootable
- Configure Avahi to announce PirateBox
Software bridge
Create the network configuration file for the bridge:
cat <<EOF > piratebox_bridge Description="General bridge interface for PirateBox" Connection=bridge Interface=br-lan BindsToInterfaces=() ForceConnect=yes #Enabling DHCP stuff SkipForwardingDelay=yes IP=static Address=(192.168.77.1/24) EOF sudo mv piratebox_bridge /etc/netctl/ sudo netctl enable piratebox_bridge sudo netctl start piratebox_bridge
Reconfigure PirateBox
sudo sed -i -e 's|DO_IFCONFIG="yes"|DO_IFCONFIG="no"|' \ -e 's|DO_BRIDGE="no"|DO_BRIDGE="yes"|' \ /opt/piratebox/conf/piratebox.conf
Edit piratebox.service file for system dependencies
sudo nano /etc/systemd/system/piratebox.service
The top of the file needs to look like this:
[Unit] Description=PirateBox Service PartOf=netctl@piratebox_bridge.service
IPv6 Setup
Do the following commands..
PREFIX="fdc0:ffea" FIXED=$(hexdump -n8 -e '/2 ":%03x" ' /dev/random ) V6_GEN_RESULT="$PREFIX:$FIXED" prefix=`</dev/urandom tr -dc a-zA-Z1-9 | head -c8` work_hostname="$prefix.piratebox.lan" sudo sed -i -e 's| radvd|/usr/bin/radvd|g' /opt/piratebox/init.d/piratebox_alt sudo touch /opt/piratebox/conf/node.conf sudo sed -i -e "s|NODE_CONFIG_ACTIVE='no'|NODE_CONFIG_ACTIVE='yes'|" /opt/piratebox/conf/node.conf sudo sed -i -e "s|NODE_IPV6_IP=''|NODE_IPV6_IP='$V6_GEN_RESULT'|" \ -e "s|NODE_NAME=''|NODE_NAME='$prefix'|" \ /opt/piratebox/conf/node.conf sudo sed -i -e 's|IPV6_ENABLE="no"|IPV6_ENABLE="yes"|' \ -e "s|fdc0:ffea::1|$V6_GEN_RESULT|" \ /opt/piratebox/conf/ipv6.conf echo "IP6=static Address6=($V6_GEN_RESULT/64)" > ipv6.netctl sudo sh -c 'cat ipv6.netctl >> /etc/netctl/piratebox_bridge' echo " OK. Please note the following infos: Generated node name: $work_hostname Generated IPv6: $V6_GEN_RESULT Prefix: /64 "