How to backup a sonicwall using rConfig

You can’t, at least not very easily.

So http://www.rconfig.com/ is pretty cool.

Unfortunately / fortunately (depending on your perspective) the creator of it got a more busy job at Dell, and hasn’t really been working on it any more.

So, there is a fair amount of chatter about how to get it to work for this or that. But really, the easiest way is to use a Bash Script on a linux box.

Like noted here http://sickbits.net/automated-backups-of-a-sonicwall-nsa-or-other-device-w-expect/

or

Here http://community.spiceworks.com/scripts/show_download/2543

The spiceworks script is a little more robust but same idea.

#!/bin/bash
###########################################################################
# Shell Script to backup Appliances SonicWALL firmware version 5.9 and above#
###########################################################################
# Variation affects Firmware backup commands of fwares before 5.9#
###########################################################################
##2
# Author : Ernander Marcus Lataliza Rosendo# Ernander<@>Gmail.com
# Last Change : Henrique Duarte#
##
##
###########################################################################
# VERSION : 1.1 | Last modified on 31/03/2014 17:45 pm#
##
# Fix :#
# Added date and time in the exported file#
# Added variable ” log “#
###########################################################################

# VARIABLE
#
# Do not remove the quotation marks :
#
# Directory for the log
DATE_TIME_UNDERLINE=$(date +%d”-“%m”-“%y”_”%H”:”%M)
DATE_TIME_PIPE=$(date +%d”-“%m”-“%y”|”%H”:”%M)
log=”/var/log/sonicwall_bkp.log”
# User Sonicwall | IF YOU CHANGES IN THE NAME OF ADMIN SYSTEM> PREFERENCES CHANGE THE VARIABLE LOGIN
login=”admin”
# Password sonicwall
password=”PASSWORD”
# Address sonicwall | IP OR FQDN
host=”192.168.168.168″
/usr/bin/expect <<EOF
spawn ssh $login@$host
expect -re “.*?assword:”
send “$password\n”
expect -re “>”
send “export current-config sonicos ftp ftp://USER_FTP:PASSWORD_FTP@IP_SERVER_FTP/bkp-SonicWall-$DATE_TIME_UNDERLINE.exp\n”

expect -re “>”
send “exit\n”
EOF

if [ $? = 0 ] ; then
echo ” $DATE_TIME_PIPE $host BKP done successfully!”;
else
echo “$DATE_TIME_PIPE – $host BKP HAS NOT BEEN DONE!”
fi

echo done

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s