cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2325
Views
23
Helpful
3
Replies

OSPF network statement - match only on the IP address, or will it also take into account the subnet mask of an interface?

Sam Brynes
Level 1
Level 1

When you go into the OSPF configuration mode, does the "network" statement match only against the IP address, or does it also take the subnet mask into account to determine whether or not it will include the interface in the OSPF process? Asking also for examples to help me understand. Trying to study for the CCIE to see if it's worth it, and also, I like knowing these things :)

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

The network statement matches just on local connected interfaces ignoring the subnet mask. Any matches are added to the local OSPF database at which point the subnet ID and mask are stored. It is this information that it exchanged with other OSPF peers.

 

cheers,

Seb.

View solution in original post

3 Replies 3

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

The network statement matches just on local connected interfaces ignoring the subnet mask. Any matches are added to the local OSPF database at which point the subnet ID and mask are stored. It is this information that it exchanged with other OSPF peers.

 

cheers,

Seb.

I find the original post to be slightly ambiguous in referring to matching the subnet mask. There is a subnet mask on the interface and there is a mask in the OSPF network statement. Which mask is it really asking about. If it is talking about matching the subnet mask of the interface then @Seb Rupik is quite correct that the subnet mask of the interface is not used in determining whether OSPF will run on the interface. But if it is talking about using the mask in the network statement then the mask is used in determining whether OSPF will run on the interface.

 

It might also be helpful in clarifying what is going on that the subnet mask of the interface is used to determine what OSPF should advertise. Some people believe that OSPF uses the mask in the network statement to determine what to advertise. The mask in the network statement is used only to determine which interfaces to run on and what to advertise is based on the interface subnet mask.

 

HTH

 

Rick

HTH

Rick

"The mask in the network statement is used only to determine which interfaces to run on and what to advertise is based on the interface subnet mask."

It's as Rick described.

To put it another way, the network mask on the OSPF router section's network statement works like an ACL matching, or not, the IP(s) on the interface. If there is a match, the network mask on the interface's IP address statement determines the network that is included with the prefix.

e.g.:

interface x
ip address 192.168.1.1 255.255.255.0

router ospf 10
network 192.168.1.1 0.0.0.0 !will match above interface's IP
!or
network 192.168.1.0 0.0.0.255 'will match above interface's IP
!or
network 192.168.0.0 0.0.255.255 'will match above interface's IP

Any of the above will advertise 192.168.1.0/24