[OLSR-users] dis/enabling HNA4 while olsrd is running

Sven-Ola Tuecke (spam-protected)
Tue Nov 2 11:28:58 CET 2004


Hi Jens,

with the dyn_gw plugin, I presume a simple cron job will do. Add a static 
default route, if your test address is pingable, remove if not. Of course, 
you need another static route for the test address (if it comes up 
again...). Put something like this on regulary schedule and the (hopefully 
someday functional) plugin will do the rest:

#!/bin/sh
#  192.168.2.2 is your gateway box, 141.1.1.1 is your well known test ip
if ping -c 2 141.1.1.1; then
  route del 141.1.1.1 netmask 255.255.255.255 gw 192.168.2.2
  route add default gw 192.168.2.2
else
  route del default gw 192.168.2.2
  route add 141.1.1.1 netmask 255.255.255.255 gw 192.168.2.2
fi

(Question is: Does dyn_gw also announces HNA4(141.1.1.1/255.255.255.255) for 
that single 141.1.1.1 route?)

Sven-Ola

"Jens Nachtigall" <(spam-protected)> schrieb im Newsbeitrag 
news:<(spam-protected)>...

> This would be a typical plug-in scenario. Actually there is already
> a plugin(dyn_gw) that adds and removed Internet HNA4 announcments
> dynamically based on the existence of a default route(with metric 0).
> You should check it out.

Thanks for the pointer. However, this does not do what I actually want,
i.e. validating HNA4 values entered by the user (preferably by
pinging):

init:
Get HNA_SET
announcable = true

periodically scheduled:
if HNA4_entry announcable
  if (NOT (IPs in HNA4_entry pingable))
    remove HNA4_entry from announcements
else
  if (IPs in HNA4_entry pingable)
     add HNA4_entry to announcements


Looks fairly straightforward.

1 thing would be needed to ease writing this plugin:
1st: Having the user state which IPs she/he wants to ping from within a
given HNA4-net. Any ideas on how to do this? Of course, I could asked
for a plugin's config:
hna4 ip netmask [IP IP ...]
However, this is a bit redundant, since hna4 is already given in the
olsrd.conf

Suggestions very welcome,

Jens


----------




More information about the Olsr-users mailing list