Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.13 KB

README.md

File metadata and controls

42 lines (29 loc) · 1.13 KB

ospf-to-graphviz

This script passively listens to OSPFv2 multicast traffic, and generates a graphviz diagram representing the network. Because it only listens and does not participate in the OSPF protocol, it takes about half an hour to learn about the network.

Prerequisites

python-netaddr

The script has been tested under Python2.6

Usage

ospf-to-graphviz.py mynetwork.dot

After a while, convert the .dot file for viewing with something like this:

dot -Tpng mynetwork.dot >mynetwork.png

The output file will be rewritten when an OSPF update is received, so you can keep converting the file every time it changes to see the diagram converge on your network topology. This should be complete after LSRefreshTime (30mins).

Limitations

Only OSPFv2 is supported. Only LS Update messages are analysed. Only Router LSAs and Network LSAs are handled at present. For Router LSAs, only transit networks and stub networks are handled.

Acknowledgements

This code is based on a Python recipe by Ferdy Riphagen: http://code.activestate.com/recipes/576664-ospf-multicast-sniffer/