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

Will Hawkins hawkinsw at opentechinstitute.org
Wed Jul 3 19:13:38 UTC 2013


Ben,

Thanks for your reply. I agree. 'ip route add ...' is far more flexible.
So, I guess we'll attempt to work with that in future. I really wanted
to use "standard" UCI in this case just, well, because.

Will

On 07/03/2013 02:58 PM, Ben West wrote:
> 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 <mailto: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
>     <http://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 <http://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
>     <mailto:Commotion-dev at lists.chambana.net>
>     https://lists.chambana.net/mailman/listinfo/commotion-dev
> 
> 
> 
> 
> -- 
> Ben West
> http://gowasabi.net
> ben at gowasabi.net <mailto:ben at gowasabi.net>
> 314-246-9434


More information about the Commotion-dev mailing list