kls0e hi :-)

How to run your own Freifunk Berlin service

Martin, a fellow Freifunker from Freifunk Fürstenwalde asked me to publish a tutorial on how to set up your own service in the Freifunk Berlin network. It is actually quite easy once you know how.

Note: Your service has to have an ip reachable from within Freifunk Berlin, you can configure a static ip for it from your Freifunk dhcp pool. If you use the first dhcp ip your Freifunk router would issue to a client, edit its /etc/config/dhcp and raise option start ‘2’ to option start ‘3’ in the lower dhcp config block. This reserves the ip for your static configured service host and avoids duplicate ip delegation via dhcp.

How to announce your service in the Freifunk Berlin network:

  1. log in to your router via ssh

  2. edit the olsr config of your router:
    vim /etc/config/olsrd

  3. scroll down to the section that starts with

config LoadPlugin
     option library 'olsrd_nameservice'
  1. press i to insert text

  2. add

list hosts '<freifunk-ip> <hostname without .olsr>'
list service 'http://<freifunk-IP:port>|tcp|<name of service>'

example: let’s say my service has 10.31.44.119 and I would like the host to be known as kls0e.olsr, and let’s say there is a web server up at port 10178, and every router at Freifunk Berlin should show a link named kls0e to this server under Services on its web gui, then my nameservice plugin section would look like so:

config LoadPlugin
        option library 'olsrd_nameservice'
        option suffix '.olsr'
        option hosts_file '/tmp/hosts/olsr'
        option latlon_file '/var/run/latlon.js'
        option services_file '/var/etc/services.olsr'
        list hosts '10.31.44.119 kls0e'
        list service 'http://10.31.44.119:10178|tcp|kls0e'

udp protocol is also an option instead of tcp. Port info is mandatory, even if it is port 80.

Give it 5-15 minutes to propagate your service announcement across the network.

From my experience, sometimes not all nodes can resolve the hosts entry, so I have chosen to publish the service with its direct Freifunk ip instead of an OLSR host name. The latter would be cooler but form follows function, I am glad if it works for you tho, please try.
Update: Noki kindly mentioned that it makes sense to issue a static dhcp lease for the device hosting the service.