Building network automation solutions

9 module online course

Start now!

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:

OSPF neighbors for process ID 1

Router ID Area State Address Interface 0 FULL Serial0/0/0.100 0 FULL/DR FastEthernet0/0

OSPF neighbors for process ID 2

Router ID Area State Address Interface 2 FULL Serial0/1/0
Add comment