Quantcast
Channel: Johannes Weber – Weberblog.net
Viewing all articles
Browse latest Browse all 311

OSPF Visualizer

$
0
0
OSPF Visualizer featured image 3

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:

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:quagge 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:

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.

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:

OSPF Visualizer 01 Load via telnet

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:

OSPF-Visualiser

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:

OSPF Visualizer 03 Quagge Router no networks

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):

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]

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:

OSPF Visualizer 04 Missing Router 192.168.86.1

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:

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:

OSPF Visualizer 05 TCP Stream Quagga

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:

OSPF Visualizer 06 Cisco Router Failure

Ok, however, for a quick-and-dirty approach, this visualizer greatly shows my OSPF map when connected to a quagga router. 😉 I like it.


Viewing all articles
Browse latest Browse all 311

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>