1

Suppose I configure OSPF using the following commands in Cisco's IOS:

router ospf 201
network 10.0.0.0 0.255.255.255 area 10.0.0.0
network 192.168.0.0 0.0.255.255 area 0

How can I subsequently list the network areas that were defined? I.e. suppose I made a typo and issue a "no network" command, how would I know what was entered previously?

EDIT: I ran "show ip ospf" and get the following output:

router#show ip ospf
Routing Process "ospf 1" with ID 10.0.0.1
Supports only single TOS(TOS0) routes
Supports opaque LSA
SPF schedule delay 5 secs, Hold time between two SPFs 10 secs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
Number of external LSA 0. Checksum Sum 0x000000
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
External flood list length 0
 Area BACKBONE(0)
     Number of interfaces in this area is 3
     Area has no authentication
     SPF algorithm executed 3 times
     Area ranges are
     Number of LSA 23. Checksum Sum 0x0d5411
     Number of opaque link LSA 0. Checksum Sum 0x000000
     Number of DCbitless LSA 0
     Number of indication LSA 0
     Number of DoNotAge LSA 0
     Flood list length 0

But I don't see the information used in the "network" commands listed.

1
  • to answer the last bit of your question. If you run a 'no network' It's gone from both the running config and the ospf process. You can however either use 'sh start' to see the startup config (the running config that was previously written to disk) assuming the network statement was there at that time, or use your terminal window's history to scroll back.
    – Sirex
    Oct 20, 2016 at 20:22

4 Answers 4

3

To see the areas which your current router is advertising routes for you can run the command

sh ip ospf statistics

This will show the areas for which SPF algorithm ran and other statistics about the results of that algorithm, Plus this will show for all the ospf processes running on the router.

There is no way you can see the areas which were running earlier i.e. before running no network command. But as Sirex pointed out you can run

sh startup-config | s ospf

To see what was the configuration before you made changes in ospf section(this can be used only before you write your config, using write command)

1

So, I feel kind of dumb. The "show run" command will list the network areas defined.

router# show run
....
 shutdown
!
router ospf 201
 log-adjacency-changes
 router ospf 201
 network 10.0.0.0 0.255.255.255 area 10.0.0.0
 network 192.168.0.0 0.0.255.255 area 0
!

There may be a more specific command, but at least "show run" works.

1
  • This is showing you the running configuration as entered. You can use 'sh run | s ospf' by the way in this case to get just the section you want. Personally, i'd rather look at the ospf process for it's information (as detailed above) as that's the definitive answer.
    – Sirex
    Oct 20, 2016 at 20:19
1

Cisco has a lot of show commands for OSPF. The show ip ospf command, and its variants, seems to be what you need. See Cisco IOS IP Routing: OSPF Command Reference


Edit:

Based on your edit, you don't seem to be using the show ip ospf command variant you need. There are many. For instance, the show ip ospf interface command has variant that will give you the information you want by interface. You need to look at the link I provided to figure out the command variant that provides you what you want.

0

sh ip ospf

this is what you want. From inside config mode you can use 'do sh ip ospf' instead.

2
  • I ran the command you suggested and copied the output to the original question. Unfortunately I don't see the information I'm looking for in that command output. Oct 20, 2016 at 19:14
  • Area BACKBONE(0) area 0 is special. It's called the backbone area.
    – Sirex
    Oct 20, 2016 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .