If 0.0.0.0 is used as the wildcard mask by an OSPF-enabled interface to advertise a non-32-bit address, will an OSPF neighbor relationship be established on this interface and will LSAs be exchanged correctly?
Yes. If an OSPF-enabled interface advertises a non-32-bit address by using the wildcard mask 0.0.0.0, this interface will establish an OSPF neighbor relationship with a remote end and they will exchange LSAs correctly.
The causes are as follows:
OSPF searches for an interface based on the configured network command. After OSPF advertises the network routes, OSPF performs the AND operation between the network address and wildcard mask and between the local interface address and the wildcard mask. If the results are the same, OSPF uses the interface as an outbound interface. After finding the interface, the OSPF process proceeds. This means that using either all 0s wildcard mask or a computed wildcard mask can correctly advertise the network route.
For example, the address of GE 1/0/0 is 192.168.1.1/24.
The network 192.168.1.1 0.0.0.0 command is run.
OSPF performs the AND operation between 192.168.1.1 and 0.0.0.0, and obtains 192.168.1.1.
OSPF performs the AND operation between each IP address of its interfaces and 0.0.0.0, and the results show that the AND operation relevant to GE 1/0/0 produces 192.168.1.1. This means that OSPF uses GE 1/0/0 as the outbound interface. Alternatively, if OSPF uses 0.0.0.255 as a wildcard mask, the result is the same and GE 1/0/0 is the outbound interface.
0.0.0.0 can be used as a wildcard mask by an interface, except for a loopback interface, to advertise a network segment route. This simplifies the configuration.