Then man made the machine in his own likeness

Following INE R&S V5.0 on VIRL (on Packet.net)

This article is for people who want to follow INE's R&S v5.0 Workbook on VIRL - Specifically, VIRL on Packet.net simulation.

What this article is NOT about


This article is not about setting up VIRL or running it on packet.net. It is assumed that you are fairly competent with basic functionality of VIRL and that you know your way around VIRL simulations on Packet.

Some background


INE R&S topology for VIRL was first posted on here by Brian back in 2014, along with base configuration files (These configurations actually use INE topology's interface names - as opposed to VIRL interfaces). After L2 supported images were added to VIRL, an updated topology was later posted VIRL community website.

While following the workbook examples against VIRL topology, I found it somewhat confusing, since the interfaces of the devices you're working with are completely different from what's in the Workbook. This was particularly true for L2 section, because in the VIRL topology, there are additional inter-switch links that aren't present in the Workbook. I redraw the INE R&S diagram with VIRL interfaces so that following the Workbook labs would be much easier when working on the simulation.

I also modified VIRL topology such that simulation can be started on packet.net baremetal server without having to change anything. This does not mean you cannot run the topology in your local VIRL instance. If you want to run it on the local machine, make sure you change the management IPv4 addresses from default VIRL on Packet subnet (172.16.11.0/24) to local "Shared Flat Network" subnet.

Additionally I removed the Kali boxes in Brian's VIRL topology and replaced those with generic LXC instances (so that you don't have to do anything when launching the simulation on Packet). In addition to R7 and R10, I also attached an LXC instances to R5, R8, and R9 to simulate LAN segment for end-to-end connectivity testing. The LXC machines in my topology are excluded from booting up on simulation start. You can start the nodes manually or can change the default behavior if that's your preference.

VIRL (on packet.net) Topology and Diagrams





Spanning Tree and Routing topology - IP addresses and Interfaces






INE Interfaces vs VIRL Interfaces




Routing Topology - IP addresses only





Interface labels only






Management IP addresses: This address space is default "Shared Flat Network" for VIRL on Packet. If you want to start the simulation on your local machine, changed to your local Shared Flat Network - The default for local installation is 172.16.1.0/24




Access to devices


Once you start the simulation on VIRL, you should be able to access the network devices (with Telnet) directly from your local machine. For LXC nodes, you need to use SSH.

Default credentials are: cisco/cisco

Observium and Mediawiki


This post assumes you have fairly adequate knowledge of MediaWiki administration and basic knowledge on how templates in MediaWiki work. 

So you have a wiki powered by MediaWiki and you also happen to have an Observium installation in your network.

You want to display CDP map of a particular device in your network,  in the corresponding device's page in your wiki. (Or any other wiki page for that matter). You only want to tell your wiki Observium's device ID, and in return wiki is to produce CDP map based off of data Observium collects on your network.

For instance, I place the following template inside a wiki page, and pass any an ID of a Cisco device Obserivum has been keeping track of.

{{DeviceMap|34}}

In this case 34 is the device ID of a Cisco device in my Observium installation. The output of above is as follows.



Now the beauty of this is, you don't really have to come back to your wiki page to change the documentation every time you change something in your network. Your Observium already keeps track of it, and it gets reflected in your wiki within 5 minutes of the change.

Colored interfaces are clickable links which takes you to respective graph page in Observium. Colorless interfaces and devices are what CDP "sees", but are not monitored by your Observium.

How do you set this up in your local wiki?

I will post the the templates I created at the end of this post.

For those templates to work, you will need to have the following prerequisites met in your wiki and Observium installation.

MediaWiki checklist:

Software packages:
  • GraphViz installed on the server running MediaWiki. I have version 2.38.0 in my installation. Your GraphViz MW extension is practically useless without the GraphViz binaries. 
You can check your MW version and extension versions at http:///wiki/index.php/Special:Version
  • MediaWiki Parser Functions - My PaserFunctions version is 1.6.0 (This used to be an extension, but is now bundled starting from  MW1.18)
  • ImageMap extension - (I have a git commit of this from August 2014. Doesn't really show me a version number on my Special:Version page)
  • Enable this in your wiki
  • GraphViz extension - (READ THIS: You can go ahead and install the latest version of this Extension. I don't use the latest version because it has the nasty habit of uploading the graphviz output to MW each time your ouput changes. This may not be a bad thing if you are using MW to render CDP maps and such, that hardly change. In my Installation I use MW Graphviz extension in conjunction with Observium to actually produce real time Weathermaps within my Wiki. And you know weathermaps change every 5 minutes. That's a lot of uploads if you refresh your weathermaps a lot) -- The version I use is here. You can configure this like like you configure any other extension.
  • External Data extension - My version of this extension is 1.8  - Have this installed and configure it so that it can talk to your Observium database. This is configured in LocalSettings.php. Mine looks like below:

    If you don't want to modify my templates, you may want to use below. Else you can use your own instead of "observerdb" and modify my templates accordingly.
    • // Defining for ExternalData extension
    • $edgDBServer['observerdb'] = "OBSERVIUM_DB_IP";
    • $edgDBServerType['observerdb'] = "mysql";
    • $edgDBName['observerdb'] = "observium";
    • $edgDBUser['observerdb'] = "SQL_READ_USER";
    • $edgDBPass['observerdb'] = "SQL_PASS";

Observium checklist:

Place this in your Obserivum config.php file. DO THIS AT YOUR OWN RISK

// Graph Auth
$config['allow_unauth_graphs'] = 1; # Allow graphs to be viewed by anyone

We can take advantage of this to render Observium graphs within the wiki. 

The set of templates I include can be used separately to place graphs in wiki pages. The template pages itself would contain adequate amount of information on how to use them. Shouldn't be that difficult to figure out, if you are already familiar with wiki templates.

The templates:

Now that all that's taken care of, you can go ahead and import the templates to your wiki. Most of the templates in the tarball are auxiliary and complimentary templates without which actual templates would not work. So you'll probably have to import them all.

After or before importing, you can modify the templates to reflect the URL of your Obserivum where links are produced as part of the output. I have listed templates that you need to alter so that you can point to your Observium URL. 
  • Template:Device map links
  • Template talk:Device map links
  • Template:ObserverGraphMemory
  • Template:ObserverGraphDeviceTotal
  • Template:ObserverGraphCPU
  • Template:DeviceOverview
It's probably easier to modify them after importing them to your wiki and click "edit" button.

Download the template files here. Inside tarball, you will see individual XML files that you need to import via Special:Import MW page.

Once you import them, try {{DeviceMap|34}} in any wiki page. Of course, you will replace 34 with one of your valid device IDs in Observium.

Ends

If any of you actually bothered to go ahead and implement this in your wiki, and things don't exactly work the way they're meant to, please drop a comment here. I'll see if I can address it.

Thanks