[Commotion-dev] Using UCI to define static routes on nodes

Ben West ben at gowasabi.net
Wed Jul 3 18:58:53 UTC 2013


The approach I've used for setting static routes besides what UCI tried to
configure has been to use the underlying command line tools directly, e.g.
with 'ifconfig' and 'route add ..."

It could be that UCI can only number interfaces reliably, but not always
set unconventional routes.  Especially since 'plug' is virtual interface
that could take multiple different addresses.

On Wed, Jul 3, 2013 at 1:51 PM, Will Hawkins <hawkinsw at opentechinstitute.org
> wrote:

> I'm sure that most everyone here knows about this, but it bit me
> yesterday and I wanted to post it for posterity (is that redundant?):
>
> OpenWRT users can define static routes on nodes through UCI. In the
> /etc/config/network file, it looks something like this:
>
> config route '<optional route name>'
>         option interface '<name of interface>'
>         option target '<target as dotted quad>'
>         option netmask '<netmask in dotted quad>'
>         option gateway '<gateway in dotted quad>'
>
> It can also be done through the web interface. Incredibly useful. Here's
> where I flubbed it:
>
> Let's say that my plug interface (eth0) is 172.16.0.0/16 but I want to
> use 192.168.1.1 as my gateway for a default route through the plug.
> Using 'ip', I could do this like:
>
> ip route add 0.0.0.0/0 via 192.168.1.1 dev eth0
>
> However, this type of "via" route is not possible using the UCI
> configuration. Before applying the static routes from the config, UCI
> checks to see if the gateway is in the interface's network range. There
> is probably a way around this, but I could not figure it out. Also, as
> far as I can tell, there's very little information spit out in the debug
> files to tell you about this.
>
> Please, PLEASE, let me know if you've worked through this issue before
> and successfully solved it. Otherwise, it's just something to keep in mind!
>
> Will
> _______________________________________________
> Commotion-dev mailing list
> Commotion-dev at lists.chambana.net
> https://lists.chambana.net/mailman/listinfo/commotion-dev
>
>


-- 
Ben West
http://gowasabi.net
ben at gowasabi.net
314-246-9434
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-dev/attachments/20130703/5e2183b1/attachment.html>


More information about the Commotion-dev mailing list