[Cerowrt-devel] Scripting CeroWrt config

Dave Taht dave.taht at gmail.com
Thu Feb 9 21:32:57 EST 2012

On Thu, Feb 9, 2012 at 11:25 PM, Richard Brown
<richard.e.brown at dartware.com> wrote:
> Folks,
> I make a number of changes to the router each time I install new firmware. Specifically:
> - I install the snmpd and fprobe packages
> - I start and enable snmpd
> - I configure fprobe to send data to my InterMapper server for monitoring, and add that command to the startup script
> - At some point, I may want to change from 172.30.42.x addresses to my "normal" network address range (192.168.2.x).

I have a similar need to script things better. The uci interface can
be quite cool.
I would suggest playing with that.


uci show network

There is decent doc on that on the openwrt web site.

> What's the best way to script this?


opkg update
opkg install snmpd fprobe
sed -i s/172.30.42/192.168.2/g /etc/config/* /etc/babeld.conf (etc -
the full string is on the wiki)

# etc, etc

# and wip for me...
opkg install ipv6policy
net=`generate-rfc4193-addr se00`
get a string of useful networks
uci set network.se00.ip6addr=whatever/64
uci set network.sw00.ip6addr=whatever/64
stick in dns somehow

etc. the ash shell is quite limited so I'd suggest developing your
script on the box.

>I'm quite content to paste in a set of commands over ssh, but wonder if there's another way... (Would save/restore do all this?)

I'm not, and I agree, this gets very tedious after a while.
I'm very glad I use a routing protocol, because keeping
bloatlab #1 operational without it is nearly impossible.

(as it is, I reflash one box, wait for it to appear anew,
 change everything, reboot it, do another one)

and for all that I've 'lost' 2 of the 8 boxes on that network
(in california) and don't know which ones they are!!

save/restore is unlikely to be a good idea at this point. Too much
stuff changing.

What I do for my much more complex configurations (includes ipv6
and I'd like very much to make it more generic)

i snarf a copy of the default config via scp to my main machine
check all that in git
make the 'perfect' configuration
check all those changes into git

build a new box
snarf it
do diffs...

I'm also working on a generic set of testbed tools for
creating ipv6 ula addresses and getting them into dns.

> Thanks!
> Rich
> _______________________________________________
> Cerowrt-devel mailing list
> Cerowrt-devel at lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cerowrt-devel

Dave Täht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374

More information about the Cerowrt-devel mailing list