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.
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.