Oxidized is an open-source network device configuration backup tool, created as an alternative to the popular RANCID software. Oxidized is highly suitable for centralizing backups of network devices, making it easier to manage and recover configurations from various devices within a single platform. This article provides a step-by-step guide on how to install this Backup Tool for network configuration backup on a Debian 11 system.

Introduction

Oxidized is a powerful, yet lightweight tool designed for network device configuration backups, offering extensive compatibility with over 130 different operating systems. Whether you’re managing a small network or a large-scale infrastructure, this Backup Tool streamlines the backup process, replacing older tools like RANCID with modern, efficient capabilities. Its flexibility and robust feature set make it an essential solution for network administrators looking to automate and centralize their configuration management.

Feature Highlights

  • Dynamically adjusts thread usage to ensure timely retrieval of configurations
  • Comprehensive RESTful API for seamless management of devices and configuration retrieval
  • Supports Syslog (UDP+file) for real-time config fetch triggers on IOS and JunOS changes
  • Integrated Git support for detailed change tracking and version control using ‘git blame’
  • Proven compatibility with a range of devices including Cisco, Juniper, Mikrotik, and Dell Force10

Prerequisites

Before we get started, make sure you have the following software and devices ready:

  • Oxidized – We’ll be using version 0.28.0 or latest for this setup.
  • Operating System – This guide is tailored for Debian 11, so you’ll need that installed on your system.
  • Network Devices – We’re working with a mix of Mikrotik (CCR, MAP Lite, RB450), Cisco (C2960G), and Dell Force10 (S60) devices.

How To Install Oxidized

Let’s start by installing the necessary tools and libraries that Oxidized needs to run smoothly on your Debian 11 system. Follow these simple steps:

These commands will install Ruby, which is the language Oxidized is written in, along with other essential libraries. By the end, you’ll have Oxidized and its web interface ready to go!

Create User and Set Up Environment

Next, we’ll set up a dedicated user and environment for Oxidized to keep everything organized and secure. Here’s how to do it:

Baca juga:  Cara Seting Mikrotik DHCP Server Dengan VLAN

These commands create a new user named ‘oxidized’ without login access, set up the necessary directories, and configure the environment for Oxidized.

Now, let’s create the initial configuration files that Oxidized will use:

This will generate empty configuration files where you’ll define your settings and devices later on.

Configuring Oxidized

To get Oxidized up and running, you’ll need to fill in the configuration file at /opt/oxidized/.config/oxidized/config. This file sets how this Backup Tool will operate, including how it saves and syncs your network configurations. Here’s a sample configuration to get you started:

This configuration ensures this Backup Tool listens for requests on your local server, logs its activities, and saves your device configurations securely. The remove_secret: true setting is particularly important as it helps protect sensitive information like passwords by removing them from the backup files.

Baca juga:  Squid sejajar client

Simply copy and paste this configuration into the config file, adjust the placeholders with your actual details, and you’re all set!

Configuring Your Router Database

Next, you’ll need to set up the router database that this Backup Tool will use to manage your network devices. Open the file at /opt/oxidized/.config/oxidized/router.db and enter the following information:

This file is formatted as a CSV (Comma-Separated Values) file but uses a colon (:) as the separator. Each line represents a device and includes:

  • name: The name you give to the device (e.g., cisco-SW).
  • ip: The IP address of the device (e.g., 172.x.x.x).
  • model: The type of device (e.g., cisco).
  • group: A label to categorize the device (e.g., cisco).

Simply replace the example values with your own device details. This setup allows this Backup Tool to recognize and connect to your network devices correctly.

Set Permissions

To ensure that this Backup Tool can access and manage its files properly, you need to adjust the permissions for the /opt/oxidized directory. This involves changing the ownership of the directory so that the oxidized user has full control.

Run the following command to update the directory permissions:

This command makes the oxidized user the owner of all files and subdirectories within /opt/oxidized. This step is crucial for ensuring that this Backup Tool can operate smoothly without permission issues.

Create Oxidized Service

To make Oxidized start automatically and manage it as a service, you’ll need to create a service file. This file will allow you to control Oxidized using standard system commands like starting, stopping, and enabling the service.

Create a file named oxidized.service in the /lib/systemd/system/ directory. You can do this by following these simple steps:

Then, add the following content to the file:

This configuration sets up Oxidized to start automatically at boot and ensures it runs under the correct user. After creating the file, you can manage this Backup Tool service easily with system commands.

Baca juga:  Lab OSPF Mikrotik Pada Topologi Jaringan Dengan 3 Router

Start and Enable the Oxidized Service

Now that you’ve set up the service file, it’s time to start Oxidized and make sure it runs automatically every time your system boots up.

To get Oxidized up and running, use the following commands:

The first command starts Oxidized right away, so it begins managing your network device backups. The second command ensures that Oxidized will start automatically whenever your system starts up, so you don’t have to start it manually each time.

Verification

Once you’ve started the Oxidized service, it will begin retrieving configuration data from all the devices you listed. To check if everything is working correctly, you can look inside the output directory where this Backup Tool stores the backups.

Use the following command to view the contents of the output directory:

This output structure shows that this Backup Tool has successfully created directories for each device type (cisco, force10, mikrotik) and saved their respective configuration files inside. The README.md file provides additional information about the backup files.

this Backup Tool organizes your backups by creating a separate folder for each group of devices. This makes it easy to find and manage configurations for different device types.

Troubleshooting

If something goes wrong, here’s how to troubleshoot:

  • systemctl status oxidized.service – Check this command to make sure the Oxidized service is running smoothly without any issues.
  • /opt/oxidized/.config/oxidized/logs/oxidized.log – Look here for detailed logs and error messages from Oxidized.
  • /opt/oxidized/.config/oxidized/crash – This file contains information about any crashes that may have occurred.
  • /var/log/syslog – This system log file might have useful information related to Oxidized’s operation.
  • debug: true – You can enable debugging in the Oxidized configuration to get more detailed error reports if needed.

For additional help, check out the official Oxidized documentation. Stay tuned for our next post, where we’ll cover how to set up auto-syncing with a Git repository.