Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Configure OSPF as the IGP


Before you can run MPLS on your network, you must have an IGP running on all specified routers and interfaces. The IGP can be either OSPF or IS-IS. For the steps to configure IS-IS, see Configure IS-IS as the IGP.

Figure 1: OSPF Network Topology
OSPF Network Topology

The OSPF IGP in the MPLS network in IS-IS Network Topology consists of the following:

  • All routers are configured for the backbone OSPF area

  • All routers have the RID manually configured to avoid possible problems when the OSPF RID changes; for example, when multiple loopback addresses are configured.

  • All routers have traffic engineering enabled. When traffic engineering is enabled for OSPF, the SPF algorithm takes into account the various LSPs configured under MPLS and configures OSPF to generate link-state advertisements (LSAs) that carry traffic engineering parameters. These routes are installed into the primary routing table inet.0,but the LSPs are installed by default into the inet.3 routing table.

  • Adjacencies between all OSPF neighbors are as follows:

    • R1 is adjacent to R2, R3, and R5

    • R2 is adjacent to R1, R3, R4, and R6

    • R3 is adjacent to R1, R2, R4, and R6

    • R4 is adjacent to R2, R3, R5, and R6

    • R5 is adjacent to R1, R4, and R6

    • R6 is adjacent to R2, R3, R4, and R5

When you configure OSPF as the IGP, you must enable OSPF and traffic engineering on the router. We also recommend that you manually configure the RID and include the loopback interface (lo0) at the [edit protocols ospf] hierarchy level.

You can enable OSPF throughout the rest of the network by repeating this step as appropriate on other routers until all routers and interfaces establish OSPF neighbors.

To configure OSPF and establish OSPF neighbors, follow these steps:

Enable OSPF on Routers in Your Network


To enable OSPF on routers in your MPLS network, follow these steps:

  1. In configuration mode, go to the following hierarchy level:

  2. Configure the area and the interface:

  3. Disable the management interface if you have included the interface all statement in the previous step:

  4. Include the loopback (lo0) interface if you intend to manually configure the RID:

  5. Set the loopback interface (lo0) to passive:

  6. Configure traffic engineering:

  7. Manually configure the RID at the [routing-options] hierarchy level:

  8. Verify and commit the entire configuration:

Sample Output


The sample output shows that OSPF, with traffic engineering, is enabled on the interfaces on egress router R6. In addition, the RID is configured manually to avoid possible problems when the OSPF RID changes; for example, when multiple loopback addresses are configured. The RID uniquely identifies the router within the OSPF network. It is transmitted within the LSAs used to populate the link-state database and calculate the shortest-path tree. In a link-state network, it is important that two routers do not share the same RID value, otherwise IP routing problems may occur.

The sample outputs also shows the passive statement included in the configuration of the loopback (lo0) interface. Including the passive statement is considered best practice and ensures the following:

  • Protocols are not run over the loopback (lo0) interface

  • When the router ID (RID) is configured manually, ensures that the loopback (lo0) interface is advertised to other networks.

Verify That OSPF Neighbors Are Established


After configuring OSPF, you must verify that neighboring routers have formed adjacencies with each other.


To verify OSPF neighbors, enter the following Junos OS CLI operational mode command:

Sample Output


The sample output from the ingress, transit, and egress routers shows that all routers in the network have formed OSPF neighbor adjacencies.