OSPF in a VRF Requires a Box-Unique Router ID

It’s obvious why two routers in the same OSPF domain cannot have the same router ID. However, requiring unique router IDs on OSPF processes running in different VRFs is probably too harsh, even though it does prevent confusion if two VRFs ever get connected through a customer site. Anyhow, if you have overlapping IP addresses on loopback interfaces in different VRFs, OSPF process might not start.

Here’s a short example: two VRFs have loopback interfaces with the same IP address. Perfectly legal setup from the MPLS/VPN perspective.

c7200#show ip vrf interfaces
Interface    IP-Address   VRF            Protocol
Lo1003     EIGRP_OSPF     up
Lo1001     OSPF_1         up

However, when you try configuring the second OSPF process, it fails to start as it cannot get a box-unique router ID. You have to enter a different router ID manually.

c7200#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
c7200(config)#router ospf 1 vrf OSPF_1
c7200(config-router)#network area 0
c7200(config)#router ospf 3 vrf EIGRP_OSPF
%OSPF-4-NORTRID: OSPF process 3 cannot pick a router-id.
  Please configure manually or bring up an interface with an ip address.


  1. I might be wrong, but you need to configure a loopback interface for each VRF. Is not it?

    If a loopback interface is not a part of VRF; Is it correct we can configure that interface for VRF ospf process.
  2. You don't need a loopback interface for a VRF. The only reason why you'd want one is the stability of the router ID ... which, BTW, is a moot issue if you have a single site connected to the VRF :)

    If the interface is not part of a VRF, it will never be used as the OSPF router ID (only interfaces within the VRF are considered when selecting the router ID), but you can manually configure any IP address as the router ID.
  3. Hi Ivan , to get accurate statement and correct me if iam wrong , OSPF RID is selected from VRF interfaces except for Loopback which must be box unique even if its VRF interface
  4. Hi, inevitable. You've mixed two independent operations in the same sentence :)

    Step 1: The candidate interface for OSPF RID is selected from all the applicable interfaces. In the OSPF-in-VRF case, the applicable interfaces are the VRF interfaces. Loopbacks are preferred. Among interfaces with the same preference, the one with the highest IP address is used (I need to turn this into a post :).

    Step 2: the selected IP address is used as OSPF RID. The OSPF RID has to be unique among all OSPF RIDs running on the same box (even if they are in different VRFs) ... which might not be the case if two VRFs have a loopback interface with the same IP address.
  5. Hi,

    How many ospf process ID can be used in a single vrf Instance.
    1. How about you set up a router and try it out?
Add comment