How to Install Oxidized on nixOS Latest

In this tutorial, we will go through the process of installing Oxidized on the latest version of nixOS. Oxidized is an open-source network configuration management tool that is widely used for backing up network configuration files. It supports a wide range of network devices including Cisco, Juniper, and many more.

Prerequisites

Before we proceed with the installation process, make sure that you have the following prerequisites:

  1. A machine running the latest version of nixOS
  2. Root access to the machine

Step 1: Install Dependencies

To install Oxidized on nixOS, we need to install some dependencies. In this step, we will install the required dependencies using the nix package manager.

  1. First, open up a terminal on your nixOS machine.

  2. Run the following command to update your package list:

    sudo nix-channel --update
    
  3. Then, install the required dependencies using the following command:

    sudo nix-env -i -A nixos.pkgs.libssh
    sudo nix-env -i -A nixos.pkgs.ruby_3_0
    sudo nix-env -i -A nixos.pkgs.git
    

    This command will install the libssh library, the Ruby programming language (version 3.0), and the Git version control system.

Step 2: Install Oxidized

Now that we have installed the required dependencies, we can proceed with the Oxidized installation process.

  1. Open up a terminal on your nixOS machine.

  2. Clone the Oxidized repository using the following command:

    git clone https://github.com/ytti/oxidized.git
    
  3. Change into the oxidized directory using the following command:

    cd oxidized
    
  4. Install Oxidized using the following command:

    sudo make install
    

This command will compile and install Oxidized on your nixOS machine.

Step 3: Configure Oxidized

Now that we have installed Oxidized on our nixOS machine, we need to configure it.

  1. Open up a terminal on your nixOS machine.

  2. Create a configuration file for Oxidized using the following command:

    sudo mkdir /etc/oxidized
    sudo touch /etc/oxidized/config
    
  3. Open the configuration file using a command-line editor such as nano, vim or emacs:

    sudo nano /etc/oxidized/config
    
  4. Add the following configuration to the file:

    ---
    username: admin
    password: admin
    model: cisco_ios
    interval: 3600
    use_ssl: false
    debug: false
    threads: 30
    timeout: 20
    retries: 3
    prompt: !ruby/regexp /^([\w.@-]+[#>]\s?)$/
    rest: 127.0.0.1:8888
    groups:
      router:
        username: some_user
        password: some_password
      switch:
        username: another_user
        password: another_password
    input:
      default: ssh
      ssh:
        secure: true
    output:
      default: file
      file:
        directory: /var/lib/oxidized/configs
    

This is a sample configuration that you can modify according to your requirements. You should change the device type and groups to match your network devices.

Step 4: Start Oxidized

Now that we have configured Oxidized, we can start it up.

  1. Open up a terminal on your nixOS machine.

  2. Start the oxidized service using the following command:

    sudo systemctl start oxidized
    
  3. Check the status of the service using the following command:

    sudo systemctl status oxidized
    

If the service status returns "active (running)", then Oxidized has been successfully installed and configured on your nixOS machine.

Conclusion

In this tutorial, we have gone through the process of installing and configuring Oxidized on the latest version of nixOS. With Oxidized, you can easily backup and manage your network device configurations, saving you time and hassle in the long run.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!