Coder Social home page Coder Social logo

ospfcli2dot's Introduction

ospfcli2dot

Converts the output of Cisco IOS command "show ip ospf database router" into a GraphViz DOT file.

GraphViz can then plot the DOT file into a vertex / edge style graph depicting your network topology and the associated OSPF costs. Any asymmetric link costs (different cost set on each end of the link) show up in red.

The script seems to also work with the output of Cisco ASAs (it is basically identical to that of a router).

Support has been added for broadcast networks. At the moment it just shows the DR as opposed to the full network / mask as this information in not available in the output of "show ip ospf database router". I may add support to populate the missing details from the output of "show ip ospf network" later.

This script requires Python 3.

Usage - Linux / Mac

Set the ospfcli2dot.py file as executable (chmod 755 ospfcli2dot.py) then run it

Usage - Windows

Run python 3 then execute:

exec(open("./ospfcli2dot.py").read())

Example

foeh@feeble ~ $ ./ospfcli2dot.py ospfcli2dot - takes the output of "show ip ospf database router" and outputs a GraphViz DOT file corresponding to the network topology

v0.1 alpha, By Foeh Mannay, April 2016

Enter input filename: cli-output.txt Enter output filename: mytopology.dot foeh@feeble ~ $

Using DOT files

Several applications can deal with DOT files.

Example: Native graphviz "dot" processor to output a .gif file:

foeh@feeble ~ $ dot -Tgif -omytopology.gif mytopology.dot

(Or use xdot under Linux / gvedit under Windows to see it directly)

Bugs

My Python is pretty scruffy but it seems to work.

ospfcli2dot's People

Contributors

theclam avatar

Watchers

 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.