Your browser failed to load CSS style sheets. Your browser or web proxy might not support elliptic-curve TLS

Building network automation solutions

6 week online course

Start now!
back to overview

Display OSPF neighbor sorted by OSPF process ID

I had two issues with the show ip ospf neighbors command:
  • It is not sorted by the OSPF process ID, so you get a mess if you have more than one OSPF process and don't specify the process ID in the show command
  • It does not display the OSPF area the neighbor belongs to
To fix both problems, I wrote a Tcl script that displays OSPF neighbors sorted by process ID and includes the fields I wanted to have. To install it on your router:
  1. Download it from my web site.
  2. Copy the ospfNeighbors.tcl file to your router's flash (or NVRAM).
  3. Define an alias, for example alias exec ospf tclsh flash:ospfNeighbors.tcl.
Here is a sample printout produced on my lab router:
a1#ospf

OSPF neighbors for process ID 1

Router ID Area State Address Interface
172.16.0.21 0 FULL 172.16.1.2 Serial0/0/0.100
172.16.0.12 0 FULL/DR 10.0.0.6 FastEthernet0/0

OSPF neighbors for process ID 2

Router ID Area State Address Interface
172.16.1.5 2 FULL 10.3.1.2 Serial0/1/0

No comments:

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Sidebar