OSPF network command

In order for an OSPF router to establish neighbor adjacencies, the network command must be issued under the router OSPF configuration mode. The command must be issued for an IP address range that contains the subnet of a particular local interface. Only then will a neighbor adjacency be established via that interface.

For example, R1 has GigabitEthernet0/1 with an IPv4 address and subnet mask combination of 192.168.5.1 255.255.255.128. The OSPF configuration has the following network command:

network 192.168.5.0 0.0.0.255 area 0

Because the 192.168.5.0/25 network to which the interface belongs is found within the 192.168.5.0/24 network defined by the network command, interface GigabitEthernet0/1 will actively participate in OSPF, and will attempt to establish an OSPF adjacency via that interface.

Similarly, the following command will cause all interfaces on an OSPF router to being to actively participate in OSPF:

network 0.0.0.0 255.255.255.255 area 0

Because this defines all IP addresses, all active interfaces on the router will begin participating in OSPF in area 0.

OSPFv3 uses interface command rather than the network command to indicate which subnets and interfaces will participate in OSPF.

Links:

https://www.ciscopress.com/articles/article.asp?p=26919&seqNum=3

https://networklessons.com/ospf/basic-ospf-configuration

Links to this page: