Generally a router id will be set to highest loopback address if present or the highest ip address of physical interface. But most vendors provide a way to configure a specific value example:- " ip router-id 55.1.1.1".
My question here is is there any restrictions for value of router-id that can be configured? any RFC recommendations ? Can i configure "255.255.255.255" as my ip router-id ?
Cisco – ny recommended range for ip router id
ciscoipv4juniperrouter
Best Answer
Summary
You didn't specify a protocol, so the answer is "it depends". If you're not using MPLS TE anywhere, the value of the Router ID doesn't seem to matter for OSPF, OSPFv3, BGP, ISIS or LDP. Technically in these cases, you can assign "255.255.255.255" as the 32-bit portion of the Router ID.
While these protocols are not strictly considered a routing protocol, you cannot divorce underlying IGP choices from your ability to deploy MPLS TE. Therefore, if you are using MPLS TE with OSPF TE Extensions, CR-LDP, etc... then it's recommended to assign your Router IDs as an address on the same router.
Overall Guidance: Keep it simple for your coworkers and future service deployments
While IGPs allow you to chose any value for Router IDs, you shouldn't make life harder than necessary. While you could theoretically assign Router-1's Router ID to be a Loopback address on Router 2, don't do that unless you already plan to make a bad reputation for yourself.
Anyone who has to support the infrastructure after you will hate the aforementioned decision. Furthermore, you'd be making implementation of some MPLS TE services much harder, because people would have to reassign the Router IDs to get several of the MPLS TE services up.
RFC 1142, (ISIS) - A variable length field, from 1 to 8 octets
### [RFC 2328, Section 5 (OSPF)] - A 32-bit number
Only defines the Router ID as a 32-bit number, thus any 32-bit number can be used:
RFC 4271, Section 4.2 (BGP) - A 4-octet unsigned integer representing a valid unicast IP host address
The BGP ID is defined as a "4-octet unsigned integer" in the OPEN message.
Nevertheless, in order to be syntactically correct it must be "a valid unicast IP host address".
RFC 2740, Section 2.2 (OSPFv3) - A 32-bit number
Explicitly disallows any relationship between the addresses in the protocol (IPv6) and the Router ID, which is only a 32-bit number.
RFC 4577, Section 4.2.2 (OSPF for BGP/MPLS IP VPNs) - A 32-bit number (valid OSPF RID)
RFC 5036, Section 3.1 (LDP) - 6 bytes, 4 of the bytes should be a valid IGP Router ID
RFC 3480, Section 2 (CR-LDP) - A stable IP address that is always reachable
Defines a Router ID as "a stable IP address of an LSR that is always reachable if there is any connectivity to the LSR." Thus it pretty much has to be a loopback address
RFC 3630, Section 2.4.1 (OSPF-TE) - A stable IP address of the advertising router
RFC 3630, Section 2.4.1 (OSPF-TE), requires a "stable IP address of the advertising router"