Always backup the configuration of your Opengear device after making significant changes and before performing a firmware upgrade.
Configuration backups can be saved remotely, e.g. to a server, or saved to locally attached USB mass storage.
For information on the OPG backup file format, refer to this article.
To begin, login to the Opengear CLI and root, or an admin group user and become root with:
sudo -s
Config backup commands
This config command exports configuration in OPG format:
config -e /working/dir/filename.opg
.. and this command imports:
config -i /working/dir/filename.opg
Note: See the warning in Gotchas below, regarding importing after a recent factory erase.
Alternative 1. Use a temporary working directory
You may use RAM (tmpfs mounted under /var/tmp/) as your working directory, e.g.:
config -e /var/tmp/my-backup.opg
Before doing so, check there is available space. Use this command to display how much space your configuration backup will require:
du -h /etc/config/ | awk 'END { print $1 }'
Use this command to display free space in tmpfs, ensure it is greater than the previous value:
df -h | awk '/^tmpfs/ { print $4 }'
See below for how to copy files to and from this directory.
Alternative 2. Mount a working directory
Otherwise you may want to export directly to a remotely mounted (e.g. NFS) or locally mounted (e.g. USB) filesystem. List mount points to which the configuration can be saved:
mount | awk '/mnt/ { print $3 }'
If your target filesystem is not listed, you can mount it temporarily, e.g.:
mkdir -p /var/mnt/working/ mount -t nfs nfs-server.corp.com:/home/exports/backups/ /var/mnt/working/
Don't forget to tidy up when you're done:
umount /var/mnt/working/
rmdir /var/mnt/working/
Copying backups to/from a remote server
Use scp to copy the backup to a remote system, e.g.:
scp /var/tmp/my-backup.opg robertw@server.corp.com:/home/robertw/backups/
To copy it from a remote server, either run scp, WinScp or similar on the remote server, or on the Opengear device run scp, e.g.:
scp robertw@server.corp.com:/home/robertw/backups/previous-backup.opg /var/tmp/
Gotchas
If restoring to either a new unit or one that has been factory defaulted, it's important to ensure the process generating SSH keys is not running before you continue:
ps w | grep ssh-keygen | grep -v grep
If this returns no output, you may continue. Otherwise a mix of old and new SSH keys may result, preventing remote SSH access.
Comments
0 comments
Article is closed for comments.