Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 10:23 PM, Bastian Bittorf wrote: > * Felix Fietkau [15.09.2013 21:59]: >> > maybe i misunderstand uci - IMHO the question is: >> > how can i name an anonymous section? >> From the command line help: >> rename .[.]= > > 8-) ok, i could believe it - so one can NOT name a section, > but must generate an unamed/anonymous section and afterwards > rename this like: > > uci add network alias > uci set network.@alias[-1].interface=lan > ... > uci set network.@route[-1].interface="agoodname" > > > uci add network route > uci set network.@route[-1].interface="agoodname" > ... > > it's working and we send congratulations for > breaking the barrier today with r38000++ of OpenWrt 8-) You can also do 'uci set network.agoodname=alias' - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
* Felix Fietkau [15.09.2013 21:59]: > > maybe i misunderstand uci - IMHO the question is: > > how can i name an anonymous section? > From the command line help: > rename .[.]= 8-) ok, i could believe it - so one can NOT name a section, but must generate an unamed/anonymous section and afterwards rename this like: uci add network alias uci set network.@alias[-1].interface=lan ... uci set network.@route[-1].interface="agoodname" uci add network route uci set network.@route[-1].interface="agoodname" ... it's working and we send congratulations for breaking the barrier today with r38000++ of OpenWrt 8-) bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 7:55 PM, Bastian Bittorf wrote: > * Felix Fietkau [15.09.2013 19:50]: >> > which commands should i use for naming the alias section? i tried e.g. >> > >> > uci set network.@alias[-1].name=test >> > >> > can you please write down the commands in the right order? >> If you run uci without arguments, it'll print a command line help :) > > really, it does not help here, otherwise i would'nt ask: > > maybe i misunderstand uci - IMHO the question is: > how can i name an anonymous section? >From the command line help: rename .[.]= - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
* Felix Fietkau [15.09.2013 19:50]: > > which commands should i use for naming the alias section? i tried e.g. > > > > uci set network.@alias[-1].name=test > > > > can you please write down the commands in the right order? > If you run uci without arguments, it'll print a command line help :) really, it does not help here, otherwise i would'nt ask: maybe i misunderstand uci - IMHO the question is: how can i name an anonymous section? i want to give my 'alias' a name, e.g. 'myalias' and use this name as an reference for another construction (the route). is this the right way to do? i read the uci reference again and again, but i cannot find the answer. bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 2:35 PM, Bastian Bittorf wrote: > * Felix Fietkau [15.09.2013 13:54]: >> > uci add network alias >> > uci set network.@alias[-1].interface="lan" >> > uci set network.@alias[-1].bla=... >> > >> > uci add network route >> > uci set network.@route[-1].interface=cfg164d8f >> > uci set network.@route[-1].bla=... > >> Bad idea. The cfg164d8f name is not guaranteed to stay constant with >> changes to the section, so you should name the alias section instead of >> relying on autogenerated names on anonymous sections. > > which commands should i use for naming the alias section? i tried e.g. > > uci set network.@alias[-1].name=test > > can you please write down the commands in the right order? If you run uci without arguments, it'll print a command line help :) - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
* Felix Fietkau [15.09.2013 13:54]: > > uci add network alias > > uci set network.@alias[-1].interface="lan" > > uci set network.@alias[-1].bla=... > > > > uci add network route > > uci set network.@route[-1].interface=cfg164d8f > > uci set network.@route[-1].bla=... > Bad idea. The cfg164d8f name is not guaranteed to stay constant with > changes to the section, so you should name the alias section instead of > relying on autogenerated names on anonymous sections. which commands should i use for naming the alias section? i tried e.g. uci set network.@alias[-1].name=test can you please write down the commands in the right order? bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 1:25 PM, Bastian Bittorf wrote: > * Felix Fietkau [15.09.2013 12:52]: >> I probably should have written instead of alias. The alias >> section needs a name (it's considered an interface by netifd), and the >> route 'interface' option needs to point at that alias section name. > > thank you. it works like this: > > uci add network alias > uci set network.@alias[-1].interface="lan" > uci set network.@alias[-1].bla=... > ... > > uci add network route > uci set network.@route[-1].interface=cfg164d8f > uci set network.@route[-1].bla=... Bad idea. The cfg164d8f name is not guaranteed to stay constant with changes to the section, so you should name the alias section instead of relying on autogenerated names on anonymous sections. > i have to point to the handle 'uci add $section' gives me. > what does not work is: > > uci set network.@route[-1].interface=@[-2] > > why not? Because netifd looks up names internally, it does not use the uci extended lookup syntax. > also in http://wiki.openwrt.org/doc/uci/network#aliases > there is warning for 'deprecated'. what is the better way? You can create an interface section, and use @lan as ifname. The alias syntax will stay supported though. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
* Felix Fietkau [15.09.2013 12:52]: > I probably should have written instead of alias. The alias > section needs a name (it's considered an interface by netifd), and the > route 'interface' option needs to point at that alias section name. thank you. it works like this: uci add network alias uci set network.@alias[-1].interface="lan" uci set network.@alias[-1].bla=... ... uci add network route uci set network.@route[-1].interface=cfg164d8f uci set network.@route[-1].bla=... ... i have to point to the handle 'uci add $section' gives me. what does not work is: uci set network.@route[-1].interface=@[-2] why not? also in http://wiki.openwrt.org/doc/uci/network#aliases there is warning for 'deprecated'. what is the better way? bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 12:16 PM, Bastian Bittorf wrote: > * Felix Fietkau [15.09.2013 11:58]: >> Try network.myroute.interface=alias > > uci changes looks now like this: > > network.cfg114d8f=alias > network.cfg114d8f.interface=lan > network.cfg114d8f.proto=static > network.cfg114d8f.ipaddr=192.168.10.2 > network.cfg114d8f.netmask=255.255.255.0 > > network.cfg12c8b4=route > network.cfg12c8b4.interface=alias > network.cfg12c8b4.target=192.168.0.0 > network.cfg12c8b4.netmask=255.255.255.0 > network.cfg12c8b4.gateway=192.168.10.1 > > the alias-IP is applied, the route is not. > i'am sure i make a mistake, but which? I probably should have written instead of alias. The alias section needs a name (it's considered an interface by netifd), and the route 'interface' option needs to point at that alias section name. - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
* Felix Fietkau [15.09.2013 11:58]: > Try network.myroute.interface=alias uci changes looks now like this: network.cfg114d8f=alias network.cfg114d8f.interface=lan network.cfg114d8f.proto=static network.cfg114d8f.ipaddr=192.168.10.2 network.cfg114d8f.netmask=255.255.255.0 network.cfg12c8b4=route network.cfg12c8b4.interface=alias network.cfg12c8b4.target=192.168.0.0 network.cfg12c8b4.netmask=255.255.255.0 network.cfg12c8b4.gateway=192.168.10.1 the alias-IP is applied, the route is not. i'am sure i make a mistake, but which? manually it's working: ip route add 192.168.0.0/24 via 192.168.10.1 bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] netifd: problem setting routes for alias-networks
On 2013-09-15 10:20 AM, Bastian Bittorf wrote: > when setting an alias network via > > network.@alias[0]=alias > network.@alias[0].interface=lan > network.@alias[0].proto=static > network.@alias[0].ipaddr=192.168.10.2 > network.@alias[0].netmask=255.255.255.0 > > and adding a route 'myroute' on top of this, > the route will not be established on bootup > > network.myroute=route > network.myroute.interface=lan Try network.myroute.interface=alias - Felix ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] netifd: problem setting routes for alias-networks
when setting an alias network via network.@alias[0]=alias network.@alias[0].interface=lan network.@alias[0].proto=static network.@alias[0].ipaddr=192.168.10.2 network.@alias[0].netmask=255.255.255.0 and adding a route 'myroute' on top of this, the route will not be established on bootup network.myroute=route network.myroute.interface=lan network.myroute.target=192.168.0.0 network.myroute.netmask=255.255.255.0 network.myroute.gateway=192.168.10.1 maybe a order problem? first there must be the alias, then the route... bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel