Got it

How Is an OSPF Router ID Selected? How Is the Default Router ID Obtained?

Latest reply: May 30, 2020 13:30:19 2137 6 0 0 0
How Is an OSPF Router ID Selected? How Is the Default Router ID Obtained?

When configuring an OSPF process, you can specify a router ID.

For example, you can run the ospf 1 router-id 1.1.1.1 command:

[~HUAWEI] ospf 1 router-id 1.1.1.1If no router ID is specified when the OSPF process is configured, the OSPF router ID is selected according to the following rules:

If one or more loopback addresses are configured, the router ID is the loopback address with the highest IP address.
If no loopback address is configured, the router ID is the physical interface with the highest IP address.
View more
  • x
  • convention:

This helped!
View more
  • x
  • convention:

Very pleased
View more
  • x
  • convention:

Hello ,
Router id in ospf is a 32 bits value in Dotted Decimal format ( Like an IP address) Ex: 0.0.0.1 ; 0.0.0.2 ; 1.1.1.1
So theory say that the router ID is selected according to the following rules:
1 - Prefer the router id configured manually in ospf
[AR1] ospf 1 router-id 0.0.0.1

2- Prefer the router id configured manually globally
[AR1] router id 0.0.0.1

3- Prefer the highest numerical value of your loopback interfaces

4- Prefer the highest numerical value of your physical interfaces

NOTE: Interfaces that are in administratively down state (you shutdown it) are excluded in election.
this is the theory , in real world it doesnt work like this
most Huawei Routers, when you configure the first ip address in the router ( physical or loopback) , your router will pick up this address as router id
example
[AR1] int gi0/0/0
[AR1-GigabitEthernet0/0/0] ip address 10.0.0.1 24
[AR1-GigabitEthernet0/0/0]  quit
[AR1] interface LoopBack 0
[AR1-LoopBack0] ip address 1.1.1.1 32
now if you refer to the theory 1.1.1.1 will be the router id but in real world your router will use 10.0.0.1

because the first ip address configured in your router will be the global router id

you can verify it by using this command
display router id

this is why it's recommended to assign it manually with

[AR1] ospf 1 router-id 0.0.0.1

View more
  • x
  • convention:

great!
View more
  • x
  • convention:

well done
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.