[Olsr-dev] weird interface flapping with olsrd-0.9.0.3

Daniel Golle (spam-protected)
Sat Feb 13 18:23:54 CET 2016


Hi!

I recently updated a router (x86_64) running olsrd to OpenWrt's new
Chaos Calmer release, resulting in a weird problem where the interface
configured seems to be constantly removed and re-added by olsrd.
This results in my syslog being poluted with lines like

Sat Feb 13 19:08:18 2016 daemon.info olsrd[10718]: Removing interface lan
Sat Feb 13 19:08:18 2016 daemon.info olsrd[10718]: Adding interface lan
Sat Feb 13 19:08:20 2016 daemon.info olsrd[10718]: Removing interface lan
Sat Feb 13 19:08:20 2016 daemon.info olsrd[10718]: Adding interface lan
Sat Feb 13 19:08:22 2016 daemon.info olsrd[10718]: Removing interface lan
Sat Feb 13 19:08:22 2016 daemon.info olsrd[10718]: Adding interface lan
Sat Feb 13 19:08:24 2016 daemon.info olsrd[10718]: Removing interface lan
Sat Feb 13 19:08:24 2016 daemon.info olsrd[10718]: Adding interface lan
Sat Feb 13 19:08:26 2016 daemon.info olsrd[10718]: Removing interface lan
Sat Feb 13 19:08:26 2016 daemon.info olsrd[10718]: Adding interface lan

It seems to happen only if the interface used for olsr has multiple
IPv4 addresses assigned to it and IPv4Src is *not* the primary address
of the interface. An additional reason could be that the layer-2 device
is a VLAN (if you're not using OpenWrt, similar things can be done via:
ip link add link eth0 name lan type vlan vlan_id 2

The problem reliably occurs with this network config:

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config device 'modemvlan'
    option ifname 'eth0'
    option name 'modem'
    option type '8021q'
    option vid '7'

config device 'lanvlan'
    option ifname 'eth0'
    option name 'lan'
    option type '8021q'
    option vid '1'

config interface 'lan'
    option ifname 'lan'
    option proto 'static'
    option defaultroute '0'
    option peerdns '0'
    option AdvRouterAddr '1'
    option ipaddr '192.168.0.138'
    option netmask '255.255.255.0'
    option ip6addr '2002:aaaa:bbbb:cccc::1/64'

config interface 'wan'
    option proto 'pppoe'
    option ifname 'modem'
    option username 'xxxxxxxx'
    option password 'yyyyyyyy'

config interface 'modem'
    option proto 'static'
    option ifname 'modem'
    option netmask '255.255.255.0'
    option defaultroute '0'
    option peerdns '0'
    option ipaddr '10.0.0.1'

config interface 'olsr'
    option proto 'static'
    option ifname '@lan'
    option ipaddr '10.1.2.3'
    option netmask '255.255.255.255'

config interface 'wan6'
    option proto '6to4'

---

However, it doesn't occur when swapping the primary/secondary
addresses. This makes olsrd stop poluting my syslog, however, it's not
that nice because now the DHCP server fails to start because it checks
if the primary address of interface is within the subnet it's supposed
to hand-out addresses for (and that kinda makes sense as there can only
be a single DHCP server on a layer-2 segment)

So this config works for olsrd, but breaks odhcpd:

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config device 'modemvlan'
    option ifname 'eth0'
    option name 'modem'
    option type '8021q'
    option vid '7'

config device 'lanvlan'
    option ifname 'eth0'
    option name 'lan'
    option type '8021q'
    option vid '1'

config interface 'lan'
    option ifname '@olsr'
    option proto 'static'
    option defaultroute '0'
    option peerdns '0'
    option AdvRouterAddr '1'
    option ipaddr '192.168.0.138'
    option netmask '255.255.255.0'
    option ip6addr '2002:aaaa:bbbb:cccc::1/64'

config interface 'wan'
    option proto 'pppoe'
    option ifname 'modem'
    option username 'xxxxxxxx'
    option password 'yyyyyyyy'

config interface 'modem'
    option proto 'static'
    option ifname 'modem'
    option netmask '255.255.255.0'
    option defaultroute '0'
    option peerdns '0'
    option ipaddr '10.0.0.1'

config interface 'olsr'
    option proto 'static'
    option ifname 'lan'
    option ipaddr '10.1.2.3'
    option netmask '255.255.255.255'

config interface 'wan6'
    option proto '6to4'


I'm in a dilemma and would appreciate any help debugging the issue.

Thank you in advance for your support!

Best regards


Daniel



More information about the Olsr-dev mailing list