Mesh Debug: Difference between revisions
Line 58: | Line 58: | ||
chmod a+x /etc/init.d/blinding |
chmod a+x /etc/init.d/blinding |
||
ln -s /etc/init.d/blinding /etc/rc5.d/S35blinding |
ln -s /etc/init.d/blinding /etc/rc5.d/S35blinding |
||
Now this laptop will only talk to the indicated school server (actually, the indicated Active Antenna) until it is updated. Please label the laptop accordingly! |
Revision as of 19:56, 31 August 2007
The wireless mesh interface contains functionality that makes it possible to debug school servers, even if there are a number of school servers in close proximity. This functionality is the ability to whitelist or blacklist other mesh nodes.
Changes to the Server
You will need to know the MAC addresses of the mesh interfaces on any laptops you wish to whitelist. In the examples below, we use 00:17:c4:05:25:60 as the XO MAC address.
We recommend placing the whitelist information in the /etc/init.d/olpc-mesh-config startup script. In this way, the whitelist will survive reboots of the server.
Add the following lines to the start() function, right after the RETVAL=$? line:
if [ -d /sys/class/net/msh0 ] ; then /sbin/iwpriv msh0 bt_reset /sbin/iwpriv msh0 bt_set_invert 1 # This adds the XO named Sofia to the whitelist /sbin/iwpriv msh0 bt_add 00:17:c4:05:25:60 fi if [ -d /sys/class/net/msh1 ] ; then /sbin/iwpriv msh1 bt_reset /sbin/iwpriv msh1 bt_set_invert 1 # This adds the XO named Sofia to the whitelist /sbin/iwpriv msh1 bt_add 00:17:c4:05:25:60 fi if [ -d /sys/class/net/msh2 ] ; then /sbin/iwpriv msh2 bt_reset /sbin/iwpriv msh2 bt_set_invert 1 # This adds the XO named Sofia to the whitelist /sbin/iwpriv msh2 bt_add 00:17:c4:05:25:60 fi
Now just start that service again to apply the blinding table:
sudo service olpc-mesh-config start
Changes to the Laptop
The changes to the laptop are similar. Place the following script into a new file called /etc/init.d/blinding:
#!/bin/sh # whitelist # This script, if run early in a laptop's boot process, will # ensure that the laptop only talks to the mesh interfaces # listed here. IWPRIV=/sbin/iwpriv MSH_IF=msh0 # Clear any pre-existing white or black list $IWPRIV $MSH_IF bt_reset # Make sure that a white list is being created $IWPRIV $MSH_IF bt_set_invert 1 # Now add the interface we allow communication with: # 00:50:43:28:01:f2 is Active Antenna S/N 0037 $IWPRIV $MSH_IF bt_add 00:50:43:28:01:f2
Make this script executable and create a link to it in the appropriate directories:
chmod a+x /etc/init.d/blinding ln -s /etc/init.d/blinding /etc/rc5.d/S35blinding
Now this laptop will only talk to the indicated school server (actually, the indicated Active Antenna) until it is updated. Please label the laptop accordingly!