Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.

OSPF configuration question

Unanswered Question
Oct 13th, 2005
User Badges:

I am studying for my CCNA exam and I'm not sure if this is the right forum but here's my question:

What is the difference between these 2 configurations:

1. router ospf 1

network area 0

network area 0

2. router ospf 1

network area 0

network area 0

I know we're applying the wildcard mask after the network but I just need some examples of when you would use one or the other.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
nhabib Thu, 10/13/2005 - 13:47
User Badges:
  • Red, 2250 points or more

You would use the first example when advertising a loopback interface

The second one would be for advertising a network.

Probably better off doing the second example in the following manner:

router ospf 1

network area 0

network area 0

Harold Ritter Thu, 10/13/2005 - 14:10
User Badges:
  • Cisco Employee,

You could actually use any of the two examples to enable OSPF on a given interface.

The first example would enable OSPF on the interface configured with the specific /32 but would advertise whatever subnet mask configured on the interface.

The second example would enable OSPF on any interface with an IP address in the /24 ranges ( and and would also advertise the subnets configured on the different interfaces.

Hope this helps,

andrew.butterworth Thu, 10/13/2005 - 14:31
User Badges:
  • Gold, 750 points or more

Both options will work if & are IP addresses of interfaces on the router. The inverse mask is there to limit (or expand) the interfaces OSPF runs on and what gets advertised. For example if you had the following:

interface 1

interface 2

interface 3

interface 4

Then you could control individually ospf on each interface with the commands:

router ospf 1

network area 0

network area 0

network area 0

network area 0

(You could also make the interfaces be in different areas by changing the 'area')

If you didn't need the flexibility and just wanted all the interfaces to be in area 0 then configuring the following will accomplish this as the inverse mask covers all the interface addresses:

router ospf 1

network area 0

I generally try to add interface addresses individually (with inverse masks). On Distribution switches though where you are terminating a lot of access vlans/subnets it is good practise to make these subnets contiguous and use a wildcard in the inverse mask. That way the configuration is kept simpler (smaller).

Whatever the inverse mask of the network command is there is no difference in how OSPF advertises the networks though; i.e. if an interface has a /30 mask the network LSA will be /30 (unless of course you are summarising with network range commands).



ekhoo Thu, 10/13/2005 - 14:42
User Badges:

OK.. the network statement in OSFP configuration is to tell router which interface to participate in OSPF routing. It has nothing to do with the route advertisement. That is.

The first config with mask tell your router the exact interface to run OSPF.

The second config with mask tell your router any interfaces that match the mask to run OSPF.

Normally, “network area 0,” config should look like this “network area 0”, after you entered into your router. the router would change the .1 to .0 and any interface within this mask .0 - .255 will run OSPF.

The same rule apply to this statement ”network area 0” this rule tells the router that any interface with a ip address would participate in OSPF routing.

Hope this help..

nz-ipv6 Thu, 10/13/2005 - 15:00
User Badges:


2 cents

You can use normal subnet mask as well in the network command. IOS automatically changes it to Wildcard mask.

conf t

int fa0/0

ip add

router ospf 1

net area 0


show run | begin router ospf 1

router ospf 1

net area 0


namasthemeanshello Thu, 10/13/2005 - 21:37
User Badges:


The basic difference lies in the wildcard mask concept.In a wildcard mask which ever bits are zero are considered significant(exactly opposite to what u have in a subnet mask !! ).

Here in the first case since all bits of the WC Mask are zero, ospf will add and ONLY to the table(since an exact match had to be made).But in the second case since first 24 bits are zero,only those 24 bits are matched ..which means that the network( and will be added as such.....




This Discussion