OpenWrt Forum Archive

Topic: Cloning running OpenWrt to >10 other routers

The content of this topic has been archived on 1 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi all,

i have following situation:

I setup one router with all changes and modification i needed. Also own scripts etc...

Is there an easy way to clone  the whole syste, without any big efforts to other routers ( exact same vendor and model) ?

I'm using ATTITUDE ADJUSTMENT (12.09, r36088)
JTAG seems to be an option but I heard it's fu**** slow

Thanks a lot
DerBasser

Can't you just backup the settings and restore them to other routers?

For ten routers I'd recommend to use the build-system to build your preconfigured images. Then you can flash them with the preinstalled features/settings to as many routers as you like :-)

Thank for the Tip with the build-system. I will have a detailed look at it!

No problem!!

you can use "dd" command to dump the firmware partion to a file, the web flash the file to other routers.

tomine wrote:

you can use "dd" command to dump the firmware partion to a file, the web flash the file to other routers.

Not that smart, not all settings should be cloned, (mac addresses etc). Building a custom firmware is a better solution.
Also because he mentions potential different routers.

So dd could be used for a full backup option.
Copying the img to the RAM and dding to the flash?

=> Is this also with the squashfs possible??

For the initial setup dd isn't so good as you already said because of the unique settings.

dd could be used for a full backup, but it is a pain. (also there is a nice backup function in openwrt anyway).
Also the image dump can't be flashed with web flash
But I recommend compiling your own firmware:
see:

http://wiki.openwrt.org/doc/howto/build
http://wiki.openwrt.org/doc/howto/build#custom.files

edit:
I agree with written_direcon, don't use it, it creates more trouble then it solves wink (should have put it that way)

(Last edited by FriedZombie on 16 Oct 2013, 16:00)

Thanks a lot for the help!!!

openwrt is quite cool but it needs time to get into it wink

Yes, but OpenWrt is a powerfull/flexible router distribution.

But you'll love it.

Btw. do not use the dd command!!

You are probably using a squashfs build, like most users.
Then all you modifications (add-on packages and settings) are located in /overlay directory. E.g. all your modified settings in /etc/config are actually in /overlay/etc/config.

The advice regarding building an own version with the needed add-on packages is sound. You can also include the "common" settings following the already given advice regarding "custom files". I am doing that for my own build for several routers.

You could copy the settings of that one configured router from /overlay/etc/config and include them as custom files to your build, along all the needed add-on packages. If you then flash the routers with that personal firmware, you would only need to set/edit the differing settings to the other routers.

Some hints about automating settings for other routers:
- you could pack into firmware special script files to be run in other routers. Those scripts would then e.g. unpack a tar archive, where your settings for router X are. I use that way to pack my perssonal settings in encrypted form to my community build: https://forum.openwrt.org/viewtopic.php … 96#p142896
-wifi: you can avoid specifying MAC, if you use phy0 and phy1 approach. then the same wifi settings are valid for all routers. See discussion near https://forum.openwrt.org/viewtopic.php … 24#p185424
- you could write an uci script to set the other different settings. Example below, how I change a router to be a dummier repeater:

+#!/bin/sh
+uci set system.@system[0].hostname=OpenWrt2
+uci set network.lan.ipaddr=192.168.1.2
+uci set network.lan.gateway=192.168.1.1
+uci set network.lan.dns=192.168.1.1
+uci set network.henet.auto=0
+uci set network.sixxs.auto=0
+uci set network.lan6=interface
+uci set network.lan6.ifname=@lan
+uci set network.lan6.proto=dhcpv6
+uci set network.lan6.reqprefix=no
+uci set wireless.@wifi-device[0].channel=9
+uci set wireless.@wifi-device[1].channel=44
+uci set wireless.@wifi-iface[1].mode=ap
+uci set dhcp.lan.ignore=1
+uci set dhcp.lan.force=0
+uci delete 6relayd.default.dhcpv6
+uci delete 6relayd.default.rd
+uci commit dhcp
+uci commit network
+uci commit wireless
+uci commit system
+uci commit 6relayd
+/etc/init.d/dnsmasq disable
+# /etc/init.d/6relayd disable

(Last edited by hnyman on 16 Oct 2013, 16:36)

The discussion might have continued from here.