TechKnowSurge
Cisco CCNA 3.4
VideoNetworkFree

DEMO: Setting Router ID and Priority

Covers the configuration of OSPF router IDs and interface priorities on Cisco routers, including the commands required to apply and verify both settings.

Complete this video to capture a CTF flag worth 1 point.

About this video

OSPF uses a router ID to uniquely identify each router within the routing domain, and by default that ID is derived from the highest loopback address configured on the device. Statically assigning a router ID gives administrators explicit control over this value and eliminates ambiguity as the network changes. The verification commands show ip ospf neighbor, show ip ospf interface, and show ip protocols provide a clear view of current router IDs, neighbor relationships, interface roles, and priority values before any configuration changes are made. Setting a static router ID is done within the OSPF process configuration using the router-id command followed by an address in dotted-decimal notation. Because the router ID is not updated dynamically once a Designated Router and Backup Designated Router have already been elected, the change requires a clear ip ospf process command to take effect. Interface priority is configured directly on the interface using the ip ospf priority command and takes effect immediately, though the router will not preempt an existing DR election until the OSPF process is reset. After clearing the process, both the new router ID and the updated priority are reflected in the routing table and interface output, and either setting can be removed by prepending the no keyword to the original command.

What you'll learn

What's covered

OSPF Router ID & Priority

Aligned to

Cisco CCNA
3.4 Configure and verify single area OSPFv2

Key terms

Open Shortest Path First
OSPF
A link-state interior gateway routing protocol that maintains a complete map of the network topology and uses Dijkstra's Shortest Path First algorithm to calculate optimal, loop-free routes. OSPF divides networks into hierarchical areas to improve scalability and supports VLSM and rapid convergence.
Router ID
A 32-bit value formatted like an IP address that uniquely identifies an OSPF router and is used as a tiebreaker in DR/BDR elections when interface priorities are equal.
Disaster Recovery
DR
The process and procedures for recovering IT systems and data following a disruptive event.
Backup Designated Router
BDR
An OSPF router elected on a multi-access network segment as the backup to the Designated Router, ready to take over DR functions if the DR fails. The BDR maintains adjacencies with all other routers on the segment to minimize reconvergence time.
OSPF Priority
A configurable interface value (0–255) used during DR and BDR elections; a higher value increases the likelihood of being elected DR, and a value of 0 prevents election.
Routing Protocol
A protocol used by routers to communicate and share routing information to determine the best path for data.

Transcript

I'm on router one right now and I'm consoled into it, so let's go ahead and take a look at some of these commands.

Checking the current state

The first thing that I'm going to do is a show ip ospf neighbor. When I do this, I can see what the neighbor ID is of my different neighbors. If you recognize this, this is actually the loopback addresses of these other devices, because we set loopback addresses on our devices, but what we didn't do is we didn't set up a router ID. So that all makes sense.

We see some other information here. It's interesting, we did talk about this, about the state that this is in. So these are in full and full DR states here. That's missing the DR or the BDR here, and that's because this is a serial interface, this is a point-to-point interface, and remember we said that it doesn't elect a DR there. So that explains that right there. This one is a fast ethernet, so even though there's a device on the other side, it still goes through that election process.

Let's take a look at another command here. I'm going to do a show ip ospf interface, and we're going to look at fa0/1. Here, when we look at this, we can see the IP address of this interface right here, and the router ID, which is the loopback address. If I do a show ip interface brief, I can see that this loopback interface is 10.241.0.2, so that's what we're seeing right here. On this link, the designated router is 10.241.0.1, so that is the other router. The other router is the designated router, so that would make this the backup designated router, which is what we see right there. And then we also see a priority of one.

The last one we'll do here is a show ip protocols, and this gives us just a short rundown of some information here, to include the router ID. So that's the one that we're going to be looking at right there.

Setting the router ID

As I mentioned, what we can do is we can set the router ID statically. What I'm going to do is get into global configuration mode and do router ospf and the process ID, which is 10, and we're going to do router-id and then specify what the router ID is. I'm just going to come up with — maybe it's 12.12.12.12. So it's in the format of an IP address. We'll just use that, and I'm going to hit enter there.

Notice here it says reload or use clear ip ospf process. One of the reasons why we have to do this is because it's not going to actively go and make a bunch of changes after a designated router and a backup designator has already been selected. So this is a command I'm going to have to enter here in a little bit.

Setting the interface priority

The next thing I'm going to do is I'll exit out of this and get into the interface. I'm going to get into my interface fa0/1, and then within that interface I'm going to do ip ospf priority, and we're going to set it to a hundred. Then I will end out of here.

We see here this router ID has not changed at this point, which shouldn't be surprising, because it said that we need one extra step before we do that. I'm going to do a show ip ospf interface fa0/1. We see the priority right here and it's set to 100, so that has already changed — it doesn't wait for that to change. Although since it is a higher priority, we notice that this would be the DR at this point in time because it's the higher priority, but it stays as a backup designated router.

Clearing the OSPF process

Now what I'm going to do is I'm going to do a clear ip ospf process and hit enter. It's going to say, are you sure you want to clear all of the processes, and I'm going to say yes. Now I'm going to do a show IP, and we see the router ID now is 12.12.12.12. So we made both of those changes successfully.

If I want to take those changes off, I just go back and do the same thing except put a no command at the beginning of it, and then it would take those off.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →