Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configure Multiple Independent Instances of OSPFv2 with Segment Routing

Use this example to configure multiple IGP instances of OSPFv2 with segment routing.

Note:

Our content testing team has validated and updated this example.

Tip:
Table 1: Readability Score and Time Estimates

Reading Time

30 minutes

Configuration Time

20 minutes

Example Prerequisites

Hardware requirements

Three MX Series routers.

Software requirements

Junos OS Release 24.4R1 or later running on all devices.

Before You Begin

Benefits

Configuring multiple independent instances of OSPFv2 with segment routing enhances network flexibility, scalability, and control over traffic engineering, especially in large and complex networks.

Know more

Multiple Independent IGP Instances of OSPFv2

Functional Overview

Technologies used

  • Routing Protocols:OSPF

  • Segment Routing with Multiprotocol Label Switching (SR-MPLS)

  • VLAN Tagging

Primary verification tasks

  • Verify that multiple independent OSPF instances are running.

  • Verify the OSPF segment routing database for different prefix-SIDs advertised by the multiple instances of OSPF

Topology Overview

This configuration example depicts three devices R1, R2, and R3. There are two sub-interfaces configured between device R1 and device R2 and between device R2 and device R3. Each device runs multiple OSPF instances with segment routing enabled. We configure SR-MPLS to provide path control through the network. There are OSPF instances named metro-edge running on each of the two subinterfaces of the devices.

Hostname

Role

Function

R1, R2, and R3

The devices have multi-instance OSPF configured on the subinterfaces, with segment routing enabled.

The devices participate in OSPF multi-instances, advertise routes, and forward traffic using prefix-SIDs to other devices.

Topology Illustration

Figure 1:

R2 Configuration Steps

For complete sample configurations on R2, see: Appendix 1: Set Commands on All Devices

This section highlights the main configuration tasks needed to configure the R0 device for this example.

    1. Configure the basic device settings such as hostname, enhanced-ip mode, IPv4 addresses on the logical units of the device interfaces.

    2. Configure the loopback interface with an IP address and enable MPLS.

    3. Configure the router ID and autonomous system (AS) number to propagate routing information within a set of routing devices that belong to the same AS.

    4. Enable VLAN tagging and configure the logical units of both the interfaces with different VLAN IDs.

    5. Enable MPLS on each logical unit. Configure the maximum number of MPLS labels that can be applied to outgoing packets on logical units of each interface.

    6. Define a policy to load balance packets and apply the per-packet policy to enable load balancing of traffic.

    7. Configure a policy statement that matches routes based on the exact prefix and assign a segment identifier to the matched route.

    8. Configure MPLS traffic engineering, segment routing global block (SRGB) label range at the edit protocol mpls hierarchy level to ensure the labels are more predictable across segment routing domain, MPLS label range to assign labels from the configured srgb labels for the links.

  1. Configure the ospf-instance metro-edge on the subinterfaces (connecting from R2 to R1 and from R2 to R3).

  2. Enable the OSPF metro-edge instance to use segment routing with prefix-sids.

  3. Configure the IPv4 index value of the node segment.
  4. Configure the loopback address of the OSPF metro-edge instance as passive and disable the management interface (fxp0.0).

Verification

Command Verification Task
show route protocol ospf table inet.0 extensive
  • Verify the route entries in the routing table.

  • Verify the loopback address of R1 and R3 is mapped to the igp-instance as configured in R2.

show ospf spring sid-database igp-instance igp-instance Verify the OSPF segment routing database for the OSPF instance.
show ospf neighbor igp-instance igp-instance Verify neighbors for the specific OSPF instance.
show ospf database igp-instance igp-instance

Verify the OSPF advertisement entries in the OSPF link-state database (LSDB) associated with the IGP instance.

show ospf interface igp-instance igp-instance Verify the interfaces mapped to the IGP instance.
show ospf route igp-instance igp-instance Verify the routes and OSPF instance mapping information of R1 and R3.

Verify the Routing Table

Purpose

Verify the route entries in the routing table

Action

From operational mode, run the show route table inet.0 route-destination address extensive command.

Meaning

The output illustrates that the loopback address of R1 (10.1.255.1) and the loopback address of R3 (10.1.255.2) is mapped to the OSPF igp-instance metro-edge as configured in R2.

Verify OSPF Advertisements

Purpose

Verify the OSPF advertisement entries in the OSPF link-state database (LSDB) associated with the IGP instance.

Action

From the operational mode, run the show ospf database igp-instance igp-instance command.

Meaning

Verify the Routes in the OSPF Routing Table

Purpose

Verify the routes in the OSPF routing table

Action

From the operational mode, run the show ospf route command.

Meaning

The output on R2 shows the loopback addresses and OSPF instance mapping information of R1 and R3.

Verify the OSPF segment routing database

Purpose

Verify the OSPF segment routing database for the OSPF instance metro-edge.

Action

From the operational mode, run the show ospf spring sid-database igp-instance igp-instance command.

Meaning

The output illustrates the multiple instances of OSPF (metro-edge) advertise different prefix-SIDs.

Verify the OSPF Interfaces

Purpose

Verify the status information about OSPF-instance enabled interfaces.

Action

From the operational mode, run the show ospf interface igp-instance igp-instance command.

Meaning

The output shows the subinterfaces of R2 mapped to the OSPF instances (metro-edge).

Verify the OSPF Neighbor

Purpose

Verify the adjacencies between the configured links.

Action

From the operational mode, run the show ospf neighbor igp-instance igp-instance command.

Meaning

Device R2 has established adjacency with Device R1 and Device R3 and as indicated by the State output field which is Full.

Appendix 1: Set Commands on All Devices

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI at the [edit] hierarchy level.

R1

R2

R3