While reading the OSPF chapter in the Cisco CCNP ROUTE learning guide, I was interested in how to visualize an OSPF area. Since every router in the same area has a complete view of all routers and networks, it should be easy to draw a map. So, I searched through the web for this kind of OSPF plotter and found two different approaches. While none of them worked out of the box, I was able to run one of them with an additional software router (Quagga) inside my OSPF area which finally drew a map. Yeah. Here we go:
Searching on the web I found two OSPF plotters:
- OSPF network visualizer (ospfviz): This project seems to be really old (prior 2008). It uses SNMP requests to a Cisco router in order to get the OSPF map. Great approach. However, there are too many prerequisite listed. ;) So I actually tried the second one:
- ospf-visualiser: This project has its latest update from 2013. It is a single Java application that connects to a Linux router (GNU Zebra or Quagga) and gets the OSPF database via telnet. Unluckily the documentation is bad. It is a kind of try-and-error. However, I decided to test this software.
Prerequisite: Quagga
The ospf-visualiser communicates with a software router “Quagga”. Later on, this is really easy to connect to that router. Note that this router does not actually route traffic. It must only be part of the OSPF area in order to have a complete view of all involved routers.
The main step for this project is to install and run this linux router with an OSPF process. I used this Ubuntu guide (German) and that Quagga tutorial for installing quagga on a Ubuntu server machine. These are the installation steps:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
sudo apt-get install quagga cd /etc/quagga/ sudo nano daemons --- zebra=yes ospfd=yes --- sudo nano debian.conf --- vtysh_enable=yes zebra_options=" --daemon" ospfd_options=" --daemon" ospf6d_options=" --daemon" --- cp /usr/share/doc/quagga/examples/zebra.conf.sample /etc/quagga/zebra.conf cp /usr/share/doc/quagga/examples/ospfd.conf.sample /etc/quagga/ospfd.conf sudo chown quagga:quagga zebra.conf sudo chown quagga:quagga ospfd.conf |
The second step is to modify these two default configuration files. I only changed the name of the OSPF-router and added the correct OSPF network:
1 2 3 4 |
hostname Quagga-OSPF password zebra router ospf network 192.168.120.0/24 area 0.0.0.0 |
The quagga process can be started with the following command. Immediately after that, the OSPF neighbor adjacencies are established to FULL.
1 2 3 4 |
weberjoh@jw-vm07:/etc/quagga$ sudo service quagga start Loading capability module if not yet done. Starting Quagga daemons (prio:10): zebra ospfd. Starting Quagga monitor daemon: watchquagga. |
OSPF-Visualiser
I downloaded ospf-visualiser version 3.0.5 from this google page. It must only be started (Java application). Works out of the box. Under Data -> Load data I connected via telnet to my just installed quagga router:
Just a few seconds after that, my OSPF area map is drawn. Yeah! My OSPF lab (see here) consists of many different devices: Cisco Router, Cisco ASA, Fortinet FortiGate, Juniper ScreenOS SSG, Palo Alto Networks firewall. This is my graph:
The router on the left-hand side (192.168.120.5) is my quagga router. This screenshot shows, that no other networks are connected to that router:
But not complete :(
Unluckily, the map is not complete. In fact, my area 0.0.0.0 has one more router (192.168.86.1) connected to the 172.16.1.1 router (point-to-point via a site-to-site VPN), which is completely hidden in the drawing. This must be a failure in the ospf-visualiser app, because on the quagga router, this router is listed in the ospf commands (line 15):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
Quagga-OSPF# show ip ospf database OSPF Router with ID (192.168.120.5) Router Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# CkSum Link count 172.16.1.1 172.16.1.1 748 0x80004d0e 0x1009 6 172.16.1.2 172.16.1.2 89 0x80004c9a 0x5832 7 172.16.1.3 172.16.1.3 897 0x80000369 0xdfbf 3 172.16.1.6 172.16.1.6 1341 0x800034d9 0x5990 3 172.16.255.4 172.16.255.4 677 0x8000003d 0x4967 3 172.16.255.5 172.16.255.5 747 0x80000036 0xeadb 3 172.16.255.6 172.16.255.6 224 0x80000063 0x0c3f 2 192.168.86.1 192.168.86.1 177 0x8000018b 0xe69e 4 192.168.120.5 192.168.120.5 88 0x80000076 0x4318 1 192.168.170.1 192.168.170.1 306 0x80000042 0xdc20 2 Net Link States (Area 0.0.0.0) Link ID ADV Router Age Seq# CkSum 172.16.1.1 172.16.1.1 352 0x8000006e 0xcdb0 172.16.2.10 172.16.255.4 677 0x80000062 0x06c6 172.16.3.10 192.168.170.1 306 0x8000003a 0x5eed 192.168.120.1 172.16.1.2 89 0x80000074 0x7264 AS External Link States Link ID ADV Router Age Seq# CkSum Route 0.0.0.0 172.16.1.1 419 0x80000040 0x0506 E1 0.0.0.0/0 [0x0] 192.168.5.0 172.16.1.1 1486 0x800044c4 0x1a33 E1 192.168.5.0/24 [0x1267] 192.168.9.0 172.16.1.1 1486 0x800044c4 0xed5b E1 192.168.9.0/24 [0x1267] 192.168.29.0 172.16.1.1 1486 0x800044c4 0x1124 E1 192.168.29.0/24 [0x1267] 192.168.100.0 172.16.1.2 699 0x80004b0e 0x5488 E2 192.168.100.0/24 [0x907] 192.168.101.0 172.16.1.2 699 0x80004b09 0x538d E2 192.168.101.0/24 [0x907] 192.168.126.0 172.16.1.2 699 0x80004c59 0xd534 E2 192.168.126.0/25 [0x907] 192.168.188.0 172.16.1.1 1486 0x800044c4 0x3560 E1 192.168.188.0/24 [0x1267] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Quagga-OSPF# show ip ospf database router OSPF Router with ID (192.168.120.5) Router Link States (Area 0.0.0.0) LS age: 1121 Options: 0x22 : *|-|DC|-|-|-|E|* LS Flags: 0x6 Flags: 0x2 : ASBR LS Type: router-LSA Link State ID: 172.16.1.1 Advertising Router: 172.16.1.1 LS Seq Number: 80004d0e Checksum: 0x1009 Length: 96 Number of Links: 6 Link connected to: another Router (point-to-point) (Link ID) Neighboring Router ID: 192.168.86.1 (Link Data) Router Interface address: 10.0.0.13 Number of TOS metrics: 0 TOS 0 Metric: 10000 |
But this router (192.168.86.1) is not listed in the map:
Directly to Cisco Router?
I also tried to connect directly to a Cisco router. But I was not able to get the information out of it. First, I configured the Cisco router to allow telnet login with a password and a direct privilege level of 15:
1 2 3 4 5 6 |
line vty 0 4 privilege level 15 password 7 001E1604165A logging synchronous login transport input telnet ssh |
After that, I captured a telnet session with Wireshark from ospf-visualiser to the quagga router to see how it behaves correctly:
That is: It logs in, sets the terminal length and begins with the show commands.
But my test to the Cisco router just looked like that, without a show after the login. Hm:
Ok, however, for a quick-and-dirty approach, this visualizer greatly shows my OSPF map when connected to a quagga router. ;) I like it.
Featured image “Tiger & Turtle – Magic Mountain” by Uwe licensed under CC BY-NC-ND 2.0.
great article!
Maybe it doesnt work with the cisco because it is in privileged mode after login. The quagga is in unprivileged mode.
Maybe the visualizer parses the prompt and stops if the # sign is found.
Just a idea… :)
Cheers
Alex
The problem of invisibility of the router on the map is probably caused by a software bug that appears if metric is quite large. On my Quagga routers i saw that links with a metric of 1000 disappeared (10 and 100 displayed fine).
Hi,
Nice work…any updates ? :)
I’m looking for OSPF monitoring/visualization
tool but nothing good&ready found so far…
BR
Bart
I had the same idea, when i read the chapter.
But hadn’t had a router to test my Idea.
Think theirs a way to display the devices identity or name?, not just the IP address.