IEEE 802.15.4 Border Router using Alpine Linux
This is a severely outdated guide for setting up a IEEE 802.15.4 border router using Alpine Linux 3.8 on a Raspberry Pi 2 with an AT86RF233 radio from openlabs. Most of the information provided is no longer applicable as is but—with some extra effort—may still provide useful pointers for setting up an Alpine-based IEEE 802.15.4 border router.
Disclaimer
Most changes initially made by myself to different Alpine packages required for using the RPI as a border router are already part of the latest stable release. Unfortunately, wpan-tools is not packaged for stable yet and installing it requires a little hack.
Installation
- Prepare your SD card for booting Alpine Linux
- Adjust the
cmdline.txtconfiguration file on the SD card. This is not strictly required but makes debugging via TTY a bit easier.- Remove the
quietkernel parameter - Add a
console=ttyAMA0,115200kernel parameter
- Remove the
- Create a
usercfg.txtconfiguration file with the contentdtoverlay=at86rf233on the SD card. - Unmount the SD card, put it into your RPI and boot it.
- Log in on the TTY as root and verify that your wpan devices actually
shows up in the
ip aoutput. - Configure the installation using
setup-alpineas explained in [4].
Install wpan-tools
wpan-tools is not packaged in Alpine 3.8 (but will be in Alpine 3.9). Therefore we are installing it from edge on 3.8 (which is usually a really bad idea but should work in this case). To do so:
- Edit
/etc/apk/repositorieson the RPI. Add the following lines:
@edge http://nl.alpinelinux.org/alpine/edge/main
@edge http://nl.alpinelinux.org/alpine/edge/community
- Update your repositories using
apk update. - Install wpan-tools using
apk add wpan-tools@edge. - Verify that everything works as expected using
iwpan list.
Configure (lo)wpan interface
We will configure our (lo)wpan interfaces by invoking the required
wpan-tools commands from /etc/network/interfaces. The exact
configuration depends on your setup. In the following example
we are using the following ULA fdf9:6a5a:3d48::/48. We are also
manually setting a MAC address for our wpan interfaces.
Add the following to /etc/network/interfaces:
auto wpan0
iface wpan0 inet6 manual
pre-up ip link set wpan0 address 86:ca:ba:3e:bb:fa:15:d2
pre-up iwpan dev wpan0 set pan_id 0x23
pre-up iwpan phy phy0 set channel 0 26
post-up ip link add link wpan0 name lowpan0 type lowpan
post-up ip link set wpan0 up
auto lowpan0
iface lowpan0 inet6 static
address fdf9:6a5a:3d48::1
netmask 48
autoconf 0
accept_ra 0
privext 0
Enable IPv6 packet forwarding:
echo 'net.ipv6.conf.all.forwarding=1' > /etc/sysctl.d/01-forwarding.conf
lbu add /etc/sysctl.d/01-forwarding.conf
Install and configure radvd
Install radvd using
apk add radvd.Configure radvd according to [2] by creating
/etc/radvd.conf. For example:interface lowpan0 { AdvSendAdvert on; UnicastOnly on; AdvSourceLLAddress on; AdvCurHopLimit 255; prefix fdf9:6a5a:3d48::/48 { AdvOnLink off; AdvAutonomous on; AdvRouterAddr on; }; abro fe80::84ca:ba3e:bbfa:15d2 { AdvVersionLow 10; AdvVersionHigh 2; AdvValidLifeTime 2; }; };Enable the radvd services using
rc-update add radvd.
Final touches
- Commit your changes using
lbu commit- VERY IMPORTANT. - Double check that a password was set for
root. - Reboot.