Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Example: Advertising Label-Switched Paths into OSPFv2

Advertising Label-Switched Paths into OSPFv2

One main reason to configure label-switched paths (LSPs) in your network is to control the shortest path between two points on the network. You can advertise LSPs into OSPFv2 as point-to-point links so that all participating routing devices can take the LSP into account when performing SPF calculations. The advertisement contains a local address (the from address of the LSP), a remote address (the to address of the LSP), and a metric with the following precedence:

  1. Use the LSP metric defined under OSPFv2.
  2. Use the LSP metric configured for the label-switched path under MPLS.
  3. If you do not configure any of the above, use the default OSPFv2 metric of 1.

Note: If you want an LSP that is announced into OSPFv2 to be used in SPF calculations, there must be a reverse link (that is, a link from the tail end of the LSP to the head end). You can accomplish this by configuring an LSP in the reverse direction and also announcing it in OSPFv2.

Example: Advertising Label-Switched Paths into OSPFv2

This example shows how to advertise LSPs into OSPFv2.

Requirements

Before you begin, configure the device interfaces. See the Junos® OS Network Interfaces.

Overview

To advertise an LSP into OSPFv2, you define the LSP and configure OSPFv2 to route traffic using the LSP. By doing this, you can use the LSP to control the shortest path between two points on the network. You might choose to do this if you want to have OSPF traffic routed along the LSP instead of having OSPF use the default best-effort routing.

In this example, you configure the following to advertise an LSP into OSPFv2:

  • BGP

    For all routing devices, configure the local AS number 65000 and define the IBGP group that recognizes the specified BGP systems as peers. All members are internal to the local AS, so you configure an internal group with a full list of peers. You also include the peer AS group, which is the same as the local AS number that you configure.

  • MPLS

    For all routing devices, configure the protocol family on each transit logical interface and enable MPLS on all interfaces, except for the management interface (fxp0.0). Specify the mpls protocol family type.

  • RSVP

    For all routing devices, enable RSVP on all interfaces, except for the management interface (fxp0.0). You enable RSVP on the devices in this network to ensure that the interfaces can signal the LSP.

  • OSPFv2

    For all routing devices, use the loopback address to assign the router ID, administratively group all of the devices into OSPF area 0.0.0.0, add all of the interfaces participating in OSPF to area 0.0.0.0, and disable OSPF on the management interface (fxp0.0).

  • Label-switched path

    On the ingress routing device R1, which is the beginning (or head end) of the LSP, configure an LSP with an explicit path. The explicit path indicates that the LSP must go to the next specified IP address in the path without traversing other nodes. In this example, you create an LSP named R1-to-R6, and you specify the IP address of the egress routing device R6.

  • Advertise the LSP in OSPFv2

    On the ingress routing device R1, you advertise the LSP as a point-to-point link into OSPFv2. You can optionally assign a metric to have the LSP be the more or less preferred path to the destination.

Figure 1 shows a sample network topology that consists of the following:

  • BGP is configured on all routing devices, with one local autonomous system (AS) 65000 that contains three routing devices:
    • R1—Device R1 is the ingress device with a router ID of 10.0.0.1. Interface so-0/0/2 connects to Device R3.
    • R3—Device R3 is the transit device with a router ID of 10.0.0.3. Interface so-0/0/2 connects to Device R1, and interface so-0/0/3 connects to Device R6.
    • R6—Device R6 is the egress device with a router ID of 10.0.0.6. Interface so-0/0/3 connects to Device R3.
  • OSPFv2 is configured on all routing devices.
  • MPLS and RSVP are enabled on all routing devices.
  • One RSVP-signaled LSP is configured on Device R1.

Configuration

The following examples require you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Modifying the Junos OS Configuration in CLI User Guide.

To configure the devices to advertise an LSP into OSPFv2, perform the following tasks:

Configuring BGP

CLI Quick Configuration

To quickly configure BGP on each routing device, copy the following commands and paste them into the CLI.

Configuration on Device R1:

[edit] set routing-options autonomous-system 65000set protocols bgp group internal-peers type internalset protocols bgp group internal-peers local-address 10.0.0.1set protocols bgp group internal-peers neighbor 10.0.0.3set protocols bgp group internal-peers neighbor 10.0.0.6set protocols bgp group internal-peers peer-as 65000

Configuration on Device R3:

[edit] set routing-options autonomous-system 65000set protocols bgp group internal-peers type internalset protocols bgp group internal-peers local-address 10.0.0.3set protocols bgp group internal-peers neighbor 10.0.0.1set protocols bgp group internal-peers neighbor 10.0.0.6set protocols bgp group internal-peers peer-as 65000

Configuration on Device R6:

[edit] set routing-options autonomous-system 65000set protocols bgp group internal-peers type internalset protocols bgp group internal-peers local-address 10.0.0.6set protocols bgp group internal-peers neighbor 10.0.0.1set protocols bgp group internal-peers neighbor 10.0.0.3set protocols bgp group internal-peers peer-as 65000

Step-by-Step Procedure

To configure BGP:

  1. On each routing device, configure the local AS number.
    [edit]user@R1# set routing-options autonomous-system 65000
    [edit]user@R3# set routing-options autonomous-system 65000
    [edit]user@R6# set routing-options autonomous-system 65000
  2. On each routing device, configure the internal BGP neighbor connections.
    [edit]user@R1# set protocols bgp group internal-peers type internaluser@R1# set protocols bgp group internal-peers local-address 10.0.0.1user@R1# set protocols bgp group internal-peers neighbor 10.0.0.3user@R1# set protocols bgp group internal-peers neighbor 10.0.0.6user@R1# set protocols bgp group internal-peers peer-as 65000
    [edit]user@R3# set protocols bgp group internal-peers type internaluser@R3# set protocols bgp group internal-peers local-address 10.0.0.3user@R3# set protocols bgp group internal-peers neighbor 10.0.0.1user@R3# set protocols bgp group internal-peers neighbor 10.0.0.6user@R3# set protocols bgp group internal-peers peer-as 65000
    [edit]user@R6# set protocols bgp group internal-peers type internaluser@R6# set protocols bgp group internal-peers local-address 10.0.0.6user@R6# set protocols bgp group internal-peers neighbor 10.0.0.1user@R6# set protocols bgp group internal-peers neighbor 10.0.0.3user@R6# set protocols bgp group internal-peers peer-as 65000
  3. If you are done configuring the devices, commit the configuration.
    [edit]user@host# commit

Results

Confirm your configuration by entering the show routing-options and show protocols bgp commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Configuration on R1:

user@R1# show routing-optionsautonomous-system 65000;
user@R1# show protocols bgp
group internal-peers {type internal;local-address 10.0.0.1;peer-as 65000;neighbor 10.0.0.3;neighbor 10.0.0.6;}

Configuration on R3:

user@R3# show routing-optionsautonomous-system 65000;
user@R3# show protocols bgp
group internal-peers {type internal;local-address 10.0.0.3;peer-as 65000;neighbor 10.0.0.1;neighbor 10.0.0.6;}

Configuration on R6:

user@R6# show routing-optionsautonomous-system 65000;
user@R6# show protocols bgp
group internal-peers {type internal;local-address 10.0.0.6;peer-as 65000;neighbor 10.0.0.1;neighbor 10.0.0.3;}

Configuring MPLS

CLI Quick Configuration

To quickly configure MPLS on all of the routing devices in AS 65000, copy the following commands and paste them into the CLI.

Configuration on Device R1:

[edit] set interfaces so-0/0/2 unit 0 family mplsset protocols mpls interface allset protocols mpls interface fxp0.0 disable

Configuration on Device R3:

[edit] set interfaces so-0/0/2 unit 0 family mplsset interfaces so-0/0/3 unit 0 family mplsset protocols mpls interface allset protocols mpls interface fxp0.0 disable

Configuration on Device R6:

[edit] set interfaces so-0/0/3 unit 0 family mplsset protocols mpls interface allset protocols mpls interface fxp0.0 disable

Step-by-Step Procedure

To configure MPLS:

  1. Configure the transit interfaces for MPLS.
    [edit ]user@R1# set interfaces so-0/0/2 unit 0 family mpls
    [edit ]user@R3# set interfaces so-0/0/2 unit 0 family mplsuser@R3# set interfaces so-0/0/3 unit 0 family mpls
    [edit ]user@R6# set interfaces so-0/0/3 unit 0 family mpls
  2. Enable MPLS.
    [edit ]user@R1# set protocols mpls interface all
    [edit ]user@R3# set protocols mpls interface all
    [edit ]user@R6# set protocols mpls interface all
  3. Disable MPLS on the management interface (fxp0.0).
    [edit ]user@R1# set protocols mpls interface fxp0.0 disable
    [edit ]user@R3# set protocols mpls interface fxp0.0 disable
    [edit ]user@R6# set protocols mpls interface fxp0.0 disable
  4. If you are done configuring the devices, commit the configuration.
    [edit]user@host# commit

Results

Confirm your configuration by entering the show interfaces and show protocols mpls commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Configuration on Device R1:

user@R1# show interfaces
so-0/0/2 {unit 0 {family mpls;}}
user@R1# show protocols mplsinterface all;interface fxp0.0 {
disable;}

Configuration on Device R3:

user@R3# show interfaces
so-0/0/2 {unit 0 {family mpls;}}
so-0/0/3 {unit 0 {family mpls;}}
user@R3# show protocols mplsinterface all;interface fxp0.0 {
disable;}

Configuration on Device R6:

user@R6# show interfaces
so-0/0/3 {unit 0 {family mpls;}}
user@R6# show protocols mplsinterface all;interface fxp0.0 {
disable;}

Configuring RSVP

CLI Quick Configuration

To quickly configure RSVP on all of the routing devices in AS 65000, copy the following commands and paste them into the CLI.

Configuration on Device R1:

[edit] set protocols rsvp interface so-0/0/2set protocols rsvp interface fxp0.0 disable

Configuration on Device R3:

[edit] set protocols rsvp interface so-0/0/2set protocols rsvp interface so-0/0/3set protocols rsvp interface fxp0.0 disable

Configuration on Device R6:

[edit] set protocols rsvp interface so-0/0/3set protocols rsvp interface fxp0.0 disable

Step-by-Step Procedure

To configure RSVP:

  1. Enable RSVP.
    [edit ]user@R1# set protocols rsvp interface so-0/0/2
    [edit ]user@R3# set protocols rsvp interface so-0/0/2user@R3# set protocols rsvp interface so-0/0/3
    [edit ]user@R6# set protocols rsvp interface so-0/0/3
  2. Disable RSVP on the management interface (fxp0.0).
    [edit ]user@R1# set protocols rsvp interface fxp0.0 disable
    [edit ]user@R3# set protocols rsvp interface fxp0.0 disable
    [edit ]user@R6# set protocols rsvp interface fxp0.0 disable
  3. If you are done configuring the devices, commit the configuration.
    [edit]user@host# commit

Results

Confirm your configuration by entering the show protocols rsvp command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Configuration on Device R1:

user@R1# show protocols rsvpinterface so-0/0/2.0;interface fxp0.0 {
disable;}

Configuration on Device R3:

user@R3# show protocols rsvpinterface so-0/0/2.0;interface so-0/0/3.0;interface fxp0.0 {
disable;}

Configuration on Device R6:

user@R3# show protocols rsvpinterface so-0/0/3.0;interface fxp0.0 {
disable;}

Configuring OSPF

CLI Quick Configuration

To quickly configure OSPF, copy the following commands and paste them into the CLI.

Configuration on Device R1:

[edit]set routing-options router-id 10.0.0.1set protocols ospf area 0.0.0.0 interface allset protocols ospf area 0.0.0.0 interface fxp0.0 disable

Configuration on Device R3:

[edit]set routing-options router-id 10.0.0.3set protocols ospf area 0.0.0.0 interface allset protocols ospf area 0.0.0.0 interface fxp0.0 disable

Configuration on Device R6:

[edit]set routing-options router-id 10.0.0.6set protocols ospf area 0.0.0.0 interface allset protocols ospf area 0.0.0.0 interface fxp0.0 disable

Step-by-Step Procedure

To configure OSPF:

  1. Configure the router ID.
    [edit]user@R1# set routing-options router-id 10.0.0.1
    [edit]user@R3# set routing-options router-id 10.0.0.3
    [edit]user@R6# set routing-options router-id 10.0.0.6
  2. Configure the OSPF area and the interfaces.
    [edit]user@R1# set protocols ospf area 0.0.0.0 interface all
    [edit]user@R3# set protocols ospf area 0.0.0.0 interface all
    [edit]user@R6# set protocols ospf area 0.0.0.0 interface all
  3. Disable OSPF on the management interface (fxp0.0).
    [edit]user@R1# set protocols ospf area 0.0.0.0 interface fxp0.0 disable
    [edit]user@R3# set protocols ospf area 0.0.0.0 interface fxp0.0 disable
    [edit]user@R6# set protocols ospf area 0.0.0.0 interface fxp0.0 disable
  4. If you are done configuring the devices, commit the configuration.
    [edit ]user@host# commit

Results

Confirm your configuration by entering the show routing-options and the show protocols ospf commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

Configuration on Device R1:

user@R1# show routing-optionsrouter-id 10.0.0.1;
user@R1# show protocols ospf
area 0.0.0.0 {interface all;interface fxp0.0 {disable;}}

Configuration on Device R3:

user@R3# show routing-optionsrouter-id 10.0.0.3;
user@R3# show protocols ospf
area 0.0.0.0 {interface all;interface fxp0.0 {disable;}}

Configuration on Device R6:

user@R6# show routing-optionsrouter-id 10.0.0.6;
user@R6# show protocols ospf
area 0.0.0.0 {interface all;interface fxp0.0 {disable;}}

Configuring the LSP

CLI Quick Configuration

To quickly configure the LSP on the ingress routing device Router R1, copy the following command and paste it into the CLI.

[edit]set protocols mpls label-switched-path R1-to-R6 to 10.0.0.6

Step-by-Step Procedure

To configure the LSP on Device R1:

  1. Enter MPLS configuration mode.
    [edit]user@R1# edit protocols mpls
  2. Create the LSP.
    [edit protocols mpls]user@R1# set label-switched-path R1-to-R6 to 10.0.0.6
  3. If you are done configuring the device, commit the configuration.
    [edit ]user@R1# commit

Results

Confirm your configuration by entering the show protocols mpls command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

user@R1# show protocols mpls
label-switched-path R1-to-R6 {to 10.0.0.6;}

Advertising the LSP into OSPFv2

CLI Quick Configuration

To quickly advertise the LSP into OSPFv2 and optionally include a metric for the LSP on Device R1, copy the following commands and paste them into the CLI.

[edit]set protocols ospf area 0.0.0.0 label-switched-path R1-to-R6 set protocols ospf area 0.0.0.0 label-switched-path R1-to-R6 metric 2

Step-by-Step Procedure

To advertise the LSP into OSPFv2 on Router R1:

  1. Enter OSPF configuration mode.
    [edit]user@R1# edit protocols ospf
  2. Include the label-switched-path statement, and specify the LSP R1-to-R6 that you created.
    [edit protocols ospf]user@R1# set protocols ospf area 0.0.0.0 label-switched-path R1-to-R6
  3. (Optional) Specify a metric for the LSP.
    [edit ]user@R1# set protocols ospf area 0.0.0.0 label-switched-path R1-to-R6 metric 2
  4. If you are done configuring the device, commit the configuration.
    [edit ]user@R1# commit

Results

Confirm your configuration by entering the show protocols ospf command. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

user@R1# show protocols ospf
area 0.0.0.0 {label-switched-path R1-to-R6 {metric 2;}}

Verification

Confirm that the configuration is working properly.

Verifying the OSPF Neighbor

Purpose

Verify that another neighbor is listed and is reachable over the LSP. The interface field indicates the name of the LSP.

Action

From operational mode, enter the show ospf neighbor command.

Published: 2013-02-01

Published: 2013-02-01