{ "info": { "author": "Michael Laforest", "author_email": "mjlaforest@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Information Technology", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "# mnet\n\nmnet Suite - Tools for network professionals. \nMichael Laforest ``\n \nAutomated discovery and diagram tools using SNMP, CDP, and LLDP.\n\n ```# ./mnet.py diagram -r 10.75.0.1 -o .\\network.svg```


*The above command will generate the diagram to the right.* | ![MNet-Diagram Example1][diag1]\n:--- | --- \n \n# Support\n\nIf you use any of these tools or find them useful please consider donating. \n\nDonation Method | Address | QR Code\n--- | --- | ---\nBitcoin (BTC) | 1HY3jPYVfE6YZbuYTYfMpazvSKRXjZDMbS | ![1HY3jPYVfE6YZbuYTYfMpazvSKRXjZDMbS](https://github.com/MJL85/mnet/blob/master/docs/donate/BTC.png \"Bitcoin (BTC)\")\nBitcoin Cash (BCH) | 1HSycjR3LAZxuLG34aEBbQdUSayPkh8XsH | ![1HSycjR3LAZxuLG34aEBbQdUSayPkh8XsH](https://github.com/MJL85/mnet/blob/master/docs/donate/BCH.png \"Bitcoin Cash (BCH)\")\n\n# Tools\n| Module | Description |\n| --- | --- |\n| Diagram | Discovers a network and generates a diagram based on CDP and LLDP neighbor information. |\n| TraceMAC | Attempts to locate a specific MAC address by recursively looking it up in switch CAM tables. |\n| GetMACS | Collect a list of all MAC addresses on the discovered network and generate a report. |\n\n# Network Discovery \n \nThe discovery process uses SNMP, CDP, and LLDP to discover the network topology and details about each node. Each discovered node will be evaluated against the `discover` ACL (defined in the config file) to determine how to proceed; the ACL may allow discovery, stop discovery here, or include it as a leaf in the diagram.\n\n\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n
\n\t\tThe discover ACL is defined as\n\t
\"discover\" : [\n\tACE1,\n\tACE2,\n\t...\n\tACEn,\n]
\n\t
\n\t\tAn ACE is defined as \n\t
<permit|deny|leaf|include|;> < [host REGEX] | [ip CIDR] >
\n\t
\nExample\n\t
\"discover\" : [\n\t\"deny ip 10.50.12.55\",\n\t\"deny host ^SEP.*\",\n\t\"permit ip 10.50.12.0/24\",\n\t\"leaf host ^Switch2$\",\n\t\"permit ip any\"\n]\t
\n\n---\n\n| ACE Match Type| Include Node | Collect Node Information | Allow Discovery of Adjacencies |\n| --- |:---:|:---:|:---:|\n| **permit** | yes | yes | yes |\n| **leaf** | yes | yes | |\n| **include** | yes | | |\n| **deny** | | | |\n\n ---\n \n| ACE Parameter | Description | Example |\n| --- | --- | --- |\n| host REGEX | The host can be matched against any regular expression string. The host string is what is reported from CDP or LLDP. | `host Router-.*` |\n| ip CIDR | The ip can be matched against and CIDR. | `ip 10.50.31.0/24` |\n\n# Command Reference\n\n### Diagram\n```\n# mnet.py diagram -r \n -o \n [-d ]\n [-c ]\n [-t ]\n [-C ]\n```\n| Option | Description |\n| --- | --- |\n| `-r ` | IP address of the network node to start on. |\n| `-o ` | The file that the output will be written to.
Common file extensions: `.png`, `.pdf`, `.svg` |\n| `-c ` | The JSON configuration file to use. |\n| `-d ` | The maximum hop depth to discover, starting at the root node specified by `-r` |\n| `-t ` | The title to give your generated network diagram. |\n| `-C ` | If specified, mnet will generate a comma separated (CSV) catalog file with a list of all devices discovered. |\n\n### TraceMAC\n```\n# mnet.py tracemac -r \n -m \n [-c ]\n```\n| Option | Description |\n| --- | --- |\n| `-r ` | IP address of the network node to start on. |\n| `-m ` | The MAC address to locate. Can be in any form. Ex: `11:22:33:44:55:66` or `112233445566` or `1122.3344.5566` |\n| `-c ` | The JSON configuration file to use. |\n\n### GetMACS\n```\n# mnet.py getmacs -r \n -o \n [-d ]\n [-c ]\n```\n| Option | Description |\n| --- | --- |\n| `-r ` | IP address of the network node to start on. |\n| `-o ` | The comma separated value (.csv) file that the output will be written to. |\n| `-d ` | The maximum hop depth to discover, starting at the root node specified by `-r` |\n| `-c ` | The JSON configuration file to use. |\n\n\n### Config\n```\n# mnet.py config\n```\n# Configuration File\nThe configuration file defines common parameters in a JSON format.\n```\n{\n\t\"snmp\" : [\n\t\t{ \"community\":\"private\",\t\"ver\":2 },\n\t\t{ \"community\":\"public\",\t\t\"ver\":2 }\n\t],\n\t\"domains\" : [\n\t\t\".company.net\",\n\t\t\".company.com\"\n\t],\n\t\"discover\" : [\n\t\t\"permit ip 10.0.0.0/8\",\n\t\t\"permit host Router[1,2]\",\n\t\t\"deny ip any\",\n\t],\n \t\"diagram\" : {\n\t\t\"node_text_size\" : 10,\n\t\t\"link_text_size\" : 9,\n\t\t\"title_text_size\" : 15,\n\t\t\"get_stack_members\" : 0,\n\t\t\"get_vss_members\" : 0,\n\t\t\"expand_stackwise\" : 0,\n\t\t\"expand_vss\" : 0,\n\t\t\"expand_lag\" : 1,\n\t\t\"group_vpc\" : 0\n }\n\t\n}\n```\n\n| Block / Variable | Description |\n| --- | --- |\n| `snmp` | Defines a list of SNMP credentials. When connecting to a node, each of these credentials is tried in order until one is successful. |\n| `discover` | Defines a Cisco-style ACL. See the `Network Discovery` section. |\n| `diagram` | Defines values used by the diagram module. Detailed below in the *Diagram block* table. |\n\n### Diagram block\n| Variable | Type | Default Value | Description |\n| --- | --- | --- | --- |\n| `node_text_size` | integer | `10` | Node text size. |\n| `link_text_size` | integer | `9` | Link text size. |\n| `title_text_size` | integer | `15` | Diagram title text size. |\n| `get_stack_members` | bool | `0` | If set to `1`, nodes will include details about stackwise members. |\n| `get_vss_members` | bool | `0` | If set to `1`, nodes will include details about VSS members. |\n| `expand_stackwise` | bool | `0` | If set to `1`, nodes belonging to stackwise groups will be expanded to show each member as a node. |\n| `expand_vss` | bool | `0` | If set to `1`, nodes belonging to VSS groups will be expanded to show each member as a node. |\n| `expand_lag` | bool | `1` | If set to `1`, each link between nodes will be shown. If set to `0`, links of the same logical link channel will be grouped and only the channel link will be shown. |\n| `group_vpc` | bool | `0` | If set to `1`, VPC peers will be grouped together on the diagram, otherwise they will not be clustered. |\n\n# Diagram\nmnet will attempt to collect the following information and include it in the generated diagram:\n+ All devices (via CDP and LLDP)\n+ Interface names\n+ IP addresses\n+ VLAN memberships\n+ Etherchannel memberships (LACP only)\n+ Identify trunk links\n+ Identify switched links\n+ Identify routed links\n+ BGP Local AS\n+ OSPF Router ID\n+ HSRP Virtual IP\n+ HSRP Priority\n+ VSS Domain\n+ Stackwise membership\n+ VPC peerlink information\n\n#### Diagram Formatting\n+ Nodes\n + Circle nodes represent layer 2 switches.\n + Diamond nodes represent layer 3 switches or routers.\n + If a node has multiple borders then either VSS or StackWise is enabled.\n + VSS - Will always have a double border.\n + StackWise - The number of borders denotes the number of switches in the stack.\n + If the configuration specifies, VSS/VPC/Stackwise nodes will be grouped in larger squares.\n+ Links\n + Links are shown with arrowed lines. The end with no arrow is the *parent* and the end with the arrow is the *child*, such that the arrangement is *parent*->*child*.\n + If a link says *P:gi0/1* , *C:gi1/4* then the parent node's connection is on port gi0/1 and the child node's connection is on port gi1/4.\n + If the link is part of an Etherchannel the etherchannel's interface name will also be shown. Since an etherchannel interface is locally significiant, a *P:* and *C:* will also be shown if available.\n\n#### Examples\n\nExample 1\n![MNet-Diagram Ex1](http://i.imgur.com/Mny7PLl.png \"MNet-Graph Ex1\")\n\nExample 2\n![MNet-Diagram Ex2](http://i.imgur.com/BuXnzWG.png \"MNet-Graph Ex2\")\n\nExample 3\n![MNet-Diagram Ex3](http://i.imgur.com/i1dqM09.png \"MNet-Graph Ex3\")\n\n# TraceMAC\n\n#### Examples\n\nThe below example shows a trace for MAC address `00:23:68:63:75:70` starting\nat node `10.10.0.3`. The MAC address is found on switch `IDF3_D` on port\n`Gi0/11`.\n\n```\n# mnet.py tracemac -r 10.10.0.3 -m 0023.6863.7570\nMNet Suite v0.7\nWritten by Michael Laforest \n\n Config file: ./mnet.conf\n Root node: 10.10.0.3\n MAC address: 0023.6863.7570\n\nStart trace.\n------------\nIDF1_A (10.10.0.3)\n VLAN: 1\n Port: Gi1/3\n Next Node: IDF1_B\n Next Node IP: 10.10.0.2\n------------\nIDF1_B (10.10.0.2)\n VLAN: 1\n Port: Gi0/24\n Next Node: IDF3_D\n Next Node IP: 10.10.0.6\n------------\nIDF3_D (10.10.0.6)\n VLAN: 1\n Port: Gi0/11\n------------\nTrace complete.\n```\n# FAQ\n\n#### Q1 - My diagram is too large. I only want to diagram part of my network.\nTry changing the config `discover` ACL to narrow down the scope of your discovery. You can explicitly deny CIDR's or host name regex patterns if you do not want them included in your diagram. \n \n#### Q2 - Where is the config file?\nCreate a new one with\n`# mnet.py config > mnet.conf`\n\n#### Q3 - I need a diagram with less proprietary information. Can I get one without IPs or serial numbers?\nYou can change the text inside each node by editing the config option `diagram\\node_text`. Below is an example that would produce a minimal information diagram:\n\n```\n\"diagram\" : {\n\tnode_text = '{node.name}
{node.ios}
{node.plat}'\n}\t\n``` \n#### Q4 - How can I remove Cisco VoIP phones from my diagram?\n```\n\"discover\" : [\n\t\"deny host ^SEP.*$\"\n]\n``` \n\n[diag1]: https://github.com/MJL85/mnet/blob/master/docs/images/mnet_example.PNG \"Diagram 1\"", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/MJL85/mnet/", "keywords": "python network cisco diagram snmp cdp", "license": "LICENSE", "maintainer": "", "maintainer_email": "", "name": "mnet", "package_url": "https://pypi.org/project/mnet/", "platform": "", "project_url": "https://pypi.org/project/mnet/", "project_urls": { "Homepage": "http://github.com/MJL85/mnet/" }, "release_url": "https://pypi.org/project/mnet/0.10/", "requires_dist": null, "requires_python": "", "summary": "MNet Suite is a collection of Python tools for network professionals.", "version": "0.10" }, "last_serial": 3841254, "releases": { "0.10": [ { "comment_text": "", "digests": { "md5": "c727f056794cdd2f71fa749c1dc5dd55", "sha256": "79f097708dcbc91b4667687824c45d2c81353fef8d8b34bfff62c9a0173d4aee" }, "downloads": -1, "filename": "mnet-0.10.tar.gz", "has_sig": false, "md5_digest": "c727f056794cdd2f71fa749c1dc5dd55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40429, "upload_time": "2018-05-07T15:01:08", "url": "https://files.pythonhosted.org/packages/e8/dd/8df072034314cc5d0dbbaf44231bee6d57a64e5e7b6ede10c67c397ba130/mnet-0.10.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "53520178ca90d9053f4d4eed83f48292", "sha256": "a95cb1481575c68c116b8a5d4492d333c802bff4b1ce8ea1241dae5a04ef815e" }, "downloads": -1, "filename": "mnet-0.5.tar.gz", "has_sig": false, "md5_digest": "53520178ca90d9053f4d4eed83f48292", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22060, "upload_time": "2015-07-16T00:02:51", "url": "https://files.pythonhosted.org/packages/bc/71/c6d4447910c4bb08f3bb7732488467cc1341d2f813b30ac892cf5dfcbef1/mnet-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "e868069667c511b925af9e7c4231b708", "sha256": "77fbabfba6f2e5ff6fc1d08dee141de45a66a134ade56ab6fb0b3c6d836ee7f4" }, "downloads": -1, "filename": "mnet-0.6.tar.gz", "has_sig": false, "md5_digest": "e868069667c511b925af9e7c4231b708", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23433, "upload_time": "2015-07-19T15:43:58", "url": "https://files.pythonhosted.org/packages/21/cc/7ae1434bd3d329aa0c71f4d0de35081a9363a868d43836d7cc26e648409e/mnet-0.6.tar.gz" } ], "0.7": [ { "comment_text": "", "digests": { "md5": "58c5197b95a83c6d570c0921880f682f", "sha256": "ffdcf4e8f8436d5e607d19f24c3657387d5ee474805dc2ddf564df77a16e70c7" }, "downloads": -1, "filename": "mnet-0.7.tar.gz", "has_sig": false, "md5_digest": "58c5197b95a83c6d570c0921880f682f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29606, "upload_time": "2015-07-25T19:48:35", "url": "https://files.pythonhosted.org/packages/8b/c1/75231f1f71b0234b22d2109eaf1821eba8d4b14b2009f207156a5f0e9fb5/mnet-0.7.tar.gz" } ], "0.8": [ { "comment_text": "", "digests": { "md5": "b7b3c525a169dee691cdab02ae71e3ef", "sha256": "ae2e01ddbef0237392fe9408dfa88ee2fd663aae5f918cf6a20cba4d104f9811" }, "downloads": -1, "filename": "mnet-0.8.tar.gz", "has_sig": false, "md5_digest": "b7b3c525a169dee691cdab02ae71e3ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32853, "upload_time": "2015-09-21T19:09:49", "url": "https://files.pythonhosted.org/packages/d4/0a/5eab2e7a4082bd8d1ca7a4970917aeac7006f2588a25de8c14adc83cb65e/mnet-0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c727f056794cdd2f71fa749c1dc5dd55", "sha256": "79f097708dcbc91b4667687824c45d2c81353fef8d8b34bfff62c9a0173d4aee" }, "downloads": -1, "filename": "mnet-0.10.tar.gz", "has_sig": false, "md5_digest": "c727f056794cdd2f71fa749c1dc5dd55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40429, "upload_time": "2018-05-07T15:01:08", "url": "https://files.pythonhosted.org/packages/e8/dd/8df072034314cc5d0dbbaf44231bee6d57a64e5e7b6ede10c67c397ba130/mnet-0.10.tar.gz" } ] }