Giter VIP home page Giter VIP logo

networkmapper's Introduction

Network Mapper

This project is a small piece of python scripting that can be used to generate a network graph from network devices running cumulus. It has been tested on a gns3 simulation with cumulus 4.3.0 virtual appliances.

Methodology

The cumulus devices, once connected, use LLDP out of the box to get network information of the devices directly connected to its ports. The tool will basically pull this information from the appliances over SSH and then generate the map.

Dependencies

The script uses the graphviz utility and this needs to be installed for the graph generation to work correctly.

You can install it using sudo apt install graphviz

Installation and running

  • To install the script, first clone it into a directory.
  • Enter the directory and create a venv environment using python3 -m venv venv
  • Activate the virtual environment with the command source venv/bin/activate
  • Install the requirements with pip install -r requirements.txt
  • Enter the hosts.txt file and fill in the IP addresses of the hosts, or the hostnames if they are resolvable by DNS
  • Ensure that the same SSH username and password are used on all the cumulus devices as the script will ssh into the devices to retrieve the data.
  • The default username of cumulus is used, and you can set the SSHUSER env variable in the shell to change it using export SSHUSER=<username>
  • The password has to be exported as a shell variable for adding some security and you can set the password as export SSHPASS=<ssh password>
  • Run the script using python runMapper.py, and it should generate a graph of the network named network-diagram.png in the directory.
  • In some cases, depending on the ssh requirements, it may be necessary to drop to a root prompt and run the script to avoid issues with certificate checks.

Sample Output The test environment in GNS3 looks as follows :

GNS test

The output from the script looks as follows

Script output

networkmapper's People

Watchers

James Cloos avatar Bakhtyar Vachha 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.