Cisco – Multiple ip address on a interface advertisement

ciscoipipv4ospfrouter

The network topology is router A and router B are directly connected with IP addresses configured on their physical interfaces int gig 0/0/1 and gig0/0/2. The third interface gig0/0/3 is configured as a layer-2 trunk port, and VLAN 12 is allowed to pass on router A and connect to router B's interface gig 0/0/3 layer-2 trunk port. The IGP ospf 100 is configured on both routers and enabled at int gig 0/0/1 and gig0/0/2.

I have multiple IP addresses on the VLAN interface as below:

interface vlanif 12
ip address 97.119.51.7 255.255.255.224
ip address 97.130.115.16 255.255.255.224 sub
ip address 97.116.60.23 255.255.255.224 sub
ip address 97.112.24.18 255.255.255.224 sub

These are advertised in router ospf by network statements in ospf 100, but by mistake, network 97.119.51.0 0.0.0.31 was skipped when configuring the OSPF process network statement. The directly connected router B does not show the route of the subinterface IP addresses of 97.130.115.16, 97.116.60.23 and 97.112.24.18.

What is the concept of multiple IP addresses on a interface, and where it is used?

Why does OSPF fail to advertise the subinterface IP address when the primary IP address network 97.119.51.0 0.0.0.31 of VLAN 12 has been skipped in the OSPF configuration?

Best Answer

You have the Cisco tag on your question, but the secondary address doesn't participate in the OSPF process. Normally, you only have one IPv4 network per VLAN, and you create multiple VLANs using subinterfaces. Subinterfaces are virtual interfaces, but they act just like real interfaces. Normally, you will define dot1q encapsulation on the subinterface so that the overall physical interface forms a layer-2 trunk, and each VLAN has its own network. The physical interface itself can have a network, and may, or may not, have dot1q encapsulation. If it doesn't, it will be the native VLAN.

When configuring OSPF, the network statements tell OSPF which interfaces will participate in the OSPF process, and in which are those interfaces are. Secondary networks configured on interfaces do not participate in the OSPF process, although they may be advertised in OSPF. You can have a single OSPF network statement which encompasses multiple interfaces, e.g. network 0.0.0.0 255.255.255.255 area 1234 will run OSPF on all interfaces, and all the interfaces will be in Area 1234.

Any interface, physical or virtual, not covered by an OSPF network statement will not participate in OSPF, and you would need to do something else, e.g. redistribution, to advertise the networks on those interfaces.