[Olsr-users] Include all advertised IPs in the routing table

Henning Rogge (spam-protected)
Fri Jan 20 17:24:35 CET 2017


On Fri, Jan 20, 2017 at 4:54 PM, Michele Segata <(spam-protected)> wrote:
>
> Hi everyone,
>
> I have a question regarding the configuration of OLSRv2 in a simple network. Consider the following network topology:
>
>  .0.1      .1.1   .1.2     .2.1
> 0 ------------- 1 ------------- 2
>
> The network is "flat", and all addresses belong to the 10.0.0.0/8 network. We are trying some experiments using mininet and OLSRv2 with a very basic OLSR configuration which is the following:
>
> [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 configuration is taken from the OLSR wiki to enable only IP4. In addition, each node enables OLSR on all its interfaces (but the loopback) using
>
> [interface=<interface name>]
>
> By running the mininet emulation, everything works almost as expected. After some seconds, the routing tables are populated. For example, this is the routing table for node 0
>
> Kernel IP routing table
> Destination  Gateway   Genmask         Flags Metric Iface
> 10.0.0.0     *         255.0.0.0       U     0      h0_0-eth1
> 10.0.1.1     10.0.1.1  255.255.255.255 UGH   2      h0_0-eth1
> 10.0.2.1     10.0.1.1  255.255.255.255 UGH   2      h0_0-eth1


First advise, use "ip route" when looking at any routing table (and
"ip addr" to look for the addresses). The old tools like "route" hide
things from you you want to know about.

>
> and this is the routing table for node 2
>
> Kernel IP routing table
> Destination  Gateway   Genmask         Flags Metric Iface
> 10.0.0.0     *         255.0.0.0       U     0      h2_2-eth1
> 10.0.0.1     10.0.1.2  255.255.255.255 UGH   2      h2_2-eth1
> 10.0.1.1     10.0.1.2  255.255.255.255 UGH   2      h2_2-eth1
>
> I said that everything is working "almost" as expected because I was expecting the routing tables of nodes 0 and 2 to include the IP address 10.0.1.2/32 as a possible destination, but this does not happen.
> I checked whether node 1 is including both IPs in its messages, and it does, so it seems like OLSR decides not to include that address in the routing table. The questions are:
> 1) why does this happen?
> 2) how can I tell OLSR to include all IPs when populating the routing tables?


By default Olsrd2 chooses a single "main IP" (called "originator
address" in the RFCs) from a random interface to identify the router
itself and only builds up routes towards this IP for every router.

The "loopback" has a priority in this IP selection, so it is a good
trick to set a "/32" IP on the loopback and add it to the list of
interfaces to set your IP independently from interfaces.

If you want a router to announce more IPs you need to tell it.

a) you can do this by hand in the configuration:

[olsrv2]
        lan 10.0.1.0/24


b) you can ask the lan_import plugin to export all routes belonging to
an interface

[lan_import=1]
       interface               eth0


Still, you should think about what a router exports... it is a BAD
idea to export the "subnet route" belonging to an interface you also
run olsrd2 on. Because your neighbors will add this route (with you as
the "next hop") to their routing table, which might disrupt outgoing
traffic for the interface.

Henning Rogge



More information about the Olsr-users mailing list