Backing up devices with Duxbak

Introduction

Duxbak allows you to store backups of your eligible routers as a private Github repository every 6+ hours. Only configurations that have changed since the last backup will be stored so it does not flood your repository with unnecessary backups. Every router purchased from Duxtel will be eligible for free backups for 3 years after purchase, otherwise there will be plans available to allow you to continue to backup older devices or those purchased from other vendors.

There are two types of backup methods available:

  • The pull method, where Duxbak will pull the configuration from your device into the repository. This requires Duxbak to be able to reach your device through a public IP address, through a DDNS service (such as Mikrotiks IP Cloud) or via port forwarding on your gateway device. With this you will also be able to restore backups onto the device from the Duxbak system.
  • The push method, where a script will be loaded onto your device that sends backups to the Duxbak system. This method does not require you to have a public IP/DDNS name,nor does it require port forwarding.

Getting started

The first thing you will need to do is to visit duxbak.duxtel.com, and log in with your Github account. We recommend creating a dedicated Github account for this, so that the Duxbak system only has access to what is required rather than other projects in your current Github account.

Once signed in you will be greeted with your devices page, from here you are able to manage any existing devices and set up new device for backup. To add a new device you will need to click 'add new device'.




Setting up a pull Device

From here you must set a descriptive name for the router backup (this cannot be changed after it's set), the backup mode it will operate in (pull, in this case), as well as how to access the device through its IP address/dns name or port if you are forwarding this traffic from your gateway.

Once you have set up the IP address/hostname and port (port 22, unless you are port forwarding) you will need to click the Fetch button so that it can generate a host fingerprint for this device. The host fingerprint is important as it will allow our server to securely connect to the backup device and allow the configuration to be transferred via an encrypted connection.

The last thing you will need to do from here is to enter the serial of your device that is eligible for backup. You can either do this manually, or alternatively just hit 'fetch' and it should auto-fill if the device is reachable. If you do not enter a serial, the device will not be able to backup in most circumstances, the exception being that each account can have 5 devices backed up without it being brought from us, or that is outside of the 3 year free backup period.



Once you have filled in all the required configuration and clicked the 'add device' button, you should see the 'routers backup' menu. Here you can download install scripts and manually backup your device. For now, we only need to download the setup script by clicking the script link.


 

Once you have downloaded your script, you will need to log into the router which you are backing up. Then, upload the file to the device (either by dragging and dropping it into your winbox window, going to the files submenu and clicking the upload button or using FTP to transfer the script to the router via IP). Once the file has been uploaded you will need to open a new terminal. Then, run the following command: 'import file=(name of script including the extension)'.



After this is done, go back to the Duxbak site and open the devices backup page by clicking on the devices name from the main menu. Now, click on the 'backup now' button to make sure this is working.



If this is not working, an error message will be displayed. Please either visit our help and support page by following the link at the bottom right, or by visiting https://duxbak.duxtel.com/faq. Alternately you can contact our team for support if you are unsure on what the issue could be. Please do this by emailing support@duxtel.com and with the error message along with a supout of your device.




Notes on setting up a pull device behind NAT

If your device is behind a firewall, you are still able to use the pull method. This is done via a destination NAT rule on your Gateway device, which sends traffic on a specific port to the device you are managing via Duxbak. For example, if my gateway router had public IP address 1.1.1.1 on ether1, and my backup device had local IP 2.2.2.2, I could add the rule: `/ip firewall nat add action=dst-nat chain=dstnat in-interface=ether1 protocol=tcp src-port=55555
to-addresses=2.2.2.2 to-ports=22`.  Then, I would go to the devices configuration page on Duxbak and set the port to 55555. 


Setting up a Push device

Setting up a push device is a little simpler. Again, you will need to add a new device, but for its configuration you will only have to enter a name for the device along with the serial (if this is not being set up as one of your five 'free' devices). After that, you will need to go to the devices backup page by clicking the devices name from the main menu of Duxbak to download the script.




Once you have your script, log into the router you wish to backup, and upload the script (by dragging and dropping the file in winbox, or going to files>upload in webfig). Once the script is on your router you will need to open a new terminal and run the following: 'import file=(name of script including the extension)'


 

Then, check to see if your configuration is working by going to to system>scripts and selecting the DuxBakPush script and clicking run. This can take a minute or two, and you can check for errors in the logs.

Again, if there's an error, please either visit our help and support page by following the link at the bottom right, or by visiting https://duxbak.duxtel.com/faq. Alternately you can contact our team for support if you are unsure on what the issue could be. Please do this by emailing support@duxtel.com and with the error message along with a supout of your device.




 

If everything was successful, you should be able to see the new backup in the devices page