router-id

Syntax

router-id <ROUTER_ADDR>

no router-id

Description

Sets an ID for the router in an IPv4 address format.

The no form of this command unconfigures the router-id for the instance and sets the router-id to the default as follows: the router-id is selected dynamically as equal to the highest loopback address on the router, or the highest active interface if there are no loopback addresses. If no IP address is configured on any interfaces on the router, OSPF will not form an adjacency.

Command context

config-ospf

Parameters

<ROUTER_ADDR>

Specifies the Router ID in IPv4 address format. Format: A.B.C.D

Authority

Administrators

Examples

Setting router-id in the OSPF context:

switch# configure terminal
switch(config)# router ospf 1
switch(config-ospf-1)# router-id 1.1.1.1

Unconfiguring router-id:

switch# configure terminal
switch(config)# router ospf 1
switch(config-ospf-1)# no router-id