Hardware: RPI2, AT86RF233 from openlabs Software: Alpine Linux 3.8
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.
- Prepare your SD card for booting Alpine Linux
- Adjust the
cmdline.txt
configuration file on the SD card. This is not strictly required but makes debugging via TTY a bit easier.- Remove the
quiet
kernel parameter - Add a
console=ttyAMA0,115200
kernel parameter
- Remove the
- Create a
usercfg.txt
configuration file with the contentdtoverlay=at86rf233
on 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 a
output. - Configure the installation using
setup-alpine
as explained in [4].
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/repositories
on 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
.
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
- 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 fdf9:6a5a:3d48::1 {
AdvVersionLow 10;
AdvVersionHigh 2;
AdvValidLifeTime 2;
};
};
- Enable the radvd services using
rc-update add radvd
.
- Commit your changes using
lbu commit
- VERY IMPORTANT. - Reboot and pray.