cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
24654
Views
6
Helpful
9
Replies

router-id command under ospf

sarahr202
Level 5
Level 5

Hi every body!

My book says something as to how to configure router id under ospf process without giving any example.

For example book shows:

router ospf 1

router-id ---------

could any body please give me example?

thanks a lot!

7 Accepted Solutions

Accepted Solutions

Mohamad Qayoom
Level 3
Level 3

This is just copy and paste from some website:

Description: Router ID is the tie-breaker for OSPF path selection. The path selection process uses a variety of metrics to select a route. If all other metrics (accessibility, administrative weight, local preference, etc.) are equal, OSPF determines the router ID using the following priority:

Use the address configured by the ospf router-id command

Use the address of the loopback 0 interface

Use the highest IP address of any interface

If no interface exists, set the router-ID to 0.0.0.0

If no OSPF router ID is explicitly configured, OSPF computes the router-ID based on the items 2, 3, and 4 and restarts OSPF (if the process is enabled and router-ID has changed).

Example: In the following example, the ospf router-id ip-address command configures the router ID as 5.1.1.49, and the show ip ospf command displays the setting:

router(config-router)#ospf router-id 5.1.1.49

router(config-router)#end

Thanks,

Mohamad

View solution in original post

Hi Zeeshan,

I understand that your question is what comes after the router-id command?

It should be an IP Address, which you want to designate as the router ID while configuring OSPF.

In such scenarios try to look for Command Reference Guide, where all the detals about the usage of a command is given.

Have a look at this for details on router-id -

http://www.cisco.com/en/US/docs/ios/12_2/iproute/command/reference/1rfospf.html#wp1049279

-> Sushil

View solution in original post

Leo Laohoo
Hall of Fame
Hall of Fame

I agree with Mohammad. I always put the loopback IP Address (/32).

View solution in original post

Hi,

I have some views please correct if I am wrong.

This router ID is used to identify neighbour router in the network to build adjacency. By default it is highest IP address on any loopback.( L0,L1...)

If there is no loopback then highest iP address on any physical interface

But if there is no ip address defined on loopback or physical interface then you cannot start OSPF (as I know) but yop are saying it will take 0.0.0.0

Also this id will be used when DR/BDR selection take place if all routers have same priority.

View solution in original post

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Sarah,

I guess you are also interested on why we should configure an OSPF router-id:

the main reason is to assure consistency over time.

Without an explicit configuration the OSPF Router-ID can change:

example :

after some time a new loopback address with an higher ip address is added.

no changes is observed until the OSPF process is restarted or the whole router is reloaded.

After that, OSPF at startup picks the highest loop ip address as router id.

This is not desirable: we want to trace a node with a specific ip address.

To be noted that the router-id argument is an ip address but doesn't need to be an ip address associated to a real interface on the router.

Also the router-id could be an ip address that is not advertised in OSPF or other manner (doesn't need to be routed and reachable)

However, one of the best practices is to use a /24 space taken from address plan and to allocate a /32 ip address to each router and to advertise them in OSPF.

Other note: if using BGP and OSPF to have a successful redistribution of OSPF into BGP the two router-id must be the same.

Hope to help

Giuseppe

View solution in original post

If yes, then how could i just change the reference bandwidth for one ospf enabled interface without changing the reference

bandwidth for all ospf-enabled interfaces?

You can't selectively use 'auto reference bandwidth'. It's all or nothing. If you want to modify the 'cost' of the interface (that's what the auto reference bandwidth actually does), then you can use the ip ospf cost command or the bandwidth command under the intended interface.

The ip ospf cost command is ideal on this type of task since it only affects the OSPF calculation while the bandwidth command affects not only OSPF but other routing protocols and QoS.

HTH,

__

Edison.

View solution in original post

Sarah

auto-cost reference-bandwidth as you say affects all OSPF interfaces on the router.

If you want to change an individual interface then you can use the "ip ospf cost" interface command.

Edit - sorry Edison was posting while you posted and anyway your answer is better than mine :)

Jon

View solution in original post

9 Replies 9

Mohamad Qayoom
Level 3
Level 3

This is just copy and paste from some website:

Description: Router ID is the tie-breaker for OSPF path selection. The path selection process uses a variety of metrics to select a route. If all other metrics (accessibility, administrative weight, local preference, etc.) are equal, OSPF determines the router ID using the following priority:

Use the address configured by the ospf router-id command

Use the address of the loopback 0 interface

Use the highest IP address of any interface

If no interface exists, set the router-ID to 0.0.0.0

If no OSPF router ID is explicitly configured, OSPF computes the router-ID based on the items 2, 3, and 4 and restarts OSPF (if the process is enabled and router-ID has changed).

Example: In the following example, the ospf router-id ip-address command configures the router ID as 5.1.1.49, and the show ip ospf command displays the setting:

router(config-router)#ospf router-id 5.1.1.49

router(config-router)#end

Thanks,

Mohamad

Hi,

I have some views please correct if I am wrong.

This router ID is used to identify neighbour router in the network to build adjacency. By default it is highest IP address on any loopback.( L0,L1...)

If there is no loopback then highest iP address on any physical interface

But if there is no ip address defined on loopback or physical interface then you cannot start OSPF (as I know) but yop are saying it will take 0.0.0.0

Also this id will be used when DR/BDR selection take place if all routers have same priority.

Hi Zeeshan,

I understand that your question is what comes after the router-id command?

It should be an IP Address, which you want to designate as the router ID while configuring OSPF.

In such scenarios try to look for Command Reference Guide, where all the detals about the usage of a command is given.

Have a look at this for details on router-id -

http://www.cisco.com/en/US/docs/ios/12_2/iproute/command/reference/1rfospf.html#wp1049279

-> Sushil

Leo Laohoo
Hall of Fame
Hall of Fame

I agree with Mohammad. I always put the loopback IP Address (/32).

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello Sarah,

I guess you are also interested on why we should configure an OSPF router-id:

the main reason is to assure consistency over time.

Without an explicit configuration the OSPF Router-ID can change:

example :

after some time a new loopback address with an higher ip address is added.

no changes is observed until the OSPF process is restarted or the whole router is reloaded.

After that, OSPF at startup picks the highest loop ip address as router id.

This is not desirable: we want to trace a node with a specific ip address.

To be noted that the router-id argument is an ip address but doesn't need to be an ip address associated to a real interface on the router.

Also the router-id could be an ip address that is not advertised in OSPF or other manner (doesn't need to be routed and reachable)

However, one of the best practices is to use a /24 space taken from address plan and to allocate a /32 ip address to each router and to advertise them in OSPF.

Other note: if using BGP and OSPF to have a successful redistribution of OSPF into BGP the two router-id must be the same.

Hope to help

Giuseppe

Thanks all of you for such awesome replies.

If you guys don't mind, i have more question

book shows a router subcommand

auto-cost reference-bandwidth

This command set the reference bandwidth for the interface.

Since this is configured "under router ospf 1" , i believe this sets the reference bandwidth for all ospf -enabled interfaces.

If yes, then how could i just change the reference bandwidth for one ospf enabled interface without changing the reference

bandwidth for all ospf-enabled interfaces?

Thanks a lot!

If yes, then how could i just change the reference bandwidth for one ospf enabled interface without changing the reference

bandwidth for all ospf-enabled interfaces?

You can't selectively use 'auto reference bandwidth'. It's all or nothing. If you want to modify the 'cost' of the interface (that's what the auto reference bandwidth actually does), then you can use the ip ospf cost command or the bandwidth command under the intended interface.

The ip ospf cost command is ideal on this type of task since it only affects the OSPF calculation while the bandwidth command affects not only OSPF but other routing protocols and QoS.

HTH,

__

Edison.

Sarah

auto-cost reference-bandwidth as you say affects all OSPF interfaces on the router.

If you want to change an individual interface then you can use the "ip ospf cost" interface command.

Edit - sorry Edison was posting while you posted and anyway your answer is better than mine :)

Jon

Leo Laohoo
Hall of Fame
Hall of Fame

Thanks for the rating Sarah.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card