* Re: [Cerowrt-devel] Scripting CeroWrt config [not found] <mailman.2.1328904001.31486.cerowrt-devel@lists.bufferbloat.net> @ 2012-02-11 3:33 ` Richard Brown 0 siblings, 0 replies; 3+ messages in thread From: Richard Brown @ 2012-02-11 3:33 UTC (permalink / raw) To: cerowrt-devel > > What's the best way to script this? > > #!/bin/sh > > 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 Bingo! The attached script is *much* easier than configuring it by hand. Rich #!/bin/sh # Install and configure the various bits of the # CeroWrt router for my preferred setup. # 10 Feb 2012 -reb # # ssh root@172.30.42.1 # cd /tmp # cp > config.sh # [paste in the contents of this file, then hit ^D] # sh config.sh # Presto! opkg update # retrieve updated packages opkg install snmpd fprobe # install snmpd & fprobe /etc/init.d/snmpd start # default snmpd config uses 'public' /etc/init.d/snmpd enable # community string for SNMPv1 & SNMPv2c # Start fprobe now to send netflow records to local netflow # collector at 192.168.2.13 (I use http://intermapper.com) fprobe -i ge00 -f ip -d 15 -e 60 192.168.2.13:2055 # Also edit /etc/rc.local to add the same command # so that it will start after next reboot sed -i '$ i\ fprobe -i ge00 -f ip -d 15 -e 60 192.168.2.13:2055' /etc/rc.local ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <mailman.0.1328817602.19893.cerowrt-devel@lists.bufferbloat.net>]
* [Cerowrt-devel] Scripting CeroWrt config [not found] <mailman.0.1328817602.19893.cerowrt-devel@lists.bufferbloat.net> @ 2012-02-09 22:25 ` Richard Brown 2012-02-10 2:32 ` Dave Taht 0 siblings, 1 reply; 3+ messages in thread From: Richard Brown @ 2012-02-09 22:25 UTC (permalink / raw) To: cerowrt-devel 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). What's the best way to script this? 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?) Thanks! Rich ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Cerowrt-devel] Scripting CeroWrt config 2012-02-09 22:25 ` Richard Brown @ 2012-02-10 2:32 ` Dave Taht 0 siblings, 0 replies; 3+ messages in thread From: Dave Taht @ 2012-02-10 2:32 UTC (permalink / raw) To: Richard Brown; +Cc: cerowrt-devel On Thu, Feb 9, 2012 at 11:25 PM, Richard Brown <richard.e.brown@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. example: uci show network There is decent doc on that on the openwrt web site. > > What's the best way to script this? #!/bin/sh 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` parse_network_somehow 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@lists.bufferbloat.net > https://lists.bufferbloat.net/listinfo/cerowrt-devel -- Dave Täht SKYPE: davetaht US Tel: 1-239-829-5608 FR Tel: 0638645374 http://www.bufferbloat.net ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-11 3:34 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <mailman.2.1328904001.31486.cerowrt-devel@lists.bufferbloat.net> 2012-02-11 3:33 ` [Cerowrt-devel] Scripting CeroWrt config Richard Brown [not found] <mailman.0.1328817602.19893.cerowrt-devel@lists.bufferbloat.net> 2012-02-09 22:25 ` Richard Brown 2012-02-10 2:32 ` Dave Taht
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox