OSPFv2 supports multiple instances of OSPF to run simultaneously on the device. Each instance is identified by an Instance ID which is a non-zero positive integer and must be provided when creating an instance.
Limitations of Multi-Instance OSPF
Multi-Instance OSPF can not coexist with single instance OSPF. If the user wants to configure multi-instance OSPF on a device which already has the single instance version of OSPF running then the user must first remove all the configuration related to single instance OSPF before configuring multi-instance OSPF.
Multiple instances of OSPFv2 can only be created in the default VRF. Multiple instances of OSPFv2 in the user defined (non-default) VRFs are not supported.
There are a maximum of 8 instances of OSPF allowed on a device.
The OSPF feature of enabling OSPF using the network command is not allowed under the multi-instance OSPF. Only by specifying a specific interface can the user enable OSPF on network interfaces.
Basic OSPF Multi-Instance Configuration
First of all we need to enable multi-instance OSPF on the device, run the command below to achieve this.
To create an OSPF instance and configure the router ID, run the command below.
Specify the backbone area for this instance and choose area-type as stub.
Add a VLAN interface vlan200 to the backbone area for instance ID 5. This command enables OSPF on the interface.
Usually, OSPF will try to form adjacencies with other routers on all interfaces that match the network prefix of an OSPF enabled interface. It is desirable to stop OSPF from forming adjacencies on interfaces facing the end users. To stop OSPF from forming adjacency on interface vlan10, run the command below.
To redistribute BGP routes through an OSPF instance, run the command below.
To configure OSPF SPF timers, run the commands shown below. This example configures the initial delay to 20ms, initial hold time to 100ms and the maximum hold time to 1000ms.
And finally, to enable debugging information, run the below commands. These three commands enable debugging for Interface State Machine (ISM) events, the Link State Advertisement (LSA) flooding and the zebra module. For a full list of debugging options, please refer to the OSPFv2 command reference.