Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

Bronze

router-id command under ospf

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

Re: router-id command under ospf

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

Re: router-id command under ospf

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

Hall of Fame Super Gold

Re: router-id command under ospf

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

New Member

Re: router-id command under ospf

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.

Hall of Fame Super Silver

Re: router-id command under ospf

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

Hall of Fame Super Bronze

Re: router-id command under ospf

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.

Hall of Fame Super Blue

Re: router-id command under ospf

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

9 REPLIES

Re: router-id command under ospf

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

New Member

Re: router-id command under ospf

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.

Re: router-id command under ospf

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

Hall of Fame Super Gold

Re: router-id command under ospf

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

Hall of Fame Super Silver

Re: router-id command under ospf

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

Bronze

Re: router-id command under ospf

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!

Hall of Fame Super Bronze

Re: router-id command under ospf

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.

Hall of Fame Super Blue

Re: router-id command under ospf

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

Hall of Fame Super Gold

Re: router-id command under ospf

Thanks for the rating Sarah.

937
Views
0
Helpful
9
Replies
CreatePlease to create content