[Olsr-dev] Propagating a default gateway OLSRv2

Peter Emanuel (spam-protected)
Thu Jul 7 20:55:55 CEST 2016


Hi Henning,

Brilliant! Thanks so much. The Wiki page was extremely informative too. Not sure how I didn't run into it before.

Both methods worked. I had tried 

	olsrd2_static --set lan_import.interface=eth0 wlan0 lo &

without success. I am not sure whether the [lan_import=1] in the config file is significant. Regardless, I can move forward using the config file.

Which of your 2 methods is preferable since both seemed to work?

On the Android front - there are a number of caveats that I need to point out (even though I am not an Android guru). I ran into these when using olsrdv1.
Starting with Android release KitKat and onwards, Google started introducing more and more security. From a mesh standpoint, it became more of a pain.
1) They introduced secure linux as the only kernel the bootloader would boot.
2) They enforced compiling with -fPIE (Program Independent Executables) as well using as -fPIC
3) Worse yet, only authorized networks would work. The connection manager inside Android would not allow connecting to an Adhoc network like OLSRD. The connection manager needs to be modified inside Android authorizing the olsrd as a valid network and any application that wants to connect to the network has to register with the network (using Java Reflection or some such method). Local network communications work fine using later releases of Android if you compile with -fPIE when communicating from node to node but not when passing through the connection manager.

It's a pain to modify and recompile android. So, I plan to address this issue later but am sticking to my Android development using Jellybean (4.2.2) for now. Olsrd2 seems to work just fine with this Android release. That said, I targeted my Android build to platform android-18 even though the latest build is android-24 so I cannot vouch for any android platform after android-18. Using kitkat, the updated Chromium browser doesn't work nor does YouTube even on Jelly Bean. Opera and the built in browser works fine. YouTube from the browser works fine.

Two other thing I ran into with the olsrd2 sources is that epoll_create1 is only supported by later kernels that came into existence with android-21 so I had to modify your sources to use the prior epoll_create call rather than epoll_create1. I also had to pull in a separately compiled version of the netlink library to support linking the nl80211 listener.

Thank you so much for the help. It really has unblocked me. Onwards!

Peter E.

-----Original Message-----
From: Henning Rogge [mailto:(spam-protected)] 
Sent: Wednesday, July 06, 2016 11:27 PM
To: Peter Emanuel
Cc: olsr-dev
Subject: Re: [Olsr-dev] Propagating a default gateway OLSRv2

Hi,

first a question... could you see if olsrd2 in version 0.12.x works on Android without changes? Android was one of the issues why I rewrote the interface handling.

As you already guessed there are two ways to make an olsrd2 router to announce a prefix (in your case the default route).

The first is described under "Deployments" in the wiki:
http://www.olsr.org/mediawiki/index.php/OLSR_network_deployments#olsrd2_2

[olsrv2]
      lan    0.0.0.0/0

The second one is the lan_import plugin, which can automatically grab all route for a specific interface (or a different set of filters).

[lan_import=1]
     interface eth0


Henning

On Thu, Jul 7, 2016 at 12:33 AM, Peter Emanuel <(spam-protected)> wrote:
> I am working on a project that wants to use OLSR to extend the network 
> to villages in emerging economies. It combines very low cost Raspberry 
> PI’s running Linux using OLSR to build out a network backbone and 
> Android devices that join the network to  run Android apps. The 
> Android app that uses OLSR to achieve this was originally using 
> Version 1 of the protocol. For many good reasons, Version 2 is 
> desired. When using version 1, HNA was utilized for a particular node 
> to alert other nodes that it could use this node to route packets to 
> the Internet. A device that has the WiFi connected to the OLSR adhoc 
> network and has a hardwired Ethernet to the internet is a candidate 
> for this. A phone with a 3G or 4G cellular connection is also such a candidate.
>
>
>
> ·         I have Olsrd2 ported to Android and it is running inside an App on
> the Android devices
>
> ·         I am using olsrd2_static as it just makes it simpler (at least at
> this juncture)
>
> ·         I am using fixed IP addresses on the WiFi for now
>
> o   I do really want to have the devices generate their own IP’s as this is
> a cool version 2 enhancement but haven’t gotten that to work yet. Later!
>
>
>
> The problem is best explained using a simple 2 node network example.
>
> 192.168.18.5 is a gateway device. It’s hardwired address on eth0 is
> 192.168.1.115 and its default gateway to the Internet is the router at
> 192.168.1.1
>
> There is 1 other Android node on the test network – 192.168.18.106
>
> The gateway route on both devices looks like the following:
>
>
>
> Ip route on gateway
>
>
>
> default via 192.168.1.1 dev eth0
> 192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.115
> 192.168.18.0/24 dev wlan0  proto kernel  scope link  src 192.168.18.5
>
> 192.168.18.106 via 192.168.18.106 dev wlan0  proto 100 src 
> 192.168.18.5 metric 2 onlink
>
>
>
> Ip route on Android device 192.168.18.106
>
>
> 192.168.18.0/24 dev wlan0 proto kernel scope link src 192.168.18.106
>
> 192.168.18.5 via 192.168.18.5 dev wlan0  proto 100 src 192.168.18.106 
> metric
> 2 onlink
>
>
>
> When using HNA on OLSRDv1 with an entry in the conf file like
>
>
>
> Hna4
>
> {
>
> # Internet gateway
>
> 0.0.0.0  0.0.0.0
>
> }
>
>
>
> a default route on the Android device is added automatically
>
>
>
> default via 192.168.18.5 dev wlan0 metric 2 onlink
>
>
>
> It’s complete gateway now (using olsrv1) is
>
>
>
> default via 192.168.18.5 dev wlan0 metric 2 onlink
>
> 192.168.18.0/24 dev wlan0 proto kernel scope link src 192.168.18.106
>
> 192.168.18.5 via 192.168.18.5 dev wlan0  proto 100 src 192.168.18.106 
> metric
> 2 onlink
>
>
>
> Now the Android device can access the Internet by routing packets 
> through the gateway.
>
>
>
> However, I am not able to replicate the same behavior on OLSRDv2. I 
> have tried using the lan_import plugin but am a little clueless on how 
> to propagate the default gateway in version 2 from the gateway devices 
> to it’s edge devices.
>
>
>
> Can someone please help me set up my gateway device properly so the 
> Android devices can see the Internet?
>
>
>
> Here is the olsrd2_static –schema output:
>
>
>
> List of section types:
> (use this command with the types as parameter for more information)
>     domain (named, default name)
>     ff_dat_metric (unnamed)
>     global (unnamed)
>     http (unnamed): Settings for the http interface
>     interface (named)
>     lan_import (named)
>     log (unnamed)
>     mesh (unnamed)
>     neighbor_probing (unnamed)
>
>     nhdp (unnamed)
>
>     nl80211_listener (unnamed)
>     olsrv2 (unnamed)
>     telnet (unnamed): Settings for the telnet interface
>
> And olsrd2_static –version output
>
>
>
> OLSRd2 version 0.11.1
> Git commit: v0.11.1-0-g35a1f94
> Visit http://www.olsr.org
> Static plugin: auto_111
>
> Static plugin: cfg_compact
> Static plugin: class
> Static plugin: clock
> Static plugin: duplicate_set
> Static plugin: ff_dat_metric
> Static plugin: http
> Static plugin: lan_import
> Static plugin: layer2
> Static plugin: layer2info
> Static plugin: link_config
> Static plugin: neighbor_probing
> Static plugin: netjsoninfo
> Static plugin: nhdp
> Static plugin: nhdpinfo
>
> Static plugin: nl80211_listener
> Static plugin: olsrv2
> Static plugin: olsrv2info
> Static plugin: os_clock
> Static plugin: os_fd
> Static plugin: os_interface
> Static plugin: os_routing
> Static plugin: os_system
> Static plugin: packet_socket
> Static plugin: rfc5444
> Static plugin: socket
> Static plugin: stream_socket
> Static plugin: systeminfo
> Static plugin: telnet
> Static plugin: timer
> Static plugin: viewer
>
>
>
> Thanks for any help forthcoming.
>
>
>
> Peter Emanuel
>
>
>
>
>
>
> --
> Olsr-dev mailing list
> (spam-protected)
> https://lists.olsr.org/mailman/listinfo/olsr-dev




More information about the Olsr-dev mailing list