[ previous ] [ next ] [ threads ]
 
 From:  Joey Morin <joeymorin at alumni dot uwaterloo dot ca>
 To:  mediomen27 <mediomen27 at gmail dot com>
 Cc:  m0n0wall <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Re: [m0n0wall] backup old firmware
 Date:  Wed, 15 Jan 2014 13:04:14 -0500
oops, had meant to reply-all...

---------- Forwarded message ----------
From: Joey Morin <joeymorin at alumni dot uwaterloo dot ca>
Date: Wed, Jan 15, 2014 at 1:03 PM
Subject: Re: [m0n0wall] backup old firmware
To: mediomen27 <mediomen27 at gmail dot com>


I don't think m0n0 has tftp... I could be mistaken...

In any case, when I've wanted to grab an image of the firmware on a remote
m0n0, I've done this from a command line:

curl -k -u root --anyauth
"https://<m0n0>/exec_raw.php?cmd=dd%20if=/dev/ad0%20bs=512%20count=65536%202>%20/dev/null|gzip%20-9"
> m0n0_image.gz

This will dump the first 32 MB of the boot device.  change the count=
argument to dd if you want more or less.

Note that I've enabled SSL-only access, hence the https://, and I've
changed the name of the m0n0's admin account to root, hence -u root.  The
boot device on my m0n0 is /dev/ad0, it might be something else on yours.
Go to the exec.php page and run dmesg to find out.

Note also that I use -k so that curl didn't validate the certificate.  This
is of no concern to me as I generally do the transfer from a trusted
LAN-side server inside the m0n0wall-protected network, over an SSH session
NATed through the m0n0.

I actually used this to retrieve an image of an entire 3GB harddrive on a
remote m0n0.  It had been hastily deployed using an old office desktop that
had been sitting in a storage closet for years.  Unfortunately, despite
assurances I received from staff that the data had been backed up, it was
discovered later that it had not been.

The m0n0 install had overwritten the first few MB of the drive, but I was
able to perform data recover on the remaining image and retrieve all
important files.

The handy thing was that this was done remotely, and without taking down
the m0n0 :)

Note that I'm still using 1.33 :( ... since 1.34 the API for exec_raw.php
has changed and the above won't work.  Perhaps someone with experience with
1.34 and curl can advise you.

JJ




On Wed, Jan 15, 2014 at 10:40 AM, mediomen27 <mediomen27 at gmail dot com> wrote:

> Hi, I want install m0n0wall on my home router but before I would like to
> make a firmware backup. Anyone know how to make it by tftp ?
>




On Wed, Jan 15, 2014 at 10:40 AM, mediomen27 <mediomen27 at gmail dot com> wrote:

> Hi, I want install m0n0wall on my home router but before I would like to
> make a firmware backup. Anyone know how to make it by tftp ?
>