| technology | networking - Ross Heintzkill
How to Change an MPLS LDP Router ID
Multiprotocol Label Switching, or MPLS, is a powerful technique for speeding up networks and getting that low, low latency on your most time-sensitive packets. With MPLS, packets navigate the network through the routes that are pre-determined to be the fastest. But the layer of connections that MPLS depends on can't be maintained or even used if the routers can't find one another.
In this blog post, we explain how to change the identifier that an MPLS router uses to communicate with its neighbors and the address it uses to create neighborships. We'll cover the broad strokes of the process, but then we'll cover the actual commands you'll need to configure an MPLS router's LDP ID for yourself.
What is MPLS?
Quick Definition: MPLS, or Multiprotocol Label Switching, is a technique for routing data through a network that is faster and more efficient than the default method. Normally, each router opens the header information of a packet, finds the packet's destination address, works out the next hop for the packet based on a long and complex lookup in a routing table, then sends it to the next router – for that router to do the same thing.
With MPLS, when a packet enters a network, it's given a much shorter and much simpler header called a Forwarding Equivalence Class that directs packets through predetermined routes. Routers in an MPLS-enabled network don't need to perform header analysis on packets with these special headers. This can make routing more efficient by giving low-latency priority to packets with real-time traffic – traffic that would be negatively affected by long delays.
What is LDP?
Quick Definition: LDP, or Label Distribution Protocol, is the protocol that enables MPLS. Routers using MPLS need LDP to learn who their neighbors are and to establish a web or mesh of connections between one another. Routers communicating with one another with LDP advertise their presence and maintain connections to their neighbors' interfaces with so-called Hello messages.
How Does an MPLS Router LDP ID Get Chosen?
Any time you enable MPLS on a router and its interfaces, Label Distribution Protocol (LDP) is automatically turned on. So whenever a router's running MPLS, it's going to have something called an LDP Identifier, or LDP ID. An LDP Router ID is an IP address, and it's fundamental to MPLS working properly on it.
If you're familiar with how OSPF chooses its Router ID, LDP uses a similar function. Essentially there are a series of three checks that the router goes through, and the Router ID gets chosen according to the first one that gets a positive response.
The first check for an LDP ID is through manual configuration. This would be if you've manually configured the router and told it which interface to be used, or what loopback interface you want used for MPLS. Part of manually specifying what interface a router should use is to configure the IP address sitting on that interface as the Router ID. That's the first check: is there a configured Router ID?
Second, if there is no configured LDP ID, MPLS will default to using the highest IP address on any loopback interface the moment that LDP comes up. Third and last, in the event that we don't have any loopbacks, as a last-ditch effort, the router will use the highest IP address on any of the other interfaces.
Those are the three checks for Router ID: manually configured, highest IP on loopback, highest IP on interface.
An Overview of How to Change an MPLS Router LDP ID [VIDEO]
In this video, Keith Barker covers how to change the router ID on a label switching router. He'll begin by discussing what determines default LDP Router IDs, where these settings come from, and then walk you through each step of the process you'll need to follow to change it.
Why Does the MPLS Router ID Matter?
At this point, you've learned a bit about LDP and MPLS, and you might be wondering why it even matters what the LDP ID for a router is. Why would it matter if a router chooses one interface or another, wouldn't any loopback as the Router ID work?
The answer to that lies in the messages that the MPLS router will broadcast when it advertises itself and checks for neighbors. The LDP ID has to be an IP address that its neighbors can reach.
Imagine a core network that comprises three routers daisy-chained together: R2, R3, R4. In the Hello messages that R3 sends to R2 and R4, R3 is going to use the LDP identifier, that IP address, as the Transport IP Address. And if that address isn't reachable by R2 and R4, they won't be able to become LDP neighbors with R3.
How to Verify the LDP ID of an MPLS Router
Next, we're going to look at the command line inputs that will let you verify and view what the LDP ID is on a router. Then, we'll walk through actually changing it.
As always, here at CBT Nuggets, we think that the best way to learn is to actually do the steps in a controlled environment. If you have a network virtualization tool, we recommend you try manually configuring the interfaces on your R3 router with these commands. Of our three routers we mentioned earlier, we have R3 connected to R2 through gig 2/0 and connected to R4 through gig 3/0.
We'll start off by asking R3 exactly what its LDP ID is. There are several ways of seeing that, but we'll discover it by typing:
show mpls ldp discovery detail
At the top of the table of data this will output, you can see the "Local LDP Identifier". Ours is 22.214.171.124:0. The :0 represents that we're using system-wide label space – as opposed to an individual set of labels per interface.
What this means is that as R3 sends Hello messages out gig 2/0 and gig 3/0, in the payload of those little LDP Hellos, it's advertising that the transport address (which means "the address if you want to connect to me") of R3 is 126.96.36.199. And that matches the router's LDP ID.
In this same table, you can read what each interface thinks the Transport IP Address is. What that's saying is that anybody who wants to neighbor up with R3 is going to be trying to connect to that IP address.
How to Change an MPLS Router LDP ID
Next, we'll configure some of the LDP settings for different interfaces on R3. First, let's create a brand-new loopback interface with an IP address. We'll also add the network into OSPF. Because, remember, if we have a router ID that's not reachable by its neighbors, we won't be able to form LDP neighborships with those neighbors.
To start, we want to enter configuration mode:
We're configuring a new loopback first. In this case, why not use interface loopback 8. Type:
interface loopback 8
All we're going to do is give it an IP address of 188.8.131.52/32 in interface config:
ip address 8.
ip address 184.108.40.206 255.255.255.255
And we'll just pop it right into OSPF 1 area 0 as well:
ip ospf 1 area 0
It's never a bad idea to check that what you've done is actually working. Let's validate that it really is participating in OSPF. To run a quick verification of that, type:
do show ip ospf int brief
This outputs a table for us to review, and we can see that we have loopback 8 and that address is a part of OSPF. And, yet again, the most important reason for checking that is we need to make sure that R2 and R4 can reach this IP address. Because once we set the LDP ID to that new address, that's going to be the transport address that R3's going to be saying he should be reached on as he sends his Hellos.
Now all that remains is to force the router's LDP ID to be that IP address on loopback 8. The command we're using is "MPLS LDP router-id". Part of the command accepts the target interface, which in this case is loopback 8. We'll also add a keyword of "force". That last keyword will essentially tell the configuration that it needs to happen right away. When it's all written out, the command to change an MPLS LDP Router ID is this:
mpls ldp router-id loopback 8 force
How to See Changes to an MPLS Router's LDP ID
After we make those changes to R3's interfaces and LDP ID, we get a series of returns. The first thing we learn is that our existing relationships with R2 and R4 have been removed (the reason for which is that the LDP Router ID has changed).
But, right below that we also see that because the 220.127.116.11 address was reachable by R2 and R4, they were both able to form sessions with R3. What's really happening behind the scenes is that the device that has the highest router ID actually initiates the sessions, but because R2 and R4 could reach 18.104.22.168, when R3 went over to initiate the sessions, R2 and R4 were both able to reply, and the sessions were successful.
If we wanted to verify our Router ID, it'd be really simple. We do the same command that we did previously. Remember that we're still in configuration mode, so we add "do" to the front of it. The same command from before should show us not only the interfaces that are participating within MPLS and LDP, but also it should show us what the new LDP ID is.
do show mpls ldp discovery detail
This table of data should look familiar. We look to the top under "Local LDP Identifier" and we see 22.214.171.124:0. That means that when R3 sends its Hellos to its neighbors, what it's doing is advertising that the transport address is also 126.96.36.199.
On top of all of that, we know that the address is reachable by R2 and R4, which means this configuration won't be causing any problems – it's not breaking the MPLS path. If we wanted to verify our neighborships, we could do that by typing:
do show mpls ldp neighbor
And that would help us verify that our LDP sessions are in place with R2 and with R4.
This is one small part of MPLS, but hopefully the LDP ID of a router makes a little more sense and you feel prepared to change it whenever the need arises. If you're interested in learning more about MPLS, the MPLS Fundamentals training from CBT Nuggets contains 15 videos and 5 hours of training about configuring and maintaining MPLS.
Or maybe you're looking for a much quicker explanation of MPLS and how it works. In that case, this CBT Nuggets YouTube tutorial explains MPLS and how it functions in less than six minutes!