kls0e hi :-)

manually downgrading mesh links using olsr Link Quality Multipliers (LinkQM)

Let’s say you have a node that sees two other nodes in the mesh with a fairly good connection but you want to shape the traffic flow because there are reasons to do so. To achieve this, we can apply link quality multipliers to certain routes. The router will multiply the routes’ priority by this factor and thus downgrade it if we choose a number lower than 1, e.g. 0.5.

  1. Find out which ip your mesh interface and the other nodes’ mesh interface has:
    The left column consists of mesh interface ips of the router you are logged into, the right column consists of remote mesh interface ips. If you are lucky, a third column to the right will appear, showing the remote olsr hostnames.
    Note your mesh ip and the remote mesh ip.

  2. You need to know your local mesh interface name you want to apply the LinkQM rule to. In the following command, insert your mesh ip (left column from step 0) that sees the other node you want to downgrade the link to:
    ip a | grep <your mesh ip from neigh.sh>

The last phrase of the output is the local interface mesh name, common results include wlan0-mesh-2, wlan1-adhoc-5, fflan, … - depending on your setup.
Important: If it is a wireless mesh interface, we need to know the network name assigned to it. You can find this information in /etc/config/wireless. Everything that starts with wlan0- is most probably wireless0, everything that starts with wlan1- is most probably wireless1.

  1. With this information, we can edit the olsr config at /etc/config/olsrd. We need to scroll down to the appropriate interface section with the local mesh interface network name we have found out in step 1.
    We can now add a new option for it:

option LinkQualityMult ‘<remote mesh ip> <multiplier>’

So as an example, my result for step 1 was fflan, because the link I want to downgrade is reachable through a lan mesh interface. The remote mesh ip from step 0 in my example is and I would like to downgrade the link by factor 2, so my multiplier is 0.5. So I am scrolling down to where the olsr config says option interface ‘fflan’ and I add the corresponding LinkQM option like so:

config Interface                                 
        option ignore '0'                    
        option interface 'fflan'             
        option Mode 'ether'        
        option LinkQualityMult ' 0.5'

Keep in mind, for wireless mesh interfaces, you need to look for wireless0 or wireless1 instead of fflan. To apply the changes, restart olsrd by issuing /etc/init.d/olsrd restart. Wait some minutes before testing the new routing until the router reworks its routing priorities.

Freifunk Berlin can be complicated sometimes but you can learn a lot.