Giter VIP home page Giter VIP logo

mind_nmap's Introduction

Mind nMap

logo

This script uses a number of different genie parses to create a formated markdown file and rendered HTML file of a given core-distribution-access Cisco topology.

Getting Started

  1. We recommend creating a python virtual environment to run this utility
  2. Software dependencies: pyATS and Markmap

Installation for Ubuntu

Virtual Environment

We recommend running Mind nMap in a Python virtual environment while testing or developing. This will help keep your host system clean and allow you to have multiple environments to try new things. If you are not using a virtual environment, start at the download/clone step below.

You will also need Python 3, pip, and venv installed on your host system.

In your project directory, create your virtual environment

python3 -m venv env

Activate (use) your new virtual environment (Linux):

source env/bin/activate

Download or clone the mind_nmap repository:

git clone https://github.com/automateyournetwork/mind_nmap.git

Install pyATS and markmap into your environment:

pip install pyats[full]
sudo apt update
sudo apt install npm
sudo npm install markmap-cli -g

Create your testbed file

here is an example of the required testbed file: *** SINGLE DEVICE ***

devices:
    Dist:
      alias: 'Dist'
      type: 'router'
      os: 'iosxe'
      role: dist
      platform: cat4500
      credentials:
        default:
          username: admin
          password: {{password}}
      connections:        
        cli:
          protocol: ssh
          ip: "192.168.1.10"
          arguments:
            connection_timeout: 360

*** TOPOLOGY ***

devices:
    Core:
      alias: 'Core'
      type: 'router'
      os: 'iosxe'
      role: dist
      platform: c9600
      credentials:
        default:
          username: admin
          password: {{password}}
      connections:        
        cli:
          protocol: ssh
          ip: "192.168.1.1"
          arguments:
            connection_timeout: 360
    Dist:
      alias: 'Dist'
      type: 'router'
      os: 'iosxe'
      role: dist
      platform: cat4500
      credentials:
        default:
          username: admin
          password: {{password}}
      connections:        
        cli:
          protocol: ssh
          ip: "192.168.1.5"
          arguments:
            connection_timeout: 360
    Access:
      alias: 'Access'
      type: 'router'
      os: 'iosxe'
      role: access
      platform: cat9300
      credentials:
        default:
          username: admin
          password: {{password}}
      connections:        
        cli:
          protocol: ssh
          ip: "192.168.1.10"
          arguments:
            connection_timeout: 360

NOTE: Highly recommended to encryt your passwords. Please use the following link for instructions on how to encyrpt your passwords with pyATS. https://pubhub.devnetcloud.com/media/pyats/docs/utilities/secret_strings.html

important note:

we use the custom tag role in our testbed to help build the topology, please lable your devices as core, dist, or access

Create your Markmap

$ cd mind_nmap
$ cd MindMaps
$ pyats run job MindMap_job.py --testbed-file ../testbeds/testbed_MindMap.yml

Viewing your MarkMap

The script will create one Layer 2 network map under /MindMaps/Devices/MindMap.md.

To view the formatted output as a markmap please install the MarkMap extension for VS Code or the files can be view externally by viewng the html versions.

L2 Map

Additionally there will be a markdown file per device that is also created. They will be located in the MindMaps/Network/Devices.

Device map

NOTE: the script has only been run on Cisco Catalyst and Nexus devices.

Links to dependancies

pyATS:

https://developer.cisco.com/pyats/

MarkMap:

https://markmap.js.org/repl

Try It Yourself!

Using the Cisco DevNet CML Sandbox you can try it for yourself!

  1. Visit https://devnetsandbox.cisco.com/RM/Topology

  2. Reserve the CML Sandbox

Reserve Sandbox

  1. Update the testbed_MindMap.yml topology from the testbed_CML_Sandbox_MindMap.yml (Replace the contents) to match the Access Layer

testbed_MindMap.yml

devices:
    dist-sw01:
     alias: 'dist-sw01'
     type: 'switch'
     os: 'nxos'
     role: 'access'
     platform: n9k
     credentials:
       default:
         username: cisco
         password: cisco
     connections:        
       cli:
         protocol: "ssh"
         ip: "10.10.20.177"
         arguments:
           connection_timeout: 360
    dist-sw02:
     alias: 'dist-sw02'
     type: 'switch'
     os: 'nxos'
     role: 'access'
     platform: n9k
     credentials:
       default:
         username: cisco
         password: cisco
     connections:        
       cli:
         protocol: "ssh"
         ip: "10.10.20.178"
         arguments:
           connection_timeout: 360

Mind Map Access Layer

mind_nmap's People

Contributors

automateyournetwork avatar devinjasloan avatar johncapobianco avatar

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.