OLSR network deployments

From OLSR.org Wiki
Jump to: navigation, search

On this page we describe a few typical deployments for OLSR mesh networks. This list is complete, feel free to ask on the OLSR.org user mailing list if you think something important is missing.

If you tried to setup a deployment and it does not work, have a look at our Troubleshooting page.

single interface mesh network

The most simple case of a mesh network is a series of devices, each with a single network interface used for connecting all of them. This interface will typically run as an adhoc interface, which means everyone on the interface can talk to everyone else (in range) directly, without going through a special central controller.

Because this setup has only a single interface, it doesn't need some of the more complicated configurations settings of the routing daemons.

For this example we use wlan0 as the mesh interface.

olsrd

olsrd (v1) can only handle IPv4 or IPv6, so you have to configure the routing agent to the IP address type you plan to use. It is possible to run the routing agent two times with different configurations to get a full dualstack mesh network.

Set an unique IP address to the mesh interface.

Start olsrd with olsrd -f <configuration-file> and a configuration file like this:

IpVersion <4 or 6>

Interface "wlan0" {
}

olsrd2

olsrd2 can handle both IPv4 and IPv6 at the same time, you don't need a configuration file for this setup.

olsrd2 can also handle linklocal IPv6 addresses on the mesh interfaces, it also can generate linklocal IPv4 addresses for its mesh interfaces automatically.

So do not setup any IP addresses (except for the automatic IPv6 linklocal address) on your mesh interfaces, instead set the IP address of your router (IPv4 and/or IPv6) as an additional address on the loopback device.

Start olsrd2 with olsrd2 wlan0 lo.

single mesh interface with local attached ethernet

This setup uses a group of mesh routers to connect a local ethernet network.

First, setup a DHCP service on the router that gives every attached computer on the local ethernet a network address from an unique IP prefix. Make sure that the DHCP service also installs a default route pointing back to the local mesh router.

As an alternative, you can also set the IP addresses on the attached computers by hand, just make sure you don't forget the route towards the mesh router. This route must contain all IP addresses used by all mesh routers and their attached ethernet devices.

For this example we use 10.1.2.0/24 and fd00::/64 as the prefix of the local ethernet interface and wlan0 as the mesh interface.

olsrd

olsrd propagates the IPs of its mesh interface through the whole mesh, so make sure you give each interface an unique IP.

In addition to the configuration in the first setup, you also have to set the IP prefix of the locally attached ethernet network.

For IPv4, use a configuration like this:

IpVersion 4

Hna4 {
         10.1.2.0   255.255.255.0
}
        
Interface "wlan0" {
}

For IPv6, use something like the following configuration:

IpVersion 6

Hna6 {
         fd00::0  64
}
        
Interface "wlan0" {
}

olsrd2

Start olsrd2 with olsrd2 --load <config-file> and use the following configuration file:

[olsrv2]
      lan    10.1.2.0/24
      lan    fd00::/64

[interface=wlan0]
[interface=lo]

multiple mesh interfaces

Multiple mesh interfaces are handled exactly as the single mesh interface case, you just need (for olsrd v1) to set more IP addresses for the interfaces. For olsrd2, you don't need to do this as long as you keep the router IP as an additional address on the loopback interface.

For this example we use wlan0 and wlan1 as the mesh interface.

olsrd

For the olsrd example we use 10.1.2.1 and fd00::1/128 as the main IP of the router

Use the following configuration for IPv4:

IpVersion 4
MainIp 10.1.2.1

Interface "wlan0" {
}

Interface "wlan1 {
}

Use the following configuration for IPv6:

IpVersion 6
MainIp fd00::1

Interface "wlan0" {
}

Interface "wlan1 {
}

olsrd2

You don't need a configuration file for this usecase for olsrd.

Just start olsrd2 with olsrd2 wlan0 wlan1 lo.

multiple mesh interface with local ethernet

This usecase is just a combination of the earlier examples, you can just combine the configuration files and IP/routing settings.

For this example we use 10.1.2.0/24 and fd00::/64 as the prefix of the local ethernet interface and wlan0 and wlan1 as the mesh interface.

olsrd

For IPv4, use something like the following configuration:

IpVersion 4
MainIp 10.1.2.1

Hna4 {
         10.1.2.0   255.255.255.0
}
        
Interface "wlan0" {
}

Interface "wlan1" {
}

For IPv6, use something like the following configuration:

IpVersion 6
MainIp fd00::1

Hna6 {
         fd00::0  64
}
        
Interface "wlan0" {
}

Interface "wlan1" {
}

olsrd2

The olsrd2 configuration file is even shorter:

[olsrv2]
      lan    10.1.2.0/24
      lan    fd00::/64

[interface=wlan0]
[interface=wlan1]
[interface=lo]

As an alternative you can use the lan_import plugin to automatically import the routes being used with an interface.

[lan_import=1]
      interface    eth0

[interface=wlan0]
[interface=wlan1]
[interface=lo]

IPv4 or IPv6 only mesh network with olsrd2

Olsrd2 is starting in dual-stack mode by default, which means it will deliver both IPv4 and IPv6 routes at the same time. While IPv6 deployment and usage is increasing, some mesh networks might want to restrict the routing daemon to IPv4 or IPv6 only.

IPv4 only

To restrict the olsrd2 daemon to IPv4 only you need to add the following lines to the configuration file:

[olsrv2]
      originator    -127.0.0.1/8
      originator    -::/0
      originator    default_accept

[interface]
      bindto        -127.0.0.1/8
      bindto        -::/0
      bindto        default_accept

The olsrv2 block restricts the selection of the originator for olsrv2 to non-loopback IPv4 addresses, the interface block restricts the selection of addresses for the interface sockets to non-loopback IPv4 addresses.

The interface block can either be put into each interface specific block (e.g. [interface=wlan0]) or just put before all of the interface specific blocks to define a default for them.

IPv6 only

To restrict the olsrd2 daemon to IPv6 only you need to add the following lines to the configuration file:

[olsrv2]
      originator    -0.0.0.0/0
      originator    -::1/128
      originator    default_accept

[interface]
      bindto        -0.0.0.0/0
      bindto        -::1/128
      bindto        default_accept

The olsrv2 block restricts the selection of the originator for olsrv2 to non-loopback IPv6 addresses, the interface block restricts the selection of addresses for the interface sockets to non-loopback IPv6 addresses.

The interface block can either be put into each interface specific block (e.g. [interface=wlan0]) or just put before all of the interface specific blocks to define a default for them.