Giter VIP home page Giter VIP logo

nak's Introduction

Network Administration Kit

Copyright (C) 2020 Tomas Hlavacek ([email protected])

Description

This is an tttempt to modernize network administration with Python and Ansible.

Currently NAK supports parsing VLANs, interface configuration, Port-channel confguration, vPC, VLT and BGP and users from IOS, NX-OS, Dell OS10, HP ProCurve and Brocade Ironware.

Moreover, NAK can write configuration to the same extent to IOS, NX-OS and OS10 boxes.

Compatibility matrix

VLANs L2 interface Port-channel vPC/VLT BGP
IOS RW RW RW N/A N
NX-OS RW RW RW RW N
OS10 RW RW RW RW N
ProCurve RO RO RO N/A N/A
Ironware RO RO RO N/A N

Installation

Prerequisities:

  • Python 3
  • Ansible
  • Napalm
pip3 install ansible
pip3 install napalm-dellos10
python3 setup.py install

Usage

The conversion of switch/router config file to YAML representation of VLANs and ports can be tested with example config file dumps.

box2yaml -t ios examples/cisco-ios-confg

box2yaml -t nxos examples/cisco-nexus-confg

box2yaml -t dellos10 examples/os10-confg

box2yaml -t procurve examples/hp-procurve-confg

box2yaml -t ironware examples/brocade-simple-confg

For configuring devices an Ansible inventory is needed - use examples/hosts as a starting point. Please note extra variables in the inventory:

all:
  vars:
    nak_commonconf: /var/lib/nak/vlans.yml
    nak_confdir: /var/lib/nak/yconfig

NAK assumes that nak_confdir contains a YAML config file for each switch in the inventory that could be cofigured/managed by NAK. Therefore for monster.taaa.eu NAK expects to find a file in /var/lib/nak/yconfig/monster.taaa.eu.yml.

To simulate configuration write and then to really write & commit the supported parts of the configuration you can run:

nak -s -l monter

which means "simulate" (-s) configuration and limit (-l) for host monster. NAK connects to the box, sends the candidate configuration, generates diff and prints the generated batch and the diff generated by the box (if supported by Napalm) and then the candidate configuration is discarded, so no changes are committed to the box.

When you are satisfied, you can run NAK for real - without -s parameter. NAK supports multiple -l <hostname> parameters or you can ommit limitations altogether and then all boxes in the entire inventory will be updated.

Last part of NAK is simple inv2csv that prints inventory in form of CSV. It is useful for generating Oxidized inventory and connecting any other tools that need access to the network boxes.

Future

Any contributions are welcome. Please fork & request merge. Issue requests are also welcome.

Plans:

  • support BGP
  • support VXLAN EVPN on NX-OS and OS10
  • support IOS-XR
  • support Junos
  • ... ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.